dodopayments 1.22.0 → 1.47.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 (449) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +143 -59
  4. data/SECURITY.md +2 -2
  5. data/lib/dodopayments/client.rb +16 -4
  6. data/lib/dodopayments/errors.rb +23 -1
  7. data/lib/dodopayments/file_part.rb +2 -2
  8. data/lib/dodopayments/internal/cursor_page_pagination.rb +90 -0
  9. data/lib/dodopayments/internal/transport/base_client.rb +88 -8
  10. data/lib/dodopayments/internal/transport/pooled_net_requester.rb +17 -1
  11. data/lib/dodopayments/internal/type/array_of.rb +16 -2
  12. data/lib/dodopayments/internal/type/base_model.rb +155 -54
  13. data/lib/dodopayments/internal/type/boolean.rb +15 -1
  14. data/lib/dodopayments/internal/type/converter.rb +86 -33
  15. data/lib/dodopayments/internal/type/enum.rb +30 -6
  16. data/lib/dodopayments/internal/type/file_input.rb +13 -1
  17. data/lib/dodopayments/internal/type/hash_of.rb +16 -2
  18. data/lib/dodopayments/internal/type/request_parameters.rb +4 -4
  19. data/lib/dodopayments/internal/type/union.rb +44 -31
  20. data/lib/dodopayments/internal/type/unknown.rb +15 -1
  21. data/lib/dodopayments/internal/util.rb +119 -11
  22. data/lib/dodopayments/internal.rb +9 -0
  23. data/lib/dodopayments/models/addon_create_params.rb +6 -10
  24. data/lib/dodopayments/models/addon_list_params.rb +4 -4
  25. data/lib/dodopayments/models/addon_response.rb +6 -10
  26. data/lib/dodopayments/models/addon_update_params.rb +6 -10
  27. data/lib/dodopayments/models/attach_addon.rb +21 -0
  28. data/lib/dodopayments/models/billing_address.rb +3 -3
  29. data/lib/dodopayments/models/brand.rb +107 -0
  30. data/lib/dodopayments/models/brand_create_params.rb +44 -0
  31. data/lib/dodopayments/models/{webhook_event_retrieve_params.rb → brand_list_params.rb} +2 -2
  32. data/lib/dodopayments/models/brand_list_response.rb +17 -0
  33. data/lib/dodopayments/models/brand_retrieve_params.rb +14 -0
  34. data/lib/dodopayments/models/brand_update_images_params.rb +14 -0
  35. data/lib/dodopayments/models/brand_update_images_response.rb +25 -0
  36. data/lib/dodopayments/models/brand_update_params.rb +43 -0
  37. data/lib/dodopayments/models/create_new_customer.rb +0 -1
  38. data/lib/dodopayments/models/customer_list_params.rb +13 -5
  39. data/lib/dodopayments/models/customer_request.rb +3 -3
  40. data/lib/dodopayments/models/customers/customer_portal_create_params.rb +2 -2
  41. data/lib/dodopayments/models/discount.rb +15 -4
  42. data/lib/dodopayments/models/discount_create_params.rb +17 -6
  43. data/lib/dodopayments/models/discount_list_params.rb +4 -4
  44. data/lib/dodopayments/models/discount_update_params.rb +16 -5
  45. data/lib/dodopayments/models/dispute.rb +6 -5
  46. data/lib/dodopayments/models/dispute_list_params.rb +44 -16
  47. data/lib/dodopayments/models/dispute_list_response.rb +6 -5
  48. data/lib/dodopayments/models/{dispute_retrieve_response.rb → get_dispute.rb} +11 -9
  49. data/lib/dodopayments/models/license_key.rb +3 -3
  50. data/lib/dodopayments/models/license_key_duration.rb +1 -1
  51. data/lib/dodopayments/models/license_key_list_params.rb +23 -11
  52. data/lib/dodopayments/models/license_key_update_params.rb +3 -3
  53. data/lib/dodopayments/models/misc_list_supported_countries_response.rb +1 -1
  54. data/lib/dodopayments/models/new_customer.rb +27 -0
  55. data/lib/dodopayments/models/one_time_product_cart_item.rb +0 -1
  56. data/lib/dodopayments/models/payment.rb +50 -21
  57. data/lib/dodopayments/models/payment_create_params.rb +22 -41
  58. data/lib/dodopayments/models/payment_create_response.rb +16 -6
  59. data/lib/dodopayments/models/payment_list_params.rb +44 -16
  60. data/lib/dodopayments/models/payment_list_response.rb +16 -4
  61. data/lib/dodopayments/models/payment_method_types.rb +31 -0
  62. data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -0
  63. data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +63 -0
  64. data/lib/dodopayments/models/payout_list_params.rb +4 -4
  65. data/lib/dodopayments/models/payout_list_response.rb +7 -3
  66. data/lib/dodopayments/models/price.rb +57 -30
  67. data/lib/dodopayments/models/product.rb +85 -12
  68. data/lib/dodopayments/models/product_create_params.rb +61 -12
  69. data/lib/dodopayments/models/product_list_params.rb +15 -7
  70. data/lib/dodopayments/models/product_list_response.rb +19 -11
  71. data/lib/dodopayments/models/product_update_files_params.rb +20 -0
  72. data/lib/dodopayments/models/product_update_files_response.rb +22 -0
  73. data/lib/dodopayments/models/product_update_params.rb +70 -13
  74. data/lib/dodopayments/models/products/image_update_params.rb +2 -2
  75. data/lib/dodopayments/models/refund.rb +15 -5
  76. data/lib/dodopayments/models/refund_create_params.rb +38 -1
  77. data/lib/dodopayments/models/refund_list_params.rb +26 -13
  78. data/lib/dodopayments/models/subscription.rb +38 -18
  79. data/lib/dodopayments/models/subscription_change_plan_params.rb +9 -23
  80. data/lib/dodopayments/models/subscription_charge_params.rb +38 -2
  81. data/lib/dodopayments/models/subscription_create_params.rb +53 -66
  82. data/lib/dodopayments/models/subscription_create_response.rb +24 -8
  83. data/lib/dodopayments/models/subscription_list_params.rb +37 -14
  84. data/lib/dodopayments/models/subscription_list_response.rb +37 -16
  85. data/lib/dodopayments/models/subscription_status.rb +0 -1
  86. data/lib/dodopayments/models/subscription_update_params.rb +10 -6
  87. data/lib/dodopayments/models/webhook_create_params.rb +86 -0
  88. data/lib/dodopayments/models/webhook_create_response.rb +88 -0
  89. data/lib/dodopayments/models/webhook_delete_params.rb +14 -0
  90. data/lib/dodopayments/models/webhook_event_type.rb +35 -0
  91. data/lib/dodopayments/models/webhook_list_params.rb +30 -0
  92. data/lib/dodopayments/models/webhook_list_response.rb +88 -0
  93. data/lib/dodopayments/models/webhook_payload.rb +161 -0
  94. data/lib/dodopayments/models/webhook_retrieve_params.rb +14 -0
  95. data/lib/dodopayments/models/webhook_retrieve_response.rb +88 -0
  96. data/lib/dodopayments/models/webhook_update_params.rb +69 -0
  97. data/lib/dodopayments/models/webhook_update_response.rb +88 -0
  98. data/lib/dodopayments/models/webhooks/header_retrieve_params.rb +16 -0
  99. data/lib/dodopayments/models/webhooks/header_retrieve_response.rb +31 -0
  100. data/lib/dodopayments/models/webhooks/header_update_params.rb +24 -0
  101. data/lib/dodopayments/models/your_webhook_url_create_params.rb +32 -0
  102. data/lib/dodopayments/models.rb +77 -3
  103. data/lib/dodopayments/request_options.rb +4 -0
  104. data/lib/dodopayments/resources/addons.rb +13 -21
  105. data/lib/dodopayments/resources/brands.rb +119 -0
  106. data/lib/dodopayments/resources/customers/customer_portal.rb +3 -3
  107. data/lib/dodopayments/resources/customers.rb +12 -10
  108. data/lib/dodopayments/resources/discounts.rb +24 -19
  109. data/lib/dodopayments/resources/disputes.rb +10 -10
  110. data/lib/dodopayments/resources/license_key_instances.rb +5 -5
  111. data/lib/dodopayments/resources/license_keys.rb +13 -13
  112. data/lib/dodopayments/resources/licenses.rb +4 -4
  113. data/lib/dodopayments/resources/misc.rb +1 -1
  114. data/lib/dodopayments/resources/payments.rb +38 -19
  115. data/lib/dodopayments/resources/payouts.rb +3 -3
  116. data/lib/dodopayments/resources/products/images.rb +2 -2
  117. data/lib/dodopayments/resources/products.rb +58 -24
  118. data/lib/dodopayments/resources/refunds.rb +14 -12
  119. data/lib/dodopayments/resources/subscriptions.rb +39 -29
  120. data/lib/dodopayments/resources/webhook_events.rb +0 -52
  121. data/lib/dodopayments/resources/webhooks/headers.rb +59 -0
  122. data/lib/dodopayments/resources/webhooks.rb +157 -0
  123. data/lib/dodopayments/resources/your_webhook_url.rb +56 -0
  124. data/lib/dodopayments/version.rb +1 -1
  125. data/lib/dodopayments.rb +46 -9
  126. data/rbi/dodopayments/client.rbi +19 -6
  127. data/rbi/dodopayments/errors.rbi +51 -16
  128. data/rbi/dodopayments/file_part.rbi +9 -6
  129. data/rbi/dodopayments/internal/cursor_page_pagination.rbi +25 -0
  130. data/rbi/dodopayments/internal/default_page_number_pagination.rbi +2 -1
  131. data/rbi/dodopayments/internal/transport/base_client.rbi +165 -77
  132. data/rbi/dodopayments/internal/transport/pooled_net_requester.rbi +33 -13
  133. data/rbi/dodopayments/internal/type/array_of.rbi +40 -24
  134. data/rbi/dodopayments/internal/type/base_model.rbi +160 -70
  135. data/rbi/dodopayments/internal/type/base_page.rbi +13 -8
  136. data/rbi/dodopayments/internal/type/boolean.rbi +24 -14
  137. data/rbi/dodopayments/internal/type/converter.rbi +135 -33
  138. data/rbi/dodopayments/internal/type/enum.rbi +29 -13
  139. data/rbi/dodopayments/internal/type/file_input.rbi +13 -4
  140. data/rbi/dodopayments/internal/type/hash_of.rbi +40 -24
  141. data/rbi/dodopayments/internal/type/request_parameters.rbi +14 -4
  142. data/rbi/dodopayments/internal/type/union.rbi +71 -23
  143. data/rbi/dodopayments/internal/type/unknown.rbi +24 -6
  144. data/rbi/dodopayments/internal/util.rbi +272 -91
  145. data/rbi/dodopayments/internal.rbi +7 -0
  146. data/rbi/dodopayments/models/addon_cart_response_item.rbi +16 -4
  147. data/rbi/dodopayments/models/addon_create_params.rbi +33 -24
  148. data/rbi/dodopayments/models/addon_list_params.rbi +29 -17
  149. data/rbi/dodopayments/models/addon_response.rbi +33 -27
  150. data/rbi/dodopayments/models/addon_retrieve_params.rbi +18 -5
  151. data/rbi/dodopayments/models/addon_update_images_params.rbi +18 -5
  152. data/rbi/dodopayments/models/addon_update_images_response.rbi +13 -3
  153. data/rbi/dodopayments/models/addon_update_params.rbi +34 -25
  154. data/rbi/dodopayments/models/attach_addon.rbi +28 -0
  155. data/rbi/dodopayments/models/attach_existing_customer.rbi +13 -3
  156. data/rbi/dodopayments/models/billing_address.rbi +24 -12
  157. data/rbi/dodopayments/models/brand.rbi +132 -0
  158. data/rbi/dodopayments/models/brand_create_params.rbi +68 -0
  159. data/rbi/dodopayments/models/brand_list_params.rbi +29 -0
  160. data/rbi/dodopayments/models/brand_list_response.rbi +34 -0
  161. data/rbi/dodopayments/models/brand_retrieve_params.rbi +32 -0
  162. data/rbi/dodopayments/models/brand_update_images_params.rbi +32 -0
  163. data/rbi/dodopayments/models/brand_update_images_response.rbi +36 -0
  164. data/rbi/dodopayments/models/brand_update_params.rbi +64 -0
  165. data/rbi/dodopayments/models/country_code.rbi +255 -252
  166. data/rbi/dodopayments/models/create_new_customer.rbi +27 -11
  167. data/rbi/dodopayments/models/currency.rbi +149 -148
  168. data/rbi/dodopayments/models/customer.rbi +27 -15
  169. data/rbi/dodopayments/models/customer_create_params.rbi +22 -14
  170. data/rbi/dodopayments/models/customer_limited_details.rbi +21 -4
  171. data/rbi/dodopayments/models/customer_list_params.rbi +43 -17
  172. data/rbi/dodopayments/models/customer_portal_session.rbi +13 -3
  173. data/rbi/dodopayments/models/customer_request.rbi +10 -2
  174. data/rbi/dodopayments/models/customer_retrieve_params.rbi +18 -5
  175. data/rbi/dodopayments/models/customer_update_params.rbi +21 -13
  176. data/rbi/dodopayments/models/customers/customer_portal_create_params.rbi +26 -8
  177. data/rbi/dodopayments/models/discount.rbi +42 -22
  178. data/rbi/dodopayments/models/discount_create_params.rbi +43 -20
  179. data/rbi/dodopayments/models/discount_delete_params.rbi +18 -5
  180. data/rbi/dodopayments/models/discount_list_params.rbi +32 -17
  181. data/rbi/dodopayments/models/discount_retrieve_params.rbi +18 -5
  182. data/rbi/dodopayments/models/discount_type.rbi +7 -4
  183. data/rbi/dodopayments/models/discount_update_params.rbi +43 -20
  184. data/rbi/dodopayments/models/dispute.rbi +32 -22
  185. data/rbi/dodopayments/models/dispute_list_params.rbi +178 -33
  186. data/rbi/dodopayments/models/dispute_list_response.rbi +34 -21
  187. data/rbi/dodopayments/models/dispute_retrieve_params.rbi +18 -5
  188. data/rbi/dodopayments/models/dispute_stage.rbi +11 -6
  189. data/rbi/dodopayments/models/dispute_status.rbi +20 -10
  190. data/rbi/dodopayments/models/{dispute_retrieve_response.rbi → get_dispute.rbi} +40 -28
  191. data/rbi/dodopayments/models/intent_status.rbi +32 -14
  192. data/rbi/dodopayments/models/invoices/payment_retrieve_params.rbi +18 -5
  193. data/rbi/dodopayments/models/license_activate_params.rbi +21 -6
  194. data/rbi/dodopayments/models/license_deactivate_params.rbi +21 -13
  195. data/rbi/dodopayments/models/license_key.rbi +31 -23
  196. data/rbi/dodopayments/models/license_key_duration.rbi +24 -5
  197. data/rbi/dodopayments/models/license_key_instance.rbi +19 -4
  198. data/rbi/dodopayments/models/license_key_instance_list_params.rbi +23 -14
  199. data/rbi/dodopayments/models/license_key_instance_retrieve_params.rbi +18 -5
  200. data/rbi/dodopayments/models/license_key_instance_update_params.rbi +19 -6
  201. data/rbi/dodopayments/models/license_key_list_params.rbi +91 -26
  202. data/rbi/dodopayments/models/license_key_retrieve_params.rbi +18 -5
  203. data/rbi/dodopayments/models/license_key_status.rbi +10 -6
  204. data/rbi/dodopayments/models/license_key_update_params.rbi +23 -14
  205. data/rbi/dodopayments/models/license_validate_params.rbi +25 -13
  206. data/rbi/dodopayments/models/license_validate_response.rbi +13 -3
  207. data/rbi/dodopayments/models/misc_list_supported_countries_params.rbi +18 -5
  208. data/rbi/dodopayments/models/misc_list_supported_countries_response.rbi +1 -1
  209. data/rbi/dodopayments/models/new_customer.rbi +39 -0
  210. data/rbi/dodopayments/models/one_time_product_cart_item.rbi +23 -4
  211. data/rbi/dodopayments/models/payment.rbi +125 -62
  212. data/rbi/dodopayments/models/payment_create_params.rbi +67 -87
  213. data/rbi/dodopayments/models/payment_create_response.rbi +45 -22
  214. data/rbi/dodopayments/models/payment_list_params.rbi +149 -32
  215. data/rbi/dodopayments/models/payment_list_response.rbi +47 -26
  216. data/rbi/dodopayments/models/payment_method_types.rbi +52 -0
  217. data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +32 -0
  218. data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +114 -0
  219. data/rbi/dodopayments/models/payment_retrieve_params.rbi +18 -5
  220. data/rbi/dodopayments/models/payout_list_params.rbi +29 -17
  221. data/rbi/dodopayments/models/payout_list_response.rbi +82 -35
  222. data/rbi/dodopayments/models/price.rbi +142 -55
  223. data/rbi/dodopayments/models/product.rbi +177 -38
  224. data/rbi/dodopayments/models/product_create_params.rbi +151 -36
  225. data/rbi/dodopayments/models/product_delete_params.rbi +18 -5
  226. data/rbi/dodopayments/models/product_list_params.rbi +50 -21
  227. data/rbi/dodopayments/models/product_list_response.rbi +57 -42
  228. data/rbi/dodopayments/models/product_retrieve_params.rbi +18 -5
  229. data/rbi/dodopayments/models/product_unarchive_params.rbi +18 -5
  230. data/rbi/dodopayments/models/product_update_files_params.rbi +38 -0
  231. data/rbi/dodopayments/models/product_update_files_response.rbi +29 -0
  232. data/rbi/dodopayments/models/product_update_params.rbi +160 -37
  233. data/rbi/dodopayments/models/products/image_update_params.rbi +20 -8
  234. data/rbi/dodopayments/models/products/image_update_response.rbi +18 -4
  235. data/rbi/dodopayments/models/refund.rbi +39 -21
  236. data/rbi/dodopayments/models/refund_create_params.rbi +87 -11
  237. data/rbi/dodopayments/models/refund_list_params.rbi +86 -29
  238. data/rbi/dodopayments/models/refund_retrieve_params.rbi +18 -5
  239. data/rbi/dodopayments/models/refund_status.rbi +10 -7
  240. data/rbi/dodopayments/models/subscription.rbi +83 -47
  241. data/rbi/dodopayments/models/subscription_change_plan_params.rbi +61 -40
  242. data/rbi/dodopayments/models/subscription_charge_params.rbi +65 -6
  243. data/rbi/dodopayments/models/subscription_charge_response.rbi +13 -3
  244. data/rbi/dodopayments/models/subscription_create_params.rbi +136 -128
  245. data/rbi/dodopayments/models/subscription_create_response.rbi +51 -22
  246. data/rbi/dodopayments/models/subscription_list_params.rbi +125 -29
  247. data/rbi/dodopayments/models/subscription_list_response.rbi +85 -44
  248. data/rbi/dodopayments/models/subscription_retrieve_params.rbi +18 -5
  249. data/rbi/dodopayments/models/subscription_status.rbi +16 -10
  250. data/rbi/dodopayments/models/subscription_update_params.rbi +63 -33
  251. data/rbi/dodopayments/models/tax_category.rbi +11 -7
  252. data/rbi/dodopayments/models/time_interval.rbi +10 -7
  253. data/rbi/dodopayments/models/webhook_create_params.rbi +115 -0
  254. data/rbi/dodopayments/models/webhook_create_response.rbi +112 -0
  255. data/rbi/dodopayments/models/webhook_delete_params.rbi +32 -0
  256. data/rbi/dodopayments/models/webhook_event_type.rbi +102 -0
  257. data/rbi/dodopayments/models/webhook_list_params.rbi +54 -0
  258. data/rbi/dodopayments/models/webhook_list_response.rbi +112 -0
  259. data/rbi/dodopayments/models/webhook_payload.rbi +440 -0
  260. data/rbi/dodopayments/models/webhook_retrieve_params.rbi +32 -0
  261. data/rbi/dodopayments/models/webhook_retrieve_response.rbi +112 -0
  262. data/rbi/dodopayments/models/webhook_update_params.rbi +94 -0
  263. data/rbi/dodopayments/models/webhook_update_response.rbi +112 -0
  264. data/rbi/dodopayments/models/webhooks/header_retrieve_params.rbi +34 -0
  265. data/rbi/dodopayments/models/webhooks/header_retrieve_response.rbi +50 -0
  266. data/rbi/dodopayments/models/webhooks/header_update_params.rbi +48 -0
  267. data/rbi/dodopayments/models/your_webhook_url_create_params.rbi +56 -0
  268. data/rbi/dodopayments/models.rbi +50 -8
  269. data/rbi/dodopayments/request_options.rbi +18 -7
  270. data/rbi/dodopayments/resources/addons.rbi +44 -27
  271. data/rbi/dodopayments/resources/brands.rbi +89 -0
  272. data/rbi/dodopayments/resources/customers/customer_portal.rbi +8 -6
  273. data/rbi/dodopayments/resources/customers.rbi +31 -17
  274. data/rbi/dodopayments/resources/discounts.rbi +54 -22
  275. data/rbi/dodopayments/resources/disputes.rbi +26 -14
  276. data/rbi/dodopayments/resources/invoices/payments.rbi +10 -3
  277. data/rbi/dodopayments/resources/invoices.rbi +2 -1
  278. data/rbi/dodopayments/resources/license_key_instances.rbi +25 -10
  279. data/rbi/dodopayments/resources/license_keys.rbi +29 -15
  280. data/rbi/dodopayments/resources/licenses.rbi +25 -12
  281. data/rbi/dodopayments/resources/misc.rbi +7 -4
  282. data/rbi/dodopayments/resources/payments.rbi +61 -27
  283. data/rbi/dodopayments/resources/payouts.rbi +12 -6
  284. data/rbi/dodopayments/resources/products/images.rbi +10 -4
  285. data/rbi/dodopayments/resources/products.rbi +118 -41
  286. data/rbi/dodopayments/resources/refunds.rbi +35 -15
  287. data/rbi/dodopayments/resources/subscriptions.rbi +95 -53
  288. data/rbi/dodopayments/resources/webhook_events.rbi +2 -34
  289. data/rbi/dodopayments/resources/webhooks/headers.rbi +40 -0
  290. data/rbi/dodopayments/resources/webhooks.rbi +127 -0
  291. data/rbi/dodopayments/resources/your_webhook_url.rbi +51 -0
  292. data/sig/dodopayments/client.rbs +6 -0
  293. data/sig/dodopayments/errors.rbs +9 -0
  294. data/sig/dodopayments/internal/cursor_page_pagination.rbs +15 -0
  295. data/sig/dodopayments/internal/transport/base_client.rbs +17 -2
  296. data/sig/dodopayments/internal/transport/pooled_net_requester.rbs +4 -0
  297. data/sig/dodopayments/internal/type/array_of.rbs +3 -0
  298. data/sig/dodopayments/internal/type/base_model.rbs +13 -5
  299. data/sig/dodopayments/internal/type/base_page.rbs +1 -1
  300. data/sig/dodopayments/internal/type/boolean.rbs +3 -0
  301. data/sig/dodopayments/internal/type/converter.rbs +26 -1
  302. data/sig/dodopayments/internal/type/enum.rbs +3 -0
  303. data/sig/dodopayments/internal/type/file_input.rbs +2 -0
  304. data/sig/dodopayments/internal/type/hash_of.rbs +3 -0
  305. data/sig/dodopayments/internal/type/request_parameters.rbs +5 -1
  306. data/sig/dodopayments/internal/type/union.rbs +5 -2
  307. data/sig/dodopayments/internal/type/unknown.rbs +3 -0
  308. data/sig/dodopayments/internal/util.rbs +25 -0
  309. data/sig/dodopayments/internal.rbs +4 -0
  310. data/sig/dodopayments/models/addon_cart_response_item.rbs +1 -1
  311. data/sig/dodopayments/models/addon_create_params.rbs +8 -1
  312. data/sig/dodopayments/models/addon_list_params.rbs +14 -6
  313. data/sig/dodopayments/models/addon_response.rbs +12 -1
  314. data/sig/dodopayments/models/addon_retrieve_params.rbs +1 -1
  315. data/sig/dodopayments/models/addon_update_images_params.rbs +1 -1
  316. data/sig/dodopayments/models/addon_update_images_response.rbs +1 -1
  317. data/sig/dodopayments/models/addon_update_params.rbs +9 -1
  318. data/sig/dodopayments/models/attach_addon.rbs +15 -0
  319. data/sig/dodopayments/models/attach_existing_customer.rbs +1 -1
  320. data/sig/dodopayments/models/billing_address.rbs +7 -1
  321. data/sig/dodopayments/models/brand.rbs +88 -0
  322. data/sig/dodopayments/models/brand_create_params.rbs +46 -0
  323. data/sig/dodopayments/models/{webhook_event_retrieve_params.rbs → brand_list_params.rbs} +3 -3
  324. data/sig/dodopayments/models/brand_list_response.rbs +13 -0
  325. data/sig/dodopayments/models/brand_retrieve_params.rbs +15 -0
  326. data/sig/dodopayments/models/brand_update_images_params.rbs +15 -0
  327. data/sig/dodopayments/models/brand_update_images_response.rbs +15 -0
  328. data/sig/dodopayments/models/brand_update_params.rbs +41 -0
  329. data/sig/dodopayments/models/create_new_customer.rbs +6 -1
  330. data/sig/dodopayments/models/customer.rbs +8 -1
  331. data/sig/dodopayments/models/customer_create_params.rbs +6 -1
  332. data/sig/dodopayments/models/customer_limited_details.rbs +1 -1
  333. data/sig/dodopayments/models/customer_list_params.rbs +20 -6
  334. data/sig/dodopayments/models/customer_portal_session.rbs +1 -1
  335. data/sig/dodopayments/models/customer_request.rbs +2 -3
  336. data/sig/dodopayments/models/customer_retrieve_params.rbs +1 -1
  337. data/sig/dodopayments/models/customer_update_params.rbs +5 -1
  338. data/sig/dodopayments/models/customers/customer_portal_create_params.rbs +9 -4
  339. data/sig/dodopayments/models/discount.rbs +18 -1
  340. data/sig/dodopayments/models/discount_create_params.rbs +15 -1
  341. data/sig/dodopayments/models/discount_delete_params.rbs +1 -1
  342. data/sig/dodopayments/models/discount_list_params.rbs +14 -6
  343. data/sig/dodopayments/models/discount_retrieve_params.rbs +1 -1
  344. data/sig/dodopayments/models/discount_update_params.rbs +15 -1
  345. data/sig/dodopayments/models/dispute.rbs +11 -1
  346. data/sig/dodopayments/models/dispute_list_params.rbs +84 -22
  347. data/sig/dodopayments/models/dispute_list_response.rbs +10 -1
  348. data/sig/dodopayments/models/dispute_retrieve_params.rbs +1 -1
  349. data/sig/dodopayments/models/{dispute_retrieve_response.rbs → get_dispute.rbs} +18 -6
  350. data/sig/dodopayments/models/invoices/payment_retrieve_params.rbs +1 -1
  351. data/sig/dodopayments/models/license_activate_params.rbs +5 -1
  352. data/sig/dodopayments/models/license_deactivate_params.rbs +5 -1
  353. data/sig/dodopayments/models/license_key.rbs +14 -1
  354. data/sig/dodopayments/models/license_key_duration.rbs +4 -1
  355. data/sig/dodopayments/models/license_key_instance.rbs +7 -1
  356. data/sig/dodopayments/models/license_key_instance_list_params.rbs +6 -1
  357. data/sig/dodopayments/models/license_key_instance_retrieve_params.rbs +1 -1
  358. data/sig/dodopayments/models/license_key_instance_update_params.rbs +4 -1
  359. data/sig/dodopayments/models/license_key_list_params.rbs +47 -16
  360. data/sig/dodopayments/models/license_key_retrieve_params.rbs +1 -1
  361. data/sig/dodopayments/models/license_key_update_params.rbs +6 -1
  362. data/sig/dodopayments/models/license_validate_params.rbs +5 -1
  363. data/sig/dodopayments/models/license_validate_response.rbs +1 -1
  364. data/sig/dodopayments/models/misc_list_supported_countries_params.rbs +1 -1
  365. data/sig/dodopayments/models/new_customer.rbs +21 -0
  366. data/sig/dodopayments/models/one_time_product_cart_item.rbs +5 -1
  367. data/sig/dodopayments/models/payment.rbs +60 -17
  368. data/sig/dodopayments/models/payment_create_params.rbs +23 -55
  369. data/sig/dodopayments/models/payment_create_response.rbs +21 -7
  370. data/sig/dodopayments/models/payment_list_params.rbs +85 -22
  371. data/sig/dodopayments/models/payment_list_response.rbs +25 -4
  372. data/sig/dodopayments/models/payment_method_types.rbs +48 -0
  373. data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +15 -0
  374. data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +67 -0
  375. data/sig/dodopayments/models/payment_retrieve_params.rbs +1 -1
  376. data/sig/dodopayments/models/payout_list_params.rbs +14 -6
  377. data/sig/dodopayments/models/payout_list_response.rbs +17 -1
  378. data/sig/dodopayments/models/price.rbs +53 -13
  379. data/sig/dodopayments/models/product.rbs +80 -4
  380. data/sig/dodopayments/models/product_create_params.rbs +45 -4
  381. data/sig/dodopayments/models/product_delete_params.rbs +1 -1
  382. data/sig/dodopayments/models/product_list_params.rbs +29 -10
  383. data/sig/dodopayments/models/product_list_response.rbs +20 -1
  384. data/sig/dodopayments/models/product_retrieve_params.rbs +1 -1
  385. data/sig/dodopayments/models/product_unarchive_params.rbs +1 -1
  386. data/sig/dodopayments/models/product_update_files_params.rbs +23 -0
  387. data/sig/dodopayments/models/product_update_files_response.rbs +15 -0
  388. data/sig/dodopayments/models/product_update_params.rbs +58 -4
  389. data/sig/dodopayments/models/products/image_update_params.rbs +9 -4
  390. data/sig/dodopayments/models/products/image_update_response.rbs +1 -1
  391. data/sig/dodopayments/models/refund.rbs +15 -1
  392. data/sig/dodopayments/models/refund_create_params.rbs +38 -2
  393. data/sig/dodopayments/models/refund_list_params.rbs +54 -19
  394. data/sig/dodopayments/models/refund_retrieve_params.rbs +1 -1
  395. data/sig/dodopayments/models/subscription.rbs +43 -10
  396. data/sig/dodopayments/models/subscription_change_plan_params.rbs +14 -17
  397. data/sig/dodopayments/models/subscription_charge_params.rbs +27 -2
  398. data/sig/dodopayments/models/subscription_charge_response.rbs +1 -1
  399. data/sig/dodopayments/models/subscription_create_params.rbs +58 -73
  400. data/sig/dodopayments/models/subscription_create_response.rbs +26 -7
  401. data/sig/dodopayments/models/subscription_list_params.rbs +64 -19
  402. data/sig/dodopayments/models/subscription_list_response.rbs +39 -7
  403. data/sig/dodopayments/models/subscription_retrieve_params.rbs +1 -1
  404. data/sig/dodopayments/models/subscription_status.rbs +1 -2
  405. data/sig/dodopayments/models/subscription_update_params.rbs +20 -8
  406. data/sig/dodopayments/models/webhook_create_params.rbs +65 -0
  407. data/sig/dodopayments/models/webhook_create_response.rbs +60 -0
  408. data/sig/dodopayments/models/webhook_delete_params.rbs +15 -0
  409. data/sig/dodopayments/models/webhook_event_type.rbs +54 -0
  410. data/sig/dodopayments/models/webhook_list_params.rbs +28 -0
  411. data/sig/dodopayments/models/webhook_list_response.rbs +60 -0
  412. data/sig/dodopayments/models/webhook_payload.rbs +203 -0
  413. data/sig/dodopayments/models/webhook_retrieve_params.rbs +15 -0
  414. data/sig/dodopayments/models/webhook_retrieve_response.rbs +60 -0
  415. data/sig/dodopayments/models/webhook_update_params.rbs +51 -0
  416. data/sig/dodopayments/models/webhook_update_response.rbs +60 -0
  417. data/sig/dodopayments/models/webhooks/header_retrieve_params.rbs +17 -0
  418. data/sig/dodopayments/models/webhooks/header_retrieve_response.rbs +24 -0
  419. data/sig/dodopayments/models/webhooks/header_update_params.rbs +26 -0
  420. data/sig/dodopayments/models/your_webhook_url_create_params.rbs +42 -0
  421. data/sig/dodopayments/models.rbs +39 -3
  422. data/sig/dodopayments/request_options.rbs +1 -1
  423. data/sig/dodopayments/resources/addons.rbs +6 -6
  424. data/sig/dodopayments/resources/brands.rbs +39 -0
  425. data/sig/dodopayments/resources/customers/customer_portal.rbs +2 -2
  426. data/sig/dodopayments/resources/customers.rbs +7 -6
  427. data/sig/dodopayments/resources/discounts.rbs +8 -6
  428. data/sig/dodopayments/resources/disputes.rbs +8 -8
  429. data/sig/dodopayments/resources/license_key_instances.rbs +3 -3
  430. data/sig/dodopayments/resources/license_keys.rbs +8 -8
  431. data/sig/dodopayments/resources/licenses.rbs +1 -1
  432. data/sig/dodopayments/resources/payments.rbs +17 -11
  433. data/sig/dodopayments/resources/payouts.rbs +2 -2
  434. data/sig/dodopayments/resources/products/images.rbs +1 -1
  435. data/sig/dodopayments/resources/products.rbs +20 -7
  436. data/sig/dodopayments/resources/refunds.rbs +10 -9
  437. data/sig/dodopayments/resources/subscriptions.rbs +21 -15
  438. data/sig/dodopayments/resources/webhook_events.rbs +0 -15
  439. data/sig/dodopayments/resources/webhooks/headers.rbs +20 -0
  440. data/sig/dodopayments/resources/webhooks.rbs +48 -0
  441. data/sig/dodopayments/resources/your_webhook_url.rbs +18 -0
  442. metadata +110 -14
  443. data/lib/dodopayments/models/webhook_event.rb +0 -58
  444. data/lib/dodopayments/models/webhook_event_list_params.rb +0 -66
  445. data/rbi/dodopayments/models/webhook_event.rbi +0 -71
  446. data/rbi/dodopayments/models/webhook_event_list_params.rbi +0 -77
  447. data/rbi/dodopayments/models/webhook_event_retrieve_params.rbi +0 -19
  448. data/sig/dodopayments/models/webhook_event.rbs +0 -46
  449. data/sig/dodopayments/models/webhook_event_list_params.rbs +0 -43
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Payments#retrieve_line_items
6
+ class PaymentRetrieveLineItemsResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute currency
8
+ #
9
+ # @return [Symbol, Dodopayments::Models::Currency]
10
+ required :currency, enum: -> { Dodopayments::Currency }
11
+
12
+ # @!attribute items
13
+ #
14
+ # @return [Array<Dodopayments::Models::PaymentRetrieveLineItemsResponse::Item>]
15
+ required :items,
16
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::PaymentRetrieveLineItemsResponse::Item] }
17
+
18
+ # @!method initialize(currency:, items:)
19
+ # @param currency [Symbol, Dodopayments::Models::Currency]
20
+ # @param items [Array<Dodopayments::Models::PaymentRetrieveLineItemsResponse::Item>]
21
+
22
+ class Item < Dodopayments::Internal::Type::BaseModel
23
+ # @!attribute amount
24
+ #
25
+ # @return [Integer]
26
+ required :amount, Integer
27
+
28
+ # @!attribute items_id
29
+ #
30
+ # @return [String]
31
+ required :items_id, String
32
+
33
+ # @!attribute refundable_amount
34
+ #
35
+ # @return [Integer]
36
+ required :refundable_amount, Integer
37
+
38
+ # @!attribute tax
39
+ #
40
+ # @return [Integer]
41
+ required :tax, Integer
42
+
43
+ # @!attribute description
44
+ #
45
+ # @return [String, nil]
46
+ optional :description, String, nil?: true
47
+
48
+ # @!attribute name
49
+ #
50
+ # @return [String, nil]
51
+ optional :name, String, nil?: true
52
+
53
+ # @!method initialize(amount:, items_id:, refundable_amount:, tax:, description: nil, name: nil)
54
+ # @param amount [Integer]
55
+ # @param items_id [String]
56
+ # @param refundable_amount [Integer]
57
+ # @param tax [Integer]
58
+ # @param description [String, nil]
59
+ # @param name [String, nil]
60
+ end
61
+ end
62
+ end
63
+ end
@@ -11,18 +11,18 @@ module Dodopayments
11
11
  # Page number default is 0
