dodopayments 2.8.0 → 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.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/models/attach_product_entitlement.rb +22 -0
  6. data/lib/dodopayments/models/cancellation_feedback.rb +21 -0
  7. data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
  8. data/lib/dodopayments/models/checkout_session_request.rb +14 -1
  9. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +1 -0
  10. data/lib/dodopayments/models/credit_overage_reset_webhook_event.rb +52 -0
  11. data/lib/dodopayments/models/customer_list_entitlements_params.rb +20 -0
  12. data/lib/dodopayments/models/customer_list_entitlements_response.rb +105 -0
  13. data/lib/dodopayments/models/digital_product_delivery.rb +13 -15
  14. data/lib/dodopayments/models/digital_product_delivery_file.rb +32 -8
  15. data/lib/dodopayments/models/entitlement.rb +86 -0
  16. data/lib/dodopayments/models/entitlement_create_params.rb +54 -0
  17. data/lib/dodopayments/models/entitlement_delete_params.rb +20 -0
  18. data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +51 -0
  19. data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +51 -0
  20. data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +51 -0
  21. data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +51 -0
  22. data/lib/dodopayments/models/entitlement_integration_type.rb +21 -0
  23. data/lib/dodopayments/models/entitlement_list_params.rb +55 -0
  24. data/lib/dodopayments/models/entitlement_retrieve_params.rb +20 -0
  25. data/lib/dodopayments/models/entitlement_update_params.rb +54 -0
  26. data/lib/dodopayments/models/entitlements/entitlement_grant.rb +172 -0
  27. data/lib/dodopayments/models/entitlements/file_delete_params.rb +28 -0
  28. data/lib/dodopayments/models/entitlements/file_upload_params.rb +22 -0
  29. data/lib/dodopayments/models/entitlements/file_upload_response.rb +23 -0
  30. data/lib/dodopayments/models/entitlements/grant_list_params.rb +68 -0
  31. data/lib/dodopayments/models/entitlements/grant_revoke_params.rb +28 -0
  32. data/lib/dodopayments/models/entitlements/license_key_grant.rb +40 -0
  33. data/lib/dodopayments/models/integration_config.rb +174 -0
  34. data/lib/dodopayments/models/integration_config_response.rb +238 -0
  35. data/lib/dodopayments/models/license_key_instance_list_params.rb +9 -1
  36. data/lib/dodopayments/models/one_time_product_cart_item.rb +15 -1
  37. data/lib/dodopayments/models/payment.rb +19 -3
  38. data/lib/dodopayments/models/payment_create_params.rb +23 -35
  39. data/lib/dodopayments/models/payment_create_response.rb +3 -33
  40. data/lib/dodopayments/models/product.rb +12 -217
  41. data/lib/dodopayments/models/product_create_params.rb +25 -6
  42. data/lib/dodopayments/models/product_entitlement_summary.rb +57 -0
  43. data/lib/dodopayments/models/product_list_response.rb +3 -218
  44. data/lib/dodopayments/models/product_update_params.rb +21 -7
  45. data/lib/dodopayments/models/scheduled_plan_change.rb +99 -0
  46. data/lib/dodopayments/models/subscription.rb +20 -102
  47. data/lib/dodopayments/models/subscription_create_params.rb +27 -37
  48. data/lib/dodopayments/models/subscription_create_response.rb +19 -3
  49. data/lib/dodopayments/models/subscription_list_response.rb +3 -103
  50. data/lib/dodopayments/models/subscription_update_params.rb +23 -1
  51. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +11 -1
  52. data/lib/dodopayments/models/unwrap_webhook_event.rb +11 -1
  53. data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -1
  54. data/lib/dodopayments/models/webhook_event_type.rb +1 -0
  55. data/lib/dodopayments/models/webhook_payload.rb +2 -154
  56. data/lib/dodopayments/models.rb +40 -0
  57. data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
  58. data/lib/dodopayments/resources/customers.rb +20 -0
  59. data/lib/dodopayments/resources/entitlements/files.rb +70 -0
  60. data/lib/dodopayments/resources/entitlements/grants.rb +78 -0
  61. data/lib/dodopayments/resources/entitlements.rb +153 -0
  62. data/lib/dodopayments/resources/license_key_instances.rb +3 -1
  63. data/lib/dodopayments/resources/payments.rb +6 -2
  64. data/lib/dodopayments/resources/products.rb +4 -4
  65. data/lib/dodopayments/resources/subscriptions.rb +20 -5
  66. data/lib/dodopayments/resources/webhooks.rb +2 -2
  67. data/lib/dodopayments/version.rb +1 -1
  68. data/lib/dodopayments.rb +30 -0
  69. data/rbi/dodopayments/client.rbi +3 -0
  70. data/rbi/dodopayments/models/attach_product_entitlement.rbi +35 -0
  71. data/rbi/dodopayments/models/cancellation_feedback.rbi +45 -0
  72. data/rbi/dodopayments/models/checkout_session_flags.rbi +20 -3
  73. data/rbi/dodopayments/models/checkout_session_request.rbi +18 -0
  74. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +5 -0
  75. data/rbi/dodopayments/models/credit_overage_reset_webhook_event.rbi +103 -0
  76. data/rbi/dodopayments/models/customer_list_entitlements_params.rbi +38 -0
  77. data/rbi/dodopayments/models/customer_list_entitlements_response.rbi +189 -0
  78. data/rbi/dodopayments/models/digital_product_delivery.rbi +10 -22
  79. data/rbi/dodopayments/models/digital_product_delivery_file.rbi +40 -8
  80. data/rbi/dodopayments/models/entitlement.rbi +112 -0
  81. data/rbi/dodopayments/models/entitlement_create_params.rbi +112 -0
  82. data/rbi/dodopayments/models/entitlement_delete_params.rbi +38 -0
  83. data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +103 -0
  84. data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +103 -0
  85. data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +102 -0
  86. data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +103 -0
  87. data/rbi/dodopayments/models/entitlement_integration_type.rbi +44 -0
  88. data/rbi/dodopayments/models/entitlement_list_params.rbi +146 -0
  89. data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +38 -0
  90. data/rbi/dodopayments/models/entitlement_update_params.rbi +111 -0
  91. data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +235 -0
  92. data/rbi/dodopayments/models/entitlements/file_delete_params.rbi +48 -0
  93. data/rbi/dodopayments/models/entitlements/file_upload_params.rbi +40 -0
  94. data/rbi/dodopayments/models/entitlements/file_upload_response.rbi +34 -0
  95. data/rbi/dodopayments/models/entitlements/grant_list_params.rbi +145 -0
  96. data/rbi/dodopayments/models/entitlements/grant_revoke_params.rbi +48 -0
  97. data/rbi/dodopayments/models/entitlements/license_key_grant.rbi +62 -0
  98. data/rbi/dodopayments/models/integration_config.rbi +296 -0
  99. data/rbi/dodopayments/models/integration_config_response.rbi +416 -0
  100. data/rbi/dodopayments/models/license_key_instance_list_params.rbi +8 -0
  101. data/rbi/dodopayments/models/one_time_product_cart_item.rbi +24 -3
  102. data/rbi/dodopayments/models/payment.rbi +31 -3
  103. data/rbi/dodopayments/models/payment_create_params.rbi +28 -56
  104. data/rbi/dodopayments/models/payment_create_response.rbi +3 -68
  105. data/rbi/dodopayments/models/product.rbi +12 -420
  106. data/rbi/dodopayments/models/product_create_params.rbi +43 -7
  107. data/rbi/dodopayments/models/product_entitlement_summary.rbi +88 -0
  108. data/rbi/dodopayments/models/product_list_response.rbi +3 -430
  109. data/rbi/dodopayments/models/product_update_params.rbi +35 -9
  110. data/rbi/dodopayments/models/scheduled_plan_change.rbi +141 -0
  111. data/rbi/dodopayments/models/subscription.rbi +24 -149
  112. data/rbi/dodopayments/models/subscription_create_params.rbi +36 -68
  113. data/rbi/dodopayments/models/subscription_create_response.rbi +47 -3
  114. data/rbi/dodopayments/models/subscription_list_response.rbi +4 -167
  115. data/rbi/dodopayments/models/subscription_update_params.rbi +27 -0
  116. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +5 -0
  117. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +5 -0
  118. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +10 -0
  119. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
  120. data/rbi/dodopayments/models/webhook_payload.rbi +4 -197
  121. data/rbi/dodopayments/models.rbi +46 -0
  122. data/rbi/dodopayments/resources/checkout_sessions.rbi +16 -0
  123. data/rbi/dodopayments/resources/customers.rbi +14 -0
  124. data/rbi/dodopayments/resources/entitlements/files.rbi +52 -0
  125. data/rbi/dodopayments/resources/entitlements/grants.rbi +65 -0
  126. data/rbi/dodopayments/resources/entitlements.rbi +143 -0
  127. data/rbi/dodopayments/resources/license_key_instances.rbi +3 -0
  128. data/rbi/dodopayments/resources/payments.rbi +10 -2
  129. data/rbi/dodopayments/resources/products.rbi +34 -7
  130. data/rbi/dodopayments/resources/subscriptions.rbi +31 -5
  131. data/rbi/dodopayments/resources/webhooks.rbi +10 -0
  132. data/sig/dodopayments/client.rbs +2 -0
  133. data/sig/dodopayments/models/attach_product_entitlement.rbs +13 -0
  134. data/sig/dodopayments/models/cancellation_feedback.rbs +28 -0
  135. data/sig/dodopayments/models/checkout_session_flags.rbs +10 -3
  136. data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
  137. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +2 -0
  138. data/sig/dodopayments/models/credit_overage_reset_webhook_event.rbs +45 -0
  139. data/sig/dodopayments/models/customer_list_entitlements_params.rbs +23 -0
  140. data/sig/dodopayments/models/customer_list_entitlements_response.rbs +95 -0
  141. data/sig/dodopayments/models/digital_product_delivery.rbs +5 -5
  142. data/sig/dodopayments/models/digital_product_delivery_file.rbs +32 -5
  143. data/sig/dodopayments/models/entitlement.rbs +67 -0
  144. data/sig/dodopayments/models/entitlement_create_params.rbs +46 -0
  145. data/sig/dodopayments/models/entitlement_delete_params.rbs +23 -0
  146. data/sig/dodopayments/models/entitlement_grant_created_webhook_event.rbs +45 -0
  147. data/sig/dodopayments/models/entitlement_grant_delivered_webhook_event.rbs +45 -0
  148. data/sig/dodopayments/models/entitlement_grant_failed_webhook_event.rbs +45 -0
  149. data/sig/dodopayments/models/entitlement_grant_revoked_webhook_event.rbs +45 -0
  150. data/sig/dodopayments/models/entitlement_integration_type.rbs +28 -0
  151. data/sig/dodopayments/models/entitlement_list_params.rbs +69 -0
  152. data/sig/dodopayments/models/entitlement_retrieve_params.rbs +23 -0
  153. data/sig/dodopayments/models/entitlement_update_params.rbs +46 -0
  154. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +134 -0
  155. data/sig/dodopayments/models/entitlements/file_delete_params.rbs +30 -0
  156. data/sig/dodopayments/models/entitlements/file_upload_params.rbs +25 -0
  157. data/sig/dodopayments/models/entitlements/file_upload_response.rbs +15 -0
  158. data/sig/dodopayments/models/entitlements/grant_list_params.rbs +71 -0
  159. data/sig/dodopayments/models/entitlements/grant_revoke_params.rbs +30 -0
  160. data/sig/dodopayments/models/entitlements/license_key_grant.rbs +37 -0
  161. data/sig/dodopayments/models/integration_config.rbs +147 -0
  162. data/sig/dodopayments/models/integration_config_response.rbs +206 -0
  163. data/sig/dodopayments/models/license_key_instance_list_params.rbs +10 -1
  164. data/sig/dodopayments/models/one_time_product_cart_item.rbs +14 -3
  165. data/sig/dodopayments/models/payment.rbs +16 -4
  166. data/sig/dodopayments/models/payment_create_params.rbs +16 -27
  167. data/sig/dodopayments/models/payment_create_response.rbs +4 -27
  168. data/sig/dodopayments/models/product.rbs +4 -205
  169. data/sig/dodopayments/models/product_create_params.rbs +4 -4
  170. data/sig/dodopayments/models/product_entitlement_summary.rbs +40 -0
  171. data/sig/dodopayments/models/product_list_response.rbs +4 -205
  172. data/sig/dodopayments/models/product_update_params.rbs +4 -4
  173. data/sig/dodopayments/models/scheduled_plan_change.rbs +73 -0
  174. data/sig/dodopayments/models/subscription.rbs +14 -74
  175. data/sig/dodopayments/models/subscription_create_params.rbs +16 -27
  176. data/sig/dodopayments/models/subscription_create_response.rbs +16 -4
  177. data/sig/dodopayments/models/subscription_list_response.rbs +4 -74
  178. data/sig/dodopayments/models/subscription_update_params.rbs +12 -0
  179. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +5 -0
  180. data/sig/dodopayments/models/unwrap_webhook_event.rbs +5 -0
  181. data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
  182. data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
  183. data/sig/dodopayments/models/webhook_payload.rbs +8 -134
  184. data/sig/dodopayments/models.rbs +40 -0
  185. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
  186. data/sig/dodopayments/resources/customers.rbs +5 -0
  187. data/sig/dodopayments/resources/entitlements/files.rbs +20 -0
  188. data/sig/dodopayments/resources/entitlements/grants.rbs +24 -0
  189. data/sig/dodopayments/resources/entitlements.rbs +46 -0
  190. data/sig/dodopayments/resources/license_key_instances.rbs +1 -0
  191. data/sig/dodopayments/resources/payments.rbs +3 -1
  192. data/sig/dodopayments/resources/products.rbs +2 -2
  193. data/sig/dodopayments/resources/subscriptions.rbs +7 -1
  194. data/sig/dodopayments/resources/webhooks.rbs +10 -0
  195. metadata +92 -2
