Class: Pago::V2026_04::Models::DiscountFixedRepeatDurationBase
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ duration: "duration", duration_in_months: "duration_in_months", type: "type", amount: "amount", currency: "currency", amounts: "amounts", created_at: "created_at", modified_at: "modified_at", id: "id", metadata: "metadata", name: "name", code: "code", starts_at: "starts_at", ends_at: "ends_at", max_redemptions: "max_redemptions", redemptions_count: "redemptions_count", organization_id: "organization_id" }.freeze
- REQUIRED_KEYS =
["duration", "duration_in_months", "type", "amount", "currency", "amounts", "created_at", "modified_at", "id", "metadata", "name", "code", "starts_at", "ends_at", "max_redemptions", "redemptions_count", "organization_id"].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
Code customers can use to apply the discount during checkout.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
- #currency ⇒ String readonly deprecated Deprecated.
- #duration ⇒ String readonly
- #duration_in_months ⇒ Integer readonly
-
#ends_at ⇒ String?
readonly
Timestamp after which the discount is no longer redeemable.
-
#id ⇒ String
readonly
The ID of the object.
-
#max_redemptions ⇒ Integer?
readonly
Maximum number of times the discount can be redeemed.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#name ⇒ String
readonly
Name of the discount.
-
#organization_id ⇒ String
readonly
The organization ID.
-
#redemptions_count ⇒ Integer
readonly
Number of times the discount has been redeemed.
-
#starts_at ⇒ String?
readonly
Timestamp after which the discount is redeemable.
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(duration:, duration_in_months:, type:, amount:, currency:, amounts:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountFixedRepeatDurationBase
constructor
A new instance of DiscountFixedRepeatDurationBase.
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:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountFixedRepeatDurationBase
Returns a new instance of DiscountFixedRepeatDurationBase.
23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 |
# File 'lib/pago/v2026_04/models.rb', line 23061 def initialize( duration:, duration_in_months:, type:, amount:, currency:, amounts:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id: ) super() assign(:duration, duration) assign(:duration_in_months, duration_in_months) assign(:type, type) assign(:amount, amount) assign(:currency, currency) assign(:amounts, amounts) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:metadata, ) assign(:name, name) assign(:code, code) assign(:starts_at, starts_at) assign(:ends_at, ends_at) assign(:max_redemptions, max_redemptions) assign(:redemptions_count, redemptions_count) assign(:organization_id, organization_id) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
23008 23009 23010 |
# File 'lib/pago/v2026_04/models.rb', line 23008 def amount @amount end |
#amounts ⇒ Hash{String => Integer} (readonly)
Map of currency to fixed amount to discount from the total.
23016 23017 23018 |
# File 'lib/pago/v2026_04/models.rb', line 23016 def amounts @amounts end |
#code ⇒ String? (readonly)
Code customers can use to apply the discount during checkout.
23039 23040 23041 |
# File 'lib/pago/v2026_04/models.rb', line 23039 def code @code end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
23020 23021 23022 |
# File 'lib/pago/v2026_04/models.rb', line 23020 def created_at @created_at end |
#currency ⇒ String (readonly)
23012 23013 23014 |
# File 'lib/pago/v2026_04/models.rb', line 23012 def currency @currency end |
#duration ⇒ String (readonly)
22998 22999 23000 |
# File 'lib/pago/v2026_04/models.rb', line 22998 def duration @duration end |
#duration_in_months ⇒ Integer (readonly)
23001 23002 23003 |
# File 'lib/pago/v2026_04/models.rb', line 23001 def duration_in_months @duration_in_months end |
#ends_at ⇒ String? (readonly)
Timestamp after which the discount is no longer redeemable.
23047 23048 23049 |
# File 'lib/pago/v2026_04/models.rb', line 23047 def ends_at @ends_at end |
#id ⇒ String (readonly)
The ID of the object.
23028 23029 23030 |
# File 'lib/pago/v2026_04/models.rb', line 23028 def id @id end |
#max_redemptions ⇒ Integer? (readonly)
Maximum number of times the discount can be redeemed.
23051 23052 23053 |
# File 'lib/pago/v2026_04/models.rb', line 23051 def max_redemptions @max_redemptions end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
23031 23032 23033 |
# File 'lib/pago/v2026_04/models.rb', line 23031 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
23024 23025 23026 |
# File 'lib/pago/v2026_04/models.rb', line 23024 def modified_at @modified_at end |
#name ⇒ String (readonly)
Name of the discount. Will be displayed to the customer when the discount is applied.
23035 23036 23037 |
# File 'lib/pago/v2026_04/models.rb', line 23035 def name @name end |
#organization_id ⇒ String (readonly)
The organization ID.
23059 23060 23061 |
# File 'lib/pago/v2026_04/models.rb', line 23059 def organization_id @organization_id end |
#redemptions_count ⇒ Integer (readonly)
Number of times the discount has been redeemed.
23055 23056 23057 |
# File 'lib/pago/v2026_04/models.rb', line 23055 def redemptions_count @redemptions_count end |
#starts_at ⇒ String? (readonly)
Timestamp after which the discount is redeemable.
23043 23044 23045 |
# File 'lib/pago/v2026_04/models.rb', line 23043 def starts_at @starts_at end |
#type ⇒ String (readonly)
23004 23005 23006 |
# File 'lib/pago/v2026_04/models.rb', line 23004 def type @type end |
Class Method Details
.from_json(data) ⇒ DiscountFixedRepeatDurationBase?
23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 |
# File 'lib/pago/v2026_04/models.rb', line 23102 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), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), name: (data.key?("name") ? data["name"] : ::Pago::UNSET), code: (data.key?("code") ? data["code"] : ::Pago::UNSET), starts_at: (data.key?("starts_at") ? data["starts_at"] : ::Pago::UNSET), ends_at: (data.key?("ends_at") ? data["ends_at"] : ::Pago::UNSET), max_redemptions: (data.key?("max_redemptions") ? data["max_redemptions"] : ::Pago::UNSET), redemptions_count: (data.key?("redemptions_count") ? data["redemptions_count"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET) ), data ) end |