12
12
  #
13
13
  # @return [Integer, nil]
14
- optional :page_number, Integer, nil?: true
14
+ optional :page_number, Integer
15
15
 
16
16
  # @!attribute page_size
17
17
  # Page size default is 10 max is 100
18
18
  #
19
19
  # @return [Integer, nil]
20
- optional :page_size, Integer, nil?: true
20
+ optional :page_size, Integer
21
21
 
22
22
  # @!method initialize(page_number: nil, page_size: nil, request_options: {})
23
- # @param page_number [Integer, nil] Page number default is 0
23
+ # @param page_number [Integer] Page number default is 0
24
24
  #
25
- # @param page_size [Integer, nil] Page size default is 10 max is 100
25
+ # @param page_size [Integer] Page size default is 10 max is 100
26
26
  #
27
27
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
28
28
  end
@@ -29,9 +29,10 @@ module Dodopayments
29
29
  required :created_at, Time
30
30
 
31
31
  # @!attribute currency
32
+ # The currency of the payout, represented as an ISO 4217 currency code.
32
33
  #
33
34
  # @return [Symbol, Dodopayments::Models::Currency]
34
- required :currency, enum: -> { Dodopayments::Models::Currency }
35
+ required :currency, enum: -> { Dodopayments::Currency }
35
36
 
