dodopayments 2.9.1 → 2.11.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 (302) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +9 -9
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/internal/transport/base_client.rb +2 -0
  6. data/lib/dodopayments/internal/type/union.rb +21 -7
  7. data/lib/dodopayments/models/abandoned_checkout_detected_webhook_event.rb +4 -16
  8. data/lib/dodopayments/models/abandoned_checkout_recovered_webhook_event.rb +4 -16
  9. data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
  10. data/lib/dodopayments/models/checkout_session_request.rb +25 -2
  11. data/lib/dodopayments/models/checkout_session_response.rb +33 -1
  12. data/lib/dodopayments/models/credit_added_webhook_event.rb +4 -16
  13. data/lib/dodopayments/models/credit_balance_low_webhook_event.rb +4 -16
  14. data/lib/dodopayments/models/credit_deducted_webhook_event.rb +4 -16
  15. data/lib/dodopayments/models/credit_expired_webhook_event.rb +4 -16
  16. data/lib/dodopayments/models/credit_manual_adjustment_webhook_event.rb +4 -16
  17. data/lib/dodopayments/models/credit_overage_charged_webhook_event.rb +4 -16
  18. data/lib/dodopayments/models/credit_overage_reset_webhook_event.rb +4 -16
  19. data/lib/dodopayments/models/credit_rolled_over_webhook_event.rb +4 -16
  20. data/lib/dodopayments/models/credit_rollover_forfeited_webhook_event.rb +4 -16
  21. data/lib/dodopayments/models/discount_detail.rb +143 -0
  22. data/lib/dodopayments/models/dispute_accepted_webhook_event.rb +4 -16
  23. data/lib/dodopayments/models/dispute_cancelled_webhook_event.rb +4 -16
  24. data/lib/dodopayments/models/dispute_challenged_webhook_event.rb +4 -16
  25. data/lib/dodopayments/models/dispute_expired_webhook_event.rb +4 -16
  26. data/lib/dodopayments/models/dispute_lost_webhook_event.rb +4 -16
  27. data/lib/dodopayments/models/dispute_opened_webhook_event.rb +4 -16
  28. data/lib/dodopayments/models/dispute_won_webhook_event.rb +4 -16
  29. data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +4 -16
  30. data/lib/dodopayments/models/dunning_started_webhook_event.rb +4 -16
  31. data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +4 -16
  32. data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +4 -16
  33. data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +4 -16
  34. data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +4 -16
  35. data/lib/dodopayments/models/filter_type.rb +71 -0
  36. data/lib/dodopayments/models/github_permission.rb +19 -0
  37. data/lib/dodopayments/models/integration_config.rb +3 -19
  38. data/lib/dodopayments/models/integration_config_response.rb +3 -19
  39. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
  40. data/lib/dodopayments/models/license_key_created_webhook_event.rb +4 -16
  41. data/lib/dodopayments/models/meter_filter.rb +3 -331
  42. data/lib/dodopayments/models/payment.rb +15 -3
  43. data/lib/dodopayments/models/payment_cancelled_webhook_event.rb +4 -16
  44. data/lib/dodopayments/models/payment_create_params.rb +25 -3
  45. data/lib/dodopayments/models/payment_create_response.rb +14 -3
  46. data/lib/dodopayments/models/payment_failed_webhook_event.rb +4 -16
  47. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  48. data/lib/dodopayments/models/payment_processing_webhook_event.rb +4 -16
  49. data/lib/dodopayments/models/payment_succeeded_webhook_event.rb +4 -16
  50. data/lib/dodopayments/models/payout_list_response.rb +6 -3
  51. data/lib/dodopayments/models/price.rb +20 -48
  52. data/lib/dodopayments/models/product.rb +3 -3
  53. data/lib/dodopayments/models/product_collection.rb +74 -0
  54. data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
  55. data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
  56. data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
  57. data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
  58. data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
  59. data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
  60. data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
  61. data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
  62. data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
  63. data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
  64. data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
  65. data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
  66. data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
  67. data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
  68. data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
  69. data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
  70. data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
  71. data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
  72. data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
  73. data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
  74. data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
  75. data/lib/dodopayments/models/product_create_params.rb +3 -3
  76. data/lib/dodopayments/models/product_item_req.rb +42 -1
  77. data/lib/dodopayments/models/product_update_params.rb +3 -3
  78. data/lib/dodopayments/models/refund_failed_webhook_event.rb +4 -16
  79. data/lib/dodopayments/models/refund_succeeded_webhook_event.rb +4 -16
  80. data/lib/dodopayments/models/subscription.rb +24 -5
  81. data/lib/dodopayments/models/subscription_active_webhook_event.rb +4 -16
  82. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +4 -16
  83. data/lib/dodopayments/models/subscription_create_params.rb +25 -3
  84. data/lib/dodopayments/models/subscription_create_response.rb +14 -3
  85. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +4 -16
  86. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +4 -16
  87. data/lib/dodopayments/models/subscription_list_response.rb +45 -5
  88. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +4 -16
  89. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +4 -16
  90. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +21 -49
  91. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +4 -16
  92. data/lib/dodopayments/models/subscription_update_params.rb +12 -1
  93. data/lib/dodopayments/models/subscription_update_payment_method_params.rb +19 -37
  94. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +4 -16
  95. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +41 -39
  96. data/lib/dodopayments/models/unwrap_webhook_event.rb +41 -39
  97. data/lib/dodopayments/models/update_subscription_plan_req.rb +17 -6
  98. data/lib/dodopayments/models/webhook_event_type.rb +1 -2
  99. data/lib/dodopayments/models/webhook_payload.rb +52 -143
  100. data/lib/dodopayments/models.rb +24 -0
  101. data/lib/dodopayments/resources/checkout_sessions.rb +12 -4
  102. data/lib/dodopayments/resources/invoices/payments.rb +18 -0
  103. data/lib/dodopayments/resources/payments.rb +6 -2
  104. data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
  105. data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
  106. data/lib/dodopayments/resources/product_collections.rb +179 -0
  107. data/lib/dodopayments/resources/subscriptions.rb +20 -10
  108. data/lib/dodopayments/version.rb +1 -1
  109. data/lib/dodopayments.rb +29 -0
  110. data/rbi/dodopayments/client.rbi +3 -0
  111. data/rbi/dodopayments/models/abandoned_checkout_detected_webhook_event.rbi +4 -40
  112. data/rbi/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbi +4 -40
  113. data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
  114. data/rbi/dodopayments/models/checkout_session_request.rbi +26 -0
  115. data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
  116. data/rbi/dodopayments/models/credit_added_webhook_event.rbi +4 -29
  117. data/rbi/dodopayments/models/credit_balance_low_webhook_event.rbi +4 -33
  118. data/rbi/dodopayments/models/credit_deducted_webhook_event.rbi +4 -33
  119. data/rbi/dodopayments/models/credit_expired_webhook_event.rbi +4 -33
  120. data/rbi/dodopayments/models/credit_manual_adjustment_webhook_event.rbi +4 -39
  121. data/rbi/dodopayments/models/credit_overage_charged_webhook_event.rbi +4 -36
  122. data/rbi/dodopayments/models/credit_overage_reset_webhook_event.rbi +4 -36
  123. data/rbi/dodopayments/models/credit_rolled_over_webhook_event.rbi +4 -33
  124. data/rbi/dodopayments/models/credit_rollover_forfeited_webhook_event.rbi +4 -40
  125. data/rbi/dodopayments/models/discount_detail.rbi +161 -0
  126. data/rbi/dodopayments/models/dispute_accepted_webhook_event.rbi +4 -33
  127. data/rbi/dodopayments/models/dispute_cancelled_webhook_event.rbi +4 -33
  128. data/rbi/dodopayments/models/dispute_challenged_webhook_event.rbi +4 -34
  129. data/rbi/dodopayments/models/dispute_expired_webhook_event.rbi +4 -33
  130. data/rbi/dodopayments/models/dispute_lost_webhook_event.rbi +4 -29
  131. data/rbi/dodopayments/models/dispute_opened_webhook_event.rbi +4 -33
  132. data/rbi/dodopayments/models/dispute_won_webhook_event.rbi +4 -29
  133. data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +4 -33
  134. data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +4 -33
  135. data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +4 -40
  136. data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +4 -40
  137. data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +4 -39
  138. data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +4 -40
  139. data/rbi/dodopayments/models/filter_type.rbi +112 -0
  140. data/rbi/dodopayments/models/github_permission.rbi +26 -0
  141. data/rbi/dodopayments/models/integration_config.rbi +3 -59
  142. data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
  143. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
  144. data/rbi/dodopayments/models/license_key_created_webhook_event.rbi +4 -34
  145. data/rbi/dodopayments/models/meter_filter.rbi +3 -572
  146. data/rbi/dodopayments/models/payment.rbi +10 -2
  147. data/rbi/dodopayments/models/payment_cancelled_webhook_event.rbi +4 -33
  148. data/rbi/dodopayments/models/payment_create_params.rbi +26 -2
  149. data/rbi/dodopayments/models/payment_create_response.rbi +12 -2
  150. data/rbi/dodopayments/models/payment_failed_webhook_event.rbi +4 -33
  151. data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
  152. data/rbi/dodopayments/models/payment_processing_webhook_event.rbi +4 -34
  153. data/rbi/dodopayments/models/payment_succeeded_webhook_event.rbi +4 -33
  154. data/rbi/dodopayments/models/price.rbi +18 -90
  155. data/rbi/dodopayments/models/product_collection.rbi +108 -0
  156. data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
  157. data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
  158. data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
  159. data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
  160. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
  161. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
  162. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
  163. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
  164. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
  165. data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
  166. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
  167. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
  168. data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
  169. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
  170. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
  171. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
  172. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
  173. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
  174. data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
  175. data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
  176. data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
  177. data/rbi/dodopayments/models/product_item_req.rbi +74 -3
  178. data/rbi/dodopayments/models/refund_failed_webhook_event.rbi +4 -31
  179. data/rbi/dodopayments/models/refund_succeeded_webhook_event.rbi +4 -33
  180. data/rbi/dodopayments/models/subscription.rbi +22 -4
  181. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +4 -36
  182. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +4 -36
  183. data/rbi/dodopayments/models/subscription_create_params.rbi +26 -2
  184. data/rbi/dodopayments/models/subscription_create_response.rbi +12 -2
  185. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +4 -36
  186. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +4 -36
  187. data/rbi/dodopayments/models/subscription_list_response.rbi +77 -4
  188. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +4 -36
  189. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +4 -40
  190. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +18 -123
  191. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +4 -36
  192. data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
  193. data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +28 -112
  194. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +4 -36
  195. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +18 -8
  196. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -4
  197. data/rbi/dodopayments/models/webhook_payload.rbi +46 -466
  198. data/rbi/dodopayments/models.rbi +31 -0
  199. data/rbi/dodopayments/resources/checkout_sessions.rbi +22 -0
  200. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  201. data/rbi/dodopayments/resources/payments.rbi +11 -1
  202. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
  203. data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
  204. data/rbi/dodopayments/resources/product_collections.rbi +149 -0
  205. data/rbi/dodopayments/resources/subscriptions.rbi +37 -13
  206. data/sig/dodopayments/client.rbs +2 -0
  207. data/sig/dodopayments/models/abandoned_checkout_detected_webhook_event.rbs +4 -14
  208. data/sig/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbs +4 -14
  209. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  210. data/sig/dodopayments/models/checkout_session_request.rbs +10 -0
  211. data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
  212. data/sig/dodopayments/models/credit_added_webhook_event.rbs +4 -14
  213. data/sig/dodopayments/models/credit_balance_low_webhook_event.rbs +4 -14
  214. data/sig/dodopayments/models/credit_deducted_webhook_event.rbs +4 -14
  215. data/sig/dodopayments/models/credit_expired_webhook_event.rbs +4 -14
  216. data/sig/dodopayments/models/credit_manual_adjustment_webhook_event.rbs +4 -14
  217. data/sig/dodopayments/models/credit_overage_charged_webhook_event.rbs +4 -14
  218. data/sig/dodopayments/models/credit_overage_reset_webhook_event.rbs +4 -14
  219. data/sig/dodopayments/models/credit_rolled_over_webhook_event.rbs +4 -14
  220. data/sig/dodopayments/models/credit_rollover_forfeited_webhook_event.rbs +4 -14
  221. data/sig/dodopayments/models/discount_detail.rbs +95 -0
  222. data/sig/dodopayments/models/dispute_accepted_webhook_event.rbs +4 -14
  223. data/sig/dodopayments/models/dispute_cancelled_webhook_event.rbs +4 -14
  224. data/sig/dodopayments/models/dispute_challenged_webhook_event.rbs +4 -14
  225. data/sig/dodopayments/models/dispute_expired_webhook_event.rbs +4 -14
  226. data/sig/dodopayments/models/dispute_lost_webhook_event.rbs +4 -14
  227. data/sig/dodopayments/models/dispute_opened_webhook_event.rbs +4 -14
  228. data/sig/dodopayments/models/dispute_won_webhook_event.rbs +4 -14
  229. data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +4 -14
  230. data/sig/dodopayments/models/dunning_started_webhook_event.rbs +4 -14
  231. data/sig/dodopayments/models/entitlement_grant_created_webhook_event.rbs +4 -14
  232. data/sig/dodopayments/models/entitlement_grant_delivered_webhook_event.rbs +4 -14
  233. data/sig/dodopayments/models/entitlement_grant_failed_webhook_event.rbs +4 -14
  234. data/sig/dodopayments/models/entitlement_grant_revoked_webhook_event.rbs +4 -14
  235. data/sig/dodopayments/models/filter_type.rbs +52 -0
  236. data/sig/dodopayments/models/github_permission.rbs +17 -0
  237. data/sig/dodopayments/models/integration_config.rbs +4 -18
  238. data/sig/dodopayments/models/integration_config_response.rbs +4 -18
  239. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
  240. data/sig/dodopayments/models/license_key_created_webhook_event.rbs +4 -14
  241. data/sig/dodopayments/models/meter_filter.rbs +4 -252
  242. data/sig/dodopayments/models/payment.rbs +5 -0
  243. data/sig/dodopayments/models/payment_cancelled_webhook_event.rbs +4 -14
  244. data/sig/dodopayments/models/payment_create_params.rbs +10 -0
  245. data/sig/dodopayments/models/payment_create_response.rbs +5 -0
  246. data/sig/dodopayments/models/payment_failed_webhook_event.rbs +4 -14
  247. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  248. data/sig/dodopayments/models/payment_processing_webhook_event.rbs +4 -14
  249. data/sig/dodopayments/models/payment_succeeded_webhook_event.rbs +4 -14
  250. data/sig/dodopayments/models/price.rbs +15 -45
  251. data/sig/dodopayments/models/product_collection.rbs +55 -0
  252. data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
  253. data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
  254. data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
  255. data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
  256. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
  257. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
  258. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
  259. data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
  260. data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
  261. data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
  262. data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
  263. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
  264. data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
  265. data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
  266. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
  267. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
  268. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
  269. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
  270. data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
  271. data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
  272. data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
  273. data/sig/dodopayments/models/product_item_req.rbs +27 -3
  274. data/sig/dodopayments/models/refund_failed_webhook_event.rbs +4 -14
  275. data/sig/dodopayments/models/refund_succeeded_webhook_event.rbs +4 -14
  276. data/sig/dodopayments/models/subscription.rbs +10 -0
  277. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +4 -14
  278. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +4 -14
  279. data/sig/dodopayments/models/subscription_create_params.rbs +10 -0
  280. data/sig/dodopayments/models/subscription_create_response.rbs +5 -0
  281. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +4 -14
  282. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +4 -14
  283. data/sig/dodopayments/models/subscription_list_response.rbs +29 -0
  284. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +4 -14
  285. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +4 -14
  286. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +15 -45
  287. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +4 -14
  288. data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
  289. data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +17 -57
  290. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +4 -14
  291. data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
  292. data/sig/dodopayments/models/webhook_event_type.rbs +2 -4
  293. data/sig/dodopayments/models/webhook_payload.rbs +50 -213
  294. data/sig/dodopayments/models.rbs +24 -0
  295. data/sig/dodopayments/resources/checkout_sessions.rbs +4 -0
  296. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  297. data/sig/dodopayments/resources/payments.rbs +2 -0
  298. data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
  299. data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
  300. data/sig/dodopayments/resources/product_collections.rbs +56 -0
  301. data/sig/dodopayments/resources/subscriptions.rbs +6 -1
  302. metadata +89 -2
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::PaymentCancelledWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::PaymentCancelledWebhookEvent::Type }
26
+ # @return [Symbol, :"payment.cancelled"]
27
+ required :type, const: :"payment.cancelled"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payment.cancelled")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Payment]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::PaymentCancelledWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::PaymentCancelledWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- PAYMENT_CANCELLED = :"payment.cancelled"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"payment.cancelled"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -52,12 +52,30 @@ module Dodopayments
52
52
  # @return [Symbol, Dodopayments::Models::Currency, nil]
