dodopayments 2.34.0 → 2.36.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 (256) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +21 -1
  4. data/lib/dodopayments/client.rb +133 -4
  5. data/lib/dodopayments/models/addon_delete_params.rb +20 -0
  6. data/lib/dodopayments/models/addon_list_params.rb +25 -1
  7. data/lib/dodopayments/models/addon_retrieve_params.rb +18 -1
  8. data/lib/dodopayments/models/addon_unarchive_params.rb +20 -0
  9. data/lib/dodopayments/models/addons/translation_delete_params.rb +36 -0
  10. data/lib/dodopayments/models/addons/translation_list_params.rb +35 -0
  11. data/lib/dodopayments/models/addons/translation_update_params.rb +52 -0
  12. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  13. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  14. data/lib/dodopayments/models/checkout_session_preview_params.rb +17 -1
  15. data/lib/dodopayments/models/create_new_customer.rb +12 -1
  16. data/lib/dodopayments/models/credit_entitlement_list_params.rb +17 -1
  17. data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +18 -1
  18. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translation.rb +47 -0
  19. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rb +23 -0
  20. data/lib/dodopayments/models/credit_entitlements/translation_delete_params.rb +37 -0
  21. data/lib/dodopayments/models/credit_entitlements/translation_list_params.rb +36 -0
  22. data/lib/dodopayments/models/credit_entitlements/translation_update_params.rb +53 -0
  23. data/lib/dodopayments/models/customer.rb +9 -1
  24. data/lib/dodopayments/models/customer_create_params.rb +14 -1
  25. data/lib/dodopayments/models/customer_update_params.rb +14 -1
  26. data/lib/dodopayments/models/entitlement_list_params.rb +17 -1
  27. data/lib/dodopayments/models/entitlement_retrieve_params.rb +18 -1
  28. data/lib/dodopayments/models/entitlements/entitlement_translation.rb +67 -0
  29. data/lib/dodopayments/models/entitlements/entitlement_translations_list_response.rb +23 -0
  30. data/lib/dodopayments/models/entitlements/translation_delete_params.rb +36 -0
  31. data/lib/dodopayments/models/entitlements/translation_list_params.rb +35 -0
  32. data/lib/dodopayments/models/entitlements/translation_update_params.rb +69 -0
  33. data/lib/dodopayments/models/locale.rb +38 -0
  34. data/lib/dodopayments/models/locale_info.rb +34 -0
  35. data/lib/dodopayments/models/meter_list_params.rb +17 -1
  36. data/lib/dodopayments/models/meter_retrieve_params.rb +18 -1
  37. data/lib/dodopayments/models/meter_update_params.rb +49 -0
  38. data/lib/dodopayments/models/meters/translation_delete_params.rb +36 -0
  39. data/lib/dodopayments/models/meters/translation_list_params.rb +35 -0
  40. data/lib/dodopayments/models/meters/translation_update_params.rb +52 -0
  41. data/lib/dodopayments/models/misc_list_locales_params.rb +14 -0
  42. data/lib/dodopayments/models/misc_list_locales_response.rb +8 -0
  43. data/lib/dodopayments/models/payment.rb +29 -1
  44. data/lib/dodopayments/models/payment_list_response.rb +29 -1
  45. data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -1
  46. data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +10 -1
  47. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +3 -1
  48. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +2 -1
  49. data/lib/dodopayments/models/product_collection_list_params.rb +17 -1
  50. data/lib/dodopayments/models/product_collection_retrieve_params.rb +18 -1
  51. data/lib/dodopayments/models/product_collections/translation_delete_params.rb +37 -0
  52. data/lib/dodopayments/models/product_collections/translation_list_params.rb +36 -0
  53. data/lib/dodopayments/models/product_collections/translation_update_params.rb +53 -0
  54. data/lib/dodopayments/models/product_list_params.rb +14 -1
  55. data/lib/dodopayments/models/product_retrieve_params.rb +18 -1
  56. data/lib/dodopayments/models/products/translation.rb +50 -0
  57. data/lib/dodopayments/models/products/translation_delete_params.rb +36 -0
  58. data/lib/dodopayments/models/products/translation_list_params.rb +35 -0
  59. data/lib/dodopayments/models/products/translation_update_params.rb +52 -0
  60. data/lib/dodopayments/models/products/translations_list_response.rb +20 -0
  61. data/lib/dodopayments/models/refund_create_params.rb +13 -1
  62. data/lib/dodopayments/models/subscription_list_params.rb +14 -1
  63. data/lib/dodopayments/models/subscription_retrieve_params.rb +18 -1
  64. data/lib/dodopayments/models/three_ds_flow.rb +16 -0
  65. data/lib/dodopayments/models/three_ds_status.rb +21 -0
  66. data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -0
  67. data/lib/dodopayments/models.rb +20 -0
  68. data/lib/dodopayments/resources/addons/translations.rb +110 -0
  69. data/lib/dodopayments/resources/addons.rb +58 -3
  70. data/lib/dodopayments/resources/checkout_sessions.rb +31 -26
  71. data/lib/dodopayments/resources/credit_entitlements/translations.rb +113 -0
  72. data/lib/dodopayments/resources/credit_entitlements.rb +20 -3
  73. data/lib/dodopayments/resources/customers.rb +12 -2
  74. data/lib/dodopayments/resources/entitlements/translations.rb +114 -0
  75. data/lib/dodopayments/resources/entitlements.rb +20 -3
  76. data/lib/dodopayments/resources/meters/translations.rb +110 -0
  77. data/lib/dodopayments/resources/meters.rb +49 -3
  78. data/lib/dodopayments/resources/misc.rb +18 -0
  79. data/lib/dodopayments/resources/payments.rb +10 -2
  80. data/lib/dodopayments/resources/payouts/breakup/details.rb +5 -2
  81. data/lib/dodopayments/resources/payouts/breakup.rb +4 -1
  82. data/lib/dodopayments/resources/product_collections/translations.rb +113 -0
  83. data/lib/dodopayments/resources/product_collections.rb +20 -3
  84. data/lib/dodopayments/resources/products/translations.rb +110 -0
  85. data/lib/dodopayments/resources/products.rb +17 -3
  86. data/lib/dodopayments/resources/refunds.rb +6 -1
  87. data/lib/dodopayments/resources/subscriptions.rb +13 -3
  88. data/lib/dodopayments/version.rb +1 -1
  89. data/lib/dodopayments/workload_identity.rb +351 -0
  90. data/lib/dodopayments.rb +40 -0
  91. data/rbi/dodopayments/client.rbi +15 -2
  92. data/rbi/dodopayments/models/addon_delete_params.rbi +38 -0
  93. data/rbi/dodopayments/models/addon_list_params.rbi +32 -0
  94. data/rbi/dodopayments/models/addon_retrieve_params.rbi +29 -2
  95. data/rbi/dodopayments/models/addon_unarchive_params.rbi +38 -0
  96. data/rbi/dodopayments/models/addons/translation_delete_params.rbi +58 -0
  97. data/rbi/dodopayments/models/addons/translation_list_params.rbi +59 -0
  98. data/rbi/dodopayments/models/addons/translation_update_params.rbi +74 -0
  99. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  100. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  101. data/rbi/dodopayments/models/checkout_session_preview_params.rbi +29 -5
  102. data/rbi/dodopayments/models/create_new_customer.rbi +17 -3
  103. data/rbi/dodopayments/models/credit_entitlement_list_params.rbi +21 -0
  104. data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +29 -2
  105. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbi +70 -0
  106. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbi +54 -0
  107. data/rbi/dodopayments/models/credit_entitlements/translation_delete_params.rbi +58 -0
  108. data/rbi/dodopayments/models/credit_entitlements/translation_list_params.rbi +59 -0
  109. data/rbi/dodopayments/models/credit_entitlements/translation_update_params.rbi +74 -0
  110. data/rbi/dodopayments/models/customer.rbi +11 -3
  111. data/rbi/dodopayments/models/customer_create_params.rbi +12 -0
  112. data/rbi/dodopayments/models/customer_update_params.rbi +12 -0
  113. data/rbi/dodopayments/models/entitlement_list_params.rbi +21 -0
  114. data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +29 -2
  115. data/rbi/dodopayments/models/entitlements/entitlement_translation.rbi +87 -0
  116. data/rbi/dodopayments/models/entitlements/entitlement_translations_list_response.rbi +48 -0
  117. data/rbi/dodopayments/models/entitlements/translation_delete_params.rbi +58 -0
  118. data/rbi/dodopayments/models/entitlements/translation_list_params.rbi +59 -0
  119. data/rbi/dodopayments/models/entitlements/translation_update_params.rbi +92 -0
  120. data/rbi/dodopayments/models/locale.rbi +42 -0
  121. data/rbi/dodopayments/models/locale_info.rbi +54 -0
  122. data/rbi/dodopayments/models/meter_list_params.rbi +21 -0
  123. data/rbi/dodopayments/models/meter_retrieve_params.rbi +29 -2
  124. data/rbi/dodopayments/models/meter_update_params.rbi +70 -0
  125. data/rbi/dodopayments/models/meters/translation_delete_params.rbi +58 -0
  126. data/rbi/dodopayments/models/meters/translation_list_params.rbi +59 -0
  127. data/rbi/dodopayments/models/meters/translation_update_params.rbi +74 -0
  128. data/rbi/dodopayments/models/misc_list_locales_params.rbi +32 -0
  129. data/rbi/dodopayments/models/misc_list_locales_response.rbi +11 -0
  130. data/rbi/dodopayments/models/payment.rbi +33 -0
  131. data/rbi/dodopayments/models/payment_list_response.rbi +36 -3
  132. data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +21 -2
  133. data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +14 -3
  134. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +6 -2
  135. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -2
  136. data/rbi/dodopayments/models/product_collection_list_params.rbi +21 -0
  137. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +29 -2
  138. data/rbi/dodopayments/models/product_collections/translation_delete_params.rbi +58 -0
  139. data/rbi/dodopayments/models/product_collections/translation_list_params.rbi +59 -0
  140. data/rbi/dodopayments/models/product_collections/translation_update_params.rbi +74 -0
  141. data/rbi/dodopayments/models/product_list_params.rbi +21 -0
  142. data/rbi/dodopayments/models/product_retrieve_params.rbi +29 -2
  143. data/rbi/dodopayments/models/products/translation.rbi +70 -0
  144. data/rbi/dodopayments/models/products/translation_delete_params.rbi +58 -0
  145. data/rbi/dodopayments/models/products/translation_list_params.rbi +59 -0
  146. data/rbi/dodopayments/models/products/translation_update_params.rbi +74 -0
  147. data/rbi/dodopayments/models/products/translations_list_response.rbi +37 -0
  148. data/rbi/dodopayments/models/refund_create_params.rbi +10 -0
  149. data/rbi/dodopayments/models/subscription_list_params.rbi +21 -0
  150. data/rbi/dodopayments/models/subscription_retrieve_params.rbi +25 -1
  151. data/rbi/dodopayments/models/three_ds_flow.rbi +23 -0
  152. data/rbi/dodopayments/models/three_ds_status.rbi +31 -0
  153. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +15 -0
  154. data/rbi/dodopayments/models.rbi +20 -0
  155. data/rbi/dodopayments/resources/addons/translations.rbi +77 -0
  156. data/rbi/dodopayments/resources/addons.rbi +48 -0
  157. data/rbi/dodopayments/resources/checkout_sessions.rbi +55 -39
  158. data/rbi/dodopayments/resources/credit_entitlements/translations.rbi +81 -0
  159. data/rbi/dodopayments/resources/credit_entitlements.rbi +19 -0
  160. data/rbi/dodopayments/resources/customers.rbi +10 -0
  161. data/rbi/dodopayments/resources/entitlements/translations.rbi +87 -0
  162. data/rbi/dodopayments/resources/entitlements.rbi +19 -0
  163. data/rbi/dodopayments/resources/meters/translations.rbi +77 -0
  164. data/rbi/dodopayments/resources/meters.rbi +42 -0
  165. data/rbi/dodopayments/resources/misc.rbi +9 -0
  166. data/rbi/dodopayments/resources/payments.rbi +4 -0
  167. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +5 -2
  168. data/rbi/dodopayments/resources/payouts/breakup.rbi +4 -1
  169. data/rbi/dodopayments/resources/product_collections/translations.rbi +77 -0
  170. data/rbi/dodopayments/resources/product_collections.rbi +19 -0
  171. data/rbi/dodopayments/resources/products/translations.rbi +77 -0
  172. data/rbi/dodopayments/resources/products.rbi +19 -0
  173. data/rbi/dodopayments/resources/refunds.rbi +4 -0
  174. data/rbi/dodopayments/resources/subscriptions.rbi +26 -0
  175. data/rbi/dodopayments/workload_identity.rbi +219 -0
  176. data/sig/dodopayments/client.rbs +6 -1
  177. data/sig/dodopayments/models/addon_delete_params.rbs +23 -0
  178. data/sig/dodopayments/models/addon_list_params.rbs +18 -1
  179. data/sig/dodopayments/models/addon_retrieve_params.rbs +8 -1
  180. data/sig/dodopayments/models/addon_unarchive_params.rbs +23 -0
  181. data/sig/dodopayments/models/addons/translation_delete_params.rbs +30 -0
  182. data/sig/dodopayments/models/addons/translation_list_params.rbs +32 -0
  183. data/sig/dodopayments/models/addons/translation_update_params.rbs +43 -0
  184. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  185. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  186. data/sig/dodopayments/models/checkout_session_preview_params.rbs +13 -3
  187. data/sig/dodopayments/models/create_new_customer.rbs +8 -3
  188. data/sig/dodopayments/models/credit_entitlement_list_params.rbs +12 -1
  189. data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +8 -1
  190. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbs +39 -0
  191. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbs +24 -0
  192. data/sig/dodopayments/models/credit_entitlements/translation_delete_params.rbs +30 -0
  193. data/sig/dodopayments/models/credit_entitlements/translation_list_params.rbs +32 -0
  194. data/sig/dodopayments/models/credit_entitlements/translation_update_params.rbs +43 -0
  195. data/sig/dodopayments/models/customer.rbs +8 -3
  196. data/sig/dodopayments/models/customer_create_params.rbs +6 -1
  197. data/sig/dodopayments/models/customer_update_params.rbs +6 -1
  198. data/sig/dodopayments/models/entitlement_list_params.rbs +7 -0
  199. data/sig/dodopayments/models/entitlement_retrieve_params.rbs +8 -1
  200. data/sig/dodopayments/models/entitlements/entitlement_translation.rbs +49 -0
  201. data/sig/dodopayments/models/entitlements/entitlement_translations_list_response.rbs +22 -0
  202. data/sig/dodopayments/models/entitlements/translation_delete_params.rbs +30 -0
  203. data/sig/dodopayments/models/entitlements/translation_list_params.rbs +32 -0
  204. data/sig/dodopayments/models/entitlements/translation_update_params.rbs +53 -0
  205. data/sig/dodopayments/models/locale.rbs +56 -0
  206. data/sig/dodopayments/models/locale_info.rbs +26 -0
  207. data/sig/dodopayments/models/meter_list_params.rbs +12 -1
  208. data/sig/dodopayments/models/meter_retrieve_params.rbs +8 -1
  209. data/sig/dodopayments/models/meter_update_params.rbs +41 -0
  210. data/sig/dodopayments/models/meters/translation_delete_params.rbs +30 -0
  211. data/sig/dodopayments/models/meters/translation_list_params.rbs +32 -0
  212. data/sig/dodopayments/models/meters/translation_update_params.rbs +43 -0
  213. data/sig/dodopayments/models/misc_list_locales_params.rbs +15 -0
  214. data/sig/dodopayments/models/misc_list_locales_response.rbs +7 -0
  215. data/sig/dodopayments/models/payment.rbs +15 -0
  216. data/sig/dodopayments/models/payment_list_response.rbs +18 -3
  217. data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +10 -1
  218. data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +8 -3
  219. data/sig/dodopayments/models/product_collection_list_params.rbs +7 -0
  220. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +8 -1
  221. data/sig/dodopayments/models/product_collections/translation_delete_params.rbs +30 -0
  222. data/sig/dodopayments/models/product_collections/translation_list_params.rbs +32 -0
  223. data/sig/dodopayments/models/product_collections/translation_update_params.rbs +43 -0
  224. data/sig/dodopayments/models/product_list_params.rbs +7 -0
  225. data/sig/dodopayments/models/product_retrieve_params.rbs +8 -1
  226. data/sig/dodopayments/models/products/translation.rbs +37 -0
  227. data/sig/dodopayments/models/products/translation_delete_params.rbs +30 -0
  228. data/sig/dodopayments/models/products/translation_list_params.rbs +32 -0
  229. data/sig/dodopayments/models/products/translation_update_params.rbs +43 -0
  230. data/sig/dodopayments/models/products/translations_list_response.rbs +18 -0
  231. data/sig/dodopayments/models/refund_create_params.rbs +5 -0
  232. data/sig/dodopayments/models/subscription_list_params.rbs +7 -0
  233. data/sig/dodopayments/models/subscription_retrieve_params.rbs +7 -1
  234. data/sig/dodopayments/models/three_ds_flow.rbs +14 -0
  235. data/sig/dodopayments/models/three_ds_status.rbs +24 -0
  236. data/sig/dodopayments/models.rbs +20 -0
  237. data/sig/dodopayments/resources/addons/translations.rbs +29 -0
  238. data/sig/dodopayments/resources/addons.rbs +15 -0
  239. data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
  240. data/sig/dodopayments/resources/credit_entitlements/translations.rbs +29 -0
  241. data/sig/dodopayments/resources/credit_entitlements.rbs +4 -0
  242. data/sig/dodopayments/resources/customers.rbs +2 -0
  243. data/sig/dodopayments/resources/entitlements/translations.rbs +31 -0
  244. data/sig/dodopayments/resources/entitlements.rbs +4 -0
  245. data/sig/dodopayments/resources/meters/translations.rbs +29 -0
  246. data/sig/dodopayments/resources/meters.rbs +12 -0
  247. data/sig/dodopayments/resources/misc.rbs +4 -0
  248. data/sig/dodopayments/resources/payments.rbs +1 -0
  249. data/sig/dodopayments/resources/product_collections/translations.rbs +29 -0
  250. data/sig/dodopayments/resources/product_collections.rbs +4 -0
  251. data/sig/dodopayments/resources/products/translations.rbs +29 -0
  252. data/sig/dodopayments/resources/products.rbs +4 -0
  253. data/sig/dodopayments/resources/refunds.rbs +1 -0
  254. data/sig/dodopayments/resources/subscriptions.rbs +2 -0
  255. data/sig/dodopayments/workload_identity.rbs +89 -0
  256. metadata +122 -2
