dodopayments 2.34.0 → 2.35.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 (250) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/addon_delete_params.rb +20 -0
  5. data/lib/dodopayments/models/addon_list_params.rb +25 -1
  6. data/lib/dodopayments/models/addon_retrieve_params.rb +18 -1
  7. data/lib/dodopayments/models/addon_unarchive_params.rb +20 -0
  8. data/lib/dodopayments/models/addons/translation_delete_params.rb +36 -0
  9. data/lib/dodopayments/models/addons/translation_list_params.rb +35 -0
  10. data/lib/dodopayments/models/addons/translation_update_params.rb +52 -0
  11. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  12. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  13. data/lib/dodopayments/models/checkout_session_preview_params.rb +17 -1
  14. data/lib/dodopayments/models/create_new_customer.rb +12 -1
  15. data/lib/dodopayments/models/credit_entitlement_list_params.rb +17 -1
  16. data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +18 -1
  17. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translation.rb +47 -0
  18. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rb +23 -0
  19. data/lib/dodopayments/models/credit_entitlements/translation_delete_params.rb +37 -0
  20. data/lib/dodopayments/models/credit_entitlements/translation_list_params.rb +36 -0
  21. data/lib/dodopayments/models/credit_entitlements/translation_update_params.rb +53 -0
  22. data/lib/dodopayments/models/customer.rb +9 -1
  23. data/lib/dodopayments/models/customer_create_params.rb +14 -1
  24. data/lib/dodopayments/models/customer_update_params.rb +14 -1
  25. data/lib/dodopayments/models/entitlement_list_params.rb +17 -1
  26. data/lib/dodopayments/models/entitlement_retrieve_params.rb +18 -1
  27. data/lib/dodopayments/models/entitlements/entitlement_translation.rb +67 -0
  28. data/lib/dodopayments/models/entitlements/entitlement_translations_list_response.rb +23 -0
  29. data/lib/dodopayments/models/entitlements/translation_delete_params.rb +36 -0
  30. data/lib/dodopayments/models/entitlements/translation_list_params.rb +35 -0
  31. data/lib/dodopayments/models/entitlements/translation_update_params.rb +69 -0
  32. data/lib/dodopayments/models/locale.rb +38 -0
  33. data/lib/dodopayments/models/locale_info.rb +34 -0
  34. data/lib/dodopayments/models/meter_list_params.rb +17 -1
  35. data/lib/dodopayments/models/meter_retrieve_params.rb +18 -1
  36. data/lib/dodopayments/models/meter_update_params.rb +49 -0
  37. data/lib/dodopayments/models/meters/translation_delete_params.rb +36 -0
  38. data/lib/dodopayments/models/meters/translation_list_params.rb +35 -0
  39. data/lib/dodopayments/models/meters/translation_update_params.rb +52 -0
  40. data/lib/dodopayments/models/misc_list_locales_params.rb +14 -0
  41. data/lib/dodopayments/models/misc_list_locales_response.rb +8 -0
  42. data/lib/dodopayments/models/payment.rb +29 -1
  43. data/lib/dodopayments/models/payment_list_response.rb +29 -1
  44. data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -1
  45. data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +10 -1
  46. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +3 -1
  47. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +2 -1
  48. data/lib/dodopayments/models/product_collection_list_params.rb +17 -1
  49. data/lib/dodopayments/models/product_collection_retrieve_params.rb +18 -1
  50. data/lib/dodopayments/models/product_collections/translation_delete_params.rb +37 -0
  51. data/lib/dodopayments/models/product_collections/translation_list_params.rb +36 -0
  52. data/lib/dodopayments/models/product_collections/translation_update_params.rb +53 -0
  53. data/lib/dodopayments/models/product_list_params.rb +14 -1
  54. data/lib/dodopayments/models/product_retrieve_params.rb +18 -1
  55. data/lib/dodopayments/models/products/translation.rb +50 -0
  56. data/lib/dodopayments/models/products/translation_delete_params.rb +36 -0
  57. data/lib/dodopayments/models/products/translation_list_params.rb +35 -0
  58. data/lib/dodopayments/models/products/translation_update_params.rb +52 -0
  59. data/lib/dodopayments/models/products/translations_list_response.rb +20 -0
  60. data/lib/dodopayments/models/refund_create_params.rb +13 -1
  61. data/lib/dodopayments/models/subscription_list_params.rb +14 -1
  62. data/lib/dodopayments/models/subscription_retrieve_params.rb +18 -1
  63. data/lib/dodopayments/models/three_ds_flow.rb +16 -0
  64. data/lib/dodopayments/models/three_ds_status.rb +21 -0
  65. data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -0
  66. data/lib/dodopayments/models.rb +20 -0
  67. data/lib/dodopayments/resources/addons/translations.rb +110 -0
  68. data/lib/dodopayments/resources/addons.rb +58 -3
  69. data/lib/dodopayments/resources/checkout_sessions.rb +31 -26
  70. data/lib/dodopayments/resources/credit_entitlements/translations.rb +113 -0
  71. data/lib/dodopayments/resources/credit_entitlements.rb +20 -3
  72. data/lib/dodopayments/resources/customers.rb +12 -2
  73. data/lib/dodopayments/resources/entitlements/translations.rb +114 -0
  74. data/lib/dodopayments/resources/entitlements.rb +20 -3
  75. data/lib/dodopayments/resources/meters/translations.rb +110 -0
  76. data/lib/dodopayments/resources/meters.rb +49 -3
  77. data/lib/dodopayments/resources/misc.rb +18 -0
  78. data/lib/dodopayments/resources/payments.rb +10 -2
  79. data/lib/dodopayments/resources/payouts/breakup/details.rb +5 -2
  80. data/lib/dodopayments/resources/payouts/breakup.rb +4 -1
  81. data/lib/dodopayments/resources/product_collections/translations.rb +113 -0
  82. data/lib/dodopayments/resources/product_collections.rb +20 -3
  83. data/lib/dodopayments/resources/products/translations.rb +110 -0
  84. data/lib/dodopayments/resources/products.rb +17 -3
  85. data/lib/dodopayments/resources/refunds.rb +6 -1
  86. data/lib/dodopayments/resources/subscriptions.rb +13 -3
  87. data/lib/dodopayments/version.rb +1 -1
  88. data/lib/dodopayments.rb +39 -0
  89. data/rbi/dodopayments/models/addon_delete_params.rbi +38 -0
  90. data/rbi/dodopayments/models/addon_list_params.rbi +32 -0
  91. data/rbi/dodopayments/models/addon_retrieve_params.rbi +29 -2
  92. data/rbi/dodopayments/models/addon_unarchive_params.rbi +38 -0
  93. data/rbi/dodopayments/models/addons/translation_delete_params.rbi +58 -0
  94. data/rbi/dodopayments/models/addons/translation_list_params.rbi +59 -0
  95. data/rbi/dodopayments/models/addons/translation_update_params.rbi +74 -0
  96. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  97. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  98. data/rbi/dodopayments/models/checkout_session_preview_params.rbi +29 -5
  99. data/rbi/dodopayments/models/create_new_customer.rbi +17 -3
  100. data/rbi/dodopayments/models/credit_entitlement_list_params.rbi +21 -0
  101. data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +29 -2
  102. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbi +70 -0
  103. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbi +54 -0
  104. data/rbi/dodopayments/models/credit_entitlements/translation_delete_params.rbi +58 -0
  105. data/rbi/dodopayments/models/credit_entitlements/translation_list_params.rbi +59 -0
  106. data/rbi/dodopayments/models/credit_entitlements/translation_update_params.rbi +74 -0
  107. data/rbi/dodopayments/models/customer.rbi +11 -3
  108. data/rbi/dodopayments/models/customer_create_params.rbi +12 -0
  109. data/rbi/dodopayments/models/customer_update_params.rbi +12 -0
  110. data/rbi/dodopayments/models/entitlement_list_params.rbi +21 -0
  111. data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +29 -2
  112. data/rbi/dodopayments/models/entitlements/entitlement_translation.rbi +87 -0
  113. data/rbi/dodopayments/models/entitlements/entitlement_translations_list_response.rbi +48 -0
  114. data/rbi/dodopayments/models/entitlements/translation_delete_params.rbi +58 -0
  115. data/rbi/dodopayments/models/entitlements/translation_list_params.rbi +59 -0
  116. data/rbi/dodopayments/models/entitlements/translation_update_params.rbi +92 -0
  117. data/rbi/dodopayments/models/locale.rbi +42 -0
  118. data/rbi/dodopayments/models/locale_info.rbi +54 -0
  119. data/rbi/dodopayments/models/meter_list_params.rbi +21 -0
  120. data/rbi/dodopayments/models/meter_retrieve_params.rbi +29 -2
  121. data/rbi/dodopayments/models/meter_update_params.rbi +70 -0
  122. data/rbi/dodopayments/models/meters/translation_delete_params.rbi +58 -0
  123. data/rbi/dodopayments/models/meters/translation_list_params.rbi +59 -0
  124. data/rbi/dodopayments/models/meters/translation_update_params.rbi +74 -0
  125. data/rbi/dodopayments/models/misc_list_locales_params.rbi +32 -0
  126. data/rbi/dodopayments/models/misc_list_locales_response.rbi +11 -0
  127. data/rbi/dodopayments/models/payment.rbi +33 -0
  128. data/rbi/dodopayments/models/payment_list_response.rbi +36 -3
  129. data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +21 -2
  130. data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +14 -3
  131. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +6 -2
  132. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -2
  133. data/rbi/dodopayments/models/product_collection_list_params.rbi +21 -0
  134. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +29 -2
  135. data/rbi/dodopayments/models/product_collections/translation_delete_params.rbi +58 -0
  136. data/rbi/dodopayments/models/product_collections/translation_list_params.rbi +59 -0
  137. data/rbi/dodopayments/models/product_collections/translation_update_params.rbi +74 -0
  138. data/rbi/dodopayments/models/product_list_params.rbi +21 -0
  139. data/rbi/dodopayments/models/product_retrieve_params.rbi +29 -2
  140. data/rbi/dodopayments/models/products/translation.rbi +70 -0
  141. data/rbi/dodopayments/models/products/translation_delete_params.rbi +58 -0
  142. data/rbi/dodopayments/models/products/translation_list_params.rbi +59 -0
  143. data/rbi/dodopayments/models/products/translation_update_params.rbi +74 -0
  144. data/rbi/dodopayments/models/products/translations_list_response.rbi +37 -0
  145. data/rbi/dodopayments/models/refund_create_params.rbi +10 -0
  146. data/rbi/dodopayments/models/subscription_list_params.rbi +21 -0
  147. data/rbi/dodopayments/models/subscription_retrieve_params.rbi +25 -1
  148. data/rbi/dodopayments/models/three_ds_flow.rbi +23 -0
  149. data/rbi/dodopayments/models/three_ds_status.rbi +31 -0
  150. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +15 -0
  151. data/rbi/dodopayments/models.rbi +20 -0
  152. data/rbi/dodopayments/resources/addons/translations.rbi +77 -0
  153. data/rbi/dodopayments/resources/addons.rbi +48 -0
  154. data/rbi/dodopayments/resources/checkout_sessions.rbi +55 -39
  155. data/rbi/dodopayments/resources/credit_entitlements/translations.rbi +81 -0
  156. data/rbi/dodopayments/resources/credit_entitlements.rbi +19 -0
  157. data/rbi/dodopayments/resources/customers.rbi +10 -0
  158. data/rbi/dodopayments/resources/entitlements/translations.rbi +87 -0
  159. data/rbi/dodopayments/resources/entitlements.rbi +19 -0
  160. data/rbi/dodopayments/resources/meters/translations.rbi +77 -0
  161. data/rbi/dodopayments/resources/meters.rbi +42 -0
  162. data/rbi/dodopayments/resources/misc.rbi +9 -0
  163. data/rbi/dodopayments/resources/payments.rbi +4 -0
  164. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +5 -2
  165. data/rbi/dodopayments/resources/payouts/breakup.rbi +4 -1
  166. data/rbi/dodopayments/resources/product_collections/translations.rbi +77 -0
  167. data/rbi/dodopayments/resources/product_collections.rbi +19 -0
  168. data/rbi/dodopayments/resources/products/translations.rbi +77 -0
  169. data/rbi/dodopayments/resources/products.rbi +19 -0
  170. data/rbi/dodopayments/resources/refunds.rbi +4 -0
  171. data/rbi/dodopayments/resources/subscriptions.rbi +26 -0
  172. data/sig/dodopayments/models/addon_delete_params.rbs +23 -0
  173. data/sig/dodopayments/models/addon_list_params.rbs +18 -1
  174. data/sig/dodopayments/models/addon_retrieve_params.rbs +8 -1
  175. data/sig/dodopayments/models/addon_unarchive_params.rbs +23 -0
  176. data/sig/dodopayments/models/addons/translation_delete_params.rbs +30 -0
  177. data/sig/dodopayments/models/addons/translation_list_params.rbs +32 -0
  178. data/sig/dodopayments/models/addons/translation_update_params.rbs +43 -0
  179. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  180. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  181. data/sig/dodopayments/models/checkout_session_preview_params.rbs +13 -3
  182. data/sig/dodopayments/models/create_new_customer.rbs +8 -3
  183. data/sig/dodopayments/models/credit_entitlement_list_params.rbs +12 -1
  184. data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +8 -1
  185. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbs +39 -0
  186. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbs +24 -0
  187. data/sig/dodopayments/models/credit_entitlements/translation_delete_params.rbs +30 -0
  188. data/sig/dodopayments/models/credit_entitlements/translation_list_params.rbs +32 -0
  189. data/sig/dodopayments/models/credit_entitlements/translation_update_params.rbs +43 -0
  190. data/sig/dodopayments/models/customer.rbs +8 -3
  191. data/sig/dodopayments/models/customer_create_params.rbs +6 -1
  192. data/sig/dodopayments/models/customer_update_params.rbs +6 -1
  193. data/sig/dodopayments/models/entitlement_list_params.rbs +7 -0
  194. data/sig/dodopayments/models/entitlement_retrieve_params.rbs +8 -1
  195. data/sig/dodopayments/models/entitlements/entitlement_translation.rbs +49 -0
  196. data/sig/dodopayments/models/entitlements/entitlement_translations_list_response.rbs +22 -0
  197. data/sig/dodopayments/models/entitlements/translation_delete_params.rbs +30 -0
  198. data/sig/dodopayments/models/entitlements/translation_list_params.rbs +32 -0
  199. data/sig/dodopayments/models/entitlements/translation_update_params.rbs +53 -0
  200. data/sig/dodopayments/models/locale.rbs +56 -0
  201. data/sig/dodopayments/models/locale_info.rbs +26 -0
  202. data/sig/dodopayments/models/meter_list_params.rbs +12 -1
  203. data/sig/dodopayments/models/meter_retrieve_params.rbs +8 -1
  204. data/sig/dodopayments/models/meter_update_params.rbs +41 -0
  205. data/sig/dodopayments/models/meters/translation_delete_params.rbs +30 -0
  206. data/sig/dodopayments/models/meters/translation_list_params.rbs +32 -0
  207. data/sig/dodopayments/models/meters/translation_update_params.rbs +43 -0
  208. data/sig/dodopayments/models/misc_list_locales_params.rbs +15 -0
  209. data/sig/dodopayments/models/misc_list_locales_response.rbs +7 -0
  210. data/sig/dodopayments/models/payment.rbs +15 -0
  211. data/sig/dodopayments/models/payment_list_response.rbs +18 -3
  212. data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +10 -1
  213. data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +8 -3
  214. data/sig/dodopayments/models/product_collection_list_params.rbs +7 -0
  215. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +8 -1
  216. data/sig/dodopayments/models/product_collections/translation_delete_params.rbs +30 -0
  217. data/sig/dodopayments/models/product_collections/translation_list_params.rbs +32 -0
  218. data/sig/dodopayments/models/product_collections/translation_update_params.rbs +43 -0
  219. data/sig/dodopayments/models/product_list_params.rbs +7 -0
  220. data/sig/dodopayments/models/product_retrieve_params.rbs +8 -1
  221. data/sig/dodopayments/models/products/translation.rbs +37 -0
  222. data/sig/dodopayments/models/products/translation_delete_params.rbs +30 -0
  223. data/sig/dodopayments/models/products/translation_list_params.rbs +32 -0
  224. data/sig/dodopayments/models/products/translation_update_params.rbs +43 -0
  225. data/sig/dodopayments/models/products/translations_list_response.rbs +18 -0
  226. data/sig/dodopayments/models/refund_create_params.rbs +5 -0
  227. data/sig/dodopayments/models/subscription_list_params.rbs +7 -0
  228. data/sig/dodopayments/models/subscription_retrieve_params.rbs +7 -1
  229. data/sig/dodopayments/models/three_ds_flow.rbs +14 -0
  230. data/sig/dodopayments/models/three_ds_status.rbs +24 -0
  231. data/sig/dodopayments/models.rbs +20 -0
  232. data/sig/dodopayments/resources/addons/translations.rbs +29 -0
  233. data/sig/dodopayments/resources/addons.rbs +15 -0
  234. data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
  235. data/sig/dodopayments/resources/credit_entitlements/translations.rbs +29 -0
  236. data/sig/dodopayments/resources/credit_entitlements.rbs +4 -0
  237. data/sig/dodopayments/resources/customers.rbs +2 -0
  238. data/sig/dodopayments/resources/entitlements/translations.rbs +31 -0
  239. data/sig/dodopayments/resources/entitlements.rbs +4 -0
  240. data/sig/dodopayments/resources/meters/translations.rbs +29 -0
  241. data/sig/dodopayments/resources/meters.rbs +12 -0
  242. data/sig/dodopayments/resources/misc.rbs +4 -0
  243. data/sig/dodopayments/resources/payments.rbs +1 -0
  244. data/sig/dodopayments/resources/product_collections/translations.rbs +29 -0
  245. data/sig/dodopayments/resources/product_collections.rbs +4 -0
  246. data/sig/dodopayments/resources/products/translations.rbs +29 -0
  247. data/sig/dodopayments/resources/products.rbs +4 -0
  248. data/sig/dodopayments/resources/refunds.rbs +1 -0
  249. data/sig/dodopayments/resources/subscriptions.rbs +2 -0
  250. metadata +119 -2
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class CreditEntitlements
6
+ # @return [Dodopayments::Resources::CreditEntitlements::Translations]
7
+ attr_reader :translations
8
+
6
9
  # @return [Dodopayments::Resources::CreditEntitlements::Balances]
