dodopayments 2.17.1 → 2.18.1

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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/attach_addon.rb +3 -1
  5. data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
  6. data/lib/dodopayments/models/credit_entitlement.rb +2 -1
  7. data/lib/dodopayments/models/credit_entitlement_cart_response.rb +2 -1
  8. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +14 -1
  9. data/lib/dodopayments/models/entitlements/grant_fulfill_license_key_params.rb +53 -0
  10. data/lib/dodopayments/models/license_key_duration.rb +3 -1
  11. data/lib/dodopayments/models/metadata.rb +8 -0
  12. data/lib/dodopayments/models/payment.rb +2 -2
  13. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  14. data/lib/dodopayments/models/product.rb +3 -17
  15. data/lib/dodopayments/models/product_create_params.rb +3 -16
  16. data/lib/dodopayments/models/product_list_response.rb +3 -17
  17. data/lib/dodopayments/models/product_update_params.rb +3 -16
  18. data/lib/dodopayments/models/products/list_localized_prices_response.rb +18 -0
  19. data/lib/dodopayments/models/products/localized_price.rb +75 -0
  20. data/lib/dodopayments/models/products/localized_price_archive_params.rb +28 -0
  21. data/lib/dodopayments/models/products/localized_price_create_params.rb +51 -0
  22. data/lib/dodopayments/models/products/localized_price_list_params.rb +22 -0
  23. data/lib/dodopayments/models/products/localized_price_retrieve_params.rb +28 -0
  24. data/lib/dodopayments/models/products/localized_price_update_params.rb +42 -0
  25. data/lib/dodopayments/models/products/pricing_mode.rb +17 -0
  26. data/lib/dodopayments/models/subscription_update_params.rb +12 -1
  27. data/lib/dodopayments/models/time_interval.rb +1 -0
  28. data/lib/dodopayments/models.rb +3 -0
  29. data/lib/dodopayments/resources/entitlements/grants.rb +35 -0
  30. data/lib/dodopayments/resources/products/localized_prices.rb +144 -0
  31. data/lib/dodopayments/resources/products.rb +6 -2
  32. data/lib/dodopayments/version.rb +1 -1
  33. data/lib/dodopayments.rb +11 -0
  34. data/rbi/dodopayments/models/attach_addon.rbi +6 -1
  35. data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
  36. data/rbi/dodopayments/models/credit_entitlement.rbi +2 -0
  37. data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +2 -0
  38. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +12 -0
  39. data/rbi/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbi +74 -0
  40. data/rbi/dodopayments/models/license_key_duration.rbi +6 -1
  41. data/rbi/dodopayments/models/metadata.rbi +11 -0
  42. data/rbi/dodopayments/models/payment.rbi +2 -2
  43. data/rbi/dodopayments/models/payment_method_types.rbi +2 -0
  44. data/rbi/dodopayments/models/product.rbi +4 -26
  45. data/rbi/dodopayments/models/product_create_params.rbi +3 -43
  46. data/rbi/dodopayments/models/product_list_response.rbi +3 -47
  47. data/rbi/dodopayments/models/product_update_params.rbi +3 -43
  48. data/rbi/dodopayments/models/products/list_localized_prices_response.rbi +36 -0
  49. data/rbi/dodopayments/models/products/localized_price.rbi +98 -0
  50. data/rbi/dodopayments/models/products/localized_price_archive_params.rbi +48 -0
  51. data/rbi/dodopayments/models/products/localized_price_create_params.rbi +72 -0
  52. data/rbi/dodopayments/models/products/localized_price_list_params.rbi +43 -0
  53. data/rbi/dodopayments/models/products/localized_price_retrieve_params.rbi +48 -0
  54. data/rbi/dodopayments/models/products/localized_price_update_params.rbi +62 -0
  55. data/rbi/dodopayments/models/products/pricing_mode.rbi +28 -0
  56. data/rbi/dodopayments/models/subscription_update_params.rbi +2 -0
  57. data/rbi/dodopayments/models/time_interval.rbi +1 -0
  58. data/rbi/dodopayments/models.rbi +6 -0
  59. data/rbi/dodopayments/resources/entitlements/grants.rbi +28 -0
  60. data/rbi/dodopayments/resources/products/localized_prices.rbi +103 -0
  61. data/rbi/dodopayments/resources/products.rbi +5 -2
  62. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  63. data/sig/dodopayments/models/checkout_session_request.rbs +4 -4
  64. data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +4 -4
  65. data/sig/dodopayments/models/credit_entitlements/balance_list_grants_response.rbs +4 -4
  66. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
  67. data/sig/dodopayments/models/customer.rbs +7 -5
  68. data/sig/dodopayments/models/customer_create_params.rbs +7 -5
  69. data/sig/dodopayments/models/customer_limited_details.rbs +7 -5
  70. data/sig/dodopayments/models/customer_update_params.rbs +4 -4
  71. data/sig/dodopayments/models/discount.rbs +4 -4
  72. data/sig/dodopayments/models/discount_create_params.rbs +7 -5
  73. data/sig/dodopayments/models/discount_detail.rbs +4 -4
  74. data/sig/dodopayments/models/discount_update_params.rbs +4 -4
  75. data/sig/dodopayments/models/entitlement.rbs +4 -4
  76. data/sig/dodopayments/models/entitlement_create_params.rbs +7 -5
  77. data/sig/dodopayments/models/entitlement_update_params.rbs +4 -4
  78. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -4
  79. data/sig/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbs +43 -0
  80. data/sig/dodopayments/models/metadata.rbs +7 -0
  81. data/sig/dodopayments/models/payment.rbs +4 -4
  82. data/sig/dodopayments/models/payment_create_params.rbs +7 -5
  83. data/sig/dodopayments/models/payment_create_response.rbs +4 -4
  84. data/sig/dodopayments/models/payment_list_response.rbs +4 -4
  85. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  86. data/sig/dodopayments/models/product.rbs +8 -19
  87. data/sig/dodopayments/models/product_create_params.rbs +11 -20
  88. data/sig/dodopayments/models/product_list_response.rbs +8 -19
  89. data/sig/dodopayments/models/product_update_params.rbs +8 -19
  90. data/sig/dodopayments/models/products/list_localized_prices_response.rbs +20 -0
  91. data/sig/dodopayments/models/products/localized_price.rbs +57 -0
  92. data/sig/dodopayments/models/products/localized_price_archive_params.rbs +30 -0
  93. data/sig/dodopayments/models/products/localized_price_create_params.rbs +43 -0
  94. data/sig/dodopayments/models/products/localized_price_list_params.rbs +26 -0
  95. data/sig/dodopayments/models/products/localized_price_retrieve_params.rbs +30 -0
  96. data/sig/dodopayments/models/products/localized_price_update_params.rbs +34 -0
  97. data/sig/dodopayments/models/products/pricing_mode.rbs +16 -0
  98. data/sig/dodopayments/models/refund.rbs +4 -4
  99. data/sig/dodopayments/models/refund_create_params.rbs +7 -5
  100. data/sig/dodopayments/models/subscription.rbs +4 -4
  101. data/sig/dodopayments/models/subscription_charge_params.rbs +4 -4
  102. data/sig/dodopayments/models/subscription_create_params.rbs +7 -5
  103. data/sig/dodopayments/models/subscription_create_response.rbs +4 -4
  104. data/sig/dodopayments/models/subscription_list_response.rbs +4 -4
  105. data/sig/dodopayments/models/subscription_update_params.rbs +4 -4
  106. data/sig/dodopayments/models/update_subscription_plan_req.rbs +4 -4
  107. data/sig/dodopayments/models.rbs +2 -0
  108. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  109. data/sig/dodopayments/resources/credit_entitlements/balances.rbs +1 -1
  110. data/sig/dodopayments/resources/customers.rbs +2 -2
  111. data/sig/dodopayments/resources/discounts.rbs +2 -2
  112. data/sig/dodopayments/resources/entitlements/grants.rbs +8 -0
  113. data/sig/dodopayments/resources/entitlements.rbs +2 -2
  114. data/sig/dodopayments/resources/payments.rbs +1 -1
  115. data/sig/dodopayments/resources/products/localized_prices.rbs +41 -0
  116. data/sig/dodopayments/resources/products.rbs +6 -4
  117. data/sig/dodopayments/resources/refunds.rbs +1 -1
  118. data/sig/dodopayments/resources/subscriptions.rbs +5 -5
  119. metadata +35 -2