53
53
  optional :billing_currency, enum: -> { Dodopayments::Currency }, nil?: true
54
54
 
55
+ # @!attribute customer_business_name
56
+ # Optional business / legal name associated with the tax id. When provided
57
+ # together with a valid tax id for a B2B purchase, this name is rendered on the
58
+ # invoice instead of the customer's personal name.
59
+ #
60
+ # @return [String, nil]
61
+ optional :customer_business_name, String, nil?: true
62
+
55
63
  # @!attribute discount_code
56
- # Discount Code to apply to the transaction
64
+ # @deprecated Use `discount_id` instead.
65
+ #
66
+ # DEPRECATED: Use discount_codes instead. Cannot be used together with
67
+ # discount_codes.
57
68
  #
58
69
  # @return [String, nil]
59
70
  optional :discount_code, String, nil?: true
60
71
 
72
+ # @!attribute discount_codes
73
+ # Stacked discount codes to apply, in order of application. Max 20. Cannot be used
74
+ # together with discount_code.
75
+ #
76
+ # @return [Array<String>, nil]
77
+ optional :discount_codes, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
78
+
61
79
  # @!attribute force_3ds
62
80
  # Override merchant default 3DS behaviour for this payment
63
81
  #
@@ -126,7 +144,7 @@ module Dodopayments
126
144
  # @return [String, nil]
