Class: Pago::V2026_04::Models::CheckoutDiscountFixedRepeatDuration
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema for a fixed amount discount that is applied on every invoice for a certain number of months.
Constant Summary collapse
- JSON_KEYS =
{ duration: "duration", duration_in_months: "duration_in_months", type: "type", amount: "amount", currency: "currency", amounts: "amounts", id: "id", name: "name", code: "code" }.freeze
- REQUIRED_KEYS =
["duration", "duration_in_months", "type", "amount", "currency", "amounts", "id", "name", "code"].freeze
Instance Attribute Summary collapse
- #amount ⇒ Integer readonly deprecated Deprecated.
-
#amounts ⇒ Hash{String => Integer}
readonly
Map of currency to fixed amount to discount from the total.
- #code ⇒ String? readonly
- #currency ⇒ String readonly deprecated Deprecated.
- #duration ⇒ String readonly
- #duration_in_months ⇒ Integer readonly
-
#id ⇒ String
readonly
The ID of the object.
- #name ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(duration:, duration_in_months:, type:, amount:, currency:, amounts:, id:, name:, code:) ⇒ CheckoutDiscountFixedRepeatDuration
constructor
A new instance of CheckoutDiscountFixedRepeatDuration.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(duration:, duration_in_months:, type:, amount:, currency:, amounts:, id:, name:, code:) ⇒ CheckoutDiscountFixedRepeatDuration
Returns a new instance of CheckoutDiscountFixedRepeatDuration.
10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 |
# File 'lib/pago/v2026_04/models.rb', line 10369 def initialize( duration:, duration_in_months:, type:, amount:, currency:, amounts:, id:, name:, code: ) super() assign(:duration, duration) assign(:duration_in_months, duration_in_months) assign(:type, type) assign(:amount, amount) assign(:currency, currency) assign(:amounts, amounts) assign(:id, id) assign(:name, name) assign(:code, code) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
Deprecated.
10349 10350 10351 |
# File 'lib/pago/v2026_04/models.rb', line 10349 def amount @amount end |
#amounts ⇒ Hash{String => Integer} (readonly)
Map of currency to fixed amount to discount from the total.
10357 10358 10359 |
# File 'lib/pago/v2026_04/models.rb', line 10357 def amounts @amounts end |
#code ⇒ String? (readonly)
10367 10368 10369 |
# File 'lib/pago/v2026_04/models.rb', line 10367 def code @code end |
#currency ⇒ String (readonly)
Deprecated.
10353 10354 10355 |
# File 'lib/pago/v2026_04/models.rb', line 10353 def currency @currency end |
#duration ⇒ String (readonly)
10339 10340 10341 |
# File 'lib/pago/v2026_04/models.rb', line 10339 def duration @duration end |
#duration_in_months ⇒ Integer (readonly)
10342 10343 10344 |
# File 'lib/pago/v2026_04/models.rb', line 10342 def duration_in_months @duration_in_months end |
#id ⇒ String (readonly)
The ID of the object.
10361 10362 10363 |
# File 'lib/pago/v2026_04/models.rb', line 10361 def id @id end |
#name ⇒ String (readonly)
10364 10365 10366 |
# File 'lib/pago/v2026_04/models.rb', line 10364 def name @name end |
#type ⇒ String (readonly)
10345 10346 10347 |
# File 'lib/pago/v2026_04/models.rb', line 10345 def type @type end |
Class Method Details
.from_json(data) ⇒ CheckoutDiscountFixedRepeatDuration?
10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 |
# File 'lib/pago/v2026_04/models.rb', line 10394 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( duration: (data.key?("duration") ? data["duration"] : ::Pago::UNSET), duration_in_months: (data.key?("duration_in_months") ? data["duration_in_months"] : ::Pago::UNSET), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET), amounts: (data.key?("amounts") ? data["amounts"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), name: (data.key?("name") ? data["name"] : ::Pago::UNSET), code: (data.key?("code") ? data["code"] : ::Pago::UNSET) ), data ) end |