@@ -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
  #
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class ProductCollections
6
+ class Translations
7
+ # Some parameter documentations has been truncated, see
8
+ # {Dodopayments::Models::ProductCollections::TranslationUpdateParams} for more
9
+ # details.
10
+ #
11
+ # Creates or replaces the translation of one locale. The response is 201 for a new
12
+ # locale and 200 for a replaced locale.
13
+ #
14
+ # @overload update(locale, id:, description: nil, name: nil, request_options: {})
15
+ #
16
+ # @param locale [Symbol, Dodopayments::Models::Locale] Path param: A locale that the checkout and the customer portal can show.
17
+ #
18
+ # @param id [String] Path param: Product Collection Id
19
+ #
20
+ # @param description [String, nil] Body param: The translated description.
21
+ #
22
+ # @param name [String, nil] Body param: The translated name.
23
+ #
24
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
25
+ #
26
+ # @return [Dodopayments::Models::Products::Translation]
27
+ #
28
+ # @see Dodopayments::Models::ProductCollections::TranslationUpdateParams
29
+ def update(locale, params)
30
+ parsed, options = Dodopayments::ProductCollections::TranslationUpdateParams.dump_request(params)
31
+ id =
32
+ parsed.delete(:id) do
33
+ raise ArgumentError.new("missing required path argument #{_1}")
34
+ end
35
+ @client.request(
36
+ method: :put,
37
+ path: ["product-collections/%1$s/translations/%2$s", id, locale],
38
+ body: parsed,
39
+ model: Dodopayments::Products::Translation,
40
+ options: options
41
+ )
42
+ end
43
+
44
+ # Some parameter documentations has been truncated, see
45
+ # {Dodopayments::Models::ProductCollections::TranslationListParams} for more
46
+ # details.
47
+ #
48
+ # Lists the translations, for all the locales or for the locales of the filter.
49
+ #
50
+ # @overload list(id, locale: nil, request_options: {})
51
+ #
52
+ # @param id [String] Product Collection Id
53
+ #
54
+ # @param locale [Array<String>] Returns only these locales, for example `?locale=fr&locale=de`. With no value, t
55
+ #
56
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
57
+ #
58
+ # @return [Dodopayments::Models::Products::TranslationsListResponse]
59
+ #
60
+ # @see Dodopayments::Models::ProductCollections::TranslationListParams
61
+ def list(id, params = {})
62
+ parsed, options = Dodopayments::ProductCollections::TranslationListParams.dump_request(params)
63
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
64
+ @client.request(
65
+ method: :get,
66
+ path: ["product-collections/%1$s/translations", id],
67
+ query: query,
68
+ model: Dodopayments::Products::TranslationsListResponse,
69
+ options: options
70
+ )
71
+ end
72
+
73
+ # Some parameter documentations has been truncated, see
74
+ # {Dodopayments::Models::ProductCollections::TranslationDeleteParams} for more
75
+ # details.
76
+ #
77
+ # Deletes the translation of one locale.
78
+ #
79
+ # @overload delete(locale, id:, request_options: {})
80
+ #
81
+ # @param locale [Symbol, Dodopayments::Models::Locale] A locale that the checkout and the customer portal can show.
82
+ #
83
+ # @param id [String] Product Collection Id
84
+ #
85
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
86
+ #
87
+ # @return [nil]
88
+ #
89
+ # @see Dodopayments::Models::ProductCollections::TranslationDeleteParams
90
+ def delete(locale, params)
91
+ parsed, options = Dodopayments::ProductCollections::TranslationDeleteParams.dump_request(params)
92
+ id =
93
+ parsed.delete(:id) do
94
+ raise ArgumentError.new("missing required path argument #{_1}")
95
+ end
96
+ @client.request(
97
+ method: :delete,
98
+ path: ["product-collections/%1$s/translations/%2$s", id, locale],
99
+ model: NilClass,
100
+ options: options
101
+ )
102
+ end
103
+
104
+ # @api private
105
+ #
106
+ # @param client [Dodopayments::Client]
107
+ def initialize(client:)
108
+ @client = client
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class ProductCollections
6
+ # @return [Dodopayments::Resources::ProductCollections::Translations]
7
+ attr_reader :translations
8
+
6
9
  # @return [Dodopayments::Resources::ProductCollections::Groups]
