dodopayments 2.8.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/attach_product_entitlement.rb +22 -0
- data/lib/dodopayments/models/cancellation_feedback.rb +21 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
- data/lib/dodopayments/models/checkout_session_request.rb +14 -1
- data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +1 -0
- data/lib/dodopayments/models/credit_overage_reset_webhook_event.rb +52 -0
- data/lib/dodopayments/models/customer_list_entitlements_params.rb +20 -0
- data/lib/dodopayments/models/customer_list_entitlements_response.rb +105 -0
- data/lib/dodopayments/models/digital_product_delivery.rb +13 -15
- data/lib/dodopayments/models/digital_product_delivery_file.rb +32 -8
- data/lib/dodopayments/models/entitlement.rb +86 -0
- data/lib/dodopayments/models/entitlement_create_params.rb +54 -0
- data/lib/dodopayments/models/entitlement_delete_params.rb +20 -0
- data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +51 -0
- data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +51 -0
- data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +51 -0
- data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +51 -0
- data/lib/dodopayments/models/entitlement_integration_type.rb +21 -0
- data/lib/dodopayments/models/entitlement_list_params.rb +55 -0
- data/lib/dodopayments/models/entitlement_retrieve_params.rb +20 -0
- data/lib/dodopayments/models/entitlement_update_params.rb +54 -0
- data/lib/dodopayments/models/entitlements/entitlement_grant.rb +172 -0
- data/lib/dodopayments/models/entitlements/file_delete_params.rb +28 -0
- data/lib/dodopayments/models/entitlements/file_upload_params.rb +22 -0
- data/lib/dodopayments/models/entitlements/file_upload_response.rb +23 -0
- data/lib/dodopayments/models/entitlements/grant_list_params.rb +68 -0
- data/lib/dodopayments/models/entitlements/grant_revoke_params.rb +28 -0
- data/lib/dodopayments/models/entitlements/license_key_grant.rb +40 -0
- data/lib/dodopayments/models/integration_config.rb +174 -0
- data/lib/dodopayments/models/integration_config_response.rb +238 -0
- data/lib/dodopayments/models/license_key_instance_list_params.rb +9 -1
- data/lib/dodopayments/models/one_time_product_cart_item.rb +15 -1
- data/lib/dodopayments/models/payment.rb +19 -3
- data/lib/dodopayments/models/payment_create_params.rb +23 -35
- data/lib/dodopayments/models/payment_create_response.rb +3 -33
- data/lib/dodopayments/models/product.rb +12 -217
- data/lib/dodopayments/models/product_create_params.rb +25 -6
- data/lib/dodopayments/models/product_entitlement_summary.rb +57 -0
- data/lib/dodopayments/models/product_list_response.rb +3 -218
- data/lib/dodopayments/models/product_update_params.rb +21 -7
- data/lib/dodopayments/models/scheduled_plan_change.rb +99 -0
- data/lib/dodopayments/models/subscription.rb +20 -102
- data/lib/dodopayments/models/subscription_create_params.rb +27 -37
- data/lib/dodopayments/models/subscription_create_response.rb +19 -3
- data/lib/dodopayments/models/subscription_list_response.rb +3 -103
- data/lib/dodopayments/models/subscription_update_params.rb +23 -1
- data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +11 -1
- data/lib/dodopayments/models/unwrap_webhook_event.rb +11 -1
- data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -1
- data/lib/dodopayments/models/webhook_event_type.rb +1 -0
- data/lib/dodopayments/models/webhook_payload.rb +2 -154
- data/lib/dodopayments/models.rb +40 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/customers.rb +20 -0
- data/lib/dodopayments/resources/entitlements/files.rb +70 -0
- data/lib/dodopayments/resources/entitlements/grants.rb +78 -0
- data/lib/dodopayments/resources/entitlements.rb +153 -0
- data/lib/dodopayments/resources/license_key_instances.rb +3 -1
- data/lib/dodopayments/resources/payments.rb +6 -2
- data/lib/dodopayments/resources/products.rb +4 -4
- data/lib/dodopayments/resources/subscriptions.rb +20 -5
- data/lib/dodopayments/resources/webhooks.rb +2 -2
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +30 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/attach_product_entitlement.rbi +35 -0
- data/rbi/dodopayments/models/cancellation_feedback.rbi +45 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +20 -3
- data/rbi/dodopayments/models/checkout_session_request.rbi +18 -0
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +5 -0
- data/rbi/dodopayments/models/credit_overage_reset_webhook_event.rbi +103 -0
- data/rbi/dodopayments/models/customer_list_entitlements_params.rbi +38 -0
- data/rbi/dodopayments/models/customer_list_entitlements_response.rbi +189 -0
- data/rbi/dodopayments/models/digital_product_delivery.rbi +10 -22
- data/rbi/dodopayments/models/digital_product_delivery_file.rbi +40 -8
- data/rbi/dodopayments/models/entitlement.rbi +112 -0
- data/rbi/dodopayments/models/entitlement_create_params.rbi +112 -0
- data/rbi/dodopayments/models/entitlement_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +103 -0
- data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +103 -0
- data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +102 -0
- data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +103 -0
- data/rbi/dodopayments/models/entitlement_integration_type.rbi +44 -0
- data/rbi/dodopayments/models/entitlement_list_params.rbi +146 -0
- data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +38 -0
- data/rbi/dodopayments/models/entitlement_update_params.rbi +111 -0
- data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +235 -0
- data/rbi/dodopayments/models/entitlements/file_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/entitlements/file_upload_params.rbi +40 -0
- data/rbi/dodopayments/models/entitlements/file_upload_response.rbi +34 -0
- data/rbi/dodopayments/models/entitlements/grant_list_params.rbi +145 -0
- data/rbi/dodopayments/models/entitlements/grant_revoke_params.rbi +48 -0
- data/rbi/dodopayments/models/entitlements/license_key_grant.rbi +62 -0
- data/rbi/dodopayments/models/integration_config.rbi +296 -0
- data/rbi/dodopayments/models/integration_config_response.rbi +416 -0
- data/rbi/dodopayments/models/license_key_instance_list_params.rbi +8 -0
- data/rbi/dodopayments/models/one_time_product_cart_item.rbi +24 -3
- data/rbi/dodopayments/models/payment.rbi +31 -3
- data/rbi/dodopayments/models/payment_create_params.rbi +28 -56
- data/rbi/dodopayments/models/payment_create_response.rbi +3 -68
- data/rbi/dodopayments/models/product.rbi +12 -420
- data/rbi/dodopayments/models/product_create_params.rbi +43 -7
- data/rbi/dodopayments/models/product_entitlement_summary.rbi +88 -0
- data/rbi/dodopayments/models/product_list_response.rbi +3 -430
- data/rbi/dodopayments/models/product_update_params.rbi +35 -9
- data/rbi/dodopayments/models/scheduled_plan_change.rbi +141 -0
- data/rbi/dodopayments/models/subscription.rbi +24 -149
- data/rbi/dodopayments/models/subscription_create_params.rbi +36 -68
- data/rbi/dodopayments/models/subscription_create_response.rbi +47 -3
- data/rbi/dodopayments/models/subscription_list_response.rbi +4 -167
- data/rbi/dodopayments/models/subscription_update_params.rbi +27 -0
- data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +5 -0
- data/rbi/dodopayments/models/unwrap_webhook_event.rbi +5 -0
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +10 -0
- data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
- data/rbi/dodopayments/models/webhook_payload.rbi +4 -197
- data/rbi/dodopayments/models.rbi +46 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +16 -0
- data/rbi/dodopayments/resources/customers.rbi +14 -0
- data/rbi/dodopayments/resources/entitlements/files.rbi +52 -0
- data/rbi/dodopayments/resources/entitlements/grants.rbi +65 -0
- data/rbi/dodopayments/resources/entitlements.rbi +143 -0
- data/rbi/dodopayments/resources/license_key_instances.rbi +3 -0
- data/rbi/dodopayments/resources/payments.rbi +10 -2
- data/rbi/dodopayments/resources/products.rbi +34 -7
- data/rbi/dodopayments/resources/subscriptions.rbi +31 -5
- data/rbi/dodopayments/resources/webhooks.rbi +10 -0
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/attach_product_entitlement.rbs +13 -0
- data/sig/dodopayments/models/cancellation_feedback.rbs +28 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +10 -3
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +2 -0
- data/sig/dodopayments/models/credit_overage_reset_webhook_event.rbs +45 -0
- data/sig/dodopayments/models/customer_list_entitlements_params.rbs +23 -0
- data/sig/dodopayments/models/customer_list_entitlements_response.rbs +95 -0
- data/sig/dodopayments/models/digital_product_delivery.rbs +5 -5
- data/sig/dodopayments/models/digital_product_delivery_file.rbs +32 -5
- data/sig/dodopayments/models/entitlement.rbs +67 -0
- data/sig/dodopayments/models/entitlement_create_params.rbs +46 -0
- data/sig/dodopayments/models/entitlement_delete_params.rbs +23 -0
- data/sig/dodopayments/models/entitlement_grant_created_webhook_event.rbs +45 -0
- data/sig/dodopayments/models/entitlement_grant_delivered_webhook_event.rbs +45 -0
- data/sig/dodopayments/models/entitlement_grant_failed_webhook_event.rbs +45 -0
- data/sig/dodopayments/models/entitlement_grant_revoked_webhook_event.rbs +45 -0
- data/sig/dodopayments/models/entitlement_integration_type.rbs +28 -0
- data/sig/dodopayments/models/entitlement_list_params.rbs +69 -0
- data/sig/dodopayments/models/entitlement_retrieve_params.rbs +23 -0
- data/sig/dodopayments/models/entitlement_update_params.rbs +46 -0
- data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +134 -0
- data/sig/dodopayments/models/entitlements/file_delete_params.rbs +30 -0
- data/sig/dodopayments/models/entitlements/file_upload_params.rbs +25 -0
- data/sig/dodopayments/models/entitlements/file_upload_response.rbs +15 -0
- data/sig/dodopayments/models/entitlements/grant_list_params.rbs +71 -0
- data/sig/dodopayments/models/entitlements/grant_revoke_params.rbs +30 -0
- data/sig/dodopayments/models/entitlements/license_key_grant.rbs +37 -0
- data/sig/dodopayments/models/integration_config.rbs +147 -0
- data/sig/dodopayments/models/integration_config_response.rbs +206 -0
- data/sig/dodopayments/models/license_key_instance_list_params.rbs +10 -1
- data/sig/dodopayments/models/one_time_product_cart_item.rbs +14 -3
- data/sig/dodopayments/models/payment.rbs +16 -4
- data/sig/dodopayments/models/payment_create_params.rbs +16 -27
- data/sig/dodopayments/models/payment_create_response.rbs +4 -27
- data/sig/dodopayments/models/product.rbs +4 -205
- data/sig/dodopayments/models/product_create_params.rbs +4 -4
- data/sig/dodopayments/models/product_entitlement_summary.rbs +40 -0
- data/sig/dodopayments/models/product_list_response.rbs +4 -205
- data/sig/dodopayments/models/product_update_params.rbs +4 -4
- data/sig/dodopayments/models/scheduled_plan_change.rbs +73 -0
- data/sig/dodopayments/models/subscription.rbs +14 -74
- data/sig/dodopayments/models/subscription_create_params.rbs +16 -27
- data/sig/dodopayments/models/subscription_create_response.rbs +16 -4
- data/sig/dodopayments/models/subscription_list_response.rbs +4 -74
- data/sig/dodopayments/models/subscription_update_params.rbs +12 -0
- data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +5 -0
- data/sig/dodopayments/models/unwrap_webhook_event.rbs +5 -0
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
- data/sig/dodopayments/models/webhook_payload.rbs +8 -134
- data/sig/dodopayments/models.rbs +40 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/customers.rbs +5 -0
- data/sig/dodopayments/resources/entitlements/files.rbs +20 -0
- data/sig/dodopayments/resources/entitlements/grants.rbs +24 -0
- data/sig/dodopayments/resources/entitlements.rbs +46 -0
- data/sig/dodopayments/resources/license_key_instances.rbs +1 -0
- data/sig/dodopayments/resources/payments.rbs +3 -1
- data/sig/dodopayments/resources/products.rbs +2 -2
- data/sig/dodopayments/resources/subscriptions.rbs +7 -1
- data/sig/dodopayments/resources/webhooks.rbs +10 -0
- metadata +92 -2
|
@@ -56,9 +56,9 @@ module Dodopayments
|
|
|
56
56
|
# @!attribute product_cart
|
|
57
57
|
# Optional list of products included in the payment
|
|
58
58
|
#
|
|
59
|
-
# @return [Array<Dodopayments::Models::
|
|
59
|
+
# @return [Array<Dodopayments::Models::OneTimeProductCartItem>, nil]
|
|
60
60
|
optional :product_cart,
|
|
61
|
-
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::
|
|
61
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::OneTimeProductCartItem] },
|
|
62
62
|
nil?: true
|
|
63
63
|
|
|
64
64
|
# @!method initialize(client_secret:, customer:, metadata:, payment_id:, total_amount:, discount_id: nil, expires_on: nil, payment_link: nil, product_cart: nil)
|
|
@@ -81,37 +81,7 @@ module Dodopayments
|
|
|
81
81
|
#
|
|
82
82
|
# @param payment_link [String, nil] Optional URL to a hosted payment page
|
|
83
83
|
#
|
|
84
|
-
# @param product_cart [Array<Dodopayments::Models::
|
|
85
|
-
|
|
86
|
-
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
|
87
|
-
# @!attribute product_id
|
|
88
|
-
#
|
|
89
|
-
# @return [String]
|
|
90
|
-
required :product_id, String
|
|
91
|
-
|
|
92
|
-
# @!attribute quantity
|
|
93
|
-
#
|
|
94
|
-
# @return [Integer]
|
|
95
|
-
required :quantity, Integer
|
|
96
|
-
|
|
97
|
-
# @!attribute amount
|
|
98
|
-
# Amount the customer pays if pay_what_you_want is enabled. If disabled then
|
|
99
|
-
# amount will be ignored Represented in the lowest denomination of the currency
|
|
100
|
-
# (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
101
|
-
#
|
|
102
|
-
# @return [Integer, nil]
|
|
103
|
-
optional :amount, Integer, nil?: true
|
|
104
|
-
|
|
105
|
-
# @!method initialize(product_id:, quantity:, amount: nil)
|
|
106
|
-
# Some parameter documentations has been truncated, see
|
|
107
|
-
# {Dodopayments::Models::PaymentCreateResponse::ProductCart} for more details.
|
|
108
|
-
#
|
|
109
|
-
# @param product_id [String]
|
|
110
|
-
#
|
|
111
|
-
# @param quantity [Integer]
|
|
112
|
-
#
|
|
113
|
-
# @param amount [Integer, nil] Amount the customer pays if pay_what_you_want is enabled. If disabled then amoun
|
|
114
|
-
end
|
|
84
|
+
# @param product_cart [Array<Dodopayments::Models::OneTimeProductCartItem>, nil] Optional list of products included in the payment
|
|
115
85
|
end
|
|
116
86
|
end
|
|
117
87
|
end
|
|
@@ -31,8 +31,9 @@ module Dodopayments
|
|
|
31
31
|
# @!attribute entitlements
|
|
32
32
|
# Attached entitlements (integration-based access grants)
|
|
33
33
|
#
|
|
34
|
-
# @return [Array<Dodopayments::Models::
|
|
35
|
-
required :entitlements,
|
|
34
|
+
# @return [Array<Dodopayments::Models::ProductEntitlementSummary>]
|
|
35
|
+
required :entitlements,
|
|
36
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductEntitlementSummary] }
|
|
36
37
|
|
|
37
38
|
# @!attribute is_recurring
|
|
38
39
|
# Indicates if the product is recurring (e.g., subscriptions).
|
|
@@ -91,6 +92,10 @@ module Dodopayments
|
|
|
91
92
|
optional :description, String, nil?: true
|
|
92
93
|
|
|
93
94
|
# @!attribute digital_product_delivery
|
|
95
|
+
# Digital-product-delivery payload for a grant. Populated for grants whose
|
|
96
|
+
# entitlement has `integration_type = 'digital_files'`. `files` carries presigned
|
|
97
|
+
# download URLs; the source (EE service or legacy in-process S3 presigning) is
|
|
98
|
+
# opaque to the caller.
|
|
94
99
|
#
|
|
95
100
|
# @return [Dodopayments::Models::DigitalProductDelivery, nil]
|
|
96
101
|
optional :digital_product_delivery, -> { Dodopayments::DigitalProductDelivery }, nil?: true
|
|
@@ -136,6 +141,9 @@ module Dodopayments
|
|
|
136
141
|
optional :product_collection_id, String, nil?: true
|
|
137
142
|
|
|
138
143
|
# @!method 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, product_collection_id: nil)
|
|
144
|
+
# Some parameter documentations has been truncated, see
|
|
145
|
+
# {Dodopayments::Models::Product} for more details.
|
|
146
|
+
#
|
|
139
147
|
# @param brand_id [String]
|
|
140
148
|
#
|
|
141
149
|
# @param business_id [String] Unique identifier for the business to which the product belongs.
|
|
@@ -144,7 +152,7 @@ module Dodopayments
|
|
|
144
152
|
#
|
|
145
153
|
# @param credit_entitlements [Array<Dodopayments::Models::CreditEntitlementMappingResponse>] Attached credit entitlements with settings
|
|
146
154
|
#
|
|
147
|
-
# @param entitlements [Array<Dodopayments::Models::
|
|
155
|
+
# @param entitlements [Array<Dodopayments::Models::ProductEntitlementSummary>] Attached entitlements (integration-based access grants)
|
|
148
156
|
#
|
|
149
157
|
# @param is_recurring [Boolean] Indicates if the product is recurring (e.g., subscriptions).
|
|
150
158
|
#
|
|
@@ -164,7 +172,7 @@ module Dodopayments
|
|
|
164
172
|
#
|
|
165
173
|
# @param description [String, nil] Description of the product, optional.
|
|
166
174
|
#
|
|
167
|
-
# @param digital_product_delivery [Dodopayments::Models::DigitalProductDelivery, nil]
|
|
175
|
+
# @param digital_product_delivery [Dodopayments::Models::DigitalProductDelivery, nil] Digital-product-delivery payload for a grant. Populated for grants whose
|
|
168
176
|
#
|
|
169
177
|
# @param image [String, nil] URL of the product image, optional.
|
|
170
178
|
#
|
|
@@ -177,219 +185,6 @@ module Dodopayments
|
|
|
177
185
|
# @param name [String, nil] Name of the product, optional.
|
|
178
186
|
#
|
|
179
187
|
# @param product_collection_id [String, nil] The product collection ID this product belongs to, if any
|
|
180
|
-
|
|
181
|
-
class Entitlement < Dodopayments::Internal::Type::BaseModel
|
|
182
|
-
# @!attribute id
|
|
183
|
-
#
|
|
184
|
-
# @return [String]
|
|
185
|
-
required :id, String
|
|
186
|
-
|
|
187
|
-
# @!attribute integration_config
|
|
188
|
-
# Platform-specific configuration for an entitlement. Each variant uses unique
|
|
189
|
-
# field names so `#[serde(untagged)]` can disambiguate correctly.
|
|
190
|
-
#
|
|
191
|
-
# @return [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig]
|
|
192
|
-
required :integration_config, union: -> { Dodopayments::Product::Entitlement::IntegrationConfig }
|
|
193
|
-
|
|
194
|
-
# @!attribute integration_type
|
|
195
|
-
#
|
|
196
|
-
# @return [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType]
|
|
197
|
-
required :integration_type, enum: -> { Dodopayments::Product::Entitlement::IntegrationType }
|
|
198
|
-
|
|
199
|
-
# @!attribute name
|
|
200
|
-
#
|
|
201
|
-
# @return [String]
|
|
202
|
-
required :name, String
|
|
203
|
-
|
|
204
|
-
# @!attribute description
|
|
205
|
-
#
|
|
206
|
-
# @return [String, nil]
|
|
207
|
-
optional :description, String, nil?: true
|
|
208
|
-
|
|
209
|
-
# @!method initialize(id:, integration_config:, integration_type:, name:, description: nil)
|
|
210
|
-
# Some parameter documentations has been truncated, see
|
|
211
|
-
# {Dodopayments::Models::Product::Entitlement} for more details.
|
|
212
|
-
#
|
|
213
|
-
# Summary of an entitlement attached to a product
|
|
214
|
-
#
|
|
215
|
-
# @param id [String]
|
|
216
|
-
#
|
|
217
|
-
# @param integration_config [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig] Platform-specific configuration for an entitlement.
|
|
218
|
-
#
|
|
219
|
-
# @param integration_type [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType]
|
|
220
|
-
#
|
|
221
|
-
# @param name [String]
|
|
222
|
-
#
|
|
223
|
-
# @param description [String, nil]
|
|
224
|
-
|
|
225
|
-
# Platform-specific configuration for an entitlement. Each variant uses unique
|
|
226
|
-
# field names so `#[serde(untagged)]` can disambiguate correctly.
|
|
227
|
-
#
|
|
228
|
-
# @see Dodopayments::Models::Product::Entitlement#integration_config
|
|
229
|
-
module IntegrationConfig
|
|
230
|
-
extend Dodopayments::Internal::Type::Union
|
|
231
|
-
|
|
232
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::GitHubConfig }
|
|
233
|
-
|
|
234
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DiscordConfig }
|
|
235
|
-
|
|
236
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::TelegramConfig }
|
|
237
|
-
|
|
238
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FigmaConfig }
|
|
239
|
-
|
|
240
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FramerConfig }
|
|
241
|
-
|
|
242
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::NotionConfig }
|
|
243
|
-
|
|
244
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DigitalFilesConfig }
|
|
245
|
-
|
|
246
|
-
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::LicenseKeyConfig }
|
|
247
|
-
|
|
248
|
-
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
249
|
-
# @!attribute permission
|
|
250
|
-
# One of: pull, push, admin, maintain, triage
|
|
251
|
-
#
|
|
252
|
-
# @return [String]
|
|
253
|
-
required :permission, String
|
|
254
|
-
|
|
255
|
-
# @!attribute target_id
|
|
256
|
-
#
|
|
257
|
-
# @return [String]
|
|
258
|
-
required :target_id, String
|
|
259
|
-
|
|
260
|
-
# @!method initialize(permission:, target_id:)
|
|
261
|
-
# @param permission [String] One of: pull, push, admin, maintain, triage
|
|
262
|
-
#
|
|
263
|
-
# @param target_id [String]
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
267
|
-
# @!attribute guild_id
|
|
268
|
-
#
|
|
269
|
-
# @return [String]
|
|
270
|
-
required :guild_id, String
|
|
271
|
-
|
|
272
|
-
# @!attribute role_id
|
|
273
|
-
#
|
|
274
|
-
# @return [String, nil]
|
|
275
|
-
optional :role_id, String, nil?: true
|
|
276
|
-
|
|
277
|
-
# @!method initialize(guild_id:, role_id: nil)
|
|
278
|
-
# @param guild_id [String]
|
|
279
|
-
# @param role_id [String, nil]
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
class TelegramConfig < Dodopayments::Internal::Type::BaseModel
|
|
283
|
-
# @!attribute chat_id
|
|
284
|
-
#
|
|
285
|
-
# @return [String]
|
|
286
|
-
required :chat_id, String
|
|
287
|
-
|
|
288
|
-
# @!method initialize(chat_id:)
|
|
289
|
-
# @param chat_id [String]
|
|
290
|
-
end
|
|
291
|
-
|
|
292
|
-
class FigmaConfig < Dodopayments::Internal::Type::BaseModel
|
|
293
|
-
# @!attribute figma_file_id
|
|
294
|
-
#
|
|
295
|
-
# @return [String]
|
|
296
|
-
required :figma_file_id, String
|
|
297
|
-
|
|
298
|
-
# @!method initialize(figma_file_id:)
|
|
299
|
-
# @param figma_file_id [String]
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
class FramerConfig < Dodopayments::Internal::Type::BaseModel
|
|
303
|
-
# @!attribute framer_template_id
|
|
304
|
-
#
|
|
305
|
-
# @return [String]
|
|
306
|
-
required :framer_template_id, String
|
|
307
|
-
|
|
308
|
-
# @!method initialize(framer_template_id:)
|
|
309
|
-
# @param framer_template_id [String]
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
class NotionConfig < Dodopayments::Internal::Type::BaseModel
|
|
313
|
-
# @!attribute notion_template_id
|
|
314
|
-
#
|
|
315
|
-
# @return [String]
|
|
316
|
-
required :notion_template_id, String
|
|
317
|
-
|
|
318
|
-
# @!method initialize(notion_template_id:)
|
|
319
|
-
# @param notion_template_id [String]
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel
|
|
323
|
-
# @!attribute digital_file_ids
|
|
324
|
-
#
|
|
325
|
-
# @return [Array<String>]
|
|
326
|
-
required :digital_file_ids, Dodopayments::Internal::Type::ArrayOf[String]
|
|
327
|
-
|
|
328
|
-
# @!attribute external_url
|
|
329
|
-
#
|
|
330
|
-
# @return [String, nil]
|
|
331
|
-
optional :external_url, String, nil?: true
|
|
332
|
-
|
|
333
|
-
# @!attribute instructions
|
|
334
|
-
#
|
|
335
|
-
# @return [String, nil]
|
|
336
|
-
optional :instructions, String, nil?: true
|
|
337
|
-
|
|
338
|
-
# @!method initialize(digital_file_ids:, external_url: nil, instructions: nil)
|
|
339
|
-
# @param digital_file_ids [Array<String>]
|
|
340
|
-
# @param external_url [String, nil]
|
|
341
|
-
# @param instructions [String, nil]
|
|
342
|
-
end
|
|
343
|
-
|
|
344
|
-
class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel
|
|
345
|
-
# @!attribute activation_message
|
|
346
|
-
#
|
|
347
|
-
# @return [String, nil]
|
|
348
|
-
optional :activation_message, String, nil?: true
|
|
349
|
-
|
|
350
|
-
# @!attribute activations_limit
|
|
351
|
-
#
|
|
352
|
-
# @return [Integer, nil]
|
|
353
|
-
optional :activations_limit, Integer, nil?: true
|
|
354
|
-
|
|
355
|
-
# @!attribute duration_count
|
|
356
|
-
#
|
|
357
|
-
# @return [Integer, nil]
|
|
358
|
-
optional :duration_count, Integer, nil?: true
|
|
359
|
-
|
|
360
|
-
# @!attribute duration_interval
|
|
361
|
-
#
|
|
362
|
-
# @return [String, nil]
|
|
363
|
-
optional :duration_interval, String, nil?: true
|
|
364
|
-
|
|
365
|
-
# @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil)
|
|
366
|
-
# @param activation_message [String, nil]
|
|
367
|
-
# @param activations_limit [Integer, nil]
|
|
368
|
-
# @param duration_count [Integer, nil]
|
|
369
|
-
# @param duration_interval [String, nil]
|
|
370
|
-
end
|
|
371
|
-
|
|
372
|
-
# @!method self.variants
|
|
373
|
-
# @return [Array(Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig)]
|
|
374
|
-
end
|
|
375
|
-
|
|
376
|
-
# @see Dodopayments::Models::Product::Entitlement#integration_type
|
|
377
|
-
module IntegrationType
|
|
378
|
-
extend Dodopayments::Internal::Type::Enum
|
|
379
|
-
|
|
380
|
-
DISCORD = :discord
|
|
381
|
-
TELEGRAM = :telegram
|
|
382
|
-
GITHUB = :github
|
|
383
|
-
FIGMA = :figma
|
|
384
|
-
FRAMER = :framer
|
|
385
|
-
NOTION = :notion
|
|
386
|
-
DIGITAL_FILES = :digital_files
|
|
387
|
-
LICENSE_KEY = :license_key
|
|
388
|
-
|
|
389
|
-
# @!method self.values
|
|
390
|
-
# @return [Array<Symbol>]
|
|
391
|
-
end
|
|
392
|
-
end
|
|
393
188
|
end
|
|
394
189
|
end
|
|
395
190
|
end
|
|
@@ -54,22 +54,29 @@ module Dodopayments
|
|
|
54
54
|
# @!attribute digital_product_delivery
|
|
55
55
|
# Choose how you would like you digital product delivered
|
|
56
56
|
#
|
|
57
|
+
# deprecated: use entitlements instead
|
|
58
|
+
#
|
|
57
59
|
# @return [Dodopayments::Models::ProductCreateParams::DigitalProductDelivery, nil]
|
|
58
60
|
optional :digital_product_delivery,
|
|
59
61
|
-> { Dodopayments::ProductCreateParams::DigitalProductDelivery },
|
|
60
62
|
nil?: true
|
|
61
63
|
|
|
62
|
-
# @!attribute
|
|
63
|
-
# Optional
|
|
64
|
+
# @!attribute entitlements
|
|
65
|
+
# Optional entitlements to attach to this product (max 20)
|
|
64
66
|
#
|
|
65
|
-
# @return [Array<
|
|
66
|
-
optional :
|
|
67
|
+
# @return [Array<Dodopayments::Models::AttachProductEntitlement>, nil]
|
|
68
|
+
optional :entitlements,
|
|
69
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachProductEntitlement] },
|
|
70
|
+
nil?: true
|
|
67
71
|
|
|
68
72
|
# @!attribute license_key_activation_message
|
|
69
73
|
# @deprecated
|
|
70
74
|
#
|
|
71
75
|
# Optional message displayed during license key activation
|
|
72
76
|
#
|
|
77
|
+
# deprecated: use entitlements instead. Ignored when a `license_key` entitlement
|
|
78
|
+
# is attached via the `entitlements` field.
|
|
79
|
+
#
|
|
73
80
|
# @return [String, nil]
|
|
74
81
|
optional :license_key_activation_message, String, nil?: true
|
|
75
82
|
|
|
@@ -78,6 +85,9 @@ module Dodopayments
|
|
|
78
85
|
#
|
|
79
86
|
# The number of times the license key can be activated. Must be 0 or greater
|
|
80
87
|
#
|
|
88
|
+
# deprecated: use entitlements instead. Ignored when a `license_key` entitlement
|
|
89
|
+
# is attached via the `entitlements` field.
|
|
90
|
+
#
|
|
81
91
|
# @return [Integer, nil]
|
|
82
92
|
optional :license_key_activations_limit, Integer, nil?: true
|
|
83
93
|
|
|
@@ -86,6 +96,9 @@ module Dodopayments
|
|
|
86
96
|
# license key to expire. For subscriptions, the lifetime of the license key is
|
|
87
97
|
# tied to the subscription period
|
|
88
98
|
#
|
|
99
|
+
# deprecated: use entitlements instead. Ignored when a `license_key` entitlement
|
|
100
|
+
# is attached via the `entitlements` field.
|
|
101
|
+
#
|
|
89
102
|
# @return [Dodopayments::Models::LicenseKeyDuration, nil]
|
|
90
103
|
optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
|
|
91
104
|
|
|
@@ -94,6 +107,10 @@ module Dodopayments
|
|
|
94
107
|
#
|
|
95
108
|
# When true, generates and sends a license key to your customer. Defaults to false
|
|
96
109
|
#
|
|
110
|
+
# deprecated: use entitlements instead. If a `license_key` entitlement is also
|
|
111
|
+
# attached via the `entitlements` field, the `license_key_*` config fields below
|
|
112
|
+
# are ignored — the attached entitlement's config is the source of truth.
|
|
113
|
+
#
|
|
97
114
|
# @return [Boolean, nil]
|
|
98
115
|
optional :license_key_enabled, Dodopayments::Internal::Type::Boolean, nil?: true
|
|
99
116
|
|
|
@@ -103,7 +120,7 @@ module Dodopayments
|
|
|
103
120
|
# @return [Hash{Symbol=>String}, nil]
|
|
104
121
|
optional :metadata, Dodopayments::Internal::Type::HashOf[String]
|
|
105
122
|
|
|
106
|
-
# @!method initialize(name:, price:, tax_category:, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil,
|
|
123
|
+
# @!method initialize(name:, price:, tax_category:, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil, entitlements: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, request_options: {})
|
|
107
124
|
# Some parameter documentations has been truncated, see
|
|
108
125
|
# {Dodopayments::Models::ProductCreateParams} for more details.
|
|
109
126
|
#
|
|
@@ -123,7 +140,7 @@ module Dodopayments
|
|
|
123
140
|
#
|
|
124
141
|
# @param digital_product_delivery [Dodopayments::Models::ProductCreateParams::DigitalProductDelivery, nil] Choose how you would like you digital product delivered
|
|
125
142
|
#
|
|
126
|
-
# @param
|
|
143
|
+
# @param entitlements [Array<Dodopayments::Models::AttachProductEntitlement>, nil] Optional entitlements to attach to this product (max 20)
|
|
127
144
|
#
|
|
128
145
|
# @param license_key_activation_message [String, nil] Optional message displayed during license key activation
|
|
129
146
|
#
|
|
@@ -153,6 +170,8 @@ module Dodopayments
|
|
|
153
170
|
# @!method initialize(external_url: nil, instructions: nil)
|
|
154
171
|
# Choose how you would like you digital product delivered
|
|
155
172
|
#
|
|
173
|
+
# deprecated: use entitlements instead
|
|
174
|
+
#
|
|
156
175
|
# @param external_url [String, nil] External URL to digital product
|
|
157
176
|
#
|
|
158
177
|
# @param instructions [String, nil] Instructions to download and use the digital product
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductEntitlementSummary < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute integration_config
|
|
12
|
+
# Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
|
|
13
|
+
# the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
|
|
14
|
+
# `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
|
|
15
|
+
# ID-only via [`IntegrationConfig`]; this enum is response-only.
|
|
16
|
+
#
|
|
17
|
+
# @return [Dodopayments::Models::IntegrationConfigResponse::GitHubConfig, Dodopayments::Models::IntegrationConfigResponse::DiscordConfig, Dodopayments::Models::IntegrationConfigResponse::TelegramConfig, Dodopayments::Models::IntegrationConfigResponse::FigmaConfig, Dodopayments::Models::IntegrationConfigResponse::FramerConfig, Dodopayments::Models::IntegrationConfigResponse::NotionConfig, Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig, Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig]
|
|
18
|
+
required :integration_config, union: -> { Dodopayments::IntegrationConfigResponse }
|
|
19
|
+
|
|
20
|
+
# @!attribute integration_type
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, Dodopayments::Models::EntitlementIntegrationType]
|
|
23
|
+
required :integration_type, enum: -> { Dodopayments::EntitlementIntegrationType }
|
|
24
|
+
|
|
25
|
+
# @!attribute name
|
|
26
|
+
#
|
|
27
|
+
# @return [String]
|
|
28
|
+
required :name, String
|
|
29
|
+
|
|
30
|
+
# @!attribute description
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :description, String, nil?: true
|
|
34
|
+
|
|
35
|
+
# @!method initialize(id:, integration_config:, integration_type:, name:, description: nil)
|
|
36
|
+
# Some parameter documentations has been truncated, see
|
|
37
|
+
# {Dodopayments::Models::ProductEntitlementSummary} for more details.
|
|
38
|
+
#
|
|
39
|
+
# Summary of an entitlement attached to a product.
|
|
40
|
+
#
|
|
41
|
+
# `integration_config` uses [`IntegrationConfigResponse`] (NOT the persisted
|
|
42
|
+
# [`IntegrationConfig`]) so digital_files entitlements embed the resolved
|
|
43
|
+
# `digital_files` object — matching what `GET /entitlements/{id}` returns. All
|
|
44
|
+
# other variants pass through unchanged via `#[serde(untagged)]`.
|
|
45
|
+
#
|
|
46
|
+
# @param id [String]
|
|
47
|
+
#
|
|
48
|
+
# @param integration_config [Dodopayments::Models::IntegrationConfigResponse::GitHubConfig, Dodopayments::Models::IntegrationConfigResponse::DiscordConfig, Dodopayments::Models::IntegrationConfigResponse::TelegramConfig, Dodopayments::Models::IntegrationConfigResponse::FigmaConfig, Dodopayments::Models::IntegrationConfigResponse::FramerConfig, Dodopayments::Models::IntegrationConfigResponse::NotionConfig, Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig, Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig] Public-facing variant of [`IntegrationConfig`]. Mirrors every variant
|
|
49
|
+
#
|
|
50
|
+
# @param integration_type [Symbol, Dodopayments::Models::EntitlementIntegrationType]
|
|
51
|
+
#
|
|
52
|
+
# @param name [String]
|
|
53
|
+
#
|
|
54
|
+
# @param description [String, nil]
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|