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
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class ProductCollections
6
+ class Translations
7
+ # Creates or replaces the translation of one locale. The response is 201 for a new
8
+ # locale and 200 for a replaced locale.
9
+ sig do
10
+ params(
11
+ locale: Dodopayments::Locale::OrSymbol,
12
+ id: String,
13
+ description: T.nilable(String),
14
+ name: T.nilable(String),
15
+ request_options: Dodopayments::RequestOptions::OrHash
16
+ ).returns(Dodopayments::Products::Translation)
17
+ end
18
+ def update(
19
+ # Path param: A locale that the checkout and the customer portal can show.
20
+ #
21
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
22
+ locale,
23
+ # Path param: Product Collection Id
24
+ id:,
25
+ # Body param: The translated description.
26
+ description: nil,
27
+ # Body param: The translated name.
28
+ name: nil,
29
+ request_options: {}
30
+ )
31
+ end
32
+
33
+ # Lists the translations, for all the locales or for the locales of the filter.
34
+ sig do
35
+ params(
36
+ id: String,
37
+ locale: T::Array[String],
38
+ request_options: Dodopayments::RequestOptions::OrHash
39
+ ).returns(Dodopayments::Products::TranslationsListResponse)
40
+ end
41
+ def list(
42
+ # Product Collection Id
43
+ id,
44
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
45
+ # the response has all the locales.
46
+ locale: nil,
47
+ request_options: {}
48
+ )
49
+ end
50
+
51
+ # Deletes the translation of one locale.
52
+ sig do
53
+ params(
54
+ locale: Dodopayments::Locale::OrSymbol,
55
+ id: String,
56
+ request_options: Dodopayments::RequestOptions::OrHash
57
+ ).void
58
+ end
59
+ def delete(
60
+ # A locale that the checkout and the customer portal can show.
61
+ #
62
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
63
+ locale,
64
+ # Product Collection Id
65
+ id:,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ # @api private
71
+ sig { params(client: Dodopayments::Client).returns(T.attached_class) }
72
+ def self.new(client:)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class ProductCollections
6
+ sig { returns(Dodopayments::Resources::ProductCollections::Translations) }
7
+ attr_reader :translations
8
+
6
9
  sig { returns(Dodopayments::Resources::ProductCollections::Groups) }
7
10
  attr_reader :groups
8
11
 
@@ -69,12 +72,20 @@ module Dodopayments
69
72
  sig do
70
73
  params(
71
74
  id: String,
75
+ locale: String,
72
76
  request_options: Dodopayments::RequestOptions::OrHash
73
77
  ).returns(Dodopayments::ProductCollection)
74
78
  end
75
79
  def retrieve(
76
80
  # Product Collection Id
77
81
  id,
82
+ # Shows the translated name, description and unit of the catalog entities in this
83
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
84
+ # with no translation, an unknown code, or no code shows the base text.
85
+ #
86
+ # Do not send a text from a localized response back in a create or update request.
87
+ # The base text then changes to the translated text.
88
+ locale: nil,
78
89
  request_options: {}
79
90
  )
80
91
  end
@@ -146,6 +157,7 @@ module Dodopayments
146
157
  params(
147
158
  archived: T::Boolean,
148
159
  brand_id: String,
160
+ locale: String,
149
161
  page_number: Integer,
150
162
  page_size: Integer,
151
163
  request_options: Dodopayments::RequestOptions::OrHash
@@ -160,6 +172,13 @@ module Dodopayments
160
172
  archived: nil,
161
173
  # Filter by Brand id
162
174
  brand_id: nil,
175
+ # Shows the translated name, description and unit of the catalog entities in this
176
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
177
+ # with no translation, an unknown code, or no code shows the base text.
178
+ #
179
+ # Do not send a text from a localized response back in a create or update request.
180
+ # The base text then changes to the translated text.
181
+ locale: nil,
163
182
  # Page number default is 0
164
183
  page_number: nil,
165
184
  # Page size default is 10 max is 100
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Products
6
+ class Translations
7
+ # Creates or replaces the translation of one locale. The response is 201 for a new
8
+ # locale and 200 for a replaced locale.
9
+ sig do
10
+ params(
11
+ locale: Dodopayments::Locale::OrSymbol,
12
+ id: String,
13
+ description: T.nilable(String),
14
+ name: T.nilable(String),
15
+ request_options: Dodopayments::RequestOptions::OrHash
16
+ ).returns(Dodopayments::Products::Translation)
17
+ end
18
+ def update(
19
+ # Path param: A locale that the checkout and the customer portal can show.
20
+ #
21
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
22
+ locale,
23
+ # Path param: Product Id
24
+ id:,
25
+ # Body param: The translated description.
26
+ description: nil,
27
+ # Body param: The translated name.
28
+ name: nil,
29
+ request_options: {}
30
+ )
31
+ end
32
+
33
+ # Lists the translations, for all the locales or for the locales of the filter.
34
+ sig do
35
+ params(
36
+ id: String,
37
+ locale: T::Array[String],
38
+ request_options: Dodopayments::RequestOptions::OrHash
39
+ ).returns(Dodopayments::Products::TranslationsListResponse)
40
+ end
41
+ def list(
42
+ # Product Id
43
+ id,
44
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
45
+ # the response has all the locales.
46
+ locale: nil,
47
+ request_options: {}
48
+ )
49
+ end
50
+
51
+ # Deletes the translation of one locale.
52
+ sig do
53
+ params(
54
+ locale: Dodopayments::Locale::OrSymbol,
55
+ id: String,
56
+ request_options: Dodopayments::RequestOptions::OrHash
57
+ ).void
58
+ end
59
+ def delete(
60
+ # A locale that the checkout and the customer portal can show.
61
+ #
62
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
63
+ locale,
64
+ # Product Id
65
+ id:,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ # @api private
71
+ sig { params(client: Dodopayments::Client).returns(T.attached_class) }
72
+ def self.new(client:)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Products
6
+ sig { returns(Dodopayments::Resources::Products::Translations) }
7
+ attr_reader :translations
8
+
6
9
  sig { returns(Dodopayments::Resources::Products::Images) }
7
10
  attr_reader :images
8
11
 
@@ -101,12 +104,20 @@ module Dodopayments
101
104
  sig do
102
105
  params(
103
106
  id: String,
107
+ locale: String,
104
108
  request_options: Dodopayments::RequestOptions::OrHash
105
109
  ).returns(Dodopayments::Product)
106
110
  end
107
111
  def retrieve(
108
112
  # Product Id
109
113
  id,
114
+ # Shows the translated name, description and unit of the catalog entities in this
115
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
116
+ # with no translation, an unknown code, or no code shows the base text.
117
+ #
118
+ # Do not send a text from a localized response back in a create or update request.
119
+ # The base text then changes to the translated text.
120
+ locale: nil,
110
121
  request_options: {}
111
122
  )
112
123
  end
@@ -216,6 +227,7 @@ module Dodopayments
216
227
  params(
217
228
  archived: T::Boolean,
218
229
  brand_id: String,
230
+ locale: String,
219
231
  page_number: Integer,
220
232
  page_size: Integer,
221
233
  recurring: T::Boolean,
@@ -231,6 +243,13 @@ module Dodopayments
231
243
  archived: nil,
232
244
  # filter by Brand id
233
245
  brand_id: nil,
246
+ # Shows the translated name, description and unit of the catalog entities in this
247
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
248
+ # with no translation, an unknown code, or no code shows the base text.
249
+ #
250
+ # Do not send a text from a localized response back in a create or update request.
251
+ # The base text then changes to the translated text.
252
+ locale: nil,
234
253
  # Page number default is 0
235
254
  page_number: nil,
236
255
  # Page size default is 10 max is 100
@@ -6,6 +6,7 @@ module Dodopayments
6
6
  sig do
7
7
  params(
8
8
  payment_id: String,
9
+ currency: T.nilable(Dodopayments::Currency::OrSymbol),
9
10
  items:
10
11
  T.nilable(T::Array[Dodopayments::RefundCreateParams::Item::OrHash]),
11
12
  metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
@@ -16,6 +17,9 @@ module Dodopayments
16
17
  def create(
17
18
  # The unique identifier of the payment to be refunded.
18
19
  payment_id:,
20
+ # The currency of every `items[].amount`. It must be the currency the customer
21
+ # paid in. Without it, the amounts are in the settlement currency.
22
+ currency: nil,
19
23
  # Partially Refund an Individual Item
20
24
  items: nil,
21
25
  # Additional metadata associated with the refund.
@@ -116,12 +116,20 @@ module Dodopayments
116
116
  sig do
117
117
  params(
118
118
  subscription_id: String,
119
+ locale: String,
119
120
  request_options: Dodopayments::RequestOptions::OrHash
120
121
  ).returns(Dodopayments::Subscription)
121
122
  end
122
123
  def retrieve(
123
124
  # Subscription Id
124
125
  subscription_id,
126
+ # Shows the translated name, description and unit of the catalog entities in this
127
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
128
+ # with no translation, an unknown code, or no code shows the base text.
129
+ #
130
+ # Do not send a text from a localized response back in a create or update request.
131
+ # The base text then changes to the translated text.
132
+ locale: nil,
125
133
  request_options: {}
126
134
  )
127
135
  end
@@ -224,6 +232,7 @@ module Dodopayments
224
232
  created_at_gte: Time,
225
233
  created_at_lte: Time,
226
234
  customer_id: String,
235
+ locale: String,
227
236
  page_number: Integer,
228
237
  page_size: Integer,
229
238
  product_id: String,
@@ -246,6 +255,13 @@ module Dodopayments
246
255
  created_at_lte: nil,
247
256
  # Filter by customer id
248
257
  customer_id: nil,
258
+ # Shows the translated name, description and unit of the catalog entities in this
259
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
260
+ # with no translation, an unknown code, or no code shows the base text.
261
+ #
262
+ # Do not send a text from a localized response back in a create or update request.
263
+ # The base text then changes to the translated text.
264
+ locale: nil,
249
265
  # Page number default is 0
250
266
  page_number: nil,
251
267
  # Page size default is 10 max is 100
@@ -369,6 +385,11 @@ module Dodopayments
369
385
  # - `apply_change` (default): Apply plan change immediately regardless of payment
370
386
  # outcome
371
387
  #
388
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
389
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
390
+ # cancelled. The subscription then renews on the current plan, with the usual
391
+ # payment retries.
392
+ #
372
393
  # If not specified, uses the business-level default setting.
373
394
  on_payment_failure: nil,
374
395
  # The URL that receives the customer after they pay the payment link. Needs
@@ -525,6 +546,11 @@ module Dodopayments
525
546
  # - `apply_change` (default): Apply plan change immediately regardless of payment
526
547
  # outcome
527
548
  #
549
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
550
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
551
+ # cancelled. The subscription then renews on the current plan, with the usual
552
+ # payment retries.
553
+ #
528
554
  # If not specified, uses the business-level default setting.
529
555
  on_payment_failure: nil,
530
556
  # The URL that receives the customer after they pay the payment link. Needs
@@ -0,0 +1,219 @@
1
+ # typed: strong
2
+
3
+ # typed: strong
4
+
5
+ module Dodopayments
6
+ # Workload identity federation: exchange a short-lived OIDC token (JWT) from
7
+ # your platform for a short-lived API access token.
8
+ module WorkloadIdentity
9
+ GRANT_TYPE = T.let(T.unsafe(nil), String)
10
+
11
+ SUBJECT_TOKEN_TYPE = T.let(T.unsafe(nil), String)
12
+
13
+ # The client refreshes the access token when this many seconds or less remain.
14
+ REFRESH_WINDOW_IN_SECONDS = T.let(T.unsafe(nil), Integer)
15
+
16
+ PROVIDER_TIMEOUT_IN_SECONDS = T.let(T.unsafe(nil), Integer)
17
+
18
+ KUBERNETES_TOKEN_PATH = T.let(T.unsafe(nil), String)
19
+
20
+ GCP_METADATA_URL = T.let(T.unsafe(nil), String)
21
+
22
+ # The values that a subject token provider gets on each token exchange.
23
+ class Context
24
+ # The base URL of the client.
25
+ sig { returns(URI::Generic) }
26
+ attr_reader :base_url
27
+
28
+ # The default audience: the origin of the client base URL.
29
+ sig { returns(String) }
30
+ attr_reader :audience
31
+
32
+ # @api private
33
+ sig do
34
+ params(base_url: URI::Generic, audience: String).returns(
35
+ T.attached_class
36
+ )
37
+ end
38
+ def self.new(base_url:, audience:)
39
+ end
40
+ end
41
+
42
+ # The `workload_identity` option of the client.
43
+ class Config
44
+ sig { returns(String) }
45
+ attr_reader :identity_provider_id
46
+
47
+ sig { returns(T.anything) }
48
+ attr_reader :provider
49
+
50
+ sig do
51
+ params(
52
+ provider: T.anything,
53
+ identity_provider_id: T.nilable(String)
54
+ ).returns(T.attached_class)
55
+ end
56
+ def self.new(
57
+ # Returns the subject token (a JWT string). It can take one argument, a
58
+ # `WorkloadIdentity::Context`.
59
+ provider:,
60
+ # Defaults to `ENV["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"]`
61
+ identity_provider_id: ENV["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"]
62
+ )
63
+ end
64
+
65
+ # @api private
66
+ sig do
67
+ params(
68
+ value:
69
+ T.any(
70
+ Dodopayments::WorkloadIdentity::Config,
71
+ T::Hash[Symbol, T.anything]
72
+ )
73
+ ).returns(Dodopayments::WorkloadIdentity::Config)
74
+ end
75
+ def self.coerce(value)
76
+ end
77
+
78
+ sig { returns(String) }
79
+ def inspect
80
+ end
81
+ end
82
+
83
+ # Caches the access token of one client. All methods are thread-safe.
84
+ class Session
85
+ sig { returns(String) }
86
+ attr_reader :identity_provider_id
87
+
88
+ # @api private
89
+ sig do
90
+ params(
91
+ config: Dodopayments::WorkloadIdentity::Config,
92
+ context: Dodopayments::WorkloadIdentity::Context,
93
+ transport: T.anything
94
+ ).returns(T.attached_class)
95
+ end
96
+ def self.new(config:, context:, transport:)
97
+ end
98
+
99
+ # Returns a valid access token. This method does a token exchange if no token is
100
+ # cached, or if 5 minutes or less remain. Concurrent callers share one exchange.
101
+ sig { returns(String) }
102
+ def access_token
103
+ end
104
+
105
+ # @api private
106
+ sig { params(token: T.nilable(String)).returns(NilClass) }
107
+ def invalidate(token = nil)
108
+ end
109
+
110
+ # Revokes the cached access token and clears the cache. Does nothing if no token
111
+ # is cached.
112
+ sig { returns(NilClass) }
113
+ def revoke
114
+ end
115
+
116
+ sig { returns(String) }
117
+ def inspect
118
+ end
119
+ end
120
+
121
+ Provider =
122
+ T.type_alias do
123
+ T
124
+ .proc
125
+ .params(context: Dodopayments::WorkloadIdentity::Context)
126
+ .returns(String)
127
+ end
128
+
129
+ class << self
130
+ # GitHub Actions. The job must have the `id-token: write` permission.
131
+ sig do
132
+ params(audience: T.nilable(String)).returns(
133
+ Dodopayments::WorkloadIdentity::Provider
134
+ )
135
+ end
136
+ def github_actions(
137
+ # Defaults to the origin of the client base URL.
138
+ audience: nil
139
+ )
140
+ end
141
+
142
+ # GitLab CI/CD. Declare the token in `id_tokens` of the job.
143
+ sig do
144
+ params(env_var: String).returns(
145
+ Dodopayments::WorkloadIdentity::Provider
146
+ )
147
+ end
148
+ def gitlab(env_var: "DODO_PAYMENTS_ID_TOKEN")
149
+ end
150
+
151
+ # HCP Terraform (Terraform Cloud) dynamic credentials.
152
+ sig { returns(Dodopayments::WorkloadIdentity::Provider) }
153
+ def terraform_cloud
154
+ end
155
+
156
+ # Google Cloud: the metadata server of the attached service account.
157
+ sig do
158
+ params(audience: T.nilable(String)).returns(
159
+ Dodopayments::WorkloadIdentity::Provider
160
+ )
161
+ end
162
+ def gcp(
163
+ # Defaults to the origin of the client base URL.
164
+ audience: nil
165
+ )
166
+ end
167
+
168
+ # Vercel OIDC federation.
169
+ sig { returns(Dodopayments::WorkloadIdentity::Provider) }
170
+ def vercel
171
+ end
172
+
173
+ # Kubernetes: a projected service account token. The file is read on each
174
+ # exchange.
175
+ sig do
176
+ params(path: String).returns(Dodopayments::WorkloadIdentity::Provider)
177
+ end
178
+ def kubernetes(path: KUBERNETES_TOKEN_PATH)
179
+ end
180
+
181
+ # A token file. The file is read on each exchange.
182
+ sig do
183
+ params(path: T.nilable(String)).returns(
184
+ Dodopayments::WorkloadIdentity::Provider
185
+ )
186
+ end
187
+ def file(
188
+ # Defaults to `ENV["DODO_PAYMENTS_IDENTITY_TOKEN_FILE"]`
189
+ path: ENV["DODO_PAYMENTS_IDENTITY_TOKEN_FILE"]
190
+ )
191
+ end
192
+
193
+ # AWS: wraps your function that returns the JWT, for example from STS
194
+ # `GetWebIdentityToken`.
195
+ sig do
196
+ params(
197
+ fn: T.nilable(T.anything),
198
+ blk: T.nilable(T.proc.returns(String))
199
+ ).returns(Dodopayments::WorkloadIdentity::Provider)
200
+ end
201
+ def aws(fn = nil, &blk)
202
+ end
203
+
204
+ # A fixed token. Use it for tests.
205
+ sig do
206
+ params(token: String).returns(Dodopayments::WorkloadIdentity::Provider)
207
+ end
208
+ def static(token)
209
+ end
210
+
211
+ # Finds a token source in the environment, in this order: GitHub Actions, HCP
212
+ # Terraform, `ENV["DODO_PAYMENTS_IDENTITY_TOKEN_FILE"]`, and the Kubernetes path.
213
+ # Returns `nil` if no source is found.
214
+ sig { returns(T.nilable(Dodopayments::WorkloadIdentity::Provider)) }
215
+ def auto
216
+ end
217
+ end
218
+ end
219
+ end
@@ -13,10 +13,12 @@ module Dodopayments
13
13
  test_mode: "https://test.dodopayments.com"
14
14
  }
15
15
 
16
- attr_reader bearer_token: String
16
+ attr_reader bearer_token: String?
17
17
 
18
18
  attr_reader webhook_key: String?
19
19
 
20
+ attr_reader workload_identity: Dodopayments::WorkloadIdentity::Session?
21
+
20
22
  attr_reader checkout_sessions: Dodopayments::Resources::CheckoutSessions
21
23
 
22
24
  attr_reader payments: Dodopayments::Resources::Payments
@@ -74,6 +76,9 @@ module Dodopayments
74
76
  def initialize: (
75
77
  ?bearer_token: String?,
76
78
  ?webhook_key: String?,
79
+ ?workload_identity: Dodopayments::WorkloadIdentity::Config
80
+ | ::Hash[Symbol, top]
81
+ | nil,
77
82
  ?environment: :live_mode | :test_mode | nil,
78
83
  ?base_url: String?,
79
84
  ?max_retries: Integer,
@@ -0,0 +1,23 @@
1
+ module Dodopayments
2
+ module Models
3
+ type addon_delete_params =
4
+ { id: String } & Dodopayments::Internal::Type::request_parameters
5
+
6
+ class AddonDeleteParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ attr_accessor id: String
11
+
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: Dodopayments::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ id: String,
19
+ request_options: Dodopayments::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end
@@ -1,13 +1,26 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type addon_list_params =
4
- { page_number: Integer, page_size: Integer }
4
+ {
5
+ archived: bool,
6
+ locale: String,
7
+ page_number: Integer,
8
+ page_size: Integer
9
+ }
5
10
  & Dodopayments::Internal::Type::request_parameters
6
11
 
7
12
  class AddonListParams < Dodopayments::Internal::Type::BaseModel
8
13
  extend Dodopayments::Internal::Type::RequestParameters::Converter
9
14
  include Dodopayments::Internal::Type::RequestParameters
10
15
 
16
+ attr_reader archived: bool?
17
+
18
+ def archived=: (bool) -> bool
19
+
20
+ attr_reader locale: String?
21
+
22
+ def locale=: (String) -> String
23
+
11
24
  attr_reader page_number: Integer?
12
25
 
13
26
  def page_number=: (Integer) -> Integer
@@ -17,12 +30,16 @@ module Dodopayments
17
30
  def page_size=: (Integer) -> Integer
18
31
 
19
32
  def initialize: (
33
+ ?archived: bool,
34
+ ?locale: String,
20
35
  ?page_number: Integer,
21
36
  ?page_size: Integer,
22
37
  ?request_options: Dodopayments::request_opts
23
38
  ) -> void
24
39
 
25
40
  def to_hash: -> {
41
+ archived: bool,
42
+ locale: String,
26
43
  page_number: Integer,
27
44
  page_size: Integer,
28
45
  request_options: Dodopayments::RequestOptions
@@ -1,7 +1,8 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type addon_retrieve_params =
4
- { id: String } & Dodopayments::Internal::Type::request_parameters
4
+ { id: String, locale: String }
5
+ & Dodopayments::Internal::Type::request_parameters
5
6
 
6
7
  class AddonRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
8
  extend Dodopayments::Internal::Type::RequestParameters::Converter
@@ -9,13 +10,19 @@ module Dodopayments
9
10
 
10
11
  attr_accessor id: String
11
12
 
13
+ attr_reader locale: String?
14
+
15
+ def locale=: (String) -> String
16
+
12
17
  def initialize: (
13
18
  id: String,
19
+ ?locale: String,
14
20
  ?request_options: Dodopayments::request_opts
15
21
  ) -> void
16
22
 
17
23
  def to_hash: -> {
18
24
  id: String,
25
+ locale: String,
19
26
  request_options: Dodopayments::RequestOptions
20
27
  }
21
28
  end