dodopayments 2.17.1 → 2.18.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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +14 -1
  5. data/lib/dodopayments/models/entitlements/grant_fulfill_license_key_params.rb +53 -0
  6. data/lib/dodopayments/models/metadata.rb +8 -0
  7. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  8. data/lib/dodopayments/models/product.rb +3 -17
  9. data/lib/dodopayments/models/product_create_params.rb +3 -16
  10. data/lib/dodopayments/models/product_list_response.rb +3 -17
  11. data/lib/dodopayments/models/product_update_params.rb +3 -16
  12. data/lib/dodopayments/models/products/list_localized_prices_response.rb +18 -0
  13. data/lib/dodopayments/models/products/localized_price.rb +75 -0
  14. data/lib/dodopayments/models/products/localized_price_archive_params.rb +28 -0
  15. data/lib/dodopayments/models/products/localized_price_create_params.rb +51 -0
  16. data/lib/dodopayments/models/products/localized_price_list_params.rb +22 -0
  17. data/lib/dodopayments/models/products/localized_price_retrieve_params.rb +28 -0
  18. data/lib/dodopayments/models/products/localized_price_update_params.rb +42 -0
  19. data/lib/dodopayments/models/products/pricing_mode.rb +17 -0
  20. data/lib/dodopayments/models.rb +3 -0
  21. data/lib/dodopayments/resources/entitlements/grants.rb +35 -0
  22. data/lib/dodopayments/resources/products/localized_prices.rb +144 -0
  23. data/lib/dodopayments/resources/products.rb +6 -2
  24. data/lib/dodopayments/version.rb +1 -1
  25. data/lib/dodopayments.rb +11 -0
  26. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +12 -0
  27. data/rbi/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbi +74 -0
  28. data/rbi/dodopayments/models/metadata.rbi +11 -0
  29. data/rbi/dodopayments/models/payment_method_types.rbi +2 -0
  30. data/rbi/dodopayments/models/product.rbi +4 -26
  31. data/rbi/dodopayments/models/product_create_params.rbi +3 -43
  32. data/rbi/dodopayments/models/product_list_response.rbi +3 -47
  33. data/rbi/dodopayments/models/product_update_params.rbi +3 -43
  34. data/rbi/dodopayments/models/products/list_localized_prices_response.rbi +36 -0
  35. data/rbi/dodopayments/models/products/localized_price.rbi +98 -0
  36. data/rbi/dodopayments/models/products/localized_price_archive_params.rbi +48 -0
  37. data/rbi/dodopayments/models/products/localized_price_create_params.rbi +72 -0
  38. data/rbi/dodopayments/models/products/localized_price_list_params.rbi +43 -0
  39. data/rbi/dodopayments/models/products/localized_price_retrieve_params.rbi +48 -0
  40. data/rbi/dodopayments/models/products/localized_price_update_params.rbi +62 -0
  41. data/rbi/dodopayments/models/products/pricing_mode.rbi +28 -0
  42. data/rbi/dodopayments/models.rbi +6 -0
  43. data/rbi/dodopayments/resources/entitlements/grants.rbi +28 -0
  44. data/rbi/dodopayments/resources/products/localized_prices.rbi +103 -0
  45. data/rbi/dodopayments/resources/products.rbi +5 -2
  46. data/sig/dodopayments/models/checkout_session_request.rbs +4 -4
  47. data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +4 -4
  48. data/sig/dodopayments/models/credit_entitlements/balance_list_grants_response.rbs +4 -4
  49. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
  50. data/sig/dodopayments/models/customer.rbs +7 -5
  51. data/sig/dodopayments/models/customer_create_params.rbs +7 -5
  52. data/sig/dodopayments/models/customer_limited_details.rbs +7 -5
  53. data/sig/dodopayments/models/customer_update_params.rbs +4 -4
  54. data/sig/dodopayments/models/discount.rbs +4 -4
  55. data/sig/dodopayments/models/discount_create_params.rbs +7 -5
  56. data/sig/dodopayments/models/discount_detail.rbs +4 -4
  57. data/sig/dodopayments/models/discount_update_params.rbs +4 -4
  58. data/sig/dodopayments/models/entitlement.rbs +4 -4
  59. data/sig/dodopayments/models/entitlement_create_params.rbs +7 -5
  60. data/sig/dodopayments/models/entitlement_update_params.rbs +4 -4
  61. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -4
  62. data/sig/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbs +43 -0
  63. data/sig/dodopayments/models/metadata.rbs +7 -0
  64. data/sig/dodopayments/models/payment.rbs +4 -4
  65. data/sig/dodopayments/models/payment_create_params.rbs +7 -5
  66. data/sig/dodopayments/models/payment_create_response.rbs +4 -4
  67. data/sig/dodopayments/models/payment_list_response.rbs +4 -4
  68. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  69. data/sig/dodopayments/models/product.rbs +8 -19
  70. data/sig/dodopayments/models/product_create_params.rbs +11 -20
  71. data/sig/dodopayments/models/product_list_response.rbs +8 -19
  72. data/sig/dodopayments/models/product_update_params.rbs +8 -19
  73. data/sig/dodopayments/models/products/list_localized_prices_response.rbs +20 -0
  74. data/sig/dodopayments/models/products/localized_price.rbs +57 -0
  75. data/sig/dodopayments/models/products/localized_price_archive_params.rbs +30 -0
  76. data/sig/dodopayments/models/products/localized_price_create_params.rbs +43 -0
  77. data/sig/dodopayments/models/products/localized_price_list_params.rbs +26 -0
  78. data/sig/dodopayments/models/products/localized_price_retrieve_params.rbs +30 -0
  79. data/sig/dodopayments/models/products/localized_price_update_params.rbs +34 -0
  80. data/sig/dodopayments/models/products/pricing_mode.rbs +16 -0
  81. data/sig/dodopayments/models/refund.rbs +4 -4
  82. data/sig/dodopayments/models/refund_create_params.rbs +7 -5
  83. data/sig/dodopayments/models/subscription.rbs +4 -4
  84. data/sig/dodopayments/models/subscription_charge_params.rbs +4 -4
  85. data/sig/dodopayments/models/subscription_create_params.rbs +7 -5
  86. data/sig/dodopayments/models/subscription_create_response.rbs +4 -4
  87. data/sig/dodopayments/models/subscription_list_response.rbs +4 -4
  88. data/sig/dodopayments/models/subscription_update_params.rbs +4 -4
  89. data/sig/dodopayments/models/update_subscription_plan_req.rbs +4 -4
  90. data/sig/dodopayments/models.rbs +2 -0
  91. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  92. data/sig/dodopayments/resources/credit_entitlements/balances.rbs +1 -1
  93. data/sig/dodopayments/resources/customers.rbs +2 -2
  94. data/sig/dodopayments/resources/discounts.rbs +2 -2
  95. data/sig/dodopayments/resources/entitlements/grants.rbs +8 -0
  96. data/sig/dodopayments/resources/entitlements.rbs +2 -2
  97. data/sig/dodopayments/resources/payments.rbs +1 -1
  98. data/sig/dodopayments/resources/products/localized_prices.rbs +41 -0
  99. data/sig/dodopayments/resources/products.rbs +6 -4
  100. data/sig/dodopayments/resources/refunds.rbs +1 -1
  101. data/sig/dodopayments/resources/subscriptions.rbs +5 -5
  102. metadata +35 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbbc9fa9d82e0c6e65c55283f6ed071347ee5eeac1991a3cebb88416ae2a5b96