127
145
  optional :tax_id, String, nil?: true
128
146
 
129
- # @!method initialize(billing:, customer:, product_cart:, adaptive_currency_fees_inclusive: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
147
+ # @!method initialize(billing:, customer:, product_cart:, adaptive_currency_fees_inclusive: nil, allowed_payment_method_types: nil, billing_currency: nil, customer_business_name: nil, discount_code: nil, discount_codes: nil, force_3ds: nil, metadata: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
130
148
  # Some parameter documentations has been truncated, see
131
149
  # {Dodopayments::Models::PaymentCreateParams} for more details.
132
150
  #
@@ -142,7 +160,11 @@ module Dodopayments
142
160
  #
143
161
  # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] Fix the currency in which the end customer is billed.
144
162
  #
145
- # @param discount_code [String, nil] Discount Code to apply to the transaction
163
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
164
+ #
165
+ # @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
166
+ #
167
+ # @param discount_codes [Array<String>, nil] Stacked discount codes to apply, in order of application. Max 20.
146
168
  #
147
169
  # @param force_3ds [Boolean, nil] Override merchant default 3DS behaviour for this payment
148
170
  #
@@ -36,11 +36,20 @@ module Dodopayments
36
36
  required :total_amount, Integer
37
37
 
38
38
  # @!attribute discount_id
