Class: Dodopayments::Models::Products::LocalizedPrice

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/products/localized_price.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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(id:, amount:, created_at:, currency:, mode:, product_id:, updated_at:, country_code: nil) ⇒ Object

Parameters:

  • id (String)

    Unique identifier for the localized price.

  • amount (Integer)

    Amount in the smallest currency unit (e.g., cents).

  • created_at (Time)

    Timestamp when the localized price was created.

  • currency (Symbol, Dodopayments::Models::Currency)

    Currency to charge in.

  • mode (Symbol, Dodopayments::Models::Products::PricingMode)

    Pricing mode of the rule: by_currency or by_country.

  • product_id (String)

    Product this localized price belongs to.

  • updated_at (Time)

    Timestamp when the localized price was last updated.

  • country_code (Symbol, Dodopayments::Models::CountryCode, nil) (defaults to: nil)

    Country the rule applies to. Only set when mode is by_country.



# File 'lib/dodopayments/models/products/localized_price.rb', line 56

Instance Attribute Details

#amountInteger

Amount in the smallest currency unit (e.g., cents).

Returns:

  • (Integer)


18
# File 'lib/dodopayments/models/products/localized_price.rb', line 18

required :amount, Integer

#country_codeSymbol, ...

Country the rule applies to. Only set when mode is by_country.

Returns:



54
# File 'lib/dodopayments/models/products/localized_price.rb', line 54

optional :country_code, enum: -> { Dodopayments::CountryCode }, nil?: true

#created_atTime

Timestamp when the localized price was created.

Returns:

  • (Time)


24
# File 'lib/dodopayments/models/products/localized_price.rb', line 24

required :created_at, Time

#currencySymbol, Dodopayments::Models::Currency

Currency to charge in.

Returns:



30
# File 'lib/dodopayments/models/products/localized_price.rb', line 30

required :currency, enum: -> { Dodopayments::Currency }

#idString

Unique identifier for the localized price.

Returns:

  • (String)


12
# File 'lib/dodopayments/models/products/localized_price.rb', line 12

required :id, String

#modeSymbol, Dodopayments::Models::Products::PricingMode

Pricing mode of the rule: by_currency or by_country.



36
# File 'lib/dodopayments/models/products/localized_price.rb', line 36

required :mode, enum: -> { Dodopayments::Products::PricingMode }

#product_idString

Product this localized price belongs to.

Returns:

  • (String)


42
# File 'lib/dodopayments/models/products/localized_price.rb', line 42

required :product_id, String

#updated_atTime

Timestamp when the localized price was last updated.

Returns:

  • (Time)


48
# File 'lib/dodopayments/models/products/localized_price.rb', line 48

required :updated_at, Time