7
10
  attr_reader :balances
8
11
 
@@ -101,6 +104,9 @@ module Dodopayments
101
104
  )
102
105
  end
103
106
 
107
+ # Some parameter documentations has been truncated, see
108
+ # {Dodopayments::Models::CreditEntitlementRetrieveParams} for more details.
109
+ #
104
110
  # Returns the full details of a single credit entitlement including all
105
111
  # configuration settings for expiration, rollover, and overage policies.
106
112
  #
@@ -126,21 +132,26 @@ module Dodopayments
126
132
  # - Deleted entitlements return a 404 error and must be retrieved via the list
127
133
  # endpoint with `deleted=true`
128
134
  #
129
- # @overload retrieve(id, request_options: {})
135
+ # @overload retrieve(id, locale: nil, request_options: {})
130
136
  #
131
137
  # @param id [String] Credit Entitlement ID
132
138
  #
139
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
140
+ #
133
141
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
134
142
  #
135
143
  # @return [Dodopayments::Models::CreditEntitlement]
136
144
  #
137
145
  # @see Dodopayments::Models::CreditEntitlementRetrieveParams
138
146
  def retrieve(id, params = {})
147
+ parsed, options = Dodopayments::CreditEntitlementRetrieveParams.dump_request(params)
148
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
139
149
  @client.request(
140
150
  method: :get,
141
151
  path: ["credit-entitlements/%1$s", id],
152
+ query: query,
142
153
  model: Dodopayments::CreditEntitlement,
143
- options: params[:request_options]
154
+ options: options
144
155
  )