39
- # The discount id if discount is applied
39
+ # @deprecated Use `discounts` instead.
40
+ #
41
+ # DEPRECATED: Use discount_ids instead. Returns the first discount's ID if
42
+ # present.
40
43
  #
41
44
  # @return [String, nil]
42
45
  optional :discount_id, String, nil?: true
43
46
 
47
+ # @!attribute discount_ids
48
+ # All stacked discount IDs applied, in order of application
49
+ #
50
+ # @return [Array<String>, nil]
51
+ optional :discount_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
52
+
44
53
  # @!attribute expires_on
45
54
  # Expiry timestamp of the payment link
46
55
  #
@@ -61,7 +70,7 @@ module Dodopayments
61
70
  -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::OneTimeProductCartItem] },
62
71
  nil?: true
63
72
 
64
- # @!method initialize(client_secret:, customer:, metadata:, payment_id:, total_amount:, discount_id: nil, expires_on: nil, payment_link: nil, product_cart: nil)
73
+ # @!method initialize(client_secret:, customer:, metadata:, payment_id:, total_amount:, discount_id: nil, discount_ids: nil, expires_on: nil, payment_link: nil, product_cart: nil)
65
74
  # Some parameter documentations has been truncated, see
66
75
  # {Dodopayments::Models::PaymentCreateResponse} for more details.
