Class: Pago::V2026_04::Models::CostMetadataOutput

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

Returns:

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

Returns a new instance of CostMetadataOutput.

Parameters:

  • amount: (String)
  • currency: (String)


13055
13056
13057
13058
13059
13060
13061
13062
# File 'lib/pago/v2026_04/models.rb', line 13055

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

Instance Attribute Details

#amountString (readonly)

The amount in cents.

Returns:

  • (String)


13049
13050
13051
# File 'lib/pago/v2026_04/models.rb', line 13049

def amount
  @amount
end

#currencyString (readonly)

The currency. Currently, only usd is supported.

Returns:

  • (String)


13053
13054
13055
# File 'lib/pago/v2026_04/models.rb', line 13053

def currency
  @currency
end

Class Method Details

.from_json(data) ⇒ CostMetadataOutput?

Parameters:

  • data (Hash, String, nil)

Returns:



13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
# File 'lib/pago/v2026_04/models.rb', line 13066

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