Class: Pago::V2026_04::Models::DiscountFixedOnceForeverDurationBase
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ duration: "duration", 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", "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
-
#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:, type:, amount:, currency:, amounts:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountFixedOnceForeverDurationBase
constructor
A new instance of DiscountFixedOnceForeverDurationBase.
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:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountFixedOnceForeverDurationBase
Returns a new instance of DiscountFixedOnceForeverDurationBase.
22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 |
# File 'lib/pago/v2026_04/models.rb', line 22741 def initialize( duration:, 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(: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)
22688 22689 22690 |
# File 'lib/pago/v2026_04/models.rb', line 22688 def amount @amount end |
#amounts ⇒ Hash{String => Integer} (readonly)
Map of currency to fixed amount to discount from the total.
22696 22697 22698 |
# File 'lib/pago/v2026_04/models.rb', line 22696 def amounts @amounts end |
#code ⇒ String? (readonly)
Code customers can use to apply the discount during checkout.
22719 22720 22721 |
# File 'lib/pago/v2026_04/models.rb', line 22719 def code @code end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
22700 22701 22702 |
# File 'lib/pago/v2026_04/models.rb', line 22700 def created_at @created_at end |
#currency ⇒ String (readonly)
22692 22693 22694 |
# File 'lib/pago/v2026_04/models.rb', line 22692 def currency @currency end |
#duration ⇒ String (readonly)
22681 22682 22683 |
# File 'lib/pago/v2026_04/models.rb', line 22681 def duration @duration end |
#ends_at ⇒ String? (readonly)
Timestamp after which the discount is no longer redeemable.
22727 22728 22729 |
# File 'lib/pago/v2026_04/models.rb', line 22727 def ends_at @ends_at end |
#id ⇒ String (readonly)
The ID of the object.
22708 22709 22710 |
# File 'lib/pago/v2026_04/models.rb', line 22708 def id @id end |
#max_redemptions ⇒ Integer? (readonly)
Maximum number of times the discount can be redeemed.
22731 22732 22733 |
# File 'lib/pago/v2026_04/models.rb', line 22731 def max_redemptions @max_redemptions end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
22711 22712 22713 |
# File 'lib/pago/v2026_04/models.rb', line 22711 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
22704 22705 22706 |
# File 'lib/pago/v2026_04/models.rb', line 22704 def modified_at @modified_at end |
#name ⇒ String (readonly)
Name of the discount. Will be displayed to the customer when the discount is applied.
22715 22716 22717 |
# File 'lib/pago/v2026_04/models.rb', line 22715 def name @name end |
#organization_id ⇒ String (readonly)
The organization ID.
22739 22740 22741 |
# File 'lib/pago/v2026_04/models.rb', line 22739 def organization_id @organization_id end |
#redemptions_count ⇒ Integer (readonly)
Number of times the discount has been redeemed.
22735 22736 22737 |
# File 'lib/pago/v2026_04/models.rb', line 22735 def redemptions_count @redemptions_count end |
#starts_at ⇒ String? (readonly)
Timestamp after which the discount is redeemable.
22723 22724 22725 |
# File 'lib/pago/v2026_04/models.rb', line 22723 def starts_at @starts_at end |
#type ⇒ String (readonly)
22684 22685 22686 |
# File 'lib/pago/v2026_04/models.rb', line 22684 def type @type end |
Class Method Details
.from_json(data) ⇒ DiscountFixedOnceForeverDurationBase?
22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 |
# File 'lib/pago/v2026_04/models.rb', line 22780 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), 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 |