Class: Pago::V2026_04::Models::OrderVoidedMetadata

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])
{
  order_id: "order_id",
  amount: "amount",
  currency: "currency"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["order_id", "amount", "currency"].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(order_id:, amount:, currency:) ⇒ OrderVoidedMetadata

Returns a new instance of OrderVoidedMetadata.

Parameters:

  • order_id: (String)
  • amount: (Integer)
  • currency: (String)


33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
# File 'lib/pago/v2026_04/models.rb', line 33799

def initialize(
  order_id:,
  amount:,
  currency:
)
  super()
  assign(:order_id, order_id)
  assign(:amount, amount)
  assign(:currency, currency)
end

Instance Attribute Details

#amountInteger (readonly)

Returns:

  • (Integer)


33794
33795
33796
# File 'lib/pago/v2026_04/models.rb', line 33794

def amount
  @amount
end

#currencyString (readonly)

Returns:

  • (String)


33797
33798
33799
# File 'lib/pago/v2026_04/models.rb', line 33797

def currency
  @currency
end

#order_idString (readonly)

Returns:

  • (String)


33791
33792
33793
# File 'lib/pago/v2026_04/models.rb', line 33791

def order_id
  @order_id
end

Class Method Details

.from_json(data) ⇒ OrderVoidedMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
# File 'lib/pago/v2026_04/models.rb', line 33812

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(
      order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET),
      amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET),
      currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET)
    ),
    data
  )
end