@@ -19,9 +19,9 @@ module Dodopayments
19
19
  # @!attribute entitlements
20
20
  # Entitlements linked to this product
21
21
  #
22
- # @return [Array<Dodopayments::Models::ProductListResponse::Entitlement>]
22
+ # @return [Array<Dodopayments::Models::ProductEntitlementSummary>]
23
23
  required :entitlements,
24
- -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ProductListResponse::Entitlement] }
24
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductEntitlementSummary] }
25
25
 
26
26
  # @!attribute is_recurring
27
27
  # Indicates if the product is recurring (e.g., subscriptions).
@@ -112,7 +112,7 @@ module Dodopayments
112
112
  #
113
113
  # @param created_at [Time] Timestamp when the product was created.
114
114
  #
115
- # @param entitlements [Array<Dodopayments::Models::ProductListResponse::Entitlement>] Entitlements linked to this product
115
+ # @param entitlements [Array<Dodopayments::Models::ProductEntitlementSummary>] Entitlements linked to this product
116
116
  #
117
117
  # @param is_recurring [Boolean] Indicates if the product is recurring (e.g., subscriptions).
118
118
  #
@@ -137,221 +137,6 @@ module Dodopayments
137
137
  # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] Details of the price
138
138
  #
139
139
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
140
-
141
- class Entitlement < Dodopayments::Internal::Type::BaseModel
142
- # @!attribute id
143
- #
144
- # @return [String]
145
- required :id, String
146
-
147
- # @!attribute integration_config
148
- # Platform-specific configuration for an entitlement. Each variant uses unique
149
- # field names so `#[serde(untagged)]` can disambiguate correctly.
150
- #
151
- # @return [Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::LicenseKeyConfig]
152
- required :integration_config,
153
- union: -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig }
154
-
155
- # @!attribute integration_type
156
- #
157
- # @return [Symbol, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationType]
158
- required :integration_type,
159
- enum: -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationType }
160
-
161
- # @!attribute name
162
- #
163
- # @return [String]
164
- required :name, String
165
-
166
- # @!attribute description
167
- #
168
- # @return [String, nil]
169
- optional :description, String, nil?: true
170
-
171
- # @!method initialize(id:, integration_config:, integration_type:, name:, description: nil)
172
- # Some parameter documentations has been truncated, see
173
- # {Dodopayments::Models::ProductListResponse::Entitlement} for more details.
174
- #
175
- # Summary of an entitlement attached to a product
176
- #
177
- # @param id [String]
178
- #
179
- # @param integration_config [Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::LicenseKeyConfig] Platform-specific configuration for an entitlement.
180
- #
181
- # @param integration_type [Symbol, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationType]
182
- #
183
- # @param name [String]
184
- #
185
- # @param description [String, nil]
186
-
187
- # Platform-specific configuration for an entitlement. Each variant uses unique
188
- # field names so `#[serde(untagged)]` can disambiguate correctly.
189
- #
190
- # @see Dodopayments::Models::ProductListResponse::Entitlement#integration_config
191
- module IntegrationConfig
192
- extend Dodopayments::Internal::Type::Union
193
-
194
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::GitHubConfig }
195
-
196
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DiscordConfig }
197
-
198
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::TelegramConfig }
199
-
200
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FigmaConfig }
201
-
202
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FramerConfig }
203
-
204
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::NotionConfig }
205
-
206
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DigitalFilesConfig }
207
-
208
- variant -> { Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::LicenseKeyConfig }
209
-
210
- class GitHubConfig < Dodopayments::Internal::Type::BaseModel
211
- # @!attribute permission
212
- # One of: pull, push, admin, maintain, triage
213
- #
214
- # @return [String]
215
- required :permission, String
216
-
217
- # @!attribute target_id
218
- #
219
- # @return [String]
220
- required :target_id, String
221
-
222
- # @!method initialize(permission:, target_id:)
223
- # @param permission [String] One of: pull, push, admin, maintain, triage
224
- #
225
- # @param target_id [String]
226
- end
227
-
228
- class DiscordConfig < Dodopayments::Internal::Type::BaseModel
229
- # @!attribute guild_id
230
- #
231
- # @return [String]
232
- required :guild_id, String
233
-
234
- # @!attribute role_id
235
- #
236
- # @return [String, nil]
237
- optional :role_id, String, nil?: true
238
-
239
- # @!method initialize(guild_id:, role_id: nil)
240
- # @param guild_id [String]
241
- # @param role_id [String, nil]
242
- end
243
-
244
- class TelegramConfig < Dodopayments::Internal::Type::BaseModel
245
- # @!attribute chat_id
246
- #
247
- # @return [String]
248
- required :chat_id, String
249
-
250
- # @!method initialize(chat_id:)
251
- # @param chat_id [String]
252
- end
253
-
254
- class FigmaConfig < Dodopayments::Internal::Type::BaseModel
255
- # @!attribute figma_file_id
256
- #
257
- # @return [String]
258
- required :figma_file_id, String
259
-
260
- # @!method initialize(figma_file_id:)
261
- # @param figma_file_id [String]
262
- end
263
-
264
- class FramerConfig < Dodopayments::Internal::Type::BaseModel
265
- # @!attribute framer_template_id
266
- #
267
- # @return [String]
268
- required :framer_template_id, String
269
-
270
- # @!method initialize(framer_template_id:)
271
- # @param framer_template_id [String]
272
- end
273
-
274
- class NotionConfig < Dodopayments::Internal::Type::BaseModel
275
- # @!attribute notion_template_id
276
- #
277
- # @return [String]
278
- required :notion_template_id, String
279
-
280
- # @!method initialize(notion_template_id:)
281
- # @param notion_template_id [String]
282
- end
283
-
284
- class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel
285
- # @!attribute digital_file_ids
286
- #
287
- # @return [Array<String>]
288
- required :digital_file_ids, Dodopayments::Internal::Type::ArrayOf[String]
289
-
290
- # @!attribute external_url
291
- #
292
- # @return [String, nil]
293
- optional :external_url, String, nil?: true
294
-
295
- # @!attribute instructions
296
- #
297
- # @return [String, nil]
298
- optional :instructions, String, nil?: true
299
-
300
- # @!method initialize(digital_file_ids:, external_url: nil, instructions: nil)
301
- # @param digital_file_ids [Array<String>]
302
- # @param external_url [String, nil]
303
- # @param instructions [String, nil]
304
- end
305
-
306
- class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel
307
- # @!attribute activation_message
308
- #
309
- # @return [String, nil]
310
- optional :activation_message, String, nil?: true
311
-
312
- # @!attribute activations_limit
313
- #
314
- # @return [Integer, nil]
315
- optional :activations_limit, Integer, nil?: true
316
-
317
- # @!attribute duration_count
318
- #
319
- # @return [Integer, nil]
320
- optional :duration_count, Integer, nil?: true
321
-
322
- # @!attribute duration_interval
323
- #
324
- # @return [String, nil]
325
- optional :duration_interval, String, nil?: true
326
-
327
- # @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil)
328
- # @param activation_message [String, nil]
329
- # @param activations_limit [Integer, nil]
330
- # @param duration_count [Integer, nil]
331
- # @param duration_interval [String, nil]
332
- end
333
-
334
- # @!method self.variants
335
- # @return [Array(Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::ProductListResponse::Entitlement::IntegrationConfig::LicenseKeyConfig)]
336
- end
337
-
338
- # @see Dodopayments::Models::ProductListResponse::Entitlement#integration_type
339
- module IntegrationType
340
- extend Dodopayments::Internal::Type::Enum
341
-
342
- DISCORD = :discord
343
- TELEGRAM = :telegram
344
- GITHUB = :github
345
- FIGMA = :figma
346
- FRAMER = :framer
347
- NOTION = :notion
348
- DIGITAL_FILES = :digital_files
349
- LICENSE_KEY = :license_key
350
-
351
- # @!method self.values
352
- # @return [Array<Symbol>]
353
- end
354
- end
355
140
  end
