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 in **basis points** (e.g., ‘540` = `5.4%`, `10000` = `100%`).
-
#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 79
|
Instance Attribute Details
#amount ⇒ Integer?
If present, update the discount amount in **basis points** (e.g., ‘540` = `5.4%`, `10000` = `100%`).
Must be at least 1 if provided.
22 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 22 optional :amount, Integer, nil?: true |
#code ⇒ String?
If present, update the discount code (uppercase).
28 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 28 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?
33 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 33 optional :expires_at, Time, nil?: true |
#metadata ⇒ Hash{Symbol=>String}?
Additional metadata for the discount
39 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 39 optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true |
#name ⇒ String?
44 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 44 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.
51 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 51 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
58 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 58 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.
66 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 66 optional :subscription_cycles, Integer, nil?: true |
#type ⇒ Symbol, ...
If present, update the discount type. Currently only ‘percentage` is supported.
72 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 72 optional :type, enum: -> { Dodopayments::DiscountType }, nil?: true |
#usage_limit ⇒ Integer?
77 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 77 optional :usage_limit, Integer, nil?: true |