Class: Pago::V2026_04::Models::DiscountPercentageRepeatDurationBase
- 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", basis_points: "basis_points", 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", "basis_points", "created_at", "modified_at", "id", "metadata", "name", "code", "starts_at", "ends_at", "max_redemptions", "redemptions_count", "organization_id"].freeze
Instance Attribute Summary collapse
-
#basis_points ⇒ Integer
readonly
Discount percentage in basis points.
-
#code ⇒ String?
readonly
Code customers can use to apply the discount during checkout.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
- #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:, basis_points:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountPercentageRepeatDurationBase
constructor
A new instance of DiscountPercentageRepeatDurationBase.
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:, basis_points:, created_at:, modified_at:, id:, metadata:, name:, code:, starts_at:, ends_at:, max_redemptions:, redemptions_count:, organization_id:) ⇒ DiscountPercentageRepeatDurationBase
Returns a new instance of DiscountPercentageRepeatDurationBase.
23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 |
# File 'lib/pago/v2026_04/models.rb', line 23771 def initialize( duration:, duration_in_months:, type:, basis_points:, 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(:basis_points, basis_points) 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
#basis_points ⇒ Integer (readonly)
Discount percentage in basis points. A basis point is 1/100th of a percent. For example, 1000 basis points equals a 10% discount.
23726 23727 23728 |
# File 'lib/pago/v2026_04/models.rb', line 23726 def basis_points @basis_points end |
#code ⇒ String? (readonly)
Code customers can use to apply the discount during checkout.
23749 23750 23751 |
# File 'lib/pago/v2026_04/models.rb', line 23749 def code @code end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
23730 23731 23732 |
# File 'lib/pago/v2026_04/models.rb', line 23730 def created_at @created_at end |
#duration ⇒ String (readonly)
23716 23717 23718 |
# File 'lib/pago/v2026_04/models.rb', line 23716 def duration @duration end |
#duration_in_months ⇒ Integer (readonly)
23719 23720 23721 |
# File 'lib/pago/v2026_04/models.rb', line 23719 def duration_in_months @duration_in_months end |
#ends_at ⇒ String? (readonly)
Timestamp after which the discount is no longer redeemable.
23757 23758 23759 |
# File 'lib/pago/v2026_04/models.rb', line 23757 def ends_at @ends_at end |
#id ⇒ String (readonly)
The ID of the object.
23738 23739 23740 |
# File 'lib/pago/v2026_04/models.rb', line 23738 def id @id end |
#max_redemptions ⇒ Integer? (readonly)
Maximum number of times the discount can be redeemed.
23761 23762 23763 |
# File 'lib/pago/v2026_04/models.rb', line 23761 def max_redemptions @max_redemptions end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
23741 23742 23743 |
# File 'lib/pago/v2026_04/models.rb', line 23741 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
23734 23735 23736 |
# File 'lib/pago/v2026_04/models.rb', line 23734 def modified_at @modified_at end |
#name ⇒ String (readonly)
Name of the discount. Will be displayed to the customer when the discount is applied.
23745 23746 23747 |
# File 'lib/pago/v2026_04/models.rb', line 23745 def name @name end |
#organization_id ⇒ String (readonly)
The organization ID.
23769 23770 23771 |
# File 'lib/pago/v2026_04/models.rb', line 23769 def organization_id @organization_id end |
#redemptions_count ⇒ Integer (readonly)
Number of times the discount has been redeemed.
23765 23766 23767 |
# File 'lib/pago/v2026_04/models.rb', line 23765 def redemptions_count @redemptions_count end |
#starts_at ⇒ String? (readonly)
Timestamp after which the discount is redeemable.
23753 23754 23755 |
# File 'lib/pago/v2026_04/models.rb', line 23753 def starts_at @starts_at end |
#type ⇒ String (readonly)
23722 23723 23724 |
# File 'lib/pago/v2026_04/models.rb', line 23722 def type @type end |
Class Method Details
.from_json(data) ⇒ DiscountPercentageRepeatDurationBase?
23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 |
# File 'lib/pago/v2026_04/models.rb', line 23808 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), basis_points: (data.key?("basis_points") ? data["basis_points"] : ::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 |