356
141
  end
357
142
  end
@@ -41,17 +41,21 @@ module Dodopayments
41
41
  # @!attribute digital_product_delivery
42
42
  # Choose how you would like you digital product delivered
43
43
  #
44
+ # deprecated: use entitlements instead
45
+ #
44
46
  # @return [Dodopayments::Models::ProductUpdateParams::DigitalProductDelivery, nil]
45
47
  optional :digital_product_delivery,
46
48
  -> { Dodopayments::ProductUpdateParams::DigitalProductDelivery },
47
49
  nil?: true
48
50
 
49
- # @!attribute entitlement_ids
50
- # Entitlement IDs to attach (replaces all existing when present) Send empty array
51
- # to remove all, omit field to leave unchanged
51
+ # @!attribute entitlements
52
+ # Entitlements to attach (replaces all existing when present) Send empty array to
53
+ # remove all, omit field to leave unchanged
52
54
  #
53
- # @return [Array<String>, nil]
54
- optional :entitlement_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
55
+ # @return [Array<Dodopayments::Models::AttachProductEntitlement>, nil]
56
+ optional :entitlements,
57
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachProductEntitlement] },
58
+ nil?: true
55
59
 
56
60
  # @!attribute image_id
57
61
  # Product image id after its uploaded to S3
@@ -67,6 +71,8 @@ module Dodopayments
67
71
  # Only applicable if `license_key_enabled` is `true`. This message contains