4
- data.tar.gz: 479550f1d1243c6b5747d8b81400ed158a20aa88bb56163ceae194de52bb5174
3
+ metadata.gz: de3e90e0a4cd35644cd9c8ef51c44c19ba4f9af2f0bbded7530ed6a95b082f60
4
+ data.tar.gz: 731dedea649eb1136b5b7c1b02b7ea1f42cbbcb619d606a90f9150b5dad2b4b9
5
5
  SHA512:
6
- metadata.gz: 8caabf2fa045e47dc985505bf98e9ee9118242a41d2b11f34ba2d644e438e821eccb386e4bfe6747077ffef3f99b9f88911eecb2c9552de1fdfbe01c0d59d7b9
7
- data.tar.gz: 686a9a414ec0dfb94b9ab737357651a3bb8571b4c7c8f2a8818e19915d71679512eb7a086ac3b56ed5b3156c8e22e154c8e5ba4b0df35887f4a450564d97704d
6
+ metadata.gz: 6ce146d98b0c8613c4a02177dc943c15444914e56d7ba545f6ee96becc372d67150f0b513d43254fe5b834ff1b3008b9998c9b4ced5295e06afea36925fbc9b8
7
+ data.tar.gz: 3530fa58411532a1f9afe760b06b11bce5f9d60c75b06d1b9be49572a758358663040a1cd24a70914ef3883760b75c47c98f4101aadfbb0bd0f414c1f64ecf16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.18.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.17.1...v2.18.0) (2026-06-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** regenerate SDK from latest OpenAPI spec ([c67cd5d](https://github.com/dodopayments/dodopayments-ruby/commit/c67cd5d823eb140d150788457cdc813616629904))
9
+ * **api:** regenerate SDK from latest OpenAPI spec ([f73e1f9](https://github.com/dodopayments/dodopayments-ruby/commit/f73e1f90193bae17de02a00cf8f239e02e1fc403))
10
+
3
11
  ## [2.17.1](https://github.com/dodopayments/dodopayments-ruby/compare/v2.17.0...v2.17.1) (2026-06-18)
4
12
 
5
13
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.17.1"
26
+ gem "dodopayments", "~> 2.18.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -56,6 +56,14 @@ module Dodopayments
56
56
  # @return [Boolean]
57
57
  required :is_credit, Dodopayments::Internal::Type::Boolean
58
58
 
59
+ # @!attribute metadata
60
+ # Metadata associated with the credit grant's source (the subscription or payment
61
+ # created at checkout). Empty when the grant has no resolvable source (e.g.
62
+ # credits granted directly via the API).
63
+ #
64
+ # @return [Hash{Symbol=>String}]
65
+ required :metadata, Dodopayments::Internal::Type::HashOf[String]
66
+
59
67
  # @!attribute overage_after
60
68
  #
61
69
  # @return [String]
@@ -92,7 +100,10 @@ module Dodopayments
92
100
  # @return [String, nil]
93
101
  optional :reference_type, String, nil?: true
94
102
 
95
- # @!method initialize(id:, amount:, balance_after:, balance_before:, brand_id:, business_id:, created_at:, credit_entitlement_id:, customer_id:, is_credit:, overage_after:, overage_before:, transaction_type:, description: nil, grant_id: nil, reference_id: nil, reference_type: nil)
103
+ # @!method initialize(id:, amount:, balance_after:, balance_before:, brand_id:, business_id:, created_at:, credit_entitlement_id:, customer_id:, is_credit:, metadata:, overage_after:, overage_before:, transaction_type:, description: nil, grant_id: nil, reference_id: nil, reference_type: nil)
104
+ # Some parameter documentations has been truncated, see
105
+ # {Dodopayments::Models::CreditEntitlements::CreditLedgerEntry} for more details.
106
+ #
96
107
  # Response for a ledger entry
97
108
  #
98
109
  # @param id [String]
@@ -115,6 +126,8 @@ module Dodopayments
115
126
  #
116
127
  # @param is_credit [Boolean]
117
128
  #
129
+ # @param metadata [Hash{Symbol=>String}] Metadata associated with the credit grant's source (the subscription or
130
+ #
118
131
  # @param overage_after [String]
119
132
  #
120
133
  # @param overage_before [String]
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ # @see Dodopayments::Resources::Entitlements::Grants#fulfill_license_key
7
+ class GrantFulfillLicenseKeyParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute grant_id
12
+ #
13
+ # @return [String]
14
+ required :grant_id, String
15
+
16
+ # @!attribute key
17
+ # The license key value to deliver to the customer.
18
+ #
19
+ # @return [String]
20
+ required :key, String
21
+
22
+ # @!attribute activations_limit
23
+ # Per-key activation limit. Defaults to the entitlement's license-key
24
+ # configuration.
25
+ #
26
+ # @return [Integer, nil]
27
+ optional :activations_limit, Integer, nil?: true
28
+
29
+ # @!attribute expires_at
30
+ # When the key expires. Defaults to the duration in the entitlement's license-key
31
+ # configuration.
32
+ #
33
+ # @return [Time, nil]
34
+ optional :expires_at, Time, nil?: true
35
+
36
+ # @!method initialize(grant_id:, key:, activations_limit: nil, expires_at: nil, request_options: {})
37
+ # Some parameter documentations has been truncated, see
38
+ # {Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams} for more
39
+ # details.
40
+ #
41
+ # @param grant_id [String]
42
+ #
43
+ # @param key [String] The license key value to deliver to the customer.
44
+ #
45
+ # @param activations_limit [Integer, nil] Per-key activation limit. Defaults to the entitlement's license-key configuratio
46
+ #
47
+ # @param expires_at [Time, nil] When the key expires. Defaults to the duration in the entitlement's license-key
48
+ #
49
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @type [Dodopayments::Internal::Type::Converter]
6
+ Metadata = Dodopayments::Internal::Type::HashOf[String]
7
+ end
8
+ end
@@ -113,6 +113,7 @@ module Dodopayments
113
113
  REVOLUT_PAY = :revolut_pay
114
114
  NAVER_PAY = :naver_pay
115
115
  PAYCO = :payco
116
+ SATISPAY = :satispay
116
117
 
117
118
  # @!method self.values
118
119
  # @return [Array<Symbol>]
@@ -136,8 +136,8 @@ module Dodopayments
136
136
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
137
137
  # apply).
138
138
  #
139
- # @return [Symbol, Dodopayments::Models::Product::PricingMode, nil]
140
- optional :pricing_mode, enum: -> { Dodopayments::Product::PricingMode }, nil?: true
139
+ # @return [Symbol, Dodopayments::Models::Products::PricingMode, nil]
140
+ optional :pricing_mode, enum: -> { Dodopayments::Products::PricingMode }, nil?: true
141
141
 
142
142
  # @!attribute product_collection_id
143
143
  # The product collection ID this product belongs to, if any
@@ -189,23 +189,9 @@ module Dodopayments
189
189
  #
190
190
  # @param name [String, nil] Name of the product, optional.
191
191
  #
192
- # @param pricing_mode [Symbol, Dodopayments::Models::Product::PricingMode, nil] Pricing mode for localized pricing. NULL means base-only (no localized rules app
192
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Pricing mode for localized pricing. NULL means base-only (no localized rules app
193
193
  #
194
194
  # @param product_collection_id [String, nil] The product collection ID this product belongs to, if any
195
-
196
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
197
- # apply).
198
- #
199
- # @see Dodopayments::Models::Product#pricing_mode
200
- module PricingMode
201
- extend Dodopayments::Internal::Type::Enum
202
-
203
- BY_CURRENCY = :by_currency
204
- BY_COUNTRY = :by_country
205
-
206
- # @!method self.values
207
- # @return [Array<Symbol>]
208
- end
209
195
  end
210
196
  end
211
197
  end
@@ -125,8 +125,8 @@ module Dodopayments
125
125
  # /products/{id}/localized-prices apply at checkout. NULL means base-only
126
126
  # (existing behavior).
127
127
  #
128
- # @return [Symbol, Dodopayments::Models::ProductCreateParams::PricingMode, nil]
129
- optional :pricing_mode, enum: -> { Dodopayments::ProductCreateParams::PricingMode }, nil?: true
128
+ # @return [Symbol, Dodopayments::Models::Products::PricingMode, nil]
129
+ optional :pricing_mode, enum: -> { Dodopayments::Products::PricingMode }, nil?: true
130
130
 
131
131
  # @!method initialize(name:, price:, tax_category:, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil, entitlements: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, pricing_mode: nil, request_options: {})
132
132
  # Some parameter documentations has been truncated, see
@@ -160,7 +160,7 @@ module Dodopayments
160
160
  #
161
161
  # @param metadata [Hash{Symbol=>String}] Additional metadata for the product
162
162
  #
163
- # @param pricing_mode [Symbol, Dodopayments::Models::ProductCreateParams::PricingMode, nil] Pricing mode for localized pricing. When set, rules from
163
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Pricing mode for localized pricing. When set, rules from
164
164
  #
165
165
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
166
166
 
@@ -186,19 +186,6 @@ module Dodopayments
186
186
  #
187
187
  # @param instructions [String, nil] Instructions to download and use the digital product
188
188
  end
189
-
190
- # Pricing mode for localized pricing. When set, rules from
191
- # /products/{id}/localized-prices apply at checkout. NULL means base-only
192
- # (existing behavior).
193
- module PricingMode
194
- extend Dodopayments::Internal::Type::Enum
195
-
196
- BY_CURRENCY = :by_currency
197
- BY_COUNTRY = :by_country
198
-
199
- # @!method self.values
200
- # @return [Array<Symbol>]
201
- end
202
189
  end
203
190
  end
204
191
  end
@@ -102,8 +102,8 @@ module Dodopayments
102
102
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
103
103
  # apply).
104
104
  #
105
- # @return [Symbol, Dodopayments::Models::ProductListResponse::PricingMode, nil]
106
- optional :pricing_mode, enum: -> { Dodopayments::Models::ProductListResponse::PricingMode }, nil?: true
105
+ # @return [Symbol, Dodopayments::Models::Products::PricingMode, nil]
106
+ optional :pricing_mode, enum: -> { Dodopayments::Products::PricingMode }, nil?: true
107
107
 
108
108
  # @!attribute tax_inclusive
109
109
  # Indicates if the price is tax inclusive
@@ -143,23 +143,9 @@ module Dodopayments
143
143
  #
144
144
  # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] Details of the price
145
145
  #
146
- # @param pricing_mode [Symbol, Dodopayments::Models::ProductListResponse::PricingMode, nil] Pricing mode for localized pricing. NULL means base-only (no localized rules app
146
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Pricing mode for localized pricing. NULL means base-only (no localized rules app
147
147
  #
148
148
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
149
-
150
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
151
- # apply).
152
- #
153
- # @see Dodopayments::Models::ProductListResponse#pricing_mode
154
- module PricingMode
155
- extend Dodopayments::Internal::Type::Enum
156
-
157
- BY_CURRENCY = :by_currency
158
- BY_COUNTRY = :by_country
159
-
160
- # @!method self.values
161
- # @return [Array<Symbol>]
162
- end
163
149
  end
164
150
  end
165
151
  end
@@ -136,8 +136,8 @@ module Dodopayments
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
138
  #
139
- # @return [Symbol, Dodopayments::Models::ProductUpdateParams::PricingMode, nil]
140
- optional :pricing_mode, enum: -> { Dodopayments::ProductUpdateParams::PricingMode }, nil?: true
139
+ # @return [Symbol, Dodopayments::Models::Products::PricingMode, nil]
140
+ optional :pricing_mode, enum: -> { Dodopayments::Products::PricingMode }, nil?: true
141
141
 
142
142
  # @!attribute tax_category
143
143
  # Tax category of the product.
@@ -179,7 +179,7 @@ module Dodopayments
179
179
  #
180
180
  # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] Price details of the product.
181
181
  #
182
- # @param pricing_mode [Symbol, Dodopayments::Models::ProductUpdateParams::PricingMode, nil] Update the pricing mode. Omit to leave unchanged; set to null to clear
182
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Update the pricing mode. Omit to leave unchanged; set to null to clear
183
183
  #
184
184
  # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Tax category of the product.
185
185
  #
@@ -215,19 +215,6 @@ module Dodopayments
215
215
  #
216
216
  # @param instructions [String, nil] Instructions to download and use the digital product
217
217
  end
218
-
219
- # Update the pricing mode. Omit to leave unchanged; set to null to clear (which
220
- # archives all active localized rules for this product). Changing to a different
221
- # non-null mode also archives any rules whose mode doesn't match the new mode.
222
- module PricingMode
223
- extend Dodopayments::Internal::Type::Enum
224
-
225
- BY_CURRENCY = :by_currency
226
- BY_COUNTRY = :by_country
227
-
228
- # @!method self.values
229
- # @return [Array<Symbol>]
230
- end
231
218
  end
232
219
  end
233
220
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#list
7
+ class ListLocalizedPricesResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute items
9
+ #
10
+ # @return [Array<Dodopayments::Models::Products::LocalizedPrice>]
11
+ required :items, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Products::LocalizedPrice] }
12
+
13
+ # @!method initialize(items:)
14
+ # @param items [Array<Dodopayments::Models::Products::LocalizedPrice>]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#create
7
+ class LocalizedPrice < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ # Unique identifier for the localized price.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute amount
15
+ # Amount in the smallest currency unit (e.g., cents).
16
+ #
17
+ # @return [Integer]
18
+ required :amount, Integer
19
+
20
+ # @!attribute created_at
21
+ # Timestamp when the localized price was created.
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute currency
27
+ # Currency to charge in.
28
+ #
29
+ # @return [Symbol, Dodopayments::Models::Currency]
30
+ required :currency, enum: -> { Dodopayments::Currency }
31
+
32
+ # @!attribute mode
33
+ # Pricing mode of the rule: by_currency or by_country.
34
+ #
35
+ # @return [Symbol, Dodopayments::Models::Products::PricingMode]
36
+ required :mode, enum: -> { Dodopayments::Products::PricingMode }
37
+
38
+ # @!attribute product_id
39
+ # Product this localized price belongs to.
40
+ #
41
+ # @return [String]
42
+ required :product_id, String
43
+
44
+ # @!attribute updated_at
45
+ # Timestamp when the localized price was last updated.
46
+ #
47
+ # @return [Time]
48
+ required :updated_at, Time
49
+
50
+ # @!attribute country_code
51
+ # Country the rule applies to. Only set when mode is by_country.
52
+ #
53
+ # @return [Symbol, Dodopayments::Models::CountryCode, nil]
54
+ optional :country_code, enum: -> { Dodopayments::CountryCode }, nil?: true
55
+
56
+ # @!method initialize(id:, amount:, created_at:, currency:, mode:, product_id:, updated_at:, country_code: nil)
57
+ # @param id [String] Unique identifier for the localized price.
58
+ #
59
+ # @param amount [Integer] Amount in the smallest currency unit (e.g., cents).
60
+ #
61
+ # @param created_at [Time] Timestamp when the localized price was created.
62
+ #
63
+ # @param currency [Symbol, Dodopayments::Models::Currency] Currency to charge in.
64
+ #
65
+ # @param mode [Symbol, Dodopayments::Models::Products::PricingMode] Pricing mode of the rule: by_currency or by_country.
66
+ #
67
+ # @param product_id [String] Product this localized price belongs to.
68
+ #
69
+ # @param updated_at [Time] Timestamp when the localized price was last updated.
70
+ #
71
+ # @param country_code [Symbol, Dodopayments::Models::CountryCode, nil] Country the rule applies to. Only set when mode is by_country.
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#archive
7
+ class LocalizedPriceArchiveParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute product_id
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute id
17
+ #
18
+ # @return [String]
19
+ required :id, String
20
+
21
+ # @!method initialize(product_id:, id:, request_options: {})
22
+ # @param product_id [String]
23
+ # @param id [String]
24
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#create
7
+ class LocalizedPriceCreateParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute product_id
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute amount
17
+ # Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
18
+ #
19
+ # @return [Integer]
20
+ required :amount, Integer
21
+
22
+ # @!attribute currency
23
+ # Currency to charge in. Must be a supported currency.
24
+ #
25
+ # @return [Symbol, Dodopayments::Models::Currency]
26
+ required :currency, enum: -> { Dodopayments::Currency }
27
+
28
+ # @!attribute country_code
29
+ # Required when the product's pricing_mode is by_country; forbidden when
30
+ # by_currency.
31
+ #
32
+ # @return [Symbol, Dodopayments::Models::CountryCode, nil]
33
+ optional :country_code, enum: -> { Dodopayments::CountryCode }, nil?: true
34
+
35
+ # @!method initialize(product_id:, amount:, currency:, country_code: nil, request_options: {})
36
+ # Some parameter documentations has been truncated, see
37
+ # {Dodopayments::Models::Products::LocalizedPriceCreateParams} for more details.
38
+ #
39
+ # @param product_id [String]
40
+ #
41
+ # @param amount [Integer] Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
42
+ #
43
+ # @param currency [Symbol, Dodopayments::Models::Currency] Currency to charge in. Must be a supported currency.
44
+ #
45
+ # @param country_code [Symbol, Dodopayments::Models::CountryCode, nil] Required when the product's pricing_mode is by_country; forbidden when by_curren
46
+ #
47
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#list
7
+ class LocalizedPriceListParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute product_id
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!method initialize(product_id:, request_options: {})
17
+ # @param product_id [String]
18
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#retrieve
7
+ class LocalizedPriceRetrieveParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute product_id
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute id
17
+ #
18
+ # @return [String]
19
+ required :id, String
20
+
21
+ # @!method initialize(product_id:, id:, request_options: {})
22
+ # @param product_id [String]
23
+ # @param id [String]
24
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ # @see Dodopayments::Resources::Products::LocalizedPrices#update
7
+ class LocalizedPriceUpdateParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute product_id
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute id
17
+ #
18
+ # @return [String]
19
+ required :id, String
20
+
21
+ # @!attribute amount
22
+ # New amount in the smallest currency unit (e.g., cents). Must be greater than
23
+ # zero. The currency and country_code of an existing rule cannot be changed.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :amount, Integer, nil?: true
27
+
28
+ # @!method initialize(product_id:, id:, amount: nil, request_options: {})
29
+ # Some parameter documentations has been truncated, see
30
+ # {Dodopayments::Models::Products::LocalizedPriceUpdateParams} for more details.
31
+ #
32
+ # @param product_id [String]
33
+ #
34
+ # @param id [String]
35
+ #
36
+ # @param amount [Integer, nil] New amount in the smallest currency unit (e.g., cents). Must be greater
37
+ #
38
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ module PricingMode
7
+ extend Dodopayments::Internal::Type::Enum
8
+
9
+ BY_CURRENCY = :by_currency
10
+ BY_COUNTRY = :by_country
11
+
12
+ # @!method self.values
13
+ # @return [Array<Symbol>]
14
+ end
15
+ end
16
+ end
17
+ end
@@ -309,6 +309,9 @@ module Dodopayments
309
309
 
310
310
  LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
311
311
 
312
+ # @type [Dodopayments::Internal::Type::Converter]
313
+ Metadata = Dodopayments::Models::Metadata
314
+
312
315
  Meter = Dodopayments::Models::Meter
313
316
 
314
317
  MeterAggregation = Dodopayments::Models::MeterAggregation
@@ -36,6 +36,41 @@ module Dodopayments
36
36
  )
37
37
  end
38
38
 
39
+ # Some parameter documentations has been truncated, see
40
+ # {Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams} for more
41
+ # details.
42
+ #
43
+ # For entitlements whose license-key config uses `manual` fulfillment, grants are
44
+ # created in the `pending` state without a key. Call this endpoint to deliver the
45
+ # key: the grant moves to `delivered`, the customer is emailed the key, and the
46
+ # `license_key.created` and `entitlement_grant.delivered` webhook events are sent.
47
+ #
48
+ # @overload fulfill_license_key(grant_id, key:, activations_limit: nil, expires_at: nil, request_options: {})
49
+ #
50
+ # @param grant_id [String] Grant ID
51
+ #
52
+ # @param key [String] The license key value to deliver to the customer.
53
+ #
54
+ # @param activations_limit [Integer, nil] Per-key activation limit. Defaults to the entitlement's license-key configuratio
55
+ #
56
+ # @param expires_at [Time, nil] When the key expires. Defaults to the duration in the entitlement's license-key
57
+ #
58
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
59
+ #
60
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
61
+ #
62
+ # @see Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams
63
+ def fulfill_license_key(grant_id, params)
64
+ parsed, options = Dodopayments::Entitlements::GrantFulfillLicenseKeyParams.dump_request(params)
65
+ @client.request(
66
+ method: :post,
67
+ path: ["grants/%1$s/license-key", grant_id],
68
+ body: parsed,
69
+ model: Dodopayments::Entitlements::EntitlementGrant,
70
+ options: options
71
+ )
72
+ end
73
+
39
74
  # Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
40
75
  # the grant in its current state.
41
76
  #