Class: Dodopayments::Models::DiscountDetail
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Dodopayments::Models::DiscountDetail
- Defined in:
- lib/dodopayments/models/discount_detail.rb
Instance Attribute Summary collapse
-
#amount ⇒ Integer
The discount amount (basis points for percentage, USD cents for flat).
-
#business_id ⇒ String
The business this discount belongs to.
-
#code ⇒ String
The discount code.
-
#created_at ⇒ Time
Timestamp when the discount was created.
-
#cycles_remaining ⇒ Integer?
Remaining billing cycles for this discount on this subscription (None for one-time payments).
-
#discount_id ⇒ String
The unique discount ID.
-
#expires_at ⇒ Time?
Optional date/time after which discount is expired.
-
#metadata ⇒ Hash{Symbol=>String}
Additional metadata.
-
#name ⇒ String?
Name for the Discount.
-
#position ⇒ Integer
Position of this discount in the stack (0-based).
-
#preserve_on_plan_change ⇒ Boolean
Whether this discount should be preserved when a subscription changes plans.
-
#restricted_to ⇒ Array<String>
List of product IDs to which this discount is restricted.
-
#subscription_cycles ⇒ Integer?
Number of subscription billing cycles this discount is valid for.
-
#times_used ⇒ Integer
How many times this discount has been used.
-
#type ⇒ Symbol, Dodopayments::Models::DiscountType
The type of discount.
-
#usage_limit ⇒ Integer?
Usage limit for this discount, if any.
Instance Method Summary collapse
-
#initialize(amount:, business_id:, code:, created_at:, discount_id:, metadata:, position:, preserve_on_plan_change:, restricted_to:, times_used:, type:, cycles_remaining: nil, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see DiscountDetail for more details.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(amount:, business_id:, code:, created_at:, discount_id:, metadata:, position:, preserve_on_plan_change:, restricted_to:, times_used:, type:, cycles_remaining: nil, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil) ⇒ Object
Some parameter documentations has been truncated, see Dodopayments::Models::DiscountDetail for more details.
Response struct for a discount with its position in a stack and optional cycle-tracking information (for subscriptions).
|
|
# File 'lib/dodopayments/models/discount_detail.rb', line 103
|
Instance Attribute Details
#amount ⇒ Integer
The discount amount (basis points for percentage, USD cents for flat)
10 |
# File 'lib/dodopayments/models/discount_detail.rb', line 10 required :amount, Integer |
#business_id ⇒ String
The business this discount belongs to
16 |
# File 'lib/dodopayments/models/discount_detail.rb', line 16 required :business_id, String |
#code ⇒ String
The discount code
22 |
# File 'lib/dodopayments/models/discount_detail.rb', line 22 required :code, String |
#created_at ⇒ Time
Timestamp when the discount was created
28 |
# File 'lib/dodopayments/models/discount_detail.rb', line 28 required :created_at, Time |
#cycles_remaining ⇒ Integer?
Remaining billing cycles for this discount on this subscription (None for one-time payments)
77 |
# File 'lib/dodopayments/models/discount_detail.rb', line 77 optional :cycles_remaining, Integer, nil?: true |
#discount_id ⇒ String
The unique discount ID
34 |
# File 'lib/dodopayments/models/discount_detail.rb', line 34 required :discount_id, String |
#expires_at ⇒ Time?
Optional date/time after which discount is expired
83 |
# File 'lib/dodopayments/models/discount_detail.rb', line 83 optional :expires_at, Time, nil?: true |
#metadata ⇒ Hash{Symbol=>String}
Additional metadata
40 |
# File 'lib/dodopayments/models/discount_detail.rb', line 40 required :metadata, Dodopayments::Internal::Type::HashOf[String] |
#name ⇒ String?
Name for the Discount
89 |
# File 'lib/dodopayments/models/discount_detail.rb', line 89 optional :name, String, nil?: true |
#position ⇒ Integer
Position of this discount in the stack (0-based)
46 |
# File 'lib/dodopayments/models/discount_detail.rb', line 46 required :position, Integer |
#preserve_on_plan_change ⇒ Boolean
Whether this discount should be preserved when a subscription changes plans
52 |
# File 'lib/dodopayments/models/discount_detail.rb', line 52 required :preserve_on_plan_change, Dodopayments::Internal::Type::Boolean |
#restricted_to ⇒ Array<String>
List of product IDs to which this discount is restricted
58 |
# File 'lib/dodopayments/models/discount_detail.rb', line 58 required :restricted_to, Dodopayments::Internal::Type::ArrayOf[String] |
#subscription_cycles ⇒ Integer?
Number of subscription billing cycles this discount is valid for
95 |
# File 'lib/dodopayments/models/discount_detail.rb', line 95 optional :subscription_cycles, Integer, nil?: true |
#times_used ⇒ Integer
How many times this discount has been used
64 |
# File 'lib/dodopayments/models/discount_detail.rb', line 64 required :times_used, Integer |
#type ⇒ Symbol, Dodopayments::Models::DiscountType
The type of discount
70 |
# File 'lib/dodopayments/models/discount_detail.rb', line 70 required :type, enum: -> { Dodopayments::DiscountType } |
#usage_limit ⇒ Integer?
Usage limit for this discount, if any
101 |
# File 'lib/dodopayments/models/discount_detail.rb', line 101 optional :usage_limit, Integer, nil?: true |