68
72
  # instructions for activating the license key.
69
73
  #
74
+ # deprecated: use entitlements instead
75
+ #
70
76
  # @return [String, nil]
71
77
  optional :license_key_activation_message, String, nil?: true
72
78
 
@@ -78,6 +84,8 @@ module Dodopayments
78
84
  # Only applicable if `license_key_enabled` is `true`. Represents the maximum
79
85
  # number of times the license key can be activated.
80
86
  #
87
+ # deprecated: use entitlements instead
88
+ #
81
89
  # @return [Integer, nil]
82
90
  optional :license_key_activations_limit, Integer, nil?: true
83
91
 
@@ -87,6 +95,8 @@ module Dodopayments
87
95
  # Only applicable if `license_key_enabled` is `true`. Represents the duration in
88
96
  # days for which the license key is valid.
89
97
  #
98
+ # deprecated: use entitlements instead
99
+ #
90
100
  # @return [Dodopayments::Models::LicenseKeyDuration, nil]
91
101
  optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
92
102
 
@@ -98,6 +108,8 @@ module Dodopayments
98
108
  # If `true`, additional fields related to license key (duration, activations
99
109
  # limit, activation message) become applicable.
100
110
  #
111
+ # deprecated: use entitlements instead
112
+ #
101
113
  # @return [Boolean, nil]