145
156
  end
146
157
 
@@ -249,6 +260,9 @@ module Dodopayments
249
260
  )
250
261
  end
251
262
 
263
+ # Some parameter documentations has been truncated, see
264
+ # {Dodopayments::Models::CreditEntitlementListParams} for more details.
265
+ #
252
266
  # Returns a paginated list of credit entitlements, allowing filtering of deleted
253
267
  # entitlements. By default, only non-deleted entitlements are returned.
254
268
  #
@@ -276,10 +290,12 @@ module Dodopayments
276
290
  # - The `deleted` parameter controls visibility of soft-deleted entitlements
277
291
  # - Pagination uses offset-based pagination (offset = page_number \* page_size)
278
292
  #
279
- # @overload list(deleted: nil, page_number: nil, page_size: nil, request_options: {})
293
+ # @overload list(deleted: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
280
294
  #
281
295
  # @param deleted [Boolean] List deleted credit entitlements
282
296
  #
297
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
298
+ #
283
299
  # @param page_number [Integer] Page number default is 0
284
300
  #
285
301
  # @param page_size [Integer] Page size default is 10 max is 100
@@ -384,6 +400,7 @@ module Dodopayments
384
400
  # @param client [Dodopayments::Client]
385
401
  def initialize(client:)
386
402
  @client = client