@@ -107,7 +107,7 @@ module Dodopayments
107
107
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
108
108
  # apply).
109
109
  sig do
110
- returns(T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol))
110
+ returns(T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol))
111
111
  end
112
112
  attr_accessor :pricing_mode
113
113
 
@@ -146,7 +146,8 @@ module Dodopayments
146
146
  license_key_duration:
147
147
  T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
148
148
  name: T.nilable(String),
149
- pricing_mode: T.nilable(Dodopayments::Product::PricingMode::OrSymbol),
149
+ pricing_mode:
150
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
150
151
  product_collection_id: T.nilable(String)
151
152
  ).returns(T.attached_class)
152
153
  end
@@ -225,36 +226,13 @@ module Dodopayments
225
226
  license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
226
227
  name: T.nilable(String),
227
228
  pricing_mode:
228
- T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol),
229
+ T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol),
229
230
  product_collection_id: T.nilable(String)
230
231
  }
231
232
  )
232
233
  end
233
234
  def to_hash
234
235
  end
235
-
236
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
237
- # apply).
238
- module PricingMode
239
- extend Dodopayments::Internal::Type::Enum
240
-
241
- TaggedSymbol =
242
- T.type_alias { T.all(Symbol, Dodopayments::Product::PricingMode) }
243
- OrSymbol = T.type_alias { T.any(Symbol, String) }
244
-
245
- BY_CURRENCY =
246
- T.let(:by_currency, Dodopayments::Product::PricingMode::TaggedSymbol)
247
- BY_COUNTRY =
248
- T.let(:by_country, Dodopayments::Product::PricingMode::TaggedSymbol)
249
-
250
- sig do
251
- override.returns(
252
- T::Array[Dodopayments::Product::PricingMode::TaggedSymbol]
253
- )
254
- end
255
- def self.values
256
- end
257
- end
258
236
  end