102
114
  optional :license_key_enabled, Dodopayments::Internal::Type::Boolean, nil?: true
103
115
 
@@ -125,7 +137,7 @@ module Dodopayments
125
137
  # @return [Symbol, Dodopayments::Models::TaxCategory, nil]
126
138
  optional :tax_category, enum: -> { Dodopayments::TaxCategory }, nil?: true
127
139
 
128
- # @!method initialize(id:, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil, entitlement_ids: nil, image_id: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, name: nil, price: nil, tax_category: nil, request_options: {})
140
+ # @!method initialize(id:, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil, entitlements: nil, image_id: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, name: nil, price: nil, tax_category: nil, request_options: {})
129
141
  # Some parameter documentations has been truncated, see
130
142
  # {Dodopayments::Models::ProductUpdateParams} for more details.
131
143
  #
@@ -141,7 +153,7 @@ module Dodopayments
141
153
  #
142
154
  # @param digital_product_delivery [Dodopayments::Models::ProductUpdateParams::DigitalProductDelivery, nil] Choose how you would like you digital product delivered
143
155
  #
144
- # @param entitlement_ids [Array<String>, nil] Entitlement IDs to attach (replaces all existing when present)
156
+ # @param entitlements [Array<Dodopayments::Models::AttachProductEntitlement>, nil] Entitlements to attach (replaces all existing when present)
145
157
  #