7
10
  attr_reader :groups
8
11
 
@@ -45,21 +48,29 @@ module Dodopayments
45
48
  )
46
49
  end
47
50
 
48
- # @overload retrieve(id, request_options: {})
51
+ # Some parameter documentations has been truncated, see
52
+ # {Dodopayments::Models::ProductCollectionRetrieveParams} for more details.
53
+ #
54
+ # @overload retrieve(id, locale: nil, request_options: {})
49
55
  #
50
56
  # @param id [String] Product Collection Id
51
57
  #
58
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
59
+ #
52
60
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
53
61
  #
54
62
  # @return [Dodopayments::Models::ProductCollection]
55
63
  #
56
64
  # @see Dodopayments::Models::ProductCollectionRetrieveParams
57
65
  def retrieve(id, params = {})
66
+ parsed, options = Dodopayments::ProductCollectionRetrieveParams.dump_request(params)
67
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
58
68
  @client.request(
59
69
  method: :get,
60
70
  path: ["product-collections/%1$s", id],
71
+ query: query,
61
72
  model: Dodopayments::ProductCollection,
62
- options: params[:request_options]
73
+ options: options
63
74
  )
64
75
  end
65
76
 
@@ -106,12 +117,17 @@ module Dodopayments
106
117
  )
107
118
  end