36
37
  # @!attribute fee
37
38
  # The fee charged for processing the payout.
@@ -58,6 +59,7 @@ module Dodopayments
58
59
  required :refunds, Integer
59
60
 
60
61
  # @!attribute status
62
+ # The current status of the payout.
61
63
  #
62
64
  # @return [Symbol, Dodopayments::Models::PayoutListResponse::Status]
63
65
  required :status, enum: -> { Dodopayments::Models::PayoutListResponse::Status }
@@ -101,7 +103,7 @@ module Dodopayments
101
103
  #
102
104
  # @param created_at [Time] The timestamp when the payout was created, in UTC.
103
105
  #
104
- # @param currency [Symbol, Dodopayments::Models::Currency]
106
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
105
107
  #
106
108
  # @param fee [Integer] The fee charged for processing the payout.
107
109
  #
@@ -111,7 +113,7 @@ module Dodopayments
111
113
  #
112
114
  # @param refunds [Integer] The total value of refunds associated with the payout.
113
115
  #
114
- # @param status [Symbol, Dodopayments::Models::PayoutListResponse::Status]
116
+ # @param status [Symbol, Dodopayments::Models::PayoutListResponse::Status] The current status of the payout.
115
117
  #
116
118
  # @param tax [Integer] The tax applied to the payout.