146
158
  # @param image_id [String, nil] Product image id after its uploaded to S3
147
159
  #
@@ -185,6 +197,8 @@ module Dodopayments
185
197
  # @!method initialize(external_url: nil, files: nil, instructions: nil)
186
198
  # Choose how you would like you digital product delivered
187
199
  #
200
+ # deprecated: use entitlements instead
201
+ #
188
202
  # @param external_url [String, nil] External URL to digital product
189
203
  #
190
204
  # @param files [Array<String>, nil] Uploaded files ids of digital product
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class ScheduledPlanChange < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The scheduled plan change ID
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute addons
13
+ # Addons included in the scheduled change
14
+ #
15
+ # @return [Array<Dodopayments::Models::ScheduledPlanChange::Addon>]
16
+ required :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ScheduledPlanChange::Addon] }
17
+
18
+ # @!attribute created_at
19
+ # When this scheduled change was created
20
+ #
21
+ # @return [Time]
22
+ required :created_at, Time
23
+
24
+ # @!attribute effective_at
25
+ # When the change will be applied
26
+ #
27
+ # @return [Time]
28
+ required :effective_at, Time
29
+
30
+ # @!attribute product_id
31
+ # The product ID the subscription will change to
32
+ #
33
+ # @return [String]
34
+ required :product_id, String
35
+
36
+ # @!attribute quantity
37
+ # Quantity for the new plan
38
+ #
39
+ # @return [Integer]
40
+ required :quantity, Integer
41
+
42
+ # @!attribute product_description
43
+ # Description of the product being changed to
44
+ #
45
+ # @return [String, nil]
46
+ optional :product_description, String, nil?: true
47
+
48
+ # @!attribute product_name
49
+ # Name of the product being changed to
50
+ #
51
+ # @return [String, nil]
52
+ optional :product_name, String, nil?: true
53
+
54
+ # @!method initialize(id:, addons:, created_at:, effective_at:, product_id:, quantity:, product_description: nil, product_name: nil)
55
+ # @param id [String] The scheduled plan change ID
56
+ #
57
+ # @param addons [Array<Dodopayments::Models::ScheduledPlanChange::Addon>] Addons included in the scheduled change
58
+ #
59
+ # @param created_at [Time] When this scheduled change was created
60
+ #
61
+ # @param effective_at [Time] When the change will be applied
62
+ #
63
+ # @param product_id [String] The product ID the subscription will change to
64
+ #
65
+ # @param quantity [Integer] Quantity for the new plan
66
+ #
67
+ # @param product_description [String, nil] Description of the product being changed to
68
+ #
69
+ # @param product_name [String, nil] Name of the product being changed to
70
+
71
+ class Addon < Dodopayments::Internal::Type::BaseModel
72
+ # @!attribute addon_id
73
+ # The addon ID
74
+ #
75
+ # @return [String]
76
+ required :addon_id, String
77
+
78
+ # @!attribute name
79
+ # Name of the addon
80
+ #
81
+ # @return [String]
82
+ required :name, String
83
+
84
+ # @!attribute quantity
85
+ # Quantity of the addon
86
+ #
87
+ # @return [Integer]
88
+ required :quantity, Integer
89
+
90
+ # @!method initialize(addon_id:, name:, quantity:)
91
+ # @param addon_id [String] The addon ID
92
+ #
93
+ # @param name [String] Name of the addon
94
+ #
95
+ # @param quantity [Integer] Quantity of the addon
96
+ end
97
+ end
98
+ end
99
+ end
@@ -152,6 +152,18 @@ module Dodopayments
152
152
  # @return [Integer]
