Class: Pago::V2026_04::Models::CheckoutCreatedMetadata

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])
{
  checkout_id: "checkout_id",
  checkout_status: "checkout_status",
  product_id: "product_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["checkout_id", "checkout_status"].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(checkout_id:, checkout_status:, product_id: ::Pago::UNSET) ⇒ CheckoutCreatedMetadata

Returns a new instance of CheckoutCreatedMetadata.

Parameters:

  • checkout_id: (String)
  • checkout_status: (String)
  • product_id: (String, nil) (defaults to: ::Pago::UNSET)


10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
# File 'lib/pago/v2026_04/models.rb', line 10207

def initialize(
  checkout_id:,
  checkout_status:,
  product_id: ::Pago::UNSET
)
  super()
  assign(:checkout_id, checkout_id)
  assign(:checkout_status, checkout_status)
  assign(:product_id, product_id)
end

Instance Attribute Details

#checkout_idString (readonly)

Returns:

  • (String)


10199
10200
10201
# File 'lib/pago/v2026_04/models.rb', line 10199

def checkout_id
  @checkout_id
end

#checkout_statusString (readonly)

Returns:

  • (String)


10202
10203
10204
# File 'lib/pago/v2026_04/models.rb', line 10202

def checkout_status
  @checkout_status
end

#product_idString (readonly)

Returns:

  • (String)


10205
10206
10207
# File 'lib/pago/v2026_04/models.rb', line 10205

def product_id
  @product_id
end

Class Method Details

.from_json(data) ⇒ CheckoutCreatedMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
# File 'lib/pago/v2026_04/models.rb', line 10220

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