117
119
  #
@@ -123,6 +125,8 @@ module Dodopayments
123
125
  #
124
126
  # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
125
127
 
128
+ # The current status of the payout.
129
+ #
126
130
  # @see Dodopayments::Models::PayoutListResponse#status
127
131
  module Status
128
132
  extend Dodopayments::Internal::Type::Enum
@@ -2,20 +2,22 @@
2
2
 
3
3
  module Dodopayments
4
4
  module Models
5
+ # One-time price details.
5
6
  module Price
6
7
  extend Dodopayments::Internal::Type::Union
7
8
 
8
- discriminator :type
9
+ # One-time price details.
10
+ variant -> { Dodopayments::Price::OneTimePrice }
9
11
 
10
- variant :one_time_price, -> { Dodopayments::Models::Price::OneTimePrice }
11
-
12
- variant :recurring_price, -> { Dodopayments::Models::Price::RecurringPrice }
12
+ # Recurring price details.
13
+ variant -> { Dodopayments::Price::RecurringPrice }
13
14
 
14
15
  class OneTimePrice < Dodopayments::Internal::Type::BaseModel
15
16
  # @!attribute currency
17
+ # The currency in which the payment is made.
16
18
  #
17
19
  # @return [Symbol, Dodopayments::Models::Currency]