108
119
 
109
- # @overload list(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {})
120
+ # Some parameter documentations has been truncated, see
121
+ # {Dodopayments::Models::ProductCollectionListParams} for more details.
122
+ #
123
+ # @overload list(archived: nil, brand_id: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
110
124
  #
111
125
  # @param archived [Boolean] List archived collections
112
126
  #
113
127
  # @param brand_id [String] Filter by Brand id
114
128
  #
129
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
130
+ #
115
131
  # @param page_number [Integer] Page number default is 0
116
132
  #
117
133
  # @param page_size [Integer] Page size default is 10 max is 100
@@ -198,6 +214,7 @@ module Dodopayments
198
214
  # @param client [Dodopayments::Client]
199
215
  def initialize(client:)
200
216
  @client = client
217
+ @translations = Dodopayments::Resources::ProductCollections::Translations.new(client: client)
201
218
  @groups = Dodopayments::Resources::ProductCollections::Groups.new(client: client)
202
219
  end
203
220
  end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Products
6
+ class Translations
7
+ # Some parameter documentations has been truncated, see
8
+ # {Dodopayments::Models::Products::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: Product 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::Products::TranslationUpdateParams
28
+ def update(locale, params)
29
+ parsed, options = Dodopayments::Products::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: ["products/%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::Products::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] Product 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::Products::TranslationListParams
59
+ def list(id, params = {})
60
+ parsed, options = Dodopayments::Products::TranslationListParams.dump_request(params)
61
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
62
+ @client.request(
63
+ method: :get,
64
+ path: ["products/%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::Products::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] Product Id
81
+ #
82
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
83
+ #
84
+ # @return [nil]
85
+ #
86
+ # @see Dodopayments::Models::Products::TranslationDeleteParams
87
+ def delete(locale, params)
88
+ parsed, options = Dodopayments::Products::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: ["products/%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 Products
6
+ # @return [Dodopayments::Resources::Products::Translations]
7
+ attr_reader :translations
8
+
6
9
  # @return [Dodopayments::Resources::Products::Images]
7
10
  attr_reader :images
8
11
 
@@ -63,21 +66,29 @@ module Dodopayments
63
66
  )
64
67
  end
65
68
 
66
- # @overload retrieve(id, request_options: {})
69
+ # Some parameter documentations has been truncated, see
70
+ # {Dodopayments::Models::ProductRetrieveParams} for more details.
71
+ #
72
+ # @overload retrieve(id, locale: nil, request_options: {})
67
73
  #
68
74
  # @param id [String] Product Id
69
75
  #
76
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
77
+ #
70
78
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
71
79
  #
72
80
  # @return [Dodopayments::Models::Product]
73
81
  #
74
82
  # @see Dodopayments::Models::ProductRetrieveParams
75
83
  def retrieve(id, params = {})
84
+ parsed, options = Dodopayments::ProductRetrieveParams.dump_request(params)
85
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
76
86
  @client.request(
77
87
  method: :get,
78
88
  path: ["products/%1$s", id],
89
+ query: query,
79
90
  model: Dodopayments::Product,
80
- options: params[:request_options]
91
+ options: options
81
92
  )
82
93
  end
83
94
 
@@ -139,12 +150,14 @@ module Dodopayments
139
150
  # Some parameter documentations has been truncated, see
140
151
  # {Dodopayments::Models::ProductListParams} for more details.
141
152
  #
142
- # @overload list(archived: nil, brand_id: nil, page_number: nil, page_size: nil, recurring: nil, request_options: {})
153
+ # @overload list(archived: nil, brand_id: nil, locale: nil, page_number: nil, page_size: nil, recurring: nil, request_options: {})
143
154
  #
144
155
  # @param archived [Boolean] List archived products
145
156
  #
146
157
  # @param brand_id [String] filter by Brand id
147
158
  #
159
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
160
+ #
148
161
  # @param page_number [Integer] Page number default is 0
149
162
  #
150
163
  # @param page_size [Integer] Page size default is 10 max is 100
@@ -232,6 +245,7 @@ module Dodopayments
232
245
  # @param client [Dodopayments::Client]
233
246
  def initialize(client:)
234
247
  @client = client
248
+ @translations = Dodopayments::Resources::Products::Translations.new(client: client)
235
249
  @images = Dodopayments::Resources::Products::Images.new(client: client)
236
250
  @short_links = Dodopayments::Resources::Products::ShortLinks.new(client: client)
237
251
  @localized_prices = Dodopayments::Resources::Products::LocalizedPrices.new(client: client)
@@ -3,10 +3,15 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Refunds
6
- # @overload create(payment_id:, items: nil, metadata: nil, reason: nil, request_options: {})
6
+ # Some parameter documentations has been truncated, see
7
+ # {Dodopayments::Models::RefundCreateParams} for more details.
8
+ #
9
+ # @overload create(payment_id:, currency: nil, items: nil, metadata: nil, reason: nil, request_options: {})
7
10
  #
8
11
  # @param payment_id [String] The unique identifier of the payment to be refunded.
9
12
  #
13
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil] The currency of every `items[].amount`. It must be the currency the customer pai
14
+ #
10
15
  # @param items [Array<Dodopayments::Models::RefundCreateParams::Item>, nil] Partially Refund an Individual Item
11
16
  #
12
17
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Additional metadata associated with the refund.
@@ -74,21 +74,29 @@ module Dodopayments
74
74
  )
75
75
  end
76
76
 
77
- # @overload retrieve(subscription_id, request_options: {})
77
+ # Some parameter documentations has been truncated, see
78
+ # {Dodopayments::Models::SubscriptionRetrieveParams} for more details.
79
+ #
80
+ # @overload retrieve(subscription_id, locale: nil, request_options: {})
78
81
  #
79
82
  # @param subscription_id [String] Subscription Id
80
83
  #
84
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
85
+ #
81
86
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
82
87
  #
83
88
  # @return [Dodopayments::Models::Subscription]
84
89
  #
85
90
  # @see Dodopayments::Models::SubscriptionRetrieveParams
86
91
  def retrieve(subscription_id, params = {})
92
+ parsed, options = Dodopayments::SubscriptionRetrieveParams.dump_request(params)
93
+ query = Dodopayments::Internal::Util.encode_query_params(parsed)
87
94
  @client.request(
88
95
  method: :get,
89
96
  path: ["subscriptions/%1$s", subscription_id],
97
+ query: query,
90
98
  model: Dodopayments::Subscription,
91
- options: params[:request_options]
99
+ options: options
92
100
  )
93
101
  end
94
102
 
@@ -150,7 +158,7 @@ module Dodopayments
150
158
  # Some parameter documentations has been truncated, see
151
159
  # {Dodopayments::Models::SubscriptionListParams} for more details.
152
160
  #
153
- # @overload list(brand_id: nil, cancel_at_next_billing_date: nil, created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, request_options: {})
161
+ # @overload list(brand_id: nil, cancel_at_next_billing_date: nil, created_at_gte: nil, created_at_lte: nil, customer_id: nil, locale: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, request_options: {})
154
162
  #
155
163
  # @param brand_id [String] filter by Brand id
156
164
  #
@@ -162,6 +170,8 @@ module Dodopayments
162
170
  #
163
171
  # @param customer_id [String] Filter by customer id
164
172
  #
173
+ # @param locale [String] Shows the translated name, description and unit of the catalog entities in this
174
+ #
165
175
  # @param page_number [Integer] Page number default is 0
166
176
  #
167
177
  # @param page_size [Integer] Page size default is 10 max is 100
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.34.0"
4
+ VERSION = "2.36.0"
5
5
  end