Class: Pago::V2026_04::Models::CustomerBenefitGrantDiscordUpdate

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

Constant Summary collapse

JSON_KEYS =

Returns:

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

Returns:

  • (Array[String])
["benefit_type", "properties"].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(benefit_type:, properties:) ⇒ CustomerBenefitGrantDiscordUpdate

Returns a new instance of CustomerBenefitGrantDiscordUpdate.

Parameters:



15072
15073
15074
15075
15076
15077
15078
15079
# File 'lib/pago/v2026_04/models.rb', line 15072

def initialize(
  benefit_type:,
  properties:
)
  super()
  assign(:benefit_type, benefit_type)
  assign(:properties, properties)
end

Instance Attribute Details

#benefit_typeString (readonly)

Returns:

  • (String)


15067
15068
15069
# File 'lib/pago/v2026_04/models.rb', line 15067

def benefit_type
  @benefit_type
end

#propertiesModels::CustomerBenefitGrantDiscordPropertiesUpdate (readonly)



15070
15071
15072
# File 'lib/pago/v2026_04/models.rb', line 15070

def properties
  @properties
end

Class Method Details

.from_json(data) ⇒ CustomerBenefitGrantDiscordUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
# File 'lib/pago/v2026_04/models.rb', line 15083

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(
      benefit_type: (data.key?("benefit_type") ? data["benefit_type"] : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::CustomerBenefitGrantDiscordPropertiesUpdate.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end