Class: Dodopayments::Models::Product

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

Overview

Defined Under Namespace

Classes: DigitalProductDelivery

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(brand_id: , business_id: , created_at: , is_recurring: , license_key_enabled: , metadata: , price: , product_id: , tax_category: , updated_at: , addons: nil, description: nil, digital_product_delivery: nil, image: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, name: nil) ⇒ Object

Parameters:

  • brand_id (String) (defaults to: )
  • business_id (String) (defaults to: )

    Unique identifier for the business to which the product belongs.

  • created_at (Time) (defaults to: )

    Timestamp when the product was created.

  • is_recurring (Boolean) (defaults to: )

    Indicates if the product is recurring (e.g., subscriptions).

  • license_key_enabled (Boolean) (defaults to: )

    Indicates whether the product requires a license key.

  • metadata (Hash{Symbol=>String}) (defaults to: )

    Additional custom data associated with the product

  • price (Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice) (defaults to: )

    Pricing information for the product.

  • product_id (String) (defaults to: )

    Unique identifier for the product.

  • tax_category (Symbol, Dodopayments::Models::TaxCategory) (defaults to: )

    Tax category associated with the product.

  • updated_at (Time) (defaults to: )

    Timestamp when the product was last updated.

  • addons (Array<String>, nil) (defaults to: nil)

    Available Addons for subscription products

  • description (String, nil) (defaults to: nil)

    Description of the product, optional.

  • digital_product_delivery (Dodopayments::Models::Product::DigitalProductDelivery, nil) (defaults to: nil)
  • image (String, nil) (defaults to: nil)

    URL of the product image, optional.

  • license_key_activation_message (String, nil) (defaults to: nil)

    Message sent upon license key activation, if applicable.

  • license_key_activations_limit (Integer, nil) (defaults to: nil)

    Limit on the number of activations for the license key, if enabled.

  • license_key_duration (Dodopayments::Models::LicenseKeyDuration, nil) (defaults to: nil)

    Duration of the license key validity, if enabled.

  • name (String, nil) (defaults to: nil)

    Name of the product, optional.



# File 'lib/dodopayments/models/product.rb', line 113

Instance Attribute Details

#addonsArray<String>?

Available Addons for subscription products

Returns:

  • (Array<String>, nil)


70
# File 'lib/dodopayments/models/product.rb', line 70

optional :addons, Dodopayments::Internal::Type::ArrayOf[String], nil?: true

#brand_idString

Returns:

  • (String)


10
# File 'lib/dodopayments/models/product.rb', line 10

required :brand_id, String

#business_idString

Unique identifier for the business to which the product belongs.

Returns:

  • (String)


16
# File 'lib/dodopayments/models/product.rb', line 16

required :business_id, String

#created_atTime

Timestamp when the product was created.

Returns:

  • (Time)


22
# File 'lib/dodopayments/models/product.rb', line 22

required :created_at, Time

#descriptionString?

Description of the product, optional.

Returns:

  • (String, nil)


76
# File 'lib/dodopayments/models/product.rb', line 76

optional :description, String, nil?: true

#digital_product_deliveryDodopayments::Models::Product::DigitalProductDelivery?



81
# File 'lib/dodopayments/models/product.rb', line 81

optional :digital_product_delivery, -> { Dodopayments::Product::DigitalProductDelivery }, nil?: true

#imageString?

URL of the product image, optional.

Returns:

  • (String, nil)


87
# File 'lib/dodopayments/models/product.rb', line 87

optional :image, String, nil?: true

#is_recurringBoolean

Indicates if the product is recurring (e.g., subscriptions).

Returns:

  • (Boolean)


28
# File 'lib/dodopayments/models/product.rb', line 28

required :is_recurring, Dodopayments::Internal::Type::Boolean

#license_key_activation_messageString?

Message sent upon license key activation, if applicable.

Returns:

  • (String, nil)


93
# File 'lib/dodopayments/models/product.rb', line 93

optional :license_key_activation_message, String, nil?: true

#license_key_activations_limitInteger?

Limit on the number of activations for the license key, if enabled.

Returns:

  • (Integer, nil)


99
# File 'lib/dodopayments/models/product.rb', line 99

optional :license_key_activations_limit, Integer, nil?: true

#license_key_durationDodopayments::Models::LicenseKeyDuration?

Duration of the license key validity, if enabled.



105
# File 'lib/dodopayments/models/product.rb', line 105

optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true

#license_key_enabledBoolean

Indicates whether the product requires a license key.

Returns:

  • (Boolean)


34
# File 'lib/dodopayments/models/product.rb', line 34

required :license_key_enabled, Dodopayments::Internal::Type::Boolean

#metadataHash{Symbol=>String}

Additional custom data associated with the product

Returns:

  • (Hash{Symbol=>String})


40
# File 'lib/dodopayments/models/product.rb', line 40

required :metadata, Dodopayments::Internal::Type::HashOf[String]

#nameString?

Name of the product, optional.

Returns:

  • (String, nil)


111
# File 'lib/dodopayments/models/product.rb', line 111

optional :name, String, nil?: true

#priceDodopayments::Models::Price::OneTimePrice, ...

Pricing information for the product.



46
# File 'lib/dodopayments/models/product.rb', line 46

required :price, union: -> { Dodopayments::Price }

#product_idString

Unique identifier for the product.

Returns:

  • (String)


52
# File 'lib/dodopayments/models/product.rb', line 52

required :product_id, String

#tax_categorySymbol, Dodopayments::Models::TaxCategory

Tax category associated with the product.



58
# File 'lib/dodopayments/models/product.rb', line 58

required :tax_category, enum: -> { Dodopayments::TaxCategory }

#updated_atTime

Timestamp when the product was last updated.

Returns:

  • (Time)


64
# File 'lib/dodopayments/models/product.rb', line 64

required :updated_at, Time