Class: Pago::V2026_04::Models::ProductBenefitsUpdate

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema to update the benefits granted by a product.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  benefits: "benefits"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["benefits"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(benefits:) ⇒ ProductBenefitsUpdate

Returns a new instance of ProductBenefitsUpdate.

Parameters:

  • benefits: (Array[String])


36188
36189
36190
36191
36192
36193
# File 'lib/pago/v2026_04/models.rb', line 36188

def initialize(
  benefits:
)
  super()
  assign(:benefits, benefits)
end

Instance Attribute Details

#benefitsArray<String> (readonly)

List of benefit IDs. Each one must be on the same organization as the product.

Returns:

  • (Array<String>)


36186
36187
36188
# File 'lib/pago/v2026_04/models.rb', line 36186

def benefits
  @benefits
end

Class Method Details

.from_json(data) ⇒ ProductBenefitsUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
# File 'lib/pago/v2026_04/models.rb', line 36197

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      benefits: (data.key?("benefits") ? data["benefits"] : ::Pago::UNSET)
    ),
    data
  )
end