Class: Dodopayments::Models::Product

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

Overview

See Also:

  • Dodopayments::Resources::Products#create

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:, credit_entitlements:, entitlements:, 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, pricing_mode: nil, product_collection_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::Product for more details.

Parameters:

  • Unique identifier for the business to which the product belongs.

  • Timestamp when the product was created.

  • Attached credit entitlements with settings

  • Attached entitlements (integration-based access grants)

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

  • Indicates whether the product requires a license key.

  • Additional custom data associated with the product

  • Pricing information for the product.

  • Unique identifier for the product.

  • Tax category associated with the product.

  • Timestamp when the product was last updated.

  • (defaults to: nil)

    Available Addons for subscription products

  • (defaults to: nil)

    Description of the product, optional.

  • (defaults to: nil)

    Digital-product-delivery payload, present on grants for digital_files

  • (defaults to: nil)

    URL of the product image, optional.

  • (defaults to: nil)

    Message sent upon license key activation, if applicable.

  • (defaults to: nil)

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

  • (defaults to: nil)

    Duration of the license key validity, if enabled.

  • (defaults to: nil)

    Name of the product, optional.

  • (defaults to: nil)

    Pricing mode for localized pricing. NULL means base-only (no localized rules app

  • (defaults to: nil)

    The product collection ID this product belongs to, if any



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

Instance Attribute Details

#addonsArray<String>?

Available Addons for subscription products

Parameters:

Returns:



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

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

#brand_idString

Parameters:

Returns:



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.

Parameters:

Returns:



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

required :business_id, String

#created_atTime

Timestamp when the product was created.

Parameters:

Returns:



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

required :created_at, Time

#credit_entitlementsArray<Dodopayments::Models::CreditEntitlementMappingResponse>

Attached credit entitlements with settings

Parameters:

Returns:



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

required :credit_entitlements,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CreditEntitlementMappingResponse] }

#descriptionString?

Description of the product, optional.

Parameters:

Returns:



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

optional :description, String, nil?: true

#digital_product_deliveryDodopayments::Models::DigitalProductDelivery?

Digital-product-delivery payload, present on grants for digital_files entitlements. Each file carries a short-lived presigned download URL.

Parameters:

Returns:



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

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

#entitlementsArray<Dodopayments::Models::ProductEntitlementSummary>

Attached entitlements (integration-based access grants)

Parameters:

Returns:



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

required :entitlements,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductEntitlementSummary] }

#imageString?

URL of the product image, optional.

Parameters:

Returns:



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

optional :image, String, nil?: true

#is_recurringBoolean

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

Parameters:

Returns:



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

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

#license_key_activation_messageString?

Deprecated.

Use the dedicated entitlements API to configure license-key delivery.

Message sent upon license key activation, if applicable.

Parameters:

Returns:



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

optional :license_key_activation_message, String, nil?: true

#license_key_activations_limitInteger?

Deprecated.

Use the dedicated entitlements API to configure license-key delivery.

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

Parameters:

Returns:



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

optional :license_key_activations_limit, Integer, nil?: true

#license_key_durationDodopayments::Models::LicenseKeyDuration?

Duration of the license key validity, if enabled.

Parameters:

Returns:



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

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

#license_key_enabledBoolean

Deprecated.

Use the dedicated entitlements API to configure license-key delivery.

Indicates whether the product requires a license key.

Parameters:

Returns:



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

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

#metadataHash{Symbol=>String, Float, Boolean}

Additional custom data associated with the product

Parameters:

Returns:



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

required :metadata, -> { Dodopayments::Internal::Type::HashOf[union: Dodopayments::MetadataItem] }

#nameString?

Name of the product, optional.

Parameters:

Returns:



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

optional :name, String, nil?: true

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

Pricing information for the product.

Parameters:

Returns:



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

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

#pricing_modeSymbol, ...

Pricing mode for localized pricing. NULL means base-only (no localized rules apply).

Parameters:

Returns:



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

optional :pricing_mode, enum: -> { Dodopayments::Products::PricingMode }, nil?: true

#product_collection_idString?

The product collection ID this product belongs to, if any

Parameters:

Returns:



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

optional :product_collection_id, String, nil?: true

#product_idString

Unique identifier for the product.

Parameters:

Returns:



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

required :product_id, String

#tax_categorySymbol, Dodopayments::Models::TaxCategory

Tax category associated with the product.

Parameters:

Returns:



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

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

#updated_atTime

Timestamp when the product was last updated.

Parameters:

Returns:



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

required :updated_at, Time

Instance Method Details

#to_hash{

Returns:



99
# File 'sig/dodopayments/models/product.rbs', line 99

def to_hash: -> {