18
- required :currency, enum: -> { Dodopayments::Models::Currency }
20
+ required :currency, enum: -> { Dodopayments::Currency }
19
21
 
20
22
  # @!attribute discount
21
23
  # Discount applied to the price, represented as a percentage (0 to 100).
@@ -42,8 +44,8 @@ module Dodopayments
42
44
 
43
45
  # @!attribute type
44
46
  #
45
- # @return [Symbol, :one_time_price]
46
- required :type, const: :one_time_price
47
+ # @return [Symbol, Dodopayments::Models::Price::OneTimePrice::Type]
48
+ required :type, enum: -> { Dodopayments::Price::OneTimePrice::Type }
47
49
 
48
50
  # @!attribute pay_what_you_want
49
51
  # Indicates whether the customer can pay any amount they choose. If set to `true`,
@@ -66,33 +68,45 @@ module Dodopayments
66
68
  # @return [Boolean, nil]
67
69
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
68
70
 
69
- # @!method initialize(currency:, discount:, price:, purchasing_power_parity:, pay_what_you_want: nil, suggested_price: nil, tax_inclusive: nil, type: :one_time_price)
71
+ # @!method initialize(currency:, discount:, price:, purchasing_power_parity:, type:, pay_what_you_want: nil, suggested_price: nil, tax_inclusive: nil)
70
72
  # Some parameter documentations has been truncated, see