259
237
  end
260
238
  end
@@ -127,11 +127,7 @@ module Dodopayments
127
127
  # Pricing mode for localized pricing. When set, rules from
128
128
  # /products/{id}/localized-prices apply at checkout. NULL means base-only
129
129
  # (existing behavior).
130
- sig do
131
- returns(
132
- T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol)
133
- )
134
- end
130
+ sig { returns(T.nilable(Dodopayments::Products::PricingMode::OrSymbol)) }
135
131
  attr_accessor :pricing_mode
136
132
 
137
133
  sig do
@@ -162,7 +158,7 @@ module Dodopayments
162
158
  license_key_enabled: T.nilable(T::Boolean),
163
159
  metadata: T::Hash[Symbol, String],
164
160
  pricing_mode:
165
- T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol),
161
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
166
162
  request_options: Dodopayments::RequestOptions::OrHash
167
163
  ).returns(T.attached_class)
168
164
  end
@@ -248,9 +244,7 @@ module Dodopayments
248
244
  license_key_enabled: T.nilable(T::Boolean),
249
245
  metadata: T::Hash[Symbol, String],
250
246
  pricing_mode:
251
- T.nilable(
252
- Dodopayments::ProductCreateParams::PricingMode::OrSymbol
253
- ),
247
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
254
248
  request_options: Dodopayments::RequestOptions
255
249
  }
256
250
  )
@@ -300,40 +294,6 @@ module Dodopayments
300
294
  def to_hash
301
295
  end
302
296
  end
