Class: Pago::V2026_04::Models::ExistingProductPrice

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

Overview

A price that already exists for this product.

Useful when updating a product if you want to keep an existing price.

Constant Summary collapse

JSON_KEYS =

Returns:

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

Returns:

  • (Array[String])
["id"].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(id:) ⇒ ExistingProductPrice

Returns a new instance of ExistingProductPrice.

Parameters:

  • id: (String)


25390
25391
25392
25393
25394
25395
# File 'lib/pago/v2026_04/models.rb', line 25390

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

Instance Attribute Details

#idString (readonly)

Returns:

  • (String)


25388
25389
25390
# File 'lib/pago/v2026_04/models.rb', line 25388

def id
  @id
end

Class Method Details

.from_json(data) ⇒ ExistingProductPrice?

Parameters:

  • data (Hash, String, nil)

Returns:



25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
# File 'lib/pago/v2026_04/models.rb', line 25399

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