checkout-intents 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +27 -1
- data/lib/checkout_intents/client.rb +10 -2
- data/lib/checkout_intents/internal/type/enum.rb +25 -0
- data/lib/checkout_intents/models/base_checkout_intent.rb +40 -1
- data/lib/checkout_intents/models/betas/checkout_session_create_params.rb +43 -1
- data/lib/checkout_intents/models/checkout_intent_create_params.rb +41 -1
- data/lib/checkout_intents/models/checkout_intent_purchase_params.rb +43 -1
- data/lib/checkout_intents/models/money.rb +3 -3
- data/lib/checkout_intents/models/product.rb +82 -0
- data/lib/checkout_intents/models/product_availability.rb +25 -0
- data/lib/checkout_intents/models/product_image.rb +21 -0
- data/lib/checkout_intents/models/product_lookup_params.rb +20 -0
- data/lib/checkout_intents/models.rb +8 -0
- data/lib/checkout_intents/resources/products.rb +35 -0
- data/lib/checkout_intents/version.rb +1 -1
- data/lib/checkout_intents.rb +5 -0
- data/rbi/checkout_intents/client.rbi +7 -2
- data/rbi/checkout_intents/internal/transport/base_client.rbi +2 -1
- data/rbi/checkout_intents/models/base_checkout_intent.rbi +88 -4
- data/rbi/checkout_intents/models/betas/checkout_session_create_params.rbi +86 -3
- data/rbi/checkout_intents/models/checkout_intent_create_params.rbi +88 -4
- data/rbi/checkout_intents/models/checkout_intent_purchase_params.rbi +88 -4
- data/rbi/checkout_intents/models/money.rbi +3 -3
- data/rbi/checkout_intents/models/product.rbi +100 -0
- data/rbi/checkout_intents/models/product_availability.rbi +39 -0
- data/rbi/checkout_intents/models/product_image.rbi +31 -0
- data/rbi/checkout_intents/models/product_lookup_params.rbi +38 -0
- data/rbi/checkout_intents/models.rbi +8 -0
- data/rbi/checkout_intents/resources/betas.rbi +3 -1
- data/rbi/checkout_intents/resources/brands.rbi +3 -1
- data/rbi/checkout_intents/resources/checkout_intents.rbi +3 -1
- data/rbi/checkout_intents/resources/products.rbi +24 -0
- data/sig/checkout_intents/client.rbs +4 -1
- data/sig/checkout_intents/models/base_checkout_intent.rbs +26 -3
- data/sig/checkout_intents/models/betas/checkout_session_create_params.rbs +26 -3
- data/sig/checkout_intents/models/checkout_intent_create_params.rbs +26 -3
- data/sig/checkout_intents/models/checkout_intent_purchase_params.rbs +26 -3
- data/sig/checkout_intents/models/money.rbs +4 -4
- data/sig/checkout_intents/models/product.rbs +60 -0
- data/sig/checkout_intents/models/product_availability.rbs +18 -0
- data/sig/checkout_intents/models/product_image.rbs +15 -0
- data/sig/checkout_intents/models/product_lookup_params.rbs +23 -0
- data/sig/checkout_intents/models.rbs +8 -0
- data/sig/checkout_intents/resources/checkout_intents.rbs +8 -4
- data/sig/checkout_intents/resources/products.rbs +12 -0
- metadata +17 -2
|
@@ -121,21 +121,105 @@ module CheckoutIntents
|
|
|
121
121
|
sig { params(max_total_price: Integer).void }
|
|
122
122
|
attr_writer :max_total_price
|
|
123
123
|
|
|
124
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
125
|
+
#
|
|
126
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
127
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
128
|
+
# success rate)
|
|
129
|
+
#
|
|
130
|
+
# Default: 'max'
|
|
124
131
|
sig do
|
|
125
|
-
|
|
126
|
-
T.
|
|
132
|
+
returns(
|
|
133
|
+
T.nilable(
|
|
134
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
135
|
+
)
|
|
127
136
|
)
|
|
128
137
|
end
|
|
129
|
-
|
|
138
|
+
attr_reader :offer_retrieval_effort
|
|
139
|
+
|
|
140
|
+
sig do
|
|
141
|
+
params(
|
|
142
|
+
offer_retrieval_effort:
|
|
143
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::OrSymbol
|
|
144
|
+
).void
|
|
145
|
+
end
|
|
146
|
+
attr_writer :offer_retrieval_effort
|
|
147
|
+
|
|
148
|
+
sig do
|
|
149
|
+
params(
|
|
150
|
+
max_shipping_price: Integer,
|
|
151
|
+
max_total_price: Integer,
|
|
152
|
+
offer_retrieval_effort:
|
|
153
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::OrSymbol
|
|
154
|
+
).returns(T.attached_class)
|
|
155
|
+
end
|
|
156
|
+
def self.new(
|
|
157
|
+
max_shipping_price: nil,
|
|
158
|
+
max_total_price: nil,
|
|
159
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
160
|
+
#
|
|
161
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
162
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
163
|
+
# success rate)
|
|
164
|
+
#
|
|
165
|
+
# Default: 'max'
|
|
166
|
+
offer_retrieval_effort: nil
|
|
167
|
+
)
|
|
130
168
|
end
|
|
131
169
|
|
|
132
170
|
sig do
|
|
133
171
|
override.returns(
|
|
134
|
-
{
|
|
172
|
+
{
|
|
173
|
+
max_shipping_price: Integer,
|
|
174
|
+
max_total_price: Integer,
|
|
175
|
+
offer_retrieval_effort:
|
|
176
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
177
|
+
}
|
|
135
178
|
)
|
|
136
179
|
end
|
|
137
180
|
def to_hash
|
|
138
181
|
end
|
|
182
|
+
|
|
183
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
184
|
+
#
|
|
185
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
186
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
187
|
+
# success rate)
|
|
188
|
+
#
|
|
189
|
+
# Default: 'max'
|
|
190
|
+
module OfferRetrievalEffort
|
|
191
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
192
|
+
|
|
193
|
+
TaggedSymbol =
|
|
194
|
+
T.type_alias do
|
|
195
|
+
T.all(
|
|
196
|
+
Symbol,
|
|
197
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
201
|
+
|
|
202
|
+
MAX =
|
|
203
|
+
T.let(
|
|
204
|
+
:max,
|
|
205
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
LOW =
|
|
208
|
+
T.let(
|
|
209
|
+
:low,
|
|
210
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
sig do
|
|
214
|
+
override.returns(
|
|
215
|
+
T::Array[
|
|
216
|
+
CheckoutIntents::BaseCheckoutIntent::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
217
|
+
]
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
def self.values
|
|
221
|
+
end
|
|
222
|
+
end
|
|
139
223
|
end
|
|
140
224
|
end
|
|
141
225
|
end
|
|
@@ -258,22 +258,105 @@ module CheckoutIntents
|
|
|
258
258
|
sig { params(max_total_price: Integer).void }
|
|
259
259
|
attr_writer :max_total_price
|
|
260
260
|
|
|
261
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
262
|
+
#
|
|
263
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
264
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
265
|
+
# success rate)
|
|
266
|
+
#
|
|
267
|
+
# Default: 'max'
|
|
268
|
+
sig do
|
|
269
|
+
returns(
|
|
270
|
+
T.nilable(
|
|
271
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
272
|
+
)
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
attr_reader :offer_retrieval_effort
|
|
276
|
+
|
|
277
|
+
sig do
|
|
278
|
+
params(
|
|
279
|
+
offer_retrieval_effort:
|
|
280
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
281
|
+
).void
|
|
282
|
+
end
|
|
283
|
+
attr_writer :offer_retrieval_effort
|
|
284
|
+
|
|
261
285
|
sig do
|
|
262
286
|
params(
|
|
263
287
|
max_shipping_price: Integer,
|
|
264
|
-
max_total_price: Integer
|
|
288
|
+
max_total_price: Integer,
|
|
289
|
+
offer_retrieval_effort:
|
|
290
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
265
291
|
).returns(T.attached_class)
|
|
266
292
|
end
|
|
267
|
-
def self.new(
|
|
293
|
+
def self.new(
|
|
294
|
+
max_shipping_price: nil,
|
|
295
|
+
max_total_price: nil,
|
|
296
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
297
|
+
#
|
|
298
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
299
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
300
|
+
# success rate)
|
|
301
|
+
#
|
|
302
|
+
# Default: 'max'
|
|
303
|
+
offer_retrieval_effort: nil
|
|
304
|
+
)
|
|
268
305
|
end
|
|
269
306
|
|
|
270
307
|
sig do
|
|
271
308
|
override.returns(
|
|
272
|
-
{
|
|
309
|
+
{
|
|
310
|
+
max_shipping_price: Integer,
|
|
311
|
+
max_total_price: Integer,
|
|
312
|
+
offer_retrieval_effort:
|
|
313
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
314
|
+
}
|
|
273
315
|
)
|
|
274
316
|
end
|
|
275
317
|
def to_hash
|
|
276
318
|
end
|
|
319
|
+
|
|
320
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
321
|
+
#
|
|
322
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
323
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
324
|
+
# success rate)
|
|
325
|
+
#
|
|
326
|
+
# Default: 'max'
|
|
327
|
+
module OfferRetrievalEffort
|
|
328
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
329
|
+
|
|
330
|
+
TaggedSymbol =
|
|
331
|
+
T.type_alias do
|
|
332
|
+
T.all(
|
|
333
|
+
Symbol,
|
|
334
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort
|
|
335
|
+
)
|
|
336
|
+
end
|
|
337
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
338
|
+
|
|
339
|
+
MAX =
|
|
340
|
+
T.let(
|
|
341
|
+
:max,
|
|
342
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
343
|
+
)
|
|
344
|
+
LOW =
|
|
345
|
+
T.let(
|
|
346
|
+
:low,
|
|
347
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
sig do
|
|
351
|
+
override.returns(
|
|
352
|
+
T::Array[
|
|
353
|
+
CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
354
|
+
]
|
|
355
|
+
)
|
|
356
|
+
end
|
|
357
|
+
def self.values
|
|
358
|
+
end
|
|
359
|
+
end
|
|
277
360
|
end
|
|
278
361
|
end
|
|
279
362
|
end
|
|
@@ -120,21 +120,105 @@ module CheckoutIntents
|
|
|
120
120
|
sig { params(max_total_price: Integer).void }
|
|
121
121
|
attr_writer :max_total_price
|
|
122
122
|
|
|
123
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
124
|
+
#
|
|
125
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
126
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
127
|
+
# success rate)
|
|
128
|
+
#
|
|
129
|
+
# Default: 'max'
|
|
123
130
|
sig do
|
|
124
|
-
|
|
125
|
-
T.
|
|
131
|
+
returns(
|
|
132
|
+
T.nilable(
|
|
133
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
134
|
+
)
|
|
126
135
|
)
|
|
127
136
|
end
|
|
128
|
-
|
|
137
|
+
attr_reader :offer_retrieval_effort
|
|
138
|
+
|
|
139
|
+
sig do
|
|
140
|
+
params(
|
|
141
|
+
offer_retrieval_effort:
|
|
142
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
143
|
+
).void
|
|
144
|
+
end
|
|
145
|
+
attr_writer :offer_retrieval_effort
|
|
146
|
+
|
|
147
|
+
sig do
|
|
148
|
+
params(
|
|
149
|
+
max_shipping_price: Integer,
|
|
150
|
+
max_total_price: Integer,
|
|
151
|
+
offer_retrieval_effort:
|
|
152
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
153
|
+
).returns(T.attached_class)
|
|
154
|
+
end
|
|
155
|
+
def self.new(
|
|
156
|
+
max_shipping_price: nil,
|
|
157
|
+
max_total_price: nil,
|
|
158
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
159
|
+
#
|
|
160
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
161
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
162
|
+
# success rate)
|
|
163
|
+
#
|
|
164
|
+
# Default: 'max'
|
|
165
|
+
offer_retrieval_effort: nil
|
|
166
|
+
)
|
|
129
167
|
end
|
|
130
168
|
|
|
131
169
|
sig do
|
|
132
170
|
override.returns(
|
|
133
|
-
{
|
|
171
|
+
{
|
|
172
|
+
max_shipping_price: Integer,
|
|
173
|
+
max_total_price: Integer,
|
|
174
|
+
offer_retrieval_effort:
|
|
175
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
176
|
+
}
|
|
134
177
|
)
|
|
135
178
|
end
|
|
136
179
|
def to_hash
|
|
137
180
|
end
|
|
181
|
+
|
|
182
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
183
|
+
#
|
|
184
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
185
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
186
|
+
# success rate)
|
|
187
|
+
#
|
|
188
|
+
# Default: 'max'
|
|
189
|
+
module OfferRetrievalEffort
|
|
190
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
191
|
+
|
|
192
|
+
TaggedSymbol =
|
|
193
|
+
T.type_alias do
|
|
194
|
+
T.all(
|
|
195
|
+
Symbol,
|
|
196
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
200
|
+
|
|
201
|
+
MAX =
|
|
202
|
+
T.let(
|
|
203
|
+
:max,
|
|
204
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
205
|
+
)
|
|
206
|
+
LOW =
|
|
207
|
+
T.let(
|
|
208
|
+
:low,
|
|
209
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
sig do
|
|
213
|
+
override.returns(
|
|
214
|
+
T::Array[
|
|
215
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
216
|
+
]
|
|
217
|
+
)
|
|
218
|
+
end
|
|
219
|
+
def self.values
|
|
220
|
+
end
|
|
221
|
+
end
|
|
138
222
|
end
|
|
139
223
|
end
|
|
140
224
|
end
|
|
@@ -144,21 +144,105 @@ module CheckoutIntents
|
|
|
144
144
|
sig { params(max_total_price: Integer).void }
|
|
145
145
|
attr_writer :max_total_price
|
|
146
146
|
|
|
147
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
148
|
+
#
|
|
149
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
150
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
151
|
+
# success rate)
|
|
152
|
+
#
|
|
153
|
+
# Default: 'max'
|
|
147
154
|
sig do
|
|
148
|
-
|
|
149
|
-
T.
|
|
155
|
+
returns(
|
|
156
|
+
T.nilable(
|
|
157
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
158
|
+
)
|
|
150
159
|
)
|
|
151
160
|
end
|
|
152
|
-
|
|
161
|
+
attr_reader :offer_retrieval_effort
|
|
162
|
+
|
|
163
|
+
sig do
|
|
164
|
+
params(
|
|
165
|
+
offer_retrieval_effort:
|
|
166
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
167
|
+
).void
|
|
168
|
+
end
|
|
169
|
+
attr_writer :offer_retrieval_effort
|
|
170
|
+
|
|
171
|
+
sig do
|
|
172
|
+
params(
|
|
173
|
+
max_shipping_price: Integer,
|
|
174
|
+
max_total_price: Integer,
|
|
175
|
+
offer_retrieval_effort:
|
|
176
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
177
|
+
).returns(T.attached_class)
|
|
178
|
+
end
|
|
179
|
+
def self.new(
|
|
180
|
+
max_shipping_price: nil,
|
|
181
|
+
max_total_price: nil,
|
|
182
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
183
|
+
#
|
|
184
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
185
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
186
|
+
# success rate)
|
|
187
|
+
#
|
|
188
|
+
# Default: 'max'
|
|
189
|
+
offer_retrieval_effort: nil
|
|
190
|
+
)
|
|
153
191
|
end
|
|
154
192
|
|
|
155
193
|
sig do
|
|
156
194
|
override.returns(
|
|
157
|
-
{
|
|
195
|
+
{
|
|
196
|
+
max_shipping_price: Integer,
|
|
197
|
+
max_total_price: Integer,
|
|
198
|
+
offer_retrieval_effort:
|
|
199
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::OrSymbol
|
|
200
|
+
}
|
|
158
201
|
)
|
|
159
202
|
end
|
|
160
203
|
def to_hash
|
|
161
204
|
end
|
|
205
|
+
|
|
206
|
+
# Controls how much effort the system should spend retrieving an offer.
|
|
207
|
+
#
|
|
208
|
+
# - 'max': Full effort including AI agent fallback (slower, higher success rate)
|
|
209
|
+
# - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
|
|
210
|
+
# success rate)
|
|
211
|
+
#
|
|
212
|
+
# Default: 'max'
|
|
213
|
+
module OfferRetrievalEffort
|
|
214
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
215
|
+
|
|
216
|
+
TaggedSymbol =
|
|
217
|
+
T.type_alias do
|
|
218
|
+
T.all(
|
|
219
|
+
Symbol,
|
|
220
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort
|
|
221
|
+
)
|
|
222
|
+
end
|
|
223
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
224
|
+
|
|
225
|
+
MAX =
|
|
226
|
+
T.let(
|
|
227
|
+
:max,
|
|
228
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
229
|
+
)
|
|
230
|
+
LOW =
|
|
231
|
+
T.let(
|
|
232
|
+
:low,
|
|
233
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
sig do
|
|
237
|
+
override.returns(
|
|
238
|
+
T::Array[
|
|
239
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OfferRetrievalEffort::TaggedSymbol
|
|
240
|
+
]
|
|
241
|
+
)
|
|
242
|
+
end
|
|
243
|
+
def self.values
|
|
244
|
+
end
|
|
245
|
+
end
|
|
162
246
|
end
|
|
163
247
|
end
|
|
164
248
|
end
|
|
@@ -8,14 +8,14 @@ module CheckoutIntents
|
|
|
8
8
|
T.any(CheckoutIntents::Money, CheckoutIntents::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
sig { returns(
|
|
11
|
+
sig { returns(Integer) }
|
|
12
12
|
attr_accessor :amount_subunits
|
|
13
13
|
|
|
14
14
|
sig { returns(String) }
|
|
15
15
|
attr_accessor :currency_code
|
|
16
16
|
|
|
17
17
|
sig do
|
|
18
|
-
params(amount_subunits:
|
|
18
|
+
params(amount_subunits: Integer, currency_code: String).returns(
|
|
19
19
|
T.attached_class
|
|
20
20
|
)
|
|
21
21
|
end
|
|
@@ -23,7 +23,7 @@ module CheckoutIntents
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
sig do
|
|
26
|
-
override.returns({ amount_subunits:
|
|
26
|
+
override.returns({ amount_subunits: Integer, currency_code: String })
|
|
27
27
|
end
|
|
28
28
|
def to_hash
|
|
29
29
|
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class Product < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(CheckoutIntents::Product, CheckoutIntents::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
attr_accessor :id
|
|
13
|
+
|
|
14
|
+
# The availability status of a product.
|
|
15
|
+
#
|
|
16
|
+
# - `in_stock`: Product is available for immediate purchase
|
|
17
|
+
# - `out_of_stock`: Product is currently unavailable
|
|
18
|
+
# - `preorder`: Product is available for pre-order before release
|
|
19
|
+
# - `backorder`: Product is temporarily out of stock but can be ordered
|
|
20
|
+
# - `unknown`: Availability could not be determined
|
|
21
|
+
sig { returns(CheckoutIntents::ProductAvailability::TaggedSymbol) }
|
|
22
|
+
attr_accessor :availability
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_accessor :brand
|
|
26
|
+
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Array[CheckoutIntents::ProductImage]) }
|
|
31
|
+
attr_accessor :images
|
|
32
|
+
|
|
33
|
+
sig { returns(String) }
|
|
34
|
+
attr_accessor :name
|
|
35
|
+
|
|
36
|
+
sig { returns(CheckoutIntents::Money) }
|
|
37
|
+
attr_reader :price
|
|
38
|
+
|
|
39
|
+
sig { params(price: CheckoutIntents::Money::OrHash).void }
|
|
40
|
+
attr_writer :price
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
attr_accessor :sku
|
|
44
|
+
|
|
45
|
+
sig { returns(String) }
|
|
46
|
+
attr_accessor :url
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
id: String,
|
|
51
|
+
availability: CheckoutIntents::ProductAvailability::OrSymbol,
|
|
52
|
+
brand: T.nilable(String),
|
|
53
|
+
description: T.nilable(String),
|
|
54
|
+
images: T::Array[CheckoutIntents::ProductImage::OrHash],
|
|
55
|
+
name: String,
|
|
56
|
+
price: CheckoutIntents::Money::OrHash,
|
|
57
|
+
sku: T.nilable(String),
|
|
58
|
+
url: String
|
|
59
|
+
).returns(T.attached_class)
|
|
60
|
+
end
|
|
61
|
+
def self.new(
|
|
62
|
+
id:,
|
|
63
|
+
# The availability status of a product.
|
|
64
|
+
#
|
|
65
|
+
# - `in_stock`: Product is available for immediate purchase
|
|
66
|
+
# - `out_of_stock`: Product is currently unavailable
|
|
67
|
+
# - `preorder`: Product is available for pre-order before release
|
|
68
|
+
# - `backorder`: Product is temporarily out of stock but can be ordered
|
|
69
|
+
# - `unknown`: Availability could not be determined
|
|
70
|
+
availability:,
|
|
71
|
+
brand:,
|
|
72
|
+
description:,
|
|
73
|
+
images:,
|
|
74
|
+
name:,
|
|
75
|
+
price:,
|
|
76
|
+
sku:,
|
|
77
|
+
url:
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
id: String,
|
|
85
|
+
availability: CheckoutIntents::ProductAvailability::TaggedSymbol,
|
|
86
|
+
brand: T.nilable(String),
|
|
87
|
+
description: T.nilable(String),
|
|
88
|
+
images: T::Array[CheckoutIntents::ProductImage],
|
|
89
|
+
name: String,
|
|
90
|
+
price: CheckoutIntents::Money,
|
|
91
|
+
sku: T.nilable(String),
|
|
92
|
+
url: String
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
def to_hash
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
# The availability status of a product.
|
|
6
|
+
#
|
|
7
|
+
# - `in_stock`: Product is available for immediate purchase
|
|
8
|
+
# - `out_of_stock`: Product is currently unavailable
|
|
9
|
+
# - `preorder`: Product is available for pre-order before release
|
|
10
|
+
# - `backorder`: Product is temporarily out of stock but can be ordered
|
|
11
|
+
# - `unknown`: Availability could not be determined
|
|
12
|
+
module ProductAvailability
|
|
13
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
14
|
+
|
|
15
|
+
TaggedSymbol =
|
|
16
|
+
T.type_alias { T.all(Symbol, CheckoutIntents::ProductAvailability) }
|
|
17
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
18
|
+
|
|
19
|
+
IN_STOCK =
|
|
20
|
+
T.let(:in_stock, CheckoutIntents::ProductAvailability::TaggedSymbol)
|
|
21
|
+
OUT_OF_STOCK =
|
|
22
|
+
T.let(:out_of_stock, CheckoutIntents::ProductAvailability::TaggedSymbol)
|
|
23
|
+
PREORDER =
|
|
24
|
+
T.let(:preorder, CheckoutIntents::ProductAvailability::TaggedSymbol)
|
|
25
|
+
BACKORDER =
|
|
26
|
+
T.let(:backorder, CheckoutIntents::ProductAvailability::TaggedSymbol)
|
|
27
|
+
UNKNOWN =
|
|
28
|
+
T.let(:unknown, CheckoutIntents::ProductAvailability::TaggedSymbol)
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
T::Array[CheckoutIntents::ProductAvailability::TaggedSymbol]
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
def self.values
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class ProductImage < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
CheckoutIntents::ProductImage,
|
|
10
|
+
CheckoutIntents::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T::Boolean) }
|
|
15
|
+
attr_accessor :is_featured
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(is_featured: T::Boolean, url: String).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(is_featured:, url:)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig { override.returns({ is_featured: T::Boolean, url: String }) }
|
|
27
|
+
def to_hash
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class ProductLookupParams < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
extend CheckoutIntents::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include CheckoutIntents::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
CheckoutIntents::ProductLookupParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
url: String,
|
|
23
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(url:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ url: String, request_options: CheckoutIntents::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -36,5 +36,13 @@ module CheckoutIntents
|
|
|
36
36
|
|
|
37
37
|
PaymentMethod = CheckoutIntents::Models::PaymentMethod
|
|
38
38
|
|
|
39
|
+
Product = CheckoutIntents::Models::Product
|
|
40
|
+
|
|
41
|
+
ProductAvailability = CheckoutIntents::Models::ProductAvailability
|
|
42
|
+
|
|
43
|
+
ProductImage = CheckoutIntents::Models::ProductImage
|
|
44
|
+
|
|
45
|
+
ProductLookupParams = CheckoutIntents::Models::ProductLookupParams
|
|
46
|
+
|
|
39
47
|
VariantSelection = CheckoutIntents::Models::VariantSelection
|
|
40
48
|
end
|