Class: Dodopayments::Models::DiscountUpdateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Dodopayments::Models::DiscountUpdateParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/dodopayments/models/discount_update_params.rb
Overview
Instance Attribute Summary collapse
-
#amount ⇒ Integer?
If present, update the discount amount:.
-
#code ⇒ String?
If present, update the discount code (uppercase).
- #discount_id ⇒ String
- #expires_at ⇒ Time?
-
#metadata ⇒ Hash{Symbol=>String}?
Additional metadata for the discount.
- #name ⇒ String?
-
#preserve_on_plan_change ⇒ Boolean?
Whether this discount should be preserved when a subscription changes plans.
-
#restricted_to ⇒ Array<String>?
If present, replaces all restricted product IDs with this new set.
-
#subscription_cycles ⇒ Integer?
Number of subscription billing cycles this discount is valid for.
-
#type ⇒ Symbol, ...
If present, update the discount type.
- #usage_limit ⇒ Integer?
Attributes included from Internal::Type::RequestParameters
Instance Method Summary collapse
-
#initialize(discount_id:, amount: nil, code: nil, expires_at: nil, metadata: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, type: nil, usage_limit: nil, request_options: {}) ⇒ Object
constructor
Some parameter documentations has been truncated, see DiscountUpdateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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(discount_id:, amount: nil, code: nil, expires_at: nil, metadata: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, type: nil, usage_limit: nil, request_options: {}) ⇒ Object
Some parameter documentations has been truncated, see Dodopayments::Models::DiscountUpdateParams for more details.
|
|
# File 'lib/dodopayments/models/discount_update_params.rb', line 82
|
Instance Attribute Details
#amount ⇒ Integer?
If present, update the discount amount:
-
If ‘discount_type` is `percentage`, this represents **basis points** (e.g., `540` = `5.4%`).
-
Otherwise, this represents **USD cents** (e.g., ‘100` = `$1.00`).
Must be at least 1 if provided.
25 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 25 optional :amount, Integer, nil?: true |
#code ⇒ String?
If present, update the discount code (uppercase).
31 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 31 optional :code, String, nil?: true |
#discount_id ⇒ String
13 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 13 required :discount_id, String |
#expires_at ⇒ Time?
36 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 36 optional :expires_at, Time, nil?: true |
#metadata ⇒ Hash{Symbol=>String}?
Additional metadata for the discount
42 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 42 optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true |
#name ⇒ String?
47 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 47 optional :name, String, nil?: true |
#preserve_on_plan_change ⇒ Boolean?
Whether this discount should be preserved when a subscription changes plans. If not provided, the existing value is kept.
54 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 54 optional :preserve_on_plan_change, Dodopayments::Internal::Type::Boolean, nil?: true |
#restricted_to ⇒ Array<String>?
If present, replaces all restricted product IDs with this new set. To remove all restrictions, send empty array
61 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 61 optional :restricted_to, Dodopayments::Internal::Type::ArrayOf[String], nil?: true |
#subscription_cycles ⇒ Integer?
Number of subscription billing cycles this discount is valid for. If not provided, the discount will be applied indefinitely to all recurring payments related to the subscription.
69 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 69 optional :subscription_cycles, Integer, nil?: true |
#type ⇒ Symbol, ...
If present, update the discount type.
75 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 75 optional :type, enum: -> { Dodopayments::DiscountType }, nil?: true |
#usage_limit ⇒ Integer?
80 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 80 optional :usage_limit, Integer, nil?: true |