71
73
  # {Dodopayments::Models::Price::OneTimePrice} for more details.
72
74
  #
73
- # @param currency [Symbol, Dodopayments::Models::Currency]
75
+ # One-time price details.
76
+ #
77
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency in which the payment is made.
74
78
  #
75
79
  # @param discount [Float] Discount applied to the price, represented as a percentage (0 to 100).
76
80
  #
77
81
  # @param price [Integer] The payment amount, in the smallest denomination of the currency (e.g., cents fo
78
- # ...
79
82
  #
80
- # @param purchasing_power_parity [Boolean] Indicates if purchasing power parity adjustments are applied to the price. ...
83
+ # @param purchasing_power_parity [Boolean] Indicates if purchasing power parity adjustments are applied to the price.
81
84
  #
82
- # @param pay_what_you_want [Boolean] Indicates whether the customer can pay any amount they choose. ...
85
+ # @param type [Symbol, Dodopayments::Models::Price::OneTimePrice::Type]
83
86
  #
84
- # @param suggested_price [Integer, nil] A suggested price for the user to pay. This value is only considered if ...
87
+ # @param pay_what_you_want [Boolean] Indicates whether the customer can pay any amount they choose.
85
88
  #
86
- # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive.
89
+ # @param suggested_price [Integer, nil] A suggested price for the user to pay. This value is only considered if
87
90
  #
88
- # @param type [Symbol, :one_time_price]
91
+ # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive.
92
+
93
+ # @see Dodopayments::Models::Price::OneTimePrice#type
94
+ module Type
95
+ extend Dodopayments::Internal::Type::Enum
96
+
97
+ ONE_TIME_PRICE = :one_time_price
98
+
99
+ # @!method self.values
100
+ # @return [Array<Symbol>]
101
+ end
89
102
  end
90
103
 
91
104
  class RecurringPrice < Dodopayments::Internal::Type::BaseModel
92
105
  # @!attribute currency
106
+ # The currency in which the payment is made.
93
107
  #
94
108
  # @return [Symbol, Dodopayments::Models::Currency]
95
- required :currency, enum: -> { Dodopayments::Models::Currency }
109
+ required :currency, enum: -> { Dodopayments::Currency }
96
110
 
97
111
  # @!attribute discount
98
112
  # Discount applied to the price, represented as a percentage (0 to 100).
@@ -108,9 +122,10 @@ module Dodopayments
108
122
  required :payment_frequency_count, Integer
109
123
 
110
124
  # @!attribute payment_frequency_interval
125
+ # The time interval for the payment frequency (e.g., day, month, year).
111
126
  #
112
127
  # @return [Symbol, Dodopayments::Models::TimeInterval]
113
- required :payment_frequency_interval, enum: -> { Dodopayments::Models::TimeInterval }
128
+ required :payment_frequency_interval, enum: -> { Dodopayments::TimeInterval }
114
129
 
115
130
  # @!attribute price
116
131
  # The payment amount. Represented in the lowest denomination of the currency
@@ -134,14 +149,15 @@ module Dodopayments
134
149
  required :subscription_period_count, Integer
135
150
 
136
151
  # @!attribute subscription_period_interval
152
+ # The time interval for the subscription period (e.g., day, month, year).
137
153
  #
138
154
  # @return [Symbol, Dodopayments::Models::TimeInterval]
139
- required :subscription_period_interval, enum: -> { Dodopayments::Models::TimeInterval }
155
+ required :subscription_period_interval, enum: -> { Dodopayments::TimeInterval }
140
156
 
141
157
  # @!attribute type
142
158
  #
143
- # @return [Symbol, :recurring_price]
144
- required :type, const: :recurring_price
159
+ # @return [Symbol, Dodopayments::Models::Price::RecurringPrice::Type]
160
+ required :type, enum: -> { Dodopayments::Price::RecurringPrice::Type }
145
161
 
146
162
  # @!attribute tax_inclusive
147
163
  # Indicates if the price is tax inclusive
@@ -155,32 +171,43 @@ module Dodopayments
155
171
  # @return [Integer, nil]
156
172
  optional :trial_period_days, Integer
157
173
 
158
- # @!method initialize(currency:, discount:, payment_frequency_count:, payment_frequency_interval:, price:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, tax_inclusive: nil, trial_period_days: nil, type: :recurring_price)
174
+ # @!method initialize(currency:, discount:, payment_frequency_count:, payment_frequency_interval:, price:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, type:, tax_inclusive: nil, trial_period_days: nil)
159
175
  # Some parameter documentations has been truncated, see
160
176
  # {Dodopayments::Models::Price::RecurringPrice} for more details.
161
177
  #
162
- # @param currency [Symbol, Dodopayments::Models::Currency]
178
+ # Recurring price details.
179
+ #
180
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency in which the payment is made.
163
181
  #
164
182
  # @param discount [Float] Discount applied to the price, represented as a percentage (0 to 100).
165
183
  #
166
- # @param payment_frequency_count [Integer] Number of units for the payment frequency. ...
184
+ # @param payment_frequency_count [Integer] Number of units for the payment frequency.
167
185
  #
168
- # @param payment_frequency_interval [Symbol, Dodopayments::Models::TimeInterval]
186
+ # @param payment_frequency_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the payment frequency (e.g., day, month, year).
169
187
  #
170
188
  # @param price [Integer] The payment amount. Represented in the lowest denomination of the currency (e.g.
171
- # ...
172
189
  #
173
- # @param purchasing_power_parity [Boolean] Indicates if purchasing power parity adjustments are applied to the price. ...
190
+ # @param purchasing_power_parity [Boolean] Indicates if purchasing power parity adjustments are applied to the price.
191
+ #
192
+ # @param subscription_period_count [Integer] Number of units for the subscription period.
174
193
  #
175
- # @param subscription_period_count [Integer] Number of units for the subscription period. ...
194
+ # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the subscription period (e.g., day, month, year).
176
195
  #