403
+ @translations = Dodopayments::Resources::CreditEntitlements::Translations.new(client: client)
387
404
  @balances = Dodopayments::Resources::CreditEntitlements::Balances.new(client: client)
388
405
  end
389
406
  end
@@ -12,7 +12,10 @@ module Dodopayments
12
12
  # @return [Dodopayments::Resources::Customers::Emails]
13
13
  attr_reader :emails
14
14
 
15
- # @overload create(email:, name:, metadata: nil, phone_number: nil, request_options: {})
15
+ # Some parameter documentations has been truncated, see
16
+ # {Dodopayments::Models::CustomerCreateParams} for more details.
17
+ #
18
+ # @overload create(email:, name:, metadata: nil, phone_number: nil, preferred_locale: nil, request_options: {})
16
19
  #
17
20
  # @param email [String]
18
21
  #
@@ -22,6 +25,8 @@ module Dodopayments
22
25
  #
23
26
  # @param phone_number [String, nil]
24
27
  #
28
+ # @param preferred_locale [Symbol, Dodopayments::Models::Locale, nil] The language of the customer emails, a code from `GET /locales`. With no value,
29
+ #
25
30
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
26
31
  #
27
32
  # @return [Dodopayments::Models::Customer]
@@ -56,7 +61,10 @@ module Dodopayments
56
61
  )