153
153
  required :trial_period_days, Integer
154
154
 
155
+ # @!attribute cancellation_comment
156
+ # Free-text cancellation comment, if any
157
+ #
158
+ # @return [String, nil]
159
+ optional :cancellation_comment, String, nil?: true
160
+
161
+ # @!attribute cancellation_feedback
162
+ # Customer-supplied churn reason, if any
163
+ #
164
+ # @return [Symbol, Dodopayments::Models::CancellationFeedback, nil]
165
+ optional :cancellation_feedback, enum: -> { Dodopayments::CancellationFeedback }, nil?: true
166
+
155
167
  # @!attribute cancelled_at
156
168
  # Cancelled timestamp if the subscription is cancelled
157
169
  #
@@ -193,8 +205,8 @@ module Dodopayments
193
205
  # @!attribute scheduled_change
194
206
  # Scheduled plan change details, if any
195
207
  #
196
- # @return [Dodopayments::Models::Subscription::ScheduledChange, nil]
197
- optional :scheduled_change, -> { Dodopayments::Subscription::ScheduledChange }, nil?: true
208
+ # @return [Dodopayments::Models::ScheduledPlanChange, nil]
209
+ optional :scheduled_change, -> { Dodopayments::ScheduledPlanChange }, nil?: true
198
210
 
199
211
  # @!attribute tax_id
200
212
  # Tax identifier provided for this subscription (if applicable)
@@ -202,7 +214,7 @@ module Dodopayments
202
214
  # @return [String, nil]