303
-
304
- # Pricing mode for localized pricing. When set, rules from
305
- # /products/{id}/localized-prices apply at checkout. NULL means base-only
306
- # (existing behavior).
307
- module PricingMode
308
- extend Dodopayments::Internal::Type::Enum
309
-
310
- TaggedSymbol =
311
- T.type_alias do
312
- T.all(Symbol, Dodopayments::ProductCreateParams::PricingMode)
313
- end
314
- OrSymbol = T.type_alias { T.any(Symbol, String) }
315
-
316
- BY_CURRENCY =
317
- T.let(
318
- :by_currency,
319
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
320
- )
321
- BY_COUNTRY =
322
- T.let(
323
- :by_country,
324
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
325
- )
326
-
327
- sig do
328
- override.returns(
329
- T::Array[
330
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
331
- ]
332
- )
333
- end
334
- def self.values
335
- end
336
- end
337
297
  end
338
298
  end
339
299
  end
@@ -79,11 +79,7 @@ module Dodopayments
79
79
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
80
80
  # apply).
81
81
  sig do
82
- returns(
83
- T.nilable(
84
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
85
- )
86
- )
82
+ returns(T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol))
87
83
  end
88
84
  attr_accessor :pricing_mode
89
85
 
@@ -116,9 +112,7 @@ module Dodopayments
116
112
  )
117
113
  ),
118
114
  pricing_mode:
119
- T.nilable(
120
- Dodopayments::Models::ProductListResponse::PricingMode::OrSymbol
121
- ),
115
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
122
116
  tax_inclusive: T.nilable(T::Boolean)
123
117
  ).returns(T.attached_class)
124
118
  end
@@ -186,51 +180,13 @@ module Dodopayments
186
180
  price: T.nilable(Integer),
187
181
  price_detail: T.nilable(Dodopayments::Price::Variants),
188
182
  pricing_mode:
189
- T.nilable(
190
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
191
- ),
183
+ T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol),
192
184
  tax_inclusive: T.nilable(T::Boolean)
193
185
  }
194
186
  )
195
187
  end
196
188
  def to_hash
197
189
  end
198
-
199
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
200
- # apply).
201
- module PricingMode
202
- extend Dodopayments::Internal::Type::Enum
203
-
204
- TaggedSymbol =
205
- T.type_alias do
206
- T.all(
207
- Symbol,
208
- Dodopayments::Models::ProductListResponse::PricingMode
209
- )
210
- end
211
- OrSymbol = T.type_alias { T.any(Symbol, String) }
212
-
213
- BY_CURRENCY =
214
- T.let(
215
- :by_currency,
216
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
217
- )
218
- BY_COUNTRY =
219
- T.let(
220
- :by_country,
221
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
222
- )
223
-
224
- sig do
225
- override.returns(
226
- T::Array[
227
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
228
- ]
229
- )
230
- end
231
- def self.values
232
- end
233
- end
234
190
  end
235
191
  end
236
192
  end
@@ -135,11 +135,7 @@ module Dodopayments
135
135
  # Update the pricing mode. Omit to leave unchanged; set to null to clear (which
136
136
  # archives all active localized rules for this product). Changing to a different
137
137
  # non-null mode also archives any rules whose mode doesn't match the new mode.
138
- sig do
139
- returns(
140
- T.nilable(Dodopayments::ProductUpdateParams::PricingMode::OrSymbol)
141
- )
142
- end
138
+ sig { returns(T.nilable(Dodopayments::Products::PricingMode::OrSymbol)) }
143
139
  attr_accessor :pricing_mode
144
140
 
145
141
  # Tax category of the product.
@@ -177,7 +173,7 @@ module Dodopayments
177
173
  )
178
174
  ),
179
175
  pricing_mode:
180
- T.nilable(Dodopayments::ProductUpdateParams::PricingMode::OrSymbol),
176
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
181
177
  tax_category: T.nilable(Dodopayments::TaxCategory::OrSymbol),
182
178
  request_options: Dodopayments::RequestOptions::OrHash
183
179
  ).returns(T.attached_class)
@@ -276,9 +272,7 @@ module Dodopayments
276
272
  )
277
273
  ),
278
274
  pricing_mode:
279
- T.nilable(
280
- Dodopayments::ProductUpdateParams::PricingMode::OrSymbol
281
- ),
275
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
282
276
  tax_category: T.nilable(Dodopayments::TaxCategory::OrSymbol),
283
277
  request_options: Dodopayments::RequestOptions
284
278
  }
@@ -340,40 +334,6 @@ module Dodopayments
340
334
  def to_hash
341
335
  end
342
336
  end
343
-
344
- # Update the pricing mode. Omit to leave unchanged; set to null to clear (which
345
- # archives all active localized rules for this product). Changing to a different
346
- # non-null mode also archives any rules whose mode doesn't match the new mode.
347
- module PricingMode
348
- extend Dodopayments::Internal::Type::Enum
349
-
350
- TaggedSymbol =
351
- T.type_alias do
352
- T.all(Symbol, Dodopayments::ProductUpdateParams::PricingMode)
353
- end
354
- OrSymbol = T.type_alias { T.any(Symbol, String) }
355
-
356
- BY_CURRENCY =
357
- T.let(
358
- :by_currency,
359
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
360
- )
361
- BY_COUNTRY =
362
- T.let(
363
- :by_country,
364
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
365
- )
366
-
367
- sig do
368
- override.returns(
369
- T::Array[
370
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
371
- ]
372
- )
373
- end
374
- def self.values
375
- end
376
- end
377
337
  end
378
338
  end
379
339
  end