67
76
  #
@@ -75,7 +84,9 @@ module Dodopayments
75
84
  #
76
85
  # @param total_amount [Integer] Total amount of the payment in smallest currency unit (e.g. cents)
77
86
  #
78
- # @param discount_id [String, nil] The discount id if discount is applied
87
+ # @param discount_id [String, nil] DEPRECATED: Use discount_ids instead. Returns the first discount's ID if present
88
+ #
89
+ # @param discount_ids [Array<String>, nil] All stacked discount IDs applied, in order of application
79
90
  #
80
91
  # @param expires_on [Time, nil] Expiry timestamp of the payment link
81
92
  #
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::PaymentFailedWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::PaymentFailedWebhookEvent::Type }
26
+ # @return [Symbol, :"payment.failed"]
27
+ required :type, const: :"payment.failed"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payment.failed")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Payment]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::PaymentFailedWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::PaymentFailedWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- PAYMENT_FAILED = :"payment.failed"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"payment.failed"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -85,6 +85,7 @@ module Dodopayments
85
85
  SEPA = :sepa
86
86
  SEPA_BANK_TRANSFER = :sepa_bank_transfer
87
87
  SOFORT = :sofort
88
+ SUNBIT = :sunbit
88
89
  SWISH = :swish
89
90
  TOUCH_N_GO = :touch_n_go