203
215
  optional :tax_id, String, nil?: true
204
216
 
205
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
217
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
206
218
  # Some parameter documentations has been truncated, see
207
219
  # {Dodopayments::Models::Subscription} for more details.
208
220
  #
@@ -256,6 +268,10 @@ module Dodopayments
256
268
  #
257
269
  # @param trial_period_days [Integer] Number of days in the trial period (0 if no trial)
258
270
  #
271
+ # @param cancellation_comment [String, nil] Free-text cancellation comment, if any
272
+ #
273
+ # @param cancellation_feedback [Symbol, Dodopayments::Models::CancellationFeedback, nil] Customer-supplied churn reason, if any
274
+ #
259
275
  # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
260
276
  #
261
277
  # @param custom_field_responses [Array<Dodopayments::Models::CustomFieldResponse>, nil] Customer's responses to custom fields collected during checkout
@@ -268,107 +284,9 @@ module Dodopayments
268
284
  #
269
285
  # @param payment_method_id [String, nil] Saved payment method id used for recurring charges
270
286
  #
271
- # @param scheduled_change [Dodopayments::Models::Subscription::ScheduledChange, nil] Scheduled plan change details, if any
287
+ # @param scheduled_change [Dodopayments::Models::ScheduledPlanChange, nil] Scheduled plan change details, if any
272
288
  #
273
289
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
274
-
275
- # @see Dodopayments::Models::Subscription#scheduled_change
276
- class ScheduledChange < Dodopayments::Internal::Type::BaseModel
277
- # @!attribute id
278
- # The scheduled plan change ID
279
- #
280
- # @return [String]
281
- required :id, String
282
-
283
- # @!attribute addons
284
- # Addons included in the scheduled change
285
- #
286
- # @return [Array<Dodopayments::Models::Subscription::ScheduledChange::Addon>]
287
- required :addons,
288
- -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Subscription::ScheduledChange::Addon] }
289
-
290
- # @!attribute created_at
291
- # When this scheduled change was created
292
- #
293
- # @return [Time]
294
- required :created_at, Time
295
-
296
- # @!attribute effective_at
297
- # When the change will be applied
298
- #
299
- # @return [Time]
300
- required :effective_at, Time
301
-
302
- # @!attribute product_id
303
- # The product ID the subscription will change to
304
- #
305
- # @return [String]
306
- required :product_id, String
307
-
308
- # @!attribute quantity
309
- # Quantity for the new plan
310
- #
311
- # @return [Integer]
312
- required :quantity, Integer
313
-
314
- # @!attribute product_description
315
- # Description of the product being changed to
316
- #
317
- # @return [String, nil]
318
- optional :product_description, String, nil?: true
319
-
320
- # @!attribute product_name
321
- # Name of the product being changed to
322
- #
323
- # @return [String, nil]
324
- optional :product_name, String, nil?: true
325
-
326
- # @!method initialize(id:, addons:, created_at:, effective_at:, product_id:, quantity:, product_description: nil, product_name: nil)
327
- # Scheduled plan change details, if any
328
- #
329
- # @param id [String] The scheduled plan change ID
330
- #
331
- # @param addons [Array<Dodopayments::Models::Subscription::ScheduledChange::Addon>] Addons included in the scheduled change
332
- #
333
- # @param created_at [Time] When this scheduled change was created
334
- #
335
- # @param effective_at [Time] When the change will be applied
336
- #
337
- # @param product_id [String] The product ID the subscription will change to
338
- #
339
- # @param quantity [Integer] Quantity for the new plan
340
- #
341
- # @param product_description [String, nil] Description of the product being changed to
342
- #
343
- # @param product_name [String, nil] Name of the product being changed to
344
-
345
- class Addon < Dodopayments::Internal::Type::BaseModel
346
- # @!attribute addon_id
347
- # The addon ID
348
- #
349
- # @return [String]
350
- required :addon_id, String
351
-
352
- # @!attribute name
353
- # Name of the addon
354
- #
355
- # @return [String]
356
- required :name, String
357
-
358
- # @!attribute quantity
359
- # Quantity of the addon
360
- #
361
- # @return [Integer]
362
- required :quantity, Integer
363
-
364
- # @!method initialize(addon_id:, name:, quantity:)
365
- # @param addon_id [String] The addon ID
366
- #
367
- # @param name [String] Name of the addon
368
- #
369
- # @param quantity [Integer] Quantity of the addon
370
- end
371
- end
372
290
  end
373
291
  end
374
292
  end