177
- # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval]
196
+ # @param type [Symbol, Dodopayments::Models::Price::RecurringPrice::Type]
178
197
  #
179
198
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
180
199
  #
181
200
  # @param trial_period_days [Integer] Number of days for the trial period. A value of `0` indicates no trial period.
182
- #
183
- # @param type [Symbol, :recurring_price]
201
+
202
+ # @see Dodopayments::Models::Price::RecurringPrice#type
203
+ module Type
204
+ extend Dodopayments::Internal::Type::Enum
205
+
206
+ RECURRING_PRICE = :recurring_price
207
+
208
+ # @!method self.values
209
+ # @return [Array<Symbol>]
210
+ end
184
211
  end
185
212
 
186
213
  # @!method self.variants
@@ -4,6 +4,11 @@ module Dodopayments
4
4
  module Models
5
5
  # @see Dodopayments::Resources::Products#create
6
6
  class Product < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute brand_id
8
+ #
9
+ # @return [String]
10
+ required :brand_id, String
11
+
7
12
  # @!attribute business_id
8
13
  # Unique identifier for the business to which the product belongs.
9
14
  #
@@ -28,10 +33,17 @@ module Dodopayments
28
33
  # @return [Boolean]
29
34
  required :license_key_enabled, Dodopayments::Internal::Type::Boolean
30
35
 
36
+ # @!attribute metadata
37
+ # Additional custom data associated with the product
38
+ #
39
+ # @return [Hash{Symbol=>String}]
40
+ required :metadata, Dodopayments::Internal::Type::HashOf[String]
41
+
31
42
  # @!attribute price
43
+ # Pricing information for the product.
32
44
  #
33
45
  # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
34
- required :price, union: -> { Dodopayments::Models::Price }
46
+ required :price, union: -> { Dodopayments::Price }
35
47
 
36
48
  # @!attribute product_id
37
49
  # Unique identifier for the product.
@@ -40,11 +52,10 @@ module Dodopayments
40
52
  required :product_id, String
41
53
 
42
54
  # @!attribute tax_category
43
- # Represents the different categories of taxation applicable to various products
44
- # and services.
55
+ # Tax category associated with the product.
45
56
  #
46
57
  # @return [Symbol, Dodopayments::Models::TaxCategory]
47
- required :tax_category, enum: -> { Dodopayments::Models::TaxCategory }
58
+ required :tax_category, enum: -> { Dodopayments::TaxCategory }
48
59
 
49
60
  # @!attribute updated_at
50
61
  # Timestamp when the product was last updated.
@@ -64,6 +75,11 @@ module Dodopayments
64
75
  # @return [String, nil]
65
76
  optional :description, String, nil?: true
66
77
 
78
+ # @!attribute digital_product_delivery
79
+ #
80
+ # @return [Dodopayments::Models::Product::DigitalProductDelivery, nil]
81
+ optional :digital_product_delivery, -> { Dodopayments::Product::DigitalProductDelivery }, nil?: true
82
+
67
83
  # @!attribute image
68
84
  # URL of the product image, optional.
69
85
  #
@@ -83,9 +99,10 @@ module Dodopayments
83
99
  optional :license_key_activations_limit, Integer, nil?: true
84
100
 
85
101
  # @!attribute license_key_duration
102
+ # Duration of the license key validity, if enabled.
86
103
  #
87
104
  # @return [Dodopayments::Models::LicenseKeyDuration, nil]
88
- optional :license_key_duration, -> { Dodopayments::Models::LicenseKeyDuration }, nil?: true
105
+ optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
89
106
 
90
107
  # @!attribute name
91
108
  # Name of the product, optional.
@@ -93,9 +110,8 @@ module Dodopayments
93
110
  # @return [String, nil]
94
111
  optional :name, String, nil?: true
95
112
 
96
- # @!method initialize(business_id:, created_at:, is_recurring:, license_key_enabled:, price:, product_id:, tax_category:, updated_at:, addons: nil, description: nil, image: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, name: nil)
97
- # Some parameter documentations has been truncated, see
98
- # {Dodopayments::Models::Product} for more details.
113
+ # @!method initialize(brand_id:, business_id:, created_at:, is_recurring:, license_key_enabled:, metadata:, price:, product_id:, tax_category:, updated_at:, addons: nil, description: nil, digital_product_delivery: nil, image: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, name: nil)
114
+ # @param brand_id [String]
99
115
  #
100
116
  # @param business_id [String] Unique identifier for the business to which the product belongs.
101
117
  #
@@ -105,12 +121,13 @@ module Dodopayments
105
121
  #
106
122
  # @param license_key_enabled [Boolean] Indicates whether the product requires a license key.
107
123
  #
108
- # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
124
+ # @param metadata [Hash{Symbol=>String}] Additional custom data associated with the product
125
+ #
126
+ # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice] Pricing information for the product.
109
127
  #
110
128
  # @param product_id [String] Unique identifier for the product.
111
129
  #
112
- # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
113
- # ...
130
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Tax category associated with the product.
114
131
  #
115
132
  # @param updated_at [Time] Timestamp when the product was last updated.
116
133
  #
@@ -118,15 +135,71 @@ module Dodopayments
118
135
  #
119
136
  # @param description [String, nil] Description of the product, optional.
120
137
  #
138
+ # @param digital_product_delivery [Dodopayments::Models::Product::DigitalProductDelivery, nil]
139
+ #
121
140
  # @param image [String, nil] URL of the product image, optional.
122
141
  #
123
142
  # @param license_key_activation_message [String, nil] Message sent upon license key activation, if applicable.
124
143
  #
125
144
  # @param license_key_activations_limit [Integer, nil] Limit on the number of activations for the license key, if enabled.
126
145
  #
127
- # @param license_key_duration [Dodopayments::Models::LicenseKeyDuration, nil]
146
+ # @param license_key_duration [Dodopayments::Models::LicenseKeyDuration, nil] Duration of the license key validity, if enabled.
128
147
  #
129
148
  # @param name [String, nil] Name of the product, optional.
149
+
150
+ # @see Dodopayments::Models::Product#digital_product_delivery
151
+ class DigitalProductDelivery < Dodopayments::Internal::Type::BaseModel
152
+ # @!attribute external_url
153
+ # External URL to digital product
154
+ #
155
+ # @return [String, nil]
156
+ optional :external_url, String, nil?: true
157
+
158
+ # @!attribute files
159
+ # Uploaded files ids of digital product
160
+ #
161
+ # @return [Array<Dodopayments::Models::Product::DigitalProductDelivery::File>, nil]
162
+ optional :files,
163
+ -> {
164
+ Dodopayments::Internal::Type::ArrayOf[Dodopayments::Product::DigitalProductDelivery::File]
165
+ },
166
+ nil?: true
167
+
168
+ # @!attribute instructions
169
+ # Instructions to download and use the digital product
170
+ #
171
+ # @return [String, nil]
172
+ optional :instructions, String, nil?: true
173
+
174
+ # @!method initialize(external_url: nil, files: nil, instructions: nil)
175
+ # @param external_url [String, nil] External URL to digital product
176
+ #
177
+ # @param files [Array<Dodopayments::Models::Product::DigitalProductDelivery::File>, nil] Uploaded files ids of digital product
178
+ #
179
+ # @param instructions [String, nil] Instructions to download and use the digital product
180
+
181
+ class File < Dodopayments::Internal::Type::BaseModel
182
+ # @!attribute file_id
183
+ #
184
+ # @return [String]
185
+ required :file_id, String
186
+
187
+ # @!attribute file_name
188
+ #
189
+ # @return [String]
190
+ required :file_name, String
191
+
192
+ # @!attribute url
193
+ #
194
+ # @return [String]
195
+ required :url, String
196
+
197
+ # @!method initialize(file_id:, file_name:, url:)
198
+ # @param file_id [String]
199
+ # @param file_name [String]
200
+ # @param url [String]
201
+ end
202
+ end
130
203
  end
131
204
  end
132
205
  end
@@ -8,16 +8,16 @@ module Dodopayments
8
8
  include Dodopayments::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute price