90
91
  TRUSTLY = :trustly
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::PaymentProcessingWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::PaymentProcessingWebhookEvent::Type }
26
+ # @return [Symbol, :"payment.processing"]
27
+ required :type, const: :"payment.processing"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payment.processing")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Payment]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::PaymentProcessingWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::PaymentProcessingWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- PAYMENT_PROCESSING = :"payment.processing"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"payment.processing"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::PaymentSucceededWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::PaymentSucceededWebhookEvent::Type }
26
+ # @return [Symbol, :"payment.succeeded"]
27
+ required :type, const: :"payment.succeeded"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payment.succeeded")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Payment]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::PaymentSucceededWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::PaymentSucceededWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- PAYMENT_SUCCEEDED = :"payment.succeeded"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"payment.succeeded"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -17,7 +17,8 @@ module Dodopayments
17
17
  required :business_id, String
18
18
 
19
19
  # @!attribute chargebacks
20
- # @deprecated
20
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
21
+ # release.
21
22
  #
22
23
  # The total value of chargebacks associated with the payout.
23
24
  #
@@ -55,7 +56,8 @@ module Dodopayments
55
56
  required :payout_id, String
56
57
 
57
58
  # @!attribute refunds
58
- # @deprecated
59
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
60
+ # release.
59
61
  #
60
62
  # The total value of refunds associated with the payout.
61
63
  #
@@ -69,7 +71,8 @@ module Dodopayments
69
71
  required :status, enum: -> { Dodopayments::Models::PayoutListResponse::Status }
70
72
 
71
73
  # @!attribute tax
72
- # @deprecated
74
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
75
+ # release.
73
76
  #
74
77
  # The tax applied to the payout.
75
78
  #
@@ -6,14 +6,16 @@ module Dodopayments
6
6
  module Price
7
7
  extend Dodopayments::Internal::Type::Union
8
8
 
9
+ discriminator :type
10
+
9
11
  # One-time price details.
10
- variant -> { Dodopayments::Price::OneTimePrice }
12
+ variant :one_time_price, -> { Dodopayments::Price::OneTimePrice }
11
13
 
12
14
  # Recurring price details.
13
- variant -> { Dodopayments::Price::RecurringPrice }
15
+ variant :recurring_price, -> { Dodopayments::Price::RecurringPrice }
14
16
 
15
17
  # Usage Based price details.
16
- variant -> { Dodopayments::Price::UsageBasedPrice }
18
+ variant :usage_based_price, -> { Dodopayments::Price::UsageBasedPrice }
17
19
 
18
20
  class OneTimePrice < Dodopayments::Internal::Type::BaseModel
19
21
  # @!attribute currency
@@ -47,8 +49,8 @@ module Dodopayments
47
49
 
48
50
  # @!attribute type
49
51
  #
50
- # @return [Symbol, Dodopayments::Models::Price::OneTimePrice::Type]
51
- required :type, enum: -> { Dodopayments::Price::OneTimePrice::Type }
52
+ # @return [Symbol, :one_time_price]
53
+ required :type, const: :one_time_price
52
54
 
53
55
  # @!attribute pay_what_you_want
54
56
  # Indicates whether the customer can pay any amount they choose. If set to `true`,
@@ -71,7 +73,7 @@ module Dodopayments
71
73
  # @return [Boolean, nil]
72
74
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
73
75
 
74
- # @!method initialize(currency:, discount:, price:, purchasing_power_parity:, type:, pay_what_you_want: nil, suggested_price: nil, tax_inclusive: nil)
76
+ # @!method initialize(currency:, discount:, price:, purchasing_power_parity:, pay_what_you_want: nil, suggested_price: nil, tax_inclusive: nil, type: :one_time_price)
75
77
  # Some parameter documentations has been truncated, see
76
78
  # {Dodopayments::Models::Price::OneTimePrice} for more details.
77
79
  #
@@ -85,23 +87,13 @@ module Dodopayments
85
87
  #
86
88
  # @param purchasing_power_parity [Boolean] Indicates if purchasing power parity adjustments are applied to the price.
87
89
  #
88
- # @param type [Symbol, Dodopayments::Models::Price::OneTimePrice::Type]
89
- #
90
90
  # @param pay_what_you_want [Boolean] Indicates whether the customer can pay any amount they choose.
91
91
  #
92
92
  # @param suggested_price [Integer, nil] A suggested price for the user to pay. This value is only considered if
93
93
  #
94
94
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive.
95
-
96
- # @see Dodopayments::Models::Price::OneTimePrice#type
97
- module Type
98
- extend Dodopayments::Internal::Type::Enum
99
-
100
- ONE_TIME_PRICE = :one_time_price
101
-
102
- # @!method self.values
103
- # @return [Array<Symbol>]
104
- end
95
+ #
96
+ # @param type [Symbol, :one_time_price]
105
97
  end
