Class: Pago::V2026_04::Models::CustomerSubscriptionUpdateProduct

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

Returns:

  • (Array[String])
["product_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(product_id:) ⇒ CustomerSubscriptionUpdateProduct

Returns a new instance of CustomerSubscriptionUpdateProduct.

Parameters:

  • product_id: (String)


21515
21516
21517
21518
21519
21520
# File 'lib/pago/v2026_04/models.rb', line 21515

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

Instance Attribute Details

#product_idString (readonly)

Update subscription to another product.

Returns:

  • (String)


21513
21514
21515
# File 'lib/pago/v2026_04/models.rb', line 21513

def product_id
  @product_id
end

Class Method Details

.from_json(data) ⇒ CustomerSubscriptionUpdateProduct?

Parameters:

  • data (Hash, String, nil)

Returns:



21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
# File 'lib/pago/v2026_04/models.rb', line 21524

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