11
+ # Price configuration for the product
11
12
  #
12
13
  # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
13
- required :price, union: -> { Dodopayments::Models::Price }
14
+ required :price, union: -> { Dodopayments::Price }
14
15
 
15
16
  # @!attribute tax_category
16
- # Represents the different categories of taxation applicable to various products
17
- # and services.
17
+ # Tax category applied to this product
18
18
  #
19
19
  # @return [Symbol, Dodopayments::Models::TaxCategory]
20
- required :tax_category, enum: -> { Dodopayments::Models::TaxCategory }
20
+ required :tax_category, enum: -> { Dodopayments::TaxCategory }
21
21
 
22
22
  # @!attribute addons
23
23
  # Addons available for subscription product
@@ -25,12 +25,26 @@ module Dodopayments
25
25
  # @return [Array<String>, nil]
26
26
  optional :addons, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
27
27
 
28
+ # @!attribute brand_id
29
+ # Brand id for the product, if not provided will default to primary brand
30
+ #
31
+ # @return [String, nil]
32
+ optional :brand_id, String, nil?: true
33
+
28
34
  # @!attribute description
29
35
  # Optional description of the product
30
36
  #
31
37
  # @return [String, nil]
32
38
  optional :description, String, nil?: true
33
39
 
40
+ # @!attribute digital_product_delivery
41
+ # Choose how you would like you digital product delivered
42
+ #
43
+ # @return [Dodopayments::Models::ProductCreateParams::DigitalProductDelivery, nil]
44
+ optional :digital_product_delivery,
45
+ -> { Dodopayments::ProductCreateParams::DigitalProductDelivery },
46
+ nil?: true
47
+
34
48
  # @!attribute license_key_activation_message
35
49
  # Optional message displayed during license key activation
36
50
  #
@@ -44,9 +58,12 @@ module Dodopayments
44
58
  optional :license_key_activations_limit, Integer, nil?: true
45
59
 
46
60
  # @!attribute license_key_duration
61
+ # Duration configuration for the license key. Set to null if you don't want the
62
+ # license key to expire. For subscriptions, the lifetime of the license key is
63
+ # tied to the subscription period
47
64
  #
48
65
  # @return [Dodopayments::Models::LicenseKeyDuration, nil]
49
- optional :license_key_duration, -> { Dodopayments::Models::LicenseKeyDuration }, nil?: true
66
+ optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
50
67
 
51
68
  # @!attribute license_key_enabled
52
69
  # When true, generates and sends a license key to your customer. Defaults to false
@@ -54,36 +71,68 @@ module Dodopayments
54
71
  # @return [Boolean, nil]
55
72
  optional :license_key_enabled, Dodopayments::Internal::Type::Boolean, nil?: true
56
73
 
74
+ # @!attribute metadata
75
+ # Additional metadata for the product
76
+ #
77
+ # @return [Hash{Symbol=>String}, nil]
78
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String]
79
+
57
80
  # @!attribute name
58
81
  # Optional name of the product
59
82
  #
60
83
  # @return [String, nil]
61
84
  optional :name, String, nil?: true
62
85
 
63
- # @!method initialize(price:, tax_category:, addons: nil, description: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, name: nil, request_options: {})
86
+ # @!method initialize(price:, tax_category:, addons: nil, brand_id: nil, description: nil, digital_product_delivery: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, name: nil, request_options: {})
64
87
  # Some parameter documentations has been truncated, see
65
88
  # {Dodopayments::Models::ProductCreateParams} for more details.
66
89
  #
67
- # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
90
+ # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice] Price configuration for the product
68
91
  #
69
- # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
70
- # ...
92
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Tax category applied to this product
71
93
  #
72
94
  # @param addons [Array<String>, nil] Addons available for subscription product
73
95
  #
96
+ # @param brand_id [String, nil] Brand id for the product, if not provided will default to primary brand
97
+ #
74
98
  # @param description [String, nil] Optional description of the product
75
99
  #
100
+ # @param digital_product_delivery [Dodopayments::Models::ProductCreateParams::DigitalProductDelivery, nil] Choose how you would like you digital product delivered
101
+ #
76
102
  # @param license_key_activation_message [String, nil] Optional message displayed during license key activation
77
103
  #
78
- # @param license_key_activations_limit [Integer, nil] The number of times the license key can be activated. ...
104
+ # @param license_key_activations_limit [Integer, nil] The number of times the license key can be activated.
105
+ #
106
+ # @param license_key_duration [Dodopayments::Models::LicenseKeyDuration, nil] Duration configuration for the license key.
79
107
  #
80
- # @param license_key_duration [Dodopayments::Models::LicenseKeyDuration, nil]
108
+ # @param license_key_enabled [Boolean, nil] When true, generates and sends a license key to your customer.
81
109
  #
82
- # @param license_key_enabled [Boolean, nil] When true, generates and sends a license key to your customer. ...
110
+ # @param metadata [Hash{Symbol=>String}] Additional metadata for the product
83
111
  #
84
112
  # @param name [String, nil] Optional name of the product
85
113
  #
86
114
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
115
+
116
+ class DigitalProductDelivery < Dodopayments::Internal::Type::BaseModel
117
+ # @!attribute external_url
118
+ # External URL to digital product
119
+ #
120
+ # @return [String, nil]
121
+ optional :external_url, String, nil?: true
122
+
123
+ # @!attribute instructions
124
+ # Instructions to download and use the digital product
125
+ #
126
+ # @return [String, nil]
127
+ optional :instructions, String, nil?: true
128
+
129
+ # @!method initialize(external_url: nil, instructions: nil)
130
+ # Choose how you would like you digital product delivered
131
+ #
132
+ # @param external_url [String, nil] External URL to digital product
133
+ #
134
+ # @param instructions [String, nil] Instructions to download and use the digital product
135
+ end
87
136
  end
88
137
  end
89
138
  end
@@ -13,17 +13,23 @@ module Dodopayments
13
13
  # @return [Boolean, nil]
14
14
  optional :archived, Dodopayments::Internal::Type::Boolean
15
15
 
16
+ # @!attribute brand_id
17
+ # filter by Brand id
18
+ #
19
+ # @return [String, nil]
20
+ optional :brand_id, String
21
+
16
22
  # @!attribute page_number
17
23
  # Page number default is 0
18
24
  #
19
25
  # @return [Integer, nil]
20
- optional :page_number, Integer, nil?: true
26
+ optional :page_number, Integer
21
27
 
22
28
  # @!attribute page_size
23
29
  # Page size default is 10 max is 100
24
30
  #
25
31
  # @return [Integer, nil]
26
- optional :page_size, Integer, nil?: true
32
+ optional :page_size, Integer
27
33
 
28
34
  # @!attribute recurring
29
35
  # Filter products by pricing type:
@@ -33,19 +39,21 @@ module Dodopayments
33
39
  # - `null` or absent: Show both types of products
34
40
  #
35
41
  # @return [Boolean, nil]
36
- optional :recurring, Dodopayments::Internal::Type::Boolean, nil?: true
42
+ optional :recurring, Dodopayments::Internal::Type::Boolean
37
43
 
38
- # @!method initialize(archived: nil, page_number: nil, page_size: nil, recurring: nil, request_options: {})
44
+ # @!method initialize(archived: nil, brand_id: nil, page_number: nil, page_size: nil, recurring: nil, request_options: {})
39
45
  # Some parameter documentations has been truncated, see
40
46
  # {Dodopayments::Models::ProductListParams} for more details.
41
47
  #
42
48
  # @param archived [Boolean] List archived products
43
49
  #
44
- # @param page_number [Integer, nil] Page number default is 0
50
+ # @param brand_id [String] filter by Brand id
51
+ #
52
+ # @param page_number [Integer] Page number default is 0
45
53
  #
46
- # @param page_size [Integer, nil] Page size default is 10 max is 100
54
+ # @param page_size [Integer] Page size default is 10 max is 100
47
55
  #
48
- # @param recurring [Boolean, nil] Filter products by pricing type: ...
56
+ # @param recurring [Boolean] Filter products by pricing type:
49
57
  #
50
58
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
51
59
  end