106
98
 
107
99
  class RecurringPrice < Dodopayments::Internal::Type::BaseModel
@@ -159,8 +151,8 @@ module Dodopayments
159
151
 
160
152
  # @!attribute type
161
153
  #
162
- # @return [Symbol, Dodopayments::Models::Price::RecurringPrice::Type]
163
- required :type, enum: -> { Dodopayments::Price::RecurringPrice::Type }
154
+ # @return [Symbol, :recurring_price]
155
+ required :type, const: :recurring_price
164
156
 
165
157
  # @!attribute tax_inclusive
166
158
  # Indicates if the price is tax inclusive
@@ -174,7 +166,7 @@ module Dodopayments
174
166
  # @return [Integer, nil]
175
167
  optional :trial_period_days, Integer
176
168
 
177
- # @!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)
169
+ # @!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)
178
170
  # Some parameter documentations has been truncated, see
179
171
  # {Dodopayments::Models::Price::RecurringPrice} for more details.
180
172
  #
@@ -196,21 +188,11 @@ module Dodopayments
196
188
  #
197
189
  # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the subscription period (e.g., day, month, year).
198
190
  #
199
- # @param type [Symbol, Dodopayments::Models::Price::RecurringPrice::Type]
200
- #
201
191
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
202
192
  #
203
193
  # @param trial_period_days [Integer] Number of days for the trial period. A value of `0` indicates no trial period.
204
-
205
- # @see Dodopayments::Models::Price::RecurringPrice#type
206
- module Type
207
- extend Dodopayments::Internal::Type::Enum
208
-
209
- RECURRING_PRICE = :recurring_price
210
-
211
- # @!method self.values
212
- # @return [Array<Symbol>]
213
- end
194
+ #
195
+ # @param type [Symbol, :recurring_price]
214
196
  end
215
197
 
216
198
  class UsageBasedPrice < Dodopayments::Internal::Type::BaseModel
@@ -268,8 +250,8 @@ module Dodopayments
268
250
 
269
251
  # @!attribute type
270
252
  #
271
- # @return [Symbol, Dodopayments::Models::Price::UsageBasedPrice::Type]
272
- required :type, enum: -> { Dodopayments::Price::UsageBasedPrice::Type }
253
+ # @return [Symbol, :usage_based_price]
254
+ required :type, const: :usage_based_price
273
255
 
274
256
  # @!attribute meters
275
257
  #
@@ -286,7 +268,7 @@ module Dodopayments
286
268
  # @return [Boolean, nil]
287
269
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
288
270
 
289
- # @!method initialize(currency:, discount:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, type:, meters: nil, tax_inclusive: nil)
271
+ # @!method initialize(currency:, discount:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, meters: nil, tax_inclusive: nil, type: :usage_based_price)
290
272
  # Some parameter documentations has been truncated, see
291
273
  # {Dodopayments::Models::Price::UsageBasedPrice} for more details.
292
274
  #
@@ -308,21 +290,11 @@ module Dodopayments
308
290
  #
309
291
  # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the subscription period (e.g., day, month, year).
310
292
  #
311
- # @param type [Symbol, Dodopayments::Models::Price::UsageBasedPrice::Type]
312
- #
313
293
  # @param meters [Array<Dodopayments::Models::AddMeterToPrice>, nil]
314
294
  #
315
295
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
316
-
317
- # @see Dodopayments::Models::Price::UsageBasedPrice#type
318
- module Type
319
- extend Dodopayments::Internal::Type::Enum
320
-
321
- USAGE_BASED_PRICE = :usage_based_price
322
-
323
- # @!method self.values
324
- # @return [Array<Symbol>]
325
- end
296
+ #
297
+ # @param type [Symbol, :usage_based_price]
326
298
  end
327
299
 
328
300
  # @!method self.variants
@@ -42,7 +42,7 @@ module Dodopayments
42
42
  required :is_recurring, Dodopayments::Internal::Type::Boolean
43
43
 
44
44
  # @!attribute license_key_enabled
45
- # @deprecated
45
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
46
46
  #
47
47
  # Indicates whether the product requires a license key.
48
48
  #
@@ -105,7 +105,7 @@ module Dodopayments
105
105
  optional :image, String, nil?: true
106
106
 
107
107
  # @!attribute license_key_activation_message
108
- # @deprecated
108
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
109
109
  #
110
110
  # Message sent upon license key activation, if applicable.
