Class: Pago::V2026_04::Models::SubscriptionUpdatedMetadata

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",
  proration_behavior: "proration_behavior",
  discount_id: "discount_id",
  trial_end: "trial_end",
  seats: "seats",
  billing_period_end: "billing_period_end",
  subscription_id: "subscription_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["subscription_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: ::Pago::UNSET, proration_behavior: ::Pago::UNSET, discount_id: ::Pago::UNSET, trial_end: ::Pago::UNSET, seats: ::Pago::UNSET, billing_period_end: ::Pago::UNSET, subscription_id:) ⇒ SubscriptionUpdatedMetadata

Returns a new instance of SubscriptionUpdatedMetadata.

Parameters:

  • product_id: (String, nil) (defaults to: ::Pago::UNSET)
  • proration_behavior: (String, nil) (defaults to: ::Pago::UNSET)
  • discount_id: (String, nil) (defaults to: ::Pago::UNSET)
  • trial_end: (String, nil) (defaults to: ::Pago::UNSET)
  • seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • billing_period_end: (String, nil) (defaults to: ::Pago::UNSET)
  • subscription_id: (String)


43154
43155
43156
43157
43158
43159
43160
43161
43162
43163
43164
43165
43166
43167
43168
43169
43170
43171
# File 'lib/pago/v2026_04/models.rb', line 43154

def initialize(
  product_id: ::Pago::UNSET,
  proration_behavior: ::Pago::UNSET,
  discount_id: ::Pago::UNSET,
  trial_end: ::Pago::UNSET,
  seats: ::Pago::UNSET,
  billing_period_end: ::Pago::UNSET,
  subscription_id:
)
  super()
  assign(:product_id, product_id)
  assign(:proration_behavior, proration_behavior)
  assign(:discount_id, discount_id)
  assign(:trial_end, trial_end)
  assign(:seats, seats)
  assign(:billing_period_end, billing_period_end)
  assign(:subscription_id, subscription_id)
end

Instance Attribute Details

#billing_period_endString (readonly)

Returns:

  • (String)


43149
43150
43151
# File 'lib/pago/v2026_04/models.rb', line 43149

def billing_period_end
  @billing_period_end
end

#discount_idString? (readonly)

Returns:

  • (String, nil)


43140
43141
43142
# File 'lib/pago/v2026_04/models.rb', line 43140

def discount_id
  @discount_id
end

#product_idString (readonly)

Returns:

  • (String)


43134
43135
43136
# File 'lib/pago/v2026_04/models.rb', line 43134

def product_id
  @product_id
end

#proration_behaviorString (readonly)

Returns:

  • (String)


43137
43138
43139
# File 'lib/pago/v2026_04/models.rb', line 43137

def proration_behavior
  @proration_behavior
end

#seatsInteger (readonly)

Returns:

  • (Integer)


43146
43147
43148
# File 'lib/pago/v2026_04/models.rb', line 43146

def seats
  @seats
end

#subscription_idString (readonly)

Returns:

  • (String)


43152
43153
43154
# File 'lib/pago/v2026_04/models.rb', line 43152

def subscription_id
  @subscription_id
end

#trial_endString (readonly)

Returns:

  • (String)


43143
43144
43145
# File 'lib/pago/v2026_04/models.rb', line 43143

def trial_end
  @trial_end
end

Class Method Details

.from_json(data) ⇒ SubscriptionUpdatedMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



43175
43176
43177
43178
43179
43180
43181
43182
43183
43184
43185
43186
43187
43188
43189
43190
43191
43192
# File 'lib/pago/v2026_04/models.rb', line 43175

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),
      proration_behavior: (data.key?("proration_behavior") ? data["proration_behavior"] : ::Pago::UNSET),
      discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET),
      trial_end: (data.key?("trial_end") ? data["trial_end"] : ::Pago::UNSET),
      seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET),
      billing_period_end: (data.key?("billing_period_end") ? data["billing_period_end"] : ::Pago::UNSET),
      subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET)
    ),
    data
  )
end