Class: Pago::V2026_04::Models::CheckoutDiscountFixedOnceForeverDuration
- Inherits:
-
Model
- Object
- Model
- Pago::V2026_04::Models::CheckoutDiscountFixedOnceForeverDuration
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema for a fixed amount discount that is applied once or forever.
Constant Summary collapse
- JSON_KEYS =
{ duration: "duration", type: "type", amount: "amount", currency: "currency", amounts: "amounts", id: "id", name: "name", code: "code" }.freeze
- REQUIRED_KEYS =
["duration", "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
-
#id ⇒ String
readonly
The ID of the object.
- #name ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(duration:, type:, amount:, currency:, amounts:, id:, name:, code:) ⇒ CheckoutDiscountFixedOnceForeverDuration
constructor
A new instance of CheckoutDiscountFixedOnceForeverDuration.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(duration:, type:, amount:, currency:, amounts:, id:, name:, code:) ⇒ CheckoutDiscountFixedOnceForeverDuration
Returns a new instance of CheckoutDiscountFixedOnceForeverDuration.
10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 |
# File 'lib/pago/v2026_04/models.rb', line 10278 def initialize( duration:, type:, amount:, currency:, amounts:, id:, name:, code: ) super() assign(:duration, duration) 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.
10258 10259 10260 |
# File 'lib/pago/v2026_04/models.rb', line 10258 def amount @amount end |
#amounts ⇒ Hash{String => Integer} (readonly)
Map of currency to fixed amount to discount from the total.
10266 10267 10268 |
# File 'lib/pago/v2026_04/models.rb', line 10266 def amounts @amounts end |
#code ⇒ String? (readonly)
10276 10277 10278 |
# File 'lib/pago/v2026_04/models.rb', line 10276 def code @code end |
#currency ⇒ String (readonly)
Deprecated.
10262 10263 10264 |
# File 'lib/pago/v2026_04/models.rb', line 10262 def currency @currency end |
#duration ⇒ String (readonly)
10251 10252 10253 |
# File 'lib/pago/v2026_04/models.rb', line 10251 def duration @duration end |
#id ⇒ String (readonly)
The ID of the object.
10270 10271 10272 |
# File 'lib/pago/v2026_04/models.rb', line 10270 def id @id end |
#name ⇒ String (readonly)
10273 10274 10275 |
# File 'lib/pago/v2026_04/models.rb', line 10273 def name @name end |
#type ⇒ String (readonly)
10254 10255 10256 |
# File 'lib/pago/v2026_04/models.rb', line 10254 def type @type end |
Class Method Details
.from_json(data) ⇒ CheckoutDiscountFixedOnceForeverDuration?
10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 |
# File 'lib/pago/v2026_04/models.rb', line 10301 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), 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 |