dodopayments 2.8.1 → 2.9.1

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 +19 -14
  14. data/lib/dodopayments/models/digital_product_delivery_file.rb +40 -9
  15. data/lib/dodopayments/models/entitlement.rb +97 -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 +56 -0
  19. data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +56 -0
  20. data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +56 -0
  21. data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +56 -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 +190 -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 +45 -0
  33. data/lib/dodopayments/models/integration_config.rb +217 -0
  34. data/lib/dodopayments/models/integration_config_response.rb +278 -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 +10 -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 +6 -153
  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 +63 -0
  60. data/lib/dodopayments/resources/entitlements/grants.rb +76 -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 +16 -18
  79. data/rbi/dodopayments/models/digital_product_delivery_file.rbi +51 -8
  80. data/rbi/dodopayments/models/entitlement.rbi +127 -0
  81. data/rbi/dodopayments/models/entitlement_create_params.rbi +115 -0
  82. data/rbi/dodopayments/models/entitlement_delete_params.rbi +38 -0
  83. data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +107 -0
  84. data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +107 -0
  85. data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +106 -0
  86. data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +107 -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 +269 -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 +68 -0
  98. data/rbi/dodopayments/models/integration_config.rbi +411 -0
  99. data/rbi/dodopayments/models/integration_config_response.rbi +531 -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 +8 -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 +6 -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 +45 -0
  125. data/rbi/dodopayments/resources/entitlements/grants.rbi +63 -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 +65 -0
  144. data/sig/dodopayments/models/entitlement_create_params.rbs +48 -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 +127 -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 +171 -0
  162. data/sig/dodopayments/models/integration_config_response.rbs +225 -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
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class EntitlementGrantCreatedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
14
+ # and any integration-specific delivery payload.
15
+ #
16
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
17
+ required :data, -> { Dodopayments::Entitlements::EntitlementGrant }
18
+
19
+ # @!attribute timestamp
20
+ # The timestamp of when the event occurred
21
+ #
22
+ # @return [Time]
23
+ required :timestamp, Time
24
+
25
+ # @!attribute type
26
+ # The event type
27
+ #
28
+ # @return [Symbol, Dodopayments::Models::EntitlementGrantCreatedWebhookEvent::Type]
29
+ required :type, enum: -> { Dodopayments::EntitlementGrantCreatedWebhookEvent::Type }
30
+
31
+ # @!method initialize(business_id:, data:, timestamp:, type:)
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::EntitlementGrantCreatedWebhookEvent} for more details.
34
+ #
35
+ # @param business_id [String] The business identifier
36
+ #
37
+ # @param data [Dodopayments::Models::Entitlements::EntitlementGrant] Detailed view of a single entitlement grant: who it's for, its
38
+ #
39
+ # @param timestamp [Time] The timestamp of when the event occurred
40
+ #
41
+ # @param type [Symbol, Dodopayments::Models::EntitlementGrantCreatedWebhookEvent::Type] The event type
42
+
43
+ # The event type
44
+ #
45
+ # @see Dodopayments::Models::EntitlementGrantCreatedWebhookEvent#type
46
+ module Type
47
+ extend Dodopayments::Internal::Type::Enum
48
+
49
+ ENTITLEMENT_GRANT_CREATED = :"entitlement_grant.created"
50
+
51
+ # @!method self.values
52
+ # @return [Array<Symbol>]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class EntitlementGrantDeliveredWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
14
+ # and any integration-specific delivery payload.
15
+ #
16
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
17
+ required :data, -> { Dodopayments::Entitlements::EntitlementGrant }
18
+
19
+ # @!attribute timestamp
20
+ # The timestamp of when the event occurred
21
+ #
22
+ # @return [Time]
23
+ required :timestamp, Time
24
+
25
+ # @!attribute type
26
+ # The event type
27
+ #
28
+ # @return [Symbol, Dodopayments::Models::EntitlementGrantDeliveredWebhookEvent::Type]
29
+ required :type, enum: -> { Dodopayments::EntitlementGrantDeliveredWebhookEvent::Type }
30
+
31
+ # @!method initialize(business_id:, data:, timestamp:, type:)
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::EntitlementGrantDeliveredWebhookEvent} for more details.
34
+ #
35
+ # @param business_id [String] The business identifier
36
+ #
37
+ # @param data [Dodopayments::Models::Entitlements::EntitlementGrant] Detailed view of a single entitlement grant: who it's for, its
38
+ #
39
+ # @param timestamp [Time] The timestamp of when the event occurred
40
+ #
41
+ # @param type [Symbol, Dodopayments::Models::EntitlementGrantDeliveredWebhookEvent::Type] The event type
42
+
43
+ # The event type
44
+ #
45
+ # @see Dodopayments::Models::EntitlementGrantDeliveredWebhookEvent#type
46
+ module Type
47
+ extend Dodopayments::Internal::Type::Enum
48
+
49
+ ENTITLEMENT_GRANT_DELIVERED = :"entitlement_grant.delivered"
50
+
51
+ # @!method self.values
52
+ # @return [Array<Symbol>]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class EntitlementGrantFailedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
14
+ # and any integration-specific delivery payload.
15
+ #
16
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
17
+ required :data, -> { Dodopayments::Entitlements::EntitlementGrant }
18
+
19
+ # @!attribute timestamp
20
+ # The timestamp of when the event occurred
21
+ #
22
+ # @return [Time]
23
+ required :timestamp, Time
24
+
25
+ # @!attribute type
26
+ # The event type
27
+ #
28
+ # @return [Symbol, Dodopayments::Models::EntitlementGrantFailedWebhookEvent::Type]
29
+ required :type, enum: -> { Dodopayments::EntitlementGrantFailedWebhookEvent::Type }
30
+
31
+ # @!method initialize(business_id:, data:, timestamp:, type:)
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::EntitlementGrantFailedWebhookEvent} for more details.
34
+ #
35
+ # @param business_id [String] The business identifier
36
+ #
37
+ # @param data [Dodopayments::Models::Entitlements::EntitlementGrant] Detailed view of a single entitlement grant: who it's for, its
38
+ #
39
+ # @param timestamp [Time] The timestamp of when the event occurred
40
+ #
41
+ # @param type [Symbol, Dodopayments::Models::EntitlementGrantFailedWebhookEvent::Type] The event type
42
+
43
+ # The event type
44
+ #
45
+ # @see Dodopayments::Models::EntitlementGrantFailedWebhookEvent#type
46
+ module Type
47
+ extend Dodopayments::Internal::Type::Enum
48
+
49
+ ENTITLEMENT_GRANT_FAILED = :"entitlement_grant.failed"
50
+
51
+ # @!method self.values
52
+ # @return [Array<Symbol>]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class EntitlementGrantRevokedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
14
+ # and any integration-specific delivery payload.
15
+ #
16
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
17
+ required :data, -> { Dodopayments::Entitlements::EntitlementGrant }
18
+
19
+ # @!attribute timestamp
20
+ # The timestamp of when the event occurred
21
+ #
22
+ # @return [Time]
23
+ required :timestamp, Time
24
+
25
+ # @!attribute type
26
+ # The event type
27
+ #
28
+ # @return [Symbol, Dodopayments::Models::EntitlementGrantRevokedWebhookEvent::Type]
29
+ required :type, enum: -> { Dodopayments::EntitlementGrantRevokedWebhookEvent::Type }
30
+
31
+ # @!method initialize(business_id:, data:, timestamp:, type:)
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::EntitlementGrantRevokedWebhookEvent} for more details.
34
+ #
35
+ # @param business_id [String] The business identifier
36
+ #
37
+ # @param data [Dodopayments::Models::Entitlements::EntitlementGrant] Detailed view of a single entitlement grant: who it's for, its
38
+ #
39
+ # @param timestamp [Time] The timestamp of when the event occurred
40
+ #
41
+ # @param type [Symbol, Dodopayments::Models::EntitlementGrantRevokedWebhookEvent::Type] The event type
42
+
43
+ # The event type
44
+ #
45
+ # @see Dodopayments::Models::EntitlementGrantRevokedWebhookEvent#type
46
+ module Type
47
+ extend Dodopayments::Internal::Type::Enum
48
+
49
+ ENTITLEMENT_GRANT_REVOKED = :"entitlement_grant.revoked"
50
+
51
+ # @!method self.values
52
+ # @return [Array<Symbol>]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module EntitlementIntegrationType
6
+ extend Dodopayments::Internal::Type::Enum
7
+
8
+ DISCORD = :discord
9
+ TELEGRAM = :telegram
10
+ GITHUB = :github
11
+ FIGMA = :figma
12
+ FRAMER = :framer
13
+ NOTION = :notion
14
+ DIGITAL_FILES = :digital_files
15
+ LICENSE_KEY = :license_key
16
+
17
+ # @!method self.values
18
+ # @return [Array<Symbol>]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Entitlements#list
6
+ class EntitlementListParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute integration_type
11
+ # Filter by integration type
12
+ #
13
+ # @return [Symbol, Dodopayments::Models::EntitlementListParams::IntegrationType, nil]
14
+ optional :integration_type, enum: -> { Dodopayments::EntitlementListParams::IntegrationType }
15
+
16
+ # @!attribute page_number
17
+ # Page number (default 0)
18
+ #
19
+ # @return [Integer, nil]
20
+ optional :page_number, Integer
21
+
22
+ # @!attribute page_size
23
+ # Page size (default 10, max 100)
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :page_size, Integer
27
+
28
+ # @!method initialize(integration_type: nil, page_number: nil, page_size: nil, request_options: {})
29
+ # @param integration_type [Symbol, Dodopayments::Models::EntitlementListParams::IntegrationType] Filter by integration type
30
+ #
31
+ # @param page_number [Integer] Page number (default 0)
32
+ #
33
+ # @param page_size [Integer] Page size (default 10, max 100)
34
+ #
35
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
36
+
37
+ # Filter by integration type
38
+ module IntegrationType
39
+ extend Dodopayments::Internal::Type::Enum
40
+
41
+ DISCORD = :discord
42
+ TELEGRAM = :telegram
43
+ GITHUB = :github
44
+ FIGMA = :figma
45
+ FRAMER = :framer
46
+ NOTION = :notion
47
+ DIGITAL_FILES = :digital_files
48
+ LICENSE_KEY = :license_key
49
+
50
+ # @!method self.values
51
+ # @return [Array<Symbol>]
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Entitlements#retrieve
6
+ class EntitlementRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
17
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Entitlements#update
6
+ class EntitlementUpdateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute description
16
+ #
17
+ # @return [String, nil]
18
+ optional :description, String, nil?: true
19
+
20
+ # @!attribute integration_config
21
+ # Integration-specific configuration supplied when creating or updating an
22
+ # entitlement. The shape required matches the entitlement's `integration_type`.
23
+ #
24
+ # @return [Dodopayments::Models::IntegrationConfig::GitHubConfig, Dodopayments::Models::IntegrationConfig::DiscordConfig, Dodopayments::Models::IntegrationConfig::TelegramConfig, Dodopayments::Models::IntegrationConfig::FigmaConfig, Dodopayments::Models::IntegrationConfig::FramerConfig, Dodopayments::Models::IntegrationConfig::NotionConfig, Dodopayments::Models::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::IntegrationConfig::LicenseKeyConfig, nil]
25
+ optional :integration_config, union: -> { Dodopayments::IntegrationConfig }, nil?: true
26
+
27
+ # @!attribute metadata
28
+ #
29
+ # @return [Hash{Symbol=>String}, nil]
30
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true
31
+
32
+ # @!attribute name
33
+ #
34
+ # @return [String, nil]
35
+ optional :name, String, nil?: true
36
+
37
+ # @!method initialize(id:, description: nil, integration_config: nil, metadata: nil, name: nil, request_options: {})
38
+ # Some parameter documentations has been truncated, see
39
+ # {Dodopayments::Models::EntitlementUpdateParams} for more details.
40
+ #
41
+ # @param id [String]
42
+ #
43
+ # @param description [String, nil]
44
+ #
45
+ # @param integration_config [Dodopayments::Models::IntegrationConfig::GitHubConfig, Dodopayments::Models::IntegrationConfig::DiscordConfig, Dodopayments::Models::IntegrationConfig::TelegramConfig, Dodopayments::Models::IntegrationConfig::FigmaConfig, Dodopayments::Models::IntegrationConfig::FramerConfig, Dodopayments::Models::IntegrationConfig::NotionConfig, Dodopayments::Models::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::IntegrationConfig::LicenseKeyConfig, nil] Integration-specific configuration supplied when creating or updating
46
+ #
47
+ # @param metadata [Hash{Symbol=>String}, nil]
48
+ #
49
+ # @param name [String, nil]
50
+ #
51
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,190 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ # @see Dodopayments::Resources::Entitlements::Grants#list
7
+ class EntitlementGrant < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ # Unique identifier of the grant.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute business_id
15
+ # Identifier of the business that owns the grant.
16
+ #
17
+ # @return [String]
18
+ required :business_id, String
19
+
20
+ # @!attribute created_at
21
+ # Timestamp when the grant was created.
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute customer_id
27
+ # Identifier of the customer the grant was issued to.
28
+ #
29
+ # @return [String]
30
+ required :customer_id, String
31
+
32
+ # @!attribute entitlement_id
33
+ # Identifier of the entitlement this grant was issued from.
34
+ #
35
+ # @return [String]
36
+ required :entitlement_id, String
37
+
38
+ # @!attribute metadata
39
+ # Arbitrary key-value metadata recorded on the grant.
40
+ #
41
+ # @return [Hash{Symbol=>String}]
42
+ required :metadata, Dodopayments::Internal::Type::HashOf[String]
43
+
44
+ # @!attribute status
45
+ # Lifecycle status of the grant.
46
+ #
47
+ # @return [Symbol, Dodopayments::Models::Entitlements::EntitlementGrant::Status]
48
+ required :status, enum: -> { Dodopayments::Entitlements::EntitlementGrant::Status }
49
+
50
+ # @!attribute updated_at
51
+ # Timestamp when the grant was last modified.
52
+ #
53
+ # @return [Time]
54
+ required :updated_at, Time
55
+
56
+ # @!attribute delivered_at
57
+ # Timestamp when the grant transitioned to `delivered`, when applicable.
58
+ #
59
+ # @return [Time, nil]
60
+ optional :delivered_at, Time, nil?: true
61
+
62
+ # @!attribute digital_product_delivery
63
+ # Digital-product-delivery payload, present when the entitlement integration is
64
+ # `digital_files`.
65
+ #
66
+ # @return [Dodopayments::Models::DigitalProductDelivery, nil]
67
+ optional :digital_product_delivery, -> { Dodopayments::DigitalProductDelivery }, nil?: true
68
+
69
+ # @!attribute error_code
70
+ # Machine-readable code reported when delivery failed, when applicable.
71
+ #
72
+ # @return [String, nil]
73
+ optional :error_code, String, nil?: true
74
+
75
+ # @!attribute error_message
76
+ # Human-readable message reported when delivery failed, when applicable.
77
+ #
78
+ # @return [String, nil]
79
+ optional :error_message, String, nil?: true
80
+
81
+ # @!attribute license_key
82
+ # License-key delivery payload, present when the entitlement integration is
83
+ # `license_key`.
84
+ #
85
+ # @return [Dodopayments::Models::Entitlements::LicenseKeyGrant, nil]
86
+ optional :license_key, -> { Dodopayments::Entitlements::LicenseKeyGrant }, nil?: true
87
+
88
+ # @!attribute oauth_expires_at
89
+ # Timestamp when `oauth_url` stops being valid, when applicable.
90
+ #
91
+ # @return [Time, nil]
92
+ optional :oauth_expires_at, Time, nil?: true
93
+
94
+ # @!attribute oauth_url
95
+ # Customer-facing OAuth URL for OAuth-style integrations. Populated during the
96
+ # customer-portal accept flow; `null` until the customer completes that step, and
97
+ # on grants for non-OAuth integrations.
98
+ #
99
+ # @return [String, nil]
100
+ optional :oauth_url, String, nil?: true
101
+
102
+ # @!attribute payment_id
103
+ # Identifier of the payment that triggered this grant, when applicable.
104
+ #
105
+ # @return [String, nil]
106
+ optional :payment_id, String, nil?: true
107
+
108
+ # @!attribute revocation_reason
109
+ # Reason recorded when the grant was revoked, when applicable.
110
+ #
111
+ # @return [String, nil]
112
+ optional :revocation_reason, String, nil?: true
113
+
114
+ # @!attribute revoked_at
115
+ # Timestamp when the grant transitioned to `revoked`, when applicable.
116
+ #
117
+ # @return [Time, nil]
118
+ optional :revoked_at, Time, nil?: true
119
+
120
+ # @!attribute subscription_id
121
+ # Identifier of the subscription that triggered this grant, when applicable.
122
+ #
123
+ # @return [String, nil]
124
+ optional :subscription_id, String, nil?: true
125
+
126
+ # @!method initialize(id:, business_id:, created_at:, customer_id:, entitlement_id:, metadata:, status:, updated_at:, delivered_at: nil, digital_product_delivery: nil, error_code: nil, error_message: nil, license_key: nil, oauth_expires_at: nil, oauth_url: nil, payment_id: nil, revocation_reason: nil, revoked_at: nil, subscription_id: nil)
127
+ # Some parameter documentations has been truncated, see
128
+ # {Dodopayments::Models::Entitlements::EntitlementGrant} for more details.
129
+ #
130
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
131
+ # and any integration-specific delivery payload.
132
+ #
133
+ # @param id [String] Unique identifier of the grant.
134
+ #
135
+ # @param business_id [String] Identifier of the business that owns the grant.
136
+ #
137
+ # @param created_at [Time] Timestamp when the grant was created.
138
+ #
139
+ # @param customer_id [String] Identifier of the customer the grant was issued to.
140
+ #
141
+ # @param entitlement_id [String] Identifier of the entitlement this grant was issued from.
142
+ #
143
+ # @param metadata [Hash{Symbol=>String}] Arbitrary key-value metadata recorded on the grant.
144
+ #
145
+ # @param status [Symbol, Dodopayments::Models::Entitlements::EntitlementGrant::Status] Lifecycle status of the grant.
146
+ #
147
+ # @param updated_at [Time] Timestamp when the grant was last modified.
148
+ #
149
+ # @param delivered_at [Time, nil] Timestamp when the grant transitioned to `delivered`, when applicable.
150
+ #
151
+ # @param digital_product_delivery [Dodopayments::Models::DigitalProductDelivery, nil] Digital-product-delivery payload, present when the entitlement
152
+ #
153
+ # @param error_code [String, nil] Machine-readable code reported when delivery failed, when applicable.
154
+ #
155
+ # @param error_message [String, nil] Human-readable message reported when delivery failed, when applicable.
156
+ #
157
+ # @param license_key [Dodopayments::Models::Entitlements::LicenseKeyGrant, nil] License-key delivery payload, present when the entitlement integration
158
+ #
159
+ # @param oauth_expires_at [Time, nil] Timestamp when `oauth_url` stops being valid, when applicable.
160
+ #
161
+ # @param oauth_url [String, nil] Customer-facing OAuth URL for OAuth-style integrations. Populated
162
+ #
163
+ # @param payment_id [String, nil] Identifier of the payment that triggered this grant, when applicable.
164
+ #
165
+ # @param revocation_reason [String, nil] Reason recorded when the grant was revoked, when applicable.
166
+ #
167
+ # @param revoked_at [Time, nil] Timestamp when the grant transitioned to `revoked`, when applicable.
168
+ #
169
+ # @param subscription_id [String, nil] Identifier of the subscription that triggered this grant, when applicable.
170
+
171
+ # Lifecycle status of the grant.
172
+ #
173
+ # @see Dodopayments::Models::Entitlements::EntitlementGrant#status
174
+ module Status
175
+ extend Dodopayments::Internal::Type::Enum
176
+
177
+ PENDING = :Pending
178
+ DELIVERED = :Delivered
179
+ FAILED = :Failed
180
+ REVOKED = :Revoked
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+
188
+ EntitlementGrant = Entitlements::EntitlementGrant
189
+ end
190
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ # @see Dodopayments::Resources::Entitlements::Files#delete
7
+ class FileDeleteParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute file_id
17
+ #
18
+ # @return [String]
19
+ required :file_id, String
20
+
21
+ # @!method initialize(id:, file_id:, request_options: {})
22
+ # @param id [String]
23
+ # @param file_id [String]
24
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ # @see Dodopayments::Resources::Entitlements::Files#upload
7
+ class FileUploadParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String]
18
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ # @see Dodopayments::Resources::Entitlements::Files#upload
7
+ class FileUploadResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute file_id
9
+ # Identifier of the attached file. Pass it to
10
+ # `DELETE /entitlements/{id}/files/{file_id}` to detach the file later.
11
+ #
12
+ # @return [String]
13
+ required :file_id, String
14
+
15
+ # @!method initialize(file_id:)
16
+ # Some parameter documentations has been truncated, see
17
+ # {Dodopayments::Models::Entitlements::FileUploadResponse} for more details.
18
+ #
19
+ # @param file_id [String] Identifier of the attached file. Pass it to
20
+ end
21
+ end
22
+ end
23
+ end