@@ -0,0 +1,36 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class ListLocalizedPricesResponse < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::ListLocalizedPricesResponse,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(T::Array[Dodopayments::Products::LocalizedPrice]) }
16
+ attr_accessor :items
17
+
18
+ sig do
19
+ params(
20
+ items: T::Array[Dodopayments::Products::LocalizedPrice::OrHash]
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(items:)
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { items: T::Array[Dodopayments::Products::LocalizedPrice] }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,98 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPrice < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::LocalizedPrice,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Unique identifier for the localized price.
16
+ sig { returns(String) }
17
+ attr_accessor :id
18
+
19
+ # Amount in the smallest currency unit (e.g., cents).
20
+ sig { returns(Integer) }
21
+ attr_accessor :amount
22
+
23
+ # Timestamp when the localized price was created.
24
+ sig { returns(Time) }
25
+ attr_accessor :created_at
26
+
27
+ # Currency to charge in.
28
+ sig { returns(Dodopayments::Currency::TaggedSymbol) }
29
+ attr_accessor :currency
30
+
31
+ # Pricing mode of the rule: by_currency or by_country.
32
+ sig { returns(Dodopayments::Products::PricingMode::TaggedSymbol) }
33
+ attr_accessor :mode
34
+
35
+ # Product this localized price belongs to.
36
+ sig { returns(String) }
37
+ attr_accessor :product_id
38
+
39
+ # Timestamp when the localized price was last updated.
40
+ sig { returns(Time) }
41
+ attr_accessor :updated_at
42
+
43
+ # Country the rule applies to. Only set when mode is by_country.
44
+ sig { returns(T.nilable(Dodopayments::CountryCode::TaggedSymbol)) }
45
+ attr_accessor :country_code
46
+
47
+ sig do
48
+ params(
49
+ id: String,
50
+ amount: Integer,
51
+ created_at: Time,
52
+ currency: Dodopayments::Currency::OrSymbol,
53
+ mode: Dodopayments::Products::PricingMode::OrSymbol,
54
+ product_id: String,
55
+ updated_at: Time,
56
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol)
57
+ ).returns(T.attached_class)
58
+ end
59
+ def self.new(
60
+ # Unique identifier for the localized price.
61
+ id:,
62
+ # Amount in the smallest currency unit (e.g., cents).
63
+ amount:,
64
+ # Timestamp when the localized price was created.
65
+ created_at:,
66
+ # Currency to charge in.
67
+ currency:,
68
+ # Pricing mode of the rule: by_currency or by_country.
69
+ mode:,
70
+ # Product this localized price belongs to.
71
+ product_id:,
72
+ # Timestamp when the localized price was last updated.
73
+ updated_at:,
74
+ # Country the rule applies to. Only set when mode is by_country.
75
+ country_code: nil
76
+ )
77
+ end
78
+
79
+ sig do
80
+ override.returns(
81
+ {
82
+ id: String,
83
+ amount: Integer,
84
+ created_at: Time,
85
+ currency: Dodopayments::Currency::TaggedSymbol,
86
+ mode: Dodopayments::Products::PricingMode::TaggedSymbol,
87
+ product_id: String,
88
+ updated_at: Time,
89
+ country_code: T.nilable(Dodopayments::CountryCode::TaggedSymbol)
90
+ }
91
+ )
92
+ end
93
+ def to_hash
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceArchiveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceArchiveParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ sig do
25
+ params(
26
+ product_id: String,
27
+ id: String,
28
+ request_options: Dodopayments::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(product_id:, id:, request_options: {})
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ product_id: String,
38
+ id: String,
39
+ request_options: Dodopayments::RequestOptions
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,72 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceCreateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceCreateParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ # Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
22
+ sig { returns(Integer) }
23
+ attr_accessor :amount
24
+
25
+ # Currency to charge in. Must be a supported currency.
26
+ sig { returns(Dodopayments::Currency::OrSymbol) }
27
+ attr_accessor :currency
28
+
29
+ # Required when the product's pricing_mode is by_country; forbidden when
30
+ # by_currency.
31
+ sig { returns(T.nilable(Dodopayments::CountryCode::OrSymbol)) }
32
+ attr_accessor :country_code
33
+
34
+ sig do
35
+ params(
36
+ product_id: String,
37
+ amount: Integer,
38
+ currency: Dodopayments::Currency::OrSymbol,
39
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
40
+ request_options: Dodopayments::RequestOptions::OrHash
41
+ ).returns(T.attached_class)
42
+ end
43
+ def self.new(
44
+ product_id:,
45
+ # Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
46
+ amount:,
47
+ # Currency to charge in. Must be a supported currency.
48
+ currency:,
49
+ # Required when the product's pricing_mode is by_country; forbidden when
50
+ # by_currency.
51
+ country_code: nil,
52
+ request_options: {}
53
+ )
54
+ end
55
+
56
+ sig do
57
+ override.returns(
58
+ {
59
+ product_id: String,
60
+ amount: Integer,
61
+ currency: Dodopayments::Currency::OrSymbol,
62
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
63
+ request_options: Dodopayments::RequestOptions
64
+ }
65
+ )
66
+ end
67
+ def to_hash
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceListParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceListParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig do
22
+ params(
23
+ product_id: String,
24
+ request_options: Dodopayments::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(product_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ {
33
+ product_id: String,
34
+ request_options: Dodopayments::RequestOptions
35
+ }
36
+ )
37
+ end
38
+ def to_hash
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceRetrieveParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ sig do
25
+ params(
26
+ product_id: String,
27
+ id: String,
28
+ request_options: Dodopayments::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(product_id:, id:, request_options: {})
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ product_id: String,
38
+ id: String,
39
+ request_options: Dodopayments::RequestOptions
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,62 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceUpdateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceUpdateParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ # New amount in the smallest currency unit (e.g., cents). Must be greater than
25
+ # zero. The currency and country_code of an existing rule cannot be changed.
26
+ sig { returns(T.nilable(Integer)) }
27
+ attr_accessor :amount
28
+
29
+ sig do
30
+ params(
31
+ product_id: String,
32
+ id: String,
33
+ amount: T.nilable(Integer),
34
+ request_options: Dodopayments::RequestOptions::OrHash
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+ product_id:,
39
+ id:,
40
+ # New amount in the smallest currency unit (e.g., cents). Must be greater than
41
+ # zero. The currency and country_code of an existing rule cannot be changed.
42
+ amount: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ product_id: String,
51
+ id: String,
52
+ amount: T.nilable(Integer),
53
+ request_options: Dodopayments::RequestOptions
54
+ }
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end