57
62
  end
58
63
 
59
- # @overload update(customer_id, email: nil, metadata: nil, name: nil, phone_number: nil, request_options: {})
64
+ # Some parameter documentations has been truncated, see
65
+ # {Dodopayments::Models::CustomerUpdateParams} for more details.
66
+ #
67
+ # @overload update(customer_id, email: nil, metadata: nil, name: nil, phone_number: nil, preferred_locale: nil, request_options: {})
60
68
  #
61
69
  # @param customer_id [String] Customer Id
62
70
  #
@@ -68,6 +76,8 @@ module Dodopayments
68
76
  #
69
77
  # @param phone_number [String, nil]
70
78
  #
79
+ # @param preferred_locale [Symbol, Dodopayments::Models::Locale, nil] The language of the customer emails, a code from `GET /locales`. A value replace
80
+ #
71
81
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
72
82
  #
73
83
  # @return [Dodopayments::Models::Customer]
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Entitlements
6
+ class Translations
7
+ # Some parameter documentations has been truncated, see
8
+ # {Dodopayments::Models::Entitlements::TranslationUpdateParams} for more details.
9
+ #
10
+ # Creates or replaces the translation of one locale. The response is 201 for a new
11
+ # locale and 200 for a replaced locale.
12
+ #
13
+ # @overload update(locale, id:, activation_message: nil, description: nil, instructions: nil, name: nil, request_options: {})
14
+ #
15
+ # @param locale [Symbol, Dodopayments::Models::Locale] Path param: A locale that the checkout and the customer portal can show.
16
+ #
17
+ # @param id [String] Path param: Entitlement Id
18
+ #
19
+ # @param activation_message [String, nil] Body param: The translated activation message. Only a `license_key` entitlement
20
+ #
21
+ # @param description [String, nil] Body param: The translated description.
22
+ #
23
+ # @param instructions [String, nil] Body param: The translated delivery instructions. Only a `digital_files` entitle
24
+ #
25
+ # @param name [String, nil] Body param: The translated name.
26
+ #
27
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
28
+ #
29
+ # @return [Dodopayments::Models::Entitlements::EntitlementTranslation]
30
+ #
31
+ # @see Dodopayments::Models::Entitlements::TranslationUpdateParams
32
+ def update(locale, params)
33
+ parsed, options = Dodopayments::Entitlements::TranslationUpdateParams.dump_request(params)
34
+ id =
35
+ parsed.delete(:id) do
36
+ raise ArgumentError.new("missing required path argument #{_1}")
37
+ end
38
+ @client.request(
39
+ method: :put,
40
+ path: ["entitlements/%1$s/translations/%2$s", id, locale],
41
+ body: parsed,
42
+ model: Dodopayments::Entitlements::EntitlementTranslation,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # Some parameter documentations has been truncated, see
48
+ # {Dodopayments::Models::Entitlements::TranslationListParams} for more details.
49
+ #
50
+ # Lists the translations, for all the locales or for the locales of the filter.
51
+ #
52
+ # @overload list(id, locale: nil, request_options: {})
53
+ #
54
+ # @param id [String] Entitlement Id
55
+ #
56
+ # @param locale [Array<String>] Returns only these locales, for example `?locale=fr&locale=de`. With no value, t
57
+ #
58
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
59
+ #
60
+ # @return [Dodopayments::Models::Entitlements::EntitlementTranslationsListResponse]
61
+ #
62
+ # @see Dodopayments::Models::Entitlements::TranslationListParams
63
+ def list(id, params = {})
64
+ parsed, options = Dodopayments::Entitlements::TranslationListParams.dump_request(params)
65
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
66
+ @client.request(
67
+ method: :get,
68
+ path: ["entitlements/%1$s/translations", id],
69
+ query: query,
70
+ model: Dodopayments::Entitlements::EntitlementTranslationsListResponse,
71
+ options: options
72
+ )
73
+ end
74
+
75
+ # Some parameter documentations has been truncated, see
76
+ # {Dodopayments::Models::Entitlements::TranslationDeleteParams} for more details.
77
+ #
78
+ # Deletes the translation of one locale.
79
+ #
80
+ # @overload delete(locale, id:, request_options: {})
81
+ #
82
+ # @param locale [Symbol, Dodopayments::Models::Locale] A locale that the checkout and the customer portal can show.
83
+ #
84
+ # @param id [String] Entitlement Id
85
+ #
86
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
87
+ #
88
+ # @return [nil]
89
+ #
90
+ # @see Dodopayments::Models::Entitlements::TranslationDeleteParams
91
+ def delete(locale, params)
92
+ parsed, options = Dodopayments::Entitlements::TranslationDeleteParams.dump_request(params)
93
+ id =
94
+ parsed.delete(:id) do
95
+ raise ArgumentError.new("missing required path argument #{_1}")
96
+ end
97
+ @client.request(
98
+ method: :delete,
99
+ path: ["entitlements/%1$s/translations/%2$s", id, locale],
100
+ model: NilClass,
101
+ options: options
102
+ )
103
+ end
104
+
105
+ # @api private
106
+ #
107
+ # @param client [Dodopayments::Client]
108
+ def initialize(client:)
109
+ @client = client
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Entitlements
6
+ # @return [Dodopayments::Resources::Entitlements::Translations]
7
+ attr_reader :translations
8
+
6
9
  # @return [Dodopayments::Resources::Entitlements::Files]
7
10
  attr_reader :files
8
11
 
@@ -39,23 +42,31 @@ module Dodopayments
39
42
  )