111
111
  #
@@ -113,7 +113,7 @@ module Dodopayments
113
113
  optional :license_key_activation_message, String, nil?: true
114
114
 
115
115
  # @!attribute license_key_activations_limit
116
- # @deprecated
116
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
117
117
  #
118
118
  # Limit on the number of activations for the license key, if enabled.
119
119
  #
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#create
6
+ class ProductCollection < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Unique identifier for the product collection
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute brand_id
14
+ # Brand ID for the collection
15
+ #
16
+ # @return [String]
17
+ required :brand_id, String
18
+
19
+ # @!attribute created_at
20
+ # Timestamp when the collection was created
21
+ #
22
+ # @return [Time]
23
+ required :created_at, Time
24
+
25
+ # @!attribute groups
26
+ # Groups in this collection
27
+ #
28
+ # @return [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupResponse>]
29
+ required :groups,
30
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::ProductCollectionGroupResponse] }
31
+
32
+ # @!attribute name
33
+ # Name of the collection
34
+ #
35
+ # @return [String]
36
+ required :name, String
37
+
38
+ # @!attribute updated_at
39
+ # Timestamp when the collection was last updated
40
+ #
41
+ # @return [Time]
42
+ required :updated_at, Time
43
+
44
+ # @!attribute description
45
+ # Description of the collection
46
+ #
47
+ # @return [String, nil]
48
+ optional :description, String, nil?: true
49
+
50
+ # @!attribute image
51
+ # URL of the collection image
52
+ #
53
+ # @return [String, nil]
54
+ optional :image, String, nil?: true
55
+
56
+ # @!method initialize(id:, brand_id:, created_at:, groups:, name:, updated_at:, description: nil, image: nil)
57
+ # @param id [String] Unique identifier for the product collection
58
+ #
59
+ # @param brand_id [String] Brand ID for the collection
60
+ #
61
+ # @param created_at [Time] Timestamp when the collection was created
62
+ #
63
+ # @param groups [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupResponse>] Groups in this collection
64
+ #
65
+ # @param name [String] Name of the collection
66
+ #
67
+ # @param updated_at [Time] Timestamp when the collection was last updated
68
+ #
69
+ # @param description [String, nil] Description of the collection
70
+ #
71
+ # @param image [String, nil] URL of the collection image
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#create
6
+ class ProductCollectionCreateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute groups
11
+ # Groups of products in this collection
12
+ #
13
+ # @return [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails>]
14
+ required :groups,
15
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::ProductCollectionGroupDetails] }
16
+
17
+ # @!attribute name
18
+ # Name of the product collection
19
+ #
20
+ # @return [String]
21
+ required :name, String
22
+
23
+ # @!attribute brand_id
24
+ # Brand id for the collection, if not provided will default to primary brand
25
+ #
26
+ # @return [String, nil]
27
+ optional :brand_id, String, nil?: true
28
+
29
+ # @!attribute description
30
+ # Optional description of the product collection
31
+ #
32
+ # @return [String, nil]
33
+ optional :description, String, nil?: true
34
+
35
+ # @!method initialize(groups:, name:, brand_id: nil, description: nil, request_options: {})
36
+ # @param groups [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails>] Groups of products in this collection
37
+ #
38
+ # @param name [String] Name of the product collection
39
+ #
40
+ # @param brand_id [String, nil] Brand id for the collection, if not provided will default to primary brand
41
+ #
42
+ # @param description [String, nil] Optional description of the product collection
43
+ #
44
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#delete
6
+ class ProductCollectionDeleteParams < 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,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#list
6
+ class ProductCollectionListParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute archived
11
+ # List archived collections
12
+ #
13
+ # @return [Boolean, nil]
14
+ optional :archived, Dodopayments::Internal::Type::Boolean
15
+
16
+ # @!attribute brand_id
17
+ # Filter by Brand id
18
+ #
19
+ # @return [String, nil]
20
+ optional :brand_id, String
21
+
22
+ # @!attribute page_number
23
+ # Page number default is 0
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :page_number, Integer
27
+
28
+ # @!attribute page_size
29
+ # Page size default is 10 max is 100
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :page_size, Integer
33
+
34
+ # @!method initialize(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {})
35
+ # @param archived [Boolean] List archived collections
36
+ #
37
+ # @param brand_id [String] Filter by Brand id
38
+ #
39
+ # @param page_number [Integer] Page number default is 0
40
+ #
41
+ # @param page_size [Integer] Page size default is 10 max is 100
42
+ #
43
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
44
+ end
45
+ end
46
+ end