Class: Dodopayments::Models::DiscountUpdateParams::CurrencyOption
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Dodopayments::Models::DiscountUpdateParams::CurrencyOption
- Defined in:
- lib/dodopayments/models/discount_update_params.rb,
sig/dodopayments/models/discount_update_params.rbs
Instance Attribute Summary collapse
-
#currency ⇒ Symbol, Dodopayments::Models::Currency
The currency this option applies to.
-
#is_default ⇒ Boolean?
Whether this row is the default to convert from for unconfigured currencies.
-
#max_amount_possible ⇒ Integer?
The most this code discounts in this currency's subunits.
-
#minimum_subtotal ⇒ Integer?
Eligible-cart threshold in this currency's subunits (0 = no minimum).
Instance Method Summary collapse
-
#initialize(discount_id:, amount: nil, code: nil, currency_options: nil, customer_eligibility: nil, expires_at: nil, metadata: nil, name: nil, per_customer_usage_limit: nil, preserve_on_plan_change: nil, restricted_to: nil, starts_at: nil, subscription_cycles: nil, type: nil, usage_limit: nil, request_options: {}) ⇒ Object
constructor
Some parameter documentations has been truncated, see Dodopayments::Models::DiscountUpdateParams for more details.
- #to_hash ⇒ {
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, currency_options: nil, customer_eligibility: nil, expires_at: nil, metadata: nil, name: nil, per_customer_usage_limit: nil, preserve_on_plan_change: nil, restricted_to: nil, starts_at: 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.
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 152 class CurrencyOption < Dodopayments::Internal::Type::BaseModel # @!attribute currency # The currency this option applies to. # # @return [Symbol, Dodopayments::Models::Currency] required :currency, enum: -> { Dodopayments::Currency } # @!attribute is_default # Whether this row is the default to convert from for unconfigured currencies. At # most one row per discount may be default. # # @return [Boolean, nil] optional :is_default, Dodopayments::Internal::Type::Boolean # @!attribute max_amount_possible # The most this code discounts in this currency's subunits. For `flat` codes this # is the deduction; for `percentage` codes it is the max-discount cap. Must be > 0 # if provided. # # @return [Integer, nil] optional :max_amount_possible, Integer, nil?: true # @!attribute minimum_subtotal # Eligible-cart threshold in this currency's subunits (0 = no minimum). # # @return [Integer, nil] optional :minimum_subtotal, Integer # @!method initialize(currency:, is_default: nil, max_amount_possible: nil, minimum_subtotal: nil) # Some parameter documentations has been truncated, see # {Dodopayments::Models::DiscountUpdateParams::CurrencyOption} for more details. # # A per-currency discount option (request shape). # # `max_amount_possible` is the most this code discounts in this currency — the # flat deduction for `flat` codes, or the max-discount cap for `percentage` codes. # Maps to the DB column of the same name. # # @param currency [Symbol, Dodopayments::Models::Currency] The currency this option applies to. # # @param is_default [Boolean] Whether this row is the default to convert from for unconfigured # # @param max_amount_possible [Integer, nil] The most this code discounts in this currency's subunits. For `flat` codes # # @param minimum_subtotal [Integer] Eligible-cart threshold in this currency's subunits (0 = no minimum). end |
Instance Attribute Details
#currency ⇒ Symbol, Dodopayments::Models::Currency
The currency this option applies to.
157 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 157 required :currency, enum: -> { Dodopayments::Currency } |
#is_default ⇒ Boolean?
Whether this row is the default to convert from for unconfigured currencies. At most one row per discount may be default.
164 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 164 optional :is_default, Dodopayments::Internal::Type::Boolean |
#max_amount_possible ⇒ Integer?
The most this code discounts in this currency's subunits. For flat codes this
is the deduction; for percentage codes it is the max-discount cap. Must be > 0
if provided.
172 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 172 optional :max_amount_possible, Integer, nil?: true |
#minimum_subtotal ⇒ Integer?
Eligible-cart threshold in this currency's subunits (0 = no minimum).
178 |
# File 'lib/dodopayments/models/discount_update_params.rb', line 178 optional :minimum_subtotal, Integer |
Instance Method Details
#to_hash ⇒ {
123 |
# File 'sig/dodopayments/models/discount_update_params.rbs', line 123
def to_hash: -> {
|