40
43
  end
41
44
 
45
+ # Some parameter documentations has been truncated, see
46
+ # {Dodopayments::Models::EntitlementRetrieveParams} for more details.
47
+ #
42
48
  # GET /entitlements/{id}
43
49
  #
44
- # @overload retrieve(id, request_options: {})
50
+ # @overload retrieve(id, locale: nil, request_options: {})
45
51
  #
46
52
  # @param id [String] Entitlement ID
47
53
  #
54
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
55
+ #
48
56
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
49
57
  #
50
58
  # @return [Dodopayments::Models::Entitlement]
51
59
  #
52
60
  # @see Dodopayments::Models::EntitlementRetrieveParams
53
61
  def retrieve(id, params = {})
62
+ parsed, options = Dodopayments::EntitlementRetrieveParams.dump_request(params)
63
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
54
64
  @client.request(
55
65
  method: :get,
56
66
  path: ["entitlements/%1$s", id],
67
+ query: query,
57
68
  model: Dodopayments::Entitlement,
58
- options: params[:request_options]
69
+ options: options
59
70
  )
60
71
  end
61
72
 
@@ -92,12 +103,17 @@ module Dodopayments
92
103
  )
93
104
  end
94
105
 
106
+ # Some parameter documentations has been truncated, see
107
+ # {Dodopayments::Models::EntitlementListParams} for more details.
108
+ #
95
109
  # GET /entitlements
96
110
  #
97
- # @overload list(integration_type: nil, page_number: nil, page_size: nil, request_options: {})
111
+ # @overload list(integration_type: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
98
112
  #
99
113
  # @param integration_type [Symbol, Dodopayments::Models::EntitlementListParams::IntegrationType] Filter by integration type
100
114
  #
115
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
116
+ #
101
117
  # @param page_number [Integer] Page number (default 0)
102
118
  #
103
119
  # @param page_size [Integer] Page size (default 10, max 100)
@@ -145,6 +161,7 @@ module Dodopayments
145
161
  # @param client [Dodopayments::Client]
146
162
  def initialize(client:)
147
163
  @client = client
164
+ @translations = Dodopayments::Resources::Entitlements::Translations.new(client: client)
148
165
  @files = Dodopayments::Resources::Entitlements::Files.new(client: client)
149
166
  @grants = Dodopayments::Resources::Entitlements::Grants.new(client: client)
150
167
  end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Meters
6
+ class Translations
7
+ # Some parameter documentations has been truncated, see
8
+ # {Dodopayments::Models::Meters::TranslationUpdateParams} for more details.
9
+ #
10
+ # Creates or replaces the translation of one locale. The response is 201 for a new
11
+ # locale and 200 for a replaced locale.
12
+ #
13
+ # @overload update(locale, id:, description: nil, name: nil, request_options: {})
14
+ #
15
+ # @param locale [Symbol, Dodopayments::Models::Locale] Path param: A locale that the checkout and the customer portal can show.
16
+ #
17
+ # @param id [String] Path param: Meter Id
18
+ #
19
+ # @param description [String, nil] Body param: The translated description.
20
+ #
21
+ # @param name [String, nil] Body param: The translated name.
22
+ #
23
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
24
+ #
25
+ # @return [Dodopayments::Models::Products::Translation]
26
+ #
27
+ # @see Dodopayments::Models::Meters::TranslationUpdateParams
28
+ def update(locale, params)
29
+ parsed, options = Dodopayments::Meters::TranslationUpdateParams.dump_request(params)
30
+ id =
31
+ parsed.delete(:id) do
32
+ raise ArgumentError.new("missing required path argument #{_1}")
33
+ end
34
+ @client.request(
35
+ method: :put,
36
+ path: ["meters/%1$s/translations/%2$s", id, locale],
37
+ body: parsed,
38
+ model: Dodopayments::Products::Translation,
39
+ options: options
40
+ )
41
+ end
42
+
43
+ # Some parameter documentations has been truncated, see
44
+ # {Dodopayments::Models::Meters::TranslationListParams} for more details.
45
+ #
46
+ # Lists the translations, for all the locales or for the locales of the filter.
47
+ #
48
+ # @overload list(id, locale: nil, request_options: {})
49
+ #
50
+ # @param id [String] Meter Id
51
+ #
52
+ # @param locale [Array<String>] Returns only these locales, for example `?locale=fr&locale=de`. With no value, t
53
+ #
54
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
55
+ #
56
+ # @return [Dodopayments::Models::Products::TranslationsListResponse]
57
+ #
58
+ # @see Dodopayments::Models::Meters::TranslationListParams
59
+ def list(id, params = {})
60
+ parsed, options = Dodopayments::Meters::TranslationListParams.dump_request(params)
61
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
62
+ @client.request(
63
+ method: :get,
64
+ path: ["meters/%1$s/translations", id],
65
+ query: query,
66
+ model: Dodopayments::Products::TranslationsListResponse,
67
+ options: options
68
+ )
69
+ end
70
+
71
+ # Some parameter documentations has been truncated, see
72
+ # {Dodopayments::Models::Meters::TranslationDeleteParams} for more details.
73
+ #
74
+ # Deletes the translation of one locale.
75
+ #
76
+ # @overload delete(locale, id:, request_options: {})
77
+ #
78
+ # @param locale [Symbol, Dodopayments::Models::Locale] A locale that the checkout and the customer portal can show.
79
+ #
80
+ # @param id [String] Meter Id
81
+ #
82
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
83
+ #
84
+ # @return [nil]
85
+ #
86
+ # @see Dodopayments::Models::Meters::TranslationDeleteParams
87
+ def delete(locale, params)
88
+ parsed, options = Dodopayments::Meters::TranslationDeleteParams.dump_request(params)
89
+ id =
90
+ parsed.delete(:id) do
91
+ raise ArgumentError.new("missing required path argument #{_1}")
92
+ end
93
+ @client.request(
94
+ method: :delete,
95
+ path: ["meters/%1$s/translations/%2$s", id, locale],
96
+ model: NilClass,
97
+ options: options
98
+ )
99
+ end
100
+
101
+ # @api private
102
+ #
103
+ # @param client [Dodopayments::Client]
104
+ def initialize(client:)
105
+ @client = client
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Meters
6
+ # @return [Dodopayments::Resources::Meters::Translations]
7
+ attr_reader :translations
8
+
6
9
  # @overload create(aggregation:, event_name:, measurement_unit:, name:, description: nil, filter: nil, request_options: {})
7
10
  #
8
11
  # @param aggregation [Dodopayments::Models::MeterAggregation] Aggregation configuration for the meter
@@ -33,28 +36,70 @@ module Dodopayments
33
36
  )
34
37
  end
35
38
 
36
- # @overload retrieve(id, request_options: {})
39
+ # Some parameter documentations has been truncated, see
40
+ # {Dodopayments::Models::MeterRetrieveParams} for more details.
41
+ #
42
+ # @overload retrieve(id, locale: nil, request_options: {})
37
43
  #
38
44
  # @param id [String] Meter ID
39
45
  #
46
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
47
+ #
40
48
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
41
49
  #
42
50
  # @return [Dodopayments::Models::Meter]
43
51
  #
44
52
  # @see Dodopayments::Models::MeterRetrieveParams
45
53
  def retrieve(id, params = {})
54
+ parsed, options = Dodopayments::MeterRetrieveParams.dump_request(params)
55
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
46
56
  @client.request(
47
57
  method: :get,
48
58
  path: ["meters/%1$s", id],
59
+ query: query,
49
60
  model: Dodopayments::Meter,
50
- options: params[:request_options]
61
+ options: options
62
+ )
63
+ end
64
+
65
+ # Some parameter documentations has been truncated, see
66
+ # {Dodopayments::Models::MeterUpdateParams} for more details.
67
+ #
68
+ # @overload update(id, description: nil, measurement_unit: nil, name: nil, request_options: {})
69
+ #
70
+ # @param id [String] Meter ID
71
+ #
72
+ # @param description [String, nil] Description of the meter. Send `null` to remove the description. Omit it to keep
73
+ #
74
+ # @param measurement_unit [String, nil] Measurement unit
75
+ #
76
+ # @param name [String, nil] Name of the meter
77
+ #
78
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
79
+ #
80
+ # @return [Dodopayments::Models::Meter]
81
+ #
82
+ # @see Dodopayments::Models::MeterUpdateParams
83
+ def update(id, params = {})
84
+ parsed, options = Dodopayments::MeterUpdateParams.dump_request(params)
85
+ @client.request(
86
+ method: :patch,
87
+ path: ["meters/%1$s", id],
88
+ body: parsed,
89
+ model: Dodopayments::Meter,
90
+ options: options
51
91
  )
52
92
  end
53
93
 
54
- # @overload list(archived: nil, page_number: nil, page_size: nil, request_options: {})
94
+ # Some parameter documentations has been truncated, see
95
+ # {Dodopayments::Models::MeterListParams} for more details.
96
+ #
97
+ # @overload list(archived: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
55
98
  #
56
99
  # @param archived [Boolean] List archived meters
57
100
  #
101
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
102
+ #
58
103
  # @param page_number [Integer] Page number default is 0
59
104
  #
60
105
  # @param page_size [Integer] Page size default is 10 max is 100
@@ -118,6 +163,7 @@ module Dodopayments
118
163
  # @param client [Dodopayments::Client]
119
164
  def initialize(client:)
120
165
  @client = client
166
+ @translations = Dodopayments::Resources::Meters::Translations.new(client: client)
121
167
  end
122
168
  end
123
169
  end
@@ -3,6 +3,24 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Misc
6
+ # Lists the locales that a translation can have.
7
+ #
8
+ # @overload list_locales(request_options: {})
9
+ #
10
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
11
+ #
12
+ # @return [Array<Dodopayments::Models::LocaleInfo>]
13
+ #
14
+ # @see Dodopayments::Models::MiscListLocalesParams
15
+ def list_locales(params = {})
16
+ @client.request(
17
+ method: :get,
18
+ path: "locales",
19
+ model: Dodopayments::Internal::Type::ArrayOf[Dodopayments::LocaleInfo],
20
+ options: params[:request_options]
21
+ )
22
+ end
23
+
6
24
  # @overload list_supported_countries(request_options: {})
7
25
  #
8
26
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -125,21 +125,29 @@ module Dodopayments
125
125
  )
126
126
  end
127
127
 
128
- # @overload retrieve_line_items(payment_id, request_options: {})
128
+ # Some parameter documentations has been truncated, see
129
+ # {Dodopayments::Models::PaymentRetrieveLineItemsParams} for more details.
130
+ #
131
+ # @overload retrieve_line_items(payment_id, currency: nil, request_options: {})
129
132
  #
130
133
  # @param payment_id [String] Payment Id
131
134
  #
135
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the amounts. It must be the currency that the customer paid in.
136
+ #
132
137
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
133
138
  #
134
139
  # @return [Dodopayments::Models::PaymentRetrieveLineItemsResponse]
135
140
  #
136
141
  # @see Dodopayments::Models::PaymentRetrieveLineItemsParams
137
142
  def retrieve_line_items(payment_id, params = {})
143
+ parsed, options = Dodopayments::PaymentRetrieveLineItemsParams.dump_request(params)
144
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
138
145
  @client.request(
139
146
  method: :get,
140
147
  path: ["payments/%1$s/line-items", payment_id],
148
+ query: query,
141
149
  model: Dodopayments::Models::PaymentRetrieveLineItemsResponse,
142
- options: params[:request_options]
150
+ options: options
143
151
  )
144
152
  end
145
153
 
@@ -8,7 +8,9 @@ module Dodopayments
8
8
  # Returns paginated individual balance ledger entries for a payout. Each entry is
9
9
  # converted into the payout's currency at the rate the payout settled at. Supports
10
10
  # pagination via `page_size` (default 10, max 100) and `page_number` (default 0)
11
- # query parameters.
11
+ # query parameters. A settlement batch payout shows its rows in native amounts.
12
+ # `unattributed` is the payout amount less the sum of its rows in the payout
13
+ # currency.
12
14
  #
13
15
  # @overload list(payout_id, page_number: nil, page_size: nil, request_options: {})
14
16
  #
@@ -39,7 +41,8 @@ module Dodopayments
39
41
  # Downloads the complete payout breakup as a CSV file. Each row represents a
40
42
  # balance ledger entry with columns: Ledger ID, Event Type, Original Amount,
41
43
  # Original Currency, Reference Object ID, Description, Created At, USD Equivalent
42
- # Amount, and Payout Currency Amount.
44
+ # Amount, and Payout Currency Amount. A settlement batch payout shows its rows in
45
+ # native amounts.
43
46
  #
44
47
  # @overload download_csv(payout_id, request_options: {})
45
48
  #
@@ -10,7 +10,10 @@ module Dodopayments
10
10
  # Returns the breakdown of a payout by event type (payments, refunds, disputes,
11
11
  # fees, etc.) in the payout's currency. Each amount is proportionally allocated
12
12
  # based on USD equivalent values, ensuring the total sums exactly to the payout
13
- # amount.
13
+ # amount. A settlement batch payout shows its rows in native amounts. The
14
+ # `carried_over` line holds the opening balance from the switch to settlement
15
+ # batches and the rows dated before that opening balance. The `unattributed` line
16
+ # shows the payout amount that the rows do not account for.
14
17
  #
15
18
  # @overload retrieve(payout_id, request_options: {})
16
19
  #