context.dev 2.18.0 → 2.20.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +220 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
  6. data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
  7. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
  8. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
  9. data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +14 -14
  10. data/lib/context_dev/models/web_map_urls_response.rb +123 -0
  11. data/lib/context_dev/models/web_scrape_params.rb +1035 -0
  12. data/lib/context_dev/models/web_scrape_response.rb +974 -0
  13. data/lib/context_dev/models/web_screenshot_params.rb +15 -1
  14. data/lib/context_dev/models/web_screenshot_response.rb +3 -3
  15. data/lib/context_dev/models.rb +8 -22
  16. data/lib/context_dev/resources/brand.rb +0 -36
  17. data/lib/context_dev/resources/monitors.rb +47 -0
  18. data/lib/context_dev/resources/web.rb +118 -486
  19. data/lib/context_dev/version.rb +1 -1
  20. data/lib/context_dev.rb +8 -23
  21. data/rbi/context_dev/client.rbi +0 -3
  22. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
  23. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
  24. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
  25. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
  26. data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +23 -45
  27. data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
  28. data/rbi/context_dev/models/web_scrape_params.rbi +2221 -0
  29. data/rbi/context_dev/models/web_scrape_response.rbi +1874 -0
  30. data/rbi/context_dev/models/web_screenshot_params.rbi +23 -0
  31. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
  32. data/rbi/context_dev/models.rbi +9 -24
  33. data/rbi/context_dev/resources/brand.rbi +0 -35
  34. data/rbi/context_dev/resources/monitors.rbi +24 -0
  35. data/rbi/context_dev/resources/web.rbi +152 -654
  36. data/sig/context_dev/client.rbs +0 -2
  37. data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
  38. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
  39. data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
  40. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
  41. data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
  42. data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
  43. data/sig/context_dev/models/web_scrape_params.rbs +925 -0
  44. data/sig/context_dev/models/web_scrape_response.rbs +782 -0
  45. data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
  46. data/sig/context_dev/models.rbs +8 -22
  47. data/sig/context_dev/resources/brand.rbs +0 -9
  48. data/sig/context_dev/resources/monitors.rbs +11 -0
  49. data/sig/context_dev/resources/web.rbs +33 -128
  50. metadata +26 -71
  51. data/lib/context_dev/models/ai_extract_product_params.rb +0 -125
  52. data/lib/context_dev/models/ai_extract_product_response.rb +0 -402
  53. data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
  54. data/lib/context_dev/models/ai_extract_products_response.rb +0 -370
  55. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
  56. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
  57. data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
  58. data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
  59. data/lib/context_dev/models/web_extract_params.rb +0 -419
  60. data/lib/context_dev/models/web_extract_response.rb +0 -287
  61. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -346
  62. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
  63. data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -812
  64. data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -628
  65. data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -373
  66. data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
  67. data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -670
  68. data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
  69. data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +0 -471
  70. data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +0 -169
  71. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
  72. data/lib/context_dev/resources/ai.rb +0 -71
  73. data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -253
  74. data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -791
  75. data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
  76. data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -718
  77. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
  78. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
  79. data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
  80. data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
  81. data/rbi/context_dev/models/web_extract_params.rbi +0 -781
  82. data/rbi/context_dev/models/web_extract_response.rbi +0 -512
  83. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -702
  84. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
  85. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1690
  86. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +0 -1287
  87. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -728
  88. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  89. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1052
  90. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  91. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +0 -1580
  92. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +0 -332
  93. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  94. data/rbi/context_dev/resources/ai.rbi +0 -63
  95. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -106
  96. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -314
  97. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  98. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -293
  99. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  100. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  101. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  102. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  103. data/sig/context_dev/models/web_extract_params.rbs +0 -324
  104. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  105. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  106. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  107. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -878
  108. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -525
  109. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -281
  110. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  111. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  112. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  113. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +0 -619
  114. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +0 -127
  115. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  116. data/sig/context_dev/resources/ai.rbs +0 -21
@@ -1,791 +0,0 @@
1
- # typed: strong
2
-
3
- module ContextDev
4
- module Models
5
- class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(
9
- ContextDev::Models::AIExtractProductResponse,
10
- ContextDev::Internal::AnyHash
11
- )
12
- end
13
-
14
- # Cache outcome for this response. Composite responses are hits only when every
15
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
16
- # oldest contributing hit.
17
- sig do
18
- returns(ContextDev::Models::AIExtractProductResponse::CacheMetadata)
19
- end
20
- attr_reader :cache_metadata
21
-
22
- sig do
23
- params(
24
- cache_metadata:
25
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::OrHash
26
- ).void
27
- end
28
- attr_writer :cache_metadata
29
-
30
- # Unique id of this API call, also sent in the X-Request-Id response header. Quote
31
- # it when contacting support about a failed request.
32
- sig { returns(String) }
33
- attr_accessor :request_id
34
-
35
- # Whether the given URL is a product detail page
36
- sig { returns(T.nilable(T::Boolean)) }
37
- attr_reader :is_product_page
38
-
39
- sig { params(is_product_page: T::Boolean).void }
40
- attr_writer :is_product_page
41
-
42
- # Credit usage, included whenever a valid API key is provided.
43
- sig do
44
- returns(
45
- T.nilable(ContextDev::Models::AIExtractProductResponse::KeyMetadata)
46
- )
47
- end
48
- attr_reader :key_metadata
49
-
50
- sig do
51
- params(
52
- key_metadata:
53
- ContextDev::Models::AIExtractProductResponse::KeyMetadata::OrHash
54
- ).void
55
- end
56
- attr_writer :key_metadata
57
-
58
- # True when the timeout ended processing and this response contains only usable
59
- # results completed so far. Unfinished results are omitted.
60
- sig { returns(T.nilable(T::Boolean)) }
61
- attr_reader :partial
62
-
63
- sig { params(partial: T::Boolean).void }
64
- attr_writer :partial
65
-
66
- # The detected ecommerce platform, or null if not a product page
67
- sig do
68
- returns(
69
- T.nilable(
70
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
71
- )
72
- )
73
- end
74
- attr_accessor :platform
75
-
76
- # The extracted product data, or null if not a product page
77
- sig do
78
- returns(
79
- T.nilable(ContextDev::Models::AIExtractProductResponse::Product)
80
- )
81
- end
82
- attr_reader :product
83
-
84
- sig do
85
- params(
86
- product:
87
- T.nilable(
88
- ContextDev::Models::AIExtractProductResponse::Product::OrHash
89
- )
90
- ).void
91
- end
92
- attr_writer :product
93
-
94
- sig do
95
- params(
96
- cache_metadata:
97
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::OrHash,
98
- request_id: String,
99
- is_product_page: T::Boolean,
100
- key_metadata:
101
- ContextDev::Models::AIExtractProductResponse::KeyMetadata::OrHash,
102
- partial: T::Boolean,
103
- platform:
104
- T.nilable(
105
- ContextDev::Models::AIExtractProductResponse::Platform::OrSymbol
106
- ),
107
- product:
108
- T.nilable(
109
- ContextDev::Models::AIExtractProductResponse::Product::OrHash
110
- )
111
- ).returns(T.attached_class)
112
- end
113
- def self.new(
114
- # Cache outcome for this response. Composite responses are hits only when every
115
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
116
- # oldest contributing hit.
117
- cache_metadata:,
118
- # Unique id of this API call, also sent in the X-Request-Id response header. Quote
119
- # it when contacting support about a failed request.
120
- request_id:,
121
- # Whether the given URL is a product detail page
122
- is_product_page: nil,
123
- # Credit usage, included whenever a valid API key is provided.
124
- key_metadata: nil,
125
- # True when the timeout ended processing and this response contains only usable
126
- # results completed so far. Unfinished results are omitted.
127
- partial: nil,
128
- # The detected ecommerce platform, or null if not a product page
129
- platform: nil,
130
- # The extracted product data, or null if not a product page
131
- product: nil
132
- )
133
- end
134
-
135
- sig do
136
- override.returns(
137
- {
138
- cache_metadata:
139
- ContextDev::Models::AIExtractProductResponse::CacheMetadata,
140
- request_id: String,
141
- is_product_page: T::Boolean,
142
- key_metadata:
143
- ContextDev::Models::AIExtractProductResponse::KeyMetadata,
144
- partial: T::Boolean,
145
- platform:
146
- T.nilable(
147
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
148
- ),
149
- product:
150
- T.nilable(ContextDev::Models::AIExtractProductResponse::Product)
151
- }
152
- )
153
- end
154
- def to_hash
155
- end
156
-
157
- class CacheMetadata < ContextDev::Internal::Type::BaseModel
158
- OrHash =
159
- T.type_alias do
160
- T.any(
161
- ContextDev::Models::AIExtractProductResponse::CacheMetadata,
162
- ContextDev::Internal::AnyHash
163
- )
164
- end
165
-
166
- # Age of the cached data in milliseconds. Zero for miss and zdr responses.
167
- sig { returns(Integer) }
168
- attr_accessor :age_ms
169
-
170
- # Whether the response was served from cache, required fresh work, or honored
171
- # zero-data-retention cache bypass.
172
- sig do
173
- returns(
174
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
175
- )
176
- end
177
- attr_accessor :status
178
-
179
- # Cache outcome for this response. Composite responses are hits only when every
180
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
181
- # oldest contributing hit.
182
- sig do
183
- params(
184
- age_ms: Integer,
185
- status:
186
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::OrSymbol
187
- ).returns(T.attached_class)
188
- end
189
- def self.new(
190
- # Age of the cached data in milliseconds. Zero for miss and zdr responses.
191
- age_ms:,
192
- # Whether the response was served from cache, required fresh work, or honored
193
- # zero-data-retention cache bypass.
194
- status:
195
- )
196
- end
197
-
198
- sig do
199
- override.returns(
200
- {
201
- age_ms: Integer,
202
- status:
203
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
204
- }
205
- )
206
- end
207
- def to_hash
208
- end
209
-
210
- # Whether the response was served from cache, required fresh work, or honored
211
- # zero-data-retention cache bypass.
212
- module Status
213
- extend ContextDev::Internal::Type::Enum
214
-
215
- TaggedSymbol =
216
- T.type_alias do
217
- T.all(
218
- Symbol,
219
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status
220
- )
221
- end
222
- OrSymbol = T.type_alias { T.any(Symbol, String) }
223
-
224
- HIT =
225
- T.let(
226
- :hit,
227
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
228
- )
229
- MISS =
230
- T.let(
231
- :miss,
232
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
233
- )
234
- ZDR =
235
- T.let(
236
- :zdr,
237
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
238
- )
239
-
240
- sig do
241
- override.returns(
242
- T::Array[
243
- ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status::TaggedSymbol
244
- ]
245
- )
246
- end
247
- def self.values
248
- end
249
- end
250
- end
251
-
252
- class KeyMetadata < ContextDev::Internal::Type::BaseModel
253
- OrHash =
254
- T.type_alias do
255
- T.any(
256
- ContextDev::Models::AIExtractProductResponse::KeyMetadata,
257
- ContextDev::Internal::AnyHash
258
- )
259
- end
260
-
261
- # Credits used by this request.
262
- sig { returns(Integer) }
263
- attr_accessor :credits_consumed
264
-
265
- # Credits remaining for your organization.
266
- sig { returns(Integer) }
267
- attr_accessor :credits_remaining
268
-
269
- # Credit usage, included whenever a valid API key is provided.
270
- sig do
271
- params(credits_consumed: Integer, credits_remaining: Integer).returns(
272
- T.attached_class
273
- )
274
- end
275
- def self.new(
276
- # Credits used by this request.
277
- credits_consumed:,
278
- # Credits remaining for your organization.
279
- credits_remaining:
280
- )
281
- end
282
-
283
- sig do
284
- override.returns(
285
- { credits_consumed: Integer, credits_remaining: Integer }
286
- )
287
- end
288
- def to_hash
289
- end
290
- end
291
-
292
- # The detected ecommerce platform, or null if not a product page
293
- module Platform
294
- extend ContextDev::Internal::Type::Enum
295
-
296
- TaggedSymbol =
297
- T.type_alias do
298
- T.all(
299
- Symbol,
300
- ContextDev::Models::AIExtractProductResponse::Platform
301
- )
302
- end
303
- OrSymbol = T.type_alias { T.any(Symbol, String) }
304
-
305
- AMAZON =
306
- T.let(
307
- :amazon,
308
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
309
- )
310
- TIKTOK_SHOP =
311
- T.let(
312
- :tiktok_shop,
313
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
314
- )
315
- ETSY =
316
- T.let(
317
- :etsy,
318
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
319
- )
320
- GENERIC =
321
- T.let(
322
- :generic,
323
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
324
- )
325
-
326
- sig do
327
- override.returns(
328
- T::Array[
329
- ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol
330
- ]
331
- )
332
- end
333
- def self.values
334
- end
335
- end
336
-
337
- class Product < ContextDev::Internal::Type::BaseModel
338
- OrHash =
339
- T.type_alias do
340
- T.any(
341
- ContextDev::Models::AIExtractProductResponse::Product,
342
- ContextDev::Internal::AnyHash
343
- )
344
- end
345
-
346
- # Description of the product
347
- sig { returns(String) }
348
- attr_accessor :description
349
-
350
- # List of product features
351
- sig { returns(T::Array[String]) }
352
- attr_accessor :features
353
-
354
- # URLs to product images on the page (up to 7)
355
- sig { returns(T::Array[String]) }
356
- attr_accessor :images
357
-
358
- # Name of the product
359
- sig { returns(String) }
360
- attr_accessor :name
361
-
362
- # Stock Keeping Unit (product identifier). Null if no identifier is found.
363
- sig { returns(T.nilable(String)) }
364
- attr_accessor :sku
365
-
366
- # Tags associated with the product
367
- sig { returns(T::Array[String]) }
368
- attr_accessor :tags
369
-
370
- # Target audience for the product (array of strings)
371
- sig { returns(T::Array[String]) }
372
- attr_accessor :target_audience
373
-
374
- # Normalized stock or ordering availability
375
- sig do
376
- returns(
377
- T.nilable(
378
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
379
- )
380
- )
381
- end
382
- attr_accessor :availability
383
-
384
- # Billing frequency for the product
385
- sig do
386
- returns(
387
- T.nilable(
388
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
389
- )
390
- )
391
- end
392
- attr_accessor :billing_frequency
393
-
394
- # Category of the product
395
- sig { returns(T.nilable(String)) }
396
- attr_accessor :category
397
-
398
- # Currency code for the price (e.g., USD, EUR)
399
- sig { returns(T.nilable(String)) }
400
- attr_accessor :currency
401
-
402
- # Dimension statements shown for the product, preserving labels, values, and units
403
- sig { returns(T.nilable(T::Array[String])) }
404
- attr_reader :dimensions
405
-
406
- sig { params(dimensions: T::Array[String]).void }
407
- attr_writer :dimensions
408
-
409
- # URL to the product image
410
- sig { returns(T.nilable(String)) }
411
- attr_accessor :image_url
412
-
413
- # Price of the product
414
- sig { returns(T.nilable(Float)) }
415
- attr_accessor :price
416
-
417
- # Pricing model for the product
418
- sig do
419
- returns(
420
- T.nilable(
421
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
422
- )
423
- )
424
- end
425
- attr_accessor :pricing_model
426
-
427
- # Original or regular price before a displayed discount
428
- sig { returns(T.nilable(Float)) }
429
- attr_accessor :regular_price
430
-
431
- # URL to the product page
432
- sig { returns(T.nilable(String)) }
433
- attr_accessor :url
434
-
435
- # Product variations, such as different colors or sizes, with their attributes and
436
- # images. Empty if none are found. May not include every variation offered by the
437
- # store.
438
- sig do
439
- returns(
440
- T.nilable(
441
- T::Array[
442
- ContextDev::Models::AIExtractProductResponse::Product::Variant
443
- ]
444
- )
445
- )
446
- end
447
- attr_reader :variants
448
-
449
- sig do
450
- params(
451
- variants:
452
- T::Array[
453
- ContextDev::Models::AIExtractProductResponse::Product::Variant::OrHash
454
- ]
455
- ).void
456
- end
457
- attr_writer :variants
458
-
459
- # The extracted product data, or null if not a product page
460
- sig do
461
- params(
462
- description: String,
463
- features: T::Array[String],
464
- images: T::Array[String],
465
- name: String,
466
- sku: T.nilable(String),
467
- tags: T::Array[String],
468
- target_audience: T::Array[String],
469
- availability:
470
- T.nilable(
471
- ContextDev::Models::AIExtractProductResponse::Product::Availability::OrSymbol
472
- ),
473
- billing_frequency:
474
- T.nilable(
475
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::OrSymbol
476
- ),
477
- category: T.nilable(String),
478
- currency: T.nilable(String),
479
- dimensions: T::Array[String],
480
- image_url: T.nilable(String),
481
- price: T.nilable(Float),
482
- pricing_model:
483
- T.nilable(
484
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::OrSymbol
485
- ),
486
- regular_price: T.nilable(Float),
487
- url: T.nilable(String),
488
- variants:
489
- T::Array[
490
- ContextDev::Models::AIExtractProductResponse::Product::Variant::OrHash
491
- ]
492
- ).returns(T.attached_class)
493
- end
494
- def self.new(
495
- # Description of the product
496
- description:,
497
- # List of product features
498
- features:,
499
- # URLs to product images on the page (up to 7)
500
- images:,
501
- # Name of the product
502
- name:,
503
- # Stock Keeping Unit (product identifier). Null if no identifier is found.
504
- sku:,
505
- # Tags associated with the product
506
- tags:,
507
- # Target audience for the product (array of strings)
508
- target_audience:,
509
- # Normalized stock or ordering availability
510
- availability: nil,
511
- # Billing frequency for the product
512
- billing_frequency: nil,
513
- # Category of the product
514
- category: nil,
515
- # Currency code for the price (e.g., USD, EUR)
516
- currency: nil,
517
- # Dimension statements shown for the product, preserving labels, values, and units
518
- dimensions: nil,
519
- # URL to the product image
520
- image_url: nil,
521
- # Price of the product
522
- price: nil,
523
- # Pricing model for the product
524
- pricing_model: nil,
525
- # Original or regular price before a displayed discount
526
- regular_price: nil,
527
- # URL to the product page
528
- url: nil,
529
- # Product variations, such as different colors or sizes, with their attributes and
530
- # images. Empty if none are found. May not include every variation offered by the
531
- # store.
532
- variants: nil
533
- )
534
- end
535
-
536
- sig do
537
- override.returns(
538
- {
539
- description: String,
540
- features: T::Array[String],
541
- images: T::Array[String],
542
- name: String,
543
- sku: T.nilable(String),
544
- tags: T::Array[String],
545
- target_audience: T::Array[String],
546
- availability:
547
- T.nilable(
548
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
549
- ),
550
- billing_frequency:
551
- T.nilable(
552
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
553
- ),
554
- category: T.nilable(String),
555
- currency: T.nilable(String),
556
- dimensions: T::Array[String],
557
- image_url: T.nilable(String),
558
- price: T.nilable(Float),
559
- pricing_model:
560
- T.nilable(
561
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
562
- ),
563
- regular_price: T.nilable(Float),
564
- url: T.nilable(String),
565
- variants:
566
- T::Array[
567
- ContextDev::Models::AIExtractProductResponse::Product::Variant
568
- ]
569
- }
570
- )
571
- end
572
- def to_hash
573
- end
574
-
575
- # Normalized stock or ordering availability
576
- module Availability
577
- extend ContextDev::Internal::Type::Enum
578
-
579
- TaggedSymbol =
580
- T.type_alias do
581
- T.all(
582
- Symbol,
583
- ContextDev::Models::AIExtractProductResponse::Product::Availability
584
- )
585
- end
586
- OrSymbol = T.type_alias { T.any(Symbol, String) }
587
-
588
- IN_STOCK =
589
- T.let(
590
- :in_stock,
591
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
592
- )
593
- OUT_OF_STOCK =
594
- T.let(
595
- :out_of_stock,
596
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
597
- )
598
- LIMITED_AVAILABILITY =
599
- T.let(
600
- :limited_availability,
601
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
602
- )
603
- PREORDER =
604
- T.let(
605
- :preorder,
606
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
607
- )
608
- BACKORDER =
609
- T.let(
610
- :backorder,
611
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
612
- )
613
- MADE_TO_ORDER =
614
- T.let(
615
- :made_to_order,
616
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
617
- )
618
- DISCONTINUED =
619
- T.let(
620
- :discontinued,
621
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
622
- )
623
-
624
- sig do
625
- override.returns(
626
- T::Array[
627
- ContextDev::Models::AIExtractProductResponse::Product::Availability::TaggedSymbol
628
- ]
629
- )
630
- end
631
- def self.values
632
- end
633
- end
634
-
635
- # Billing frequency for the product
636
- module BillingFrequency
637
- extend ContextDev::Internal::Type::Enum
638
-
639
- TaggedSymbol =
640
- T.type_alias do
641
- T.all(
642
- Symbol,
643
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency
644
- )
645
- end
646
- OrSymbol = T.type_alias { T.any(Symbol, String) }
647
-
648
- MONTHLY =
649
- T.let(
650
- :monthly,
651
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
652
- )
653
- YEARLY =
654
- T.let(
655
- :yearly,
656
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
657
- )
658
- ONE_TIME =
659
- T.let(
660
- :one_time,
661
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
662
- )
663
- USAGE_BASED =
664
- T.let(
665
- :usage_based,
666
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
667
- )
668
-
669
- sig do
670
- override.returns(
671
- T::Array[
672
- ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency::TaggedSymbol
673
- ]
674
- )
675
- end
676
- def self.values
677
- end
678
- end
679
-
680
- # Pricing model for the product
681
- module PricingModel
682
- extend ContextDev::Internal::Type::Enum
683
-
684
- TaggedSymbol =
685
- T.type_alias do
686
- T.all(
687
- Symbol,
688
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel
689
- )
690
- end
691
- OrSymbol = T.type_alias { T.any(Symbol, String) }
692
-
693
- PER_SEAT =
694
- T.let(
695
- :per_seat,
696
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
697
- )
698
- FLAT =
699
- T.let(
700
- :flat,
701
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
702
- )
703
- TIERED =
704
- T.let(
705
- :tiered,
706
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
707
- )
708
- FREEMIUM =
709
- T.let(
710
- :freemium,
711
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
712
- )
713
- CUSTOM =
714
- T.let(
715
- :custom,
716
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
717
- )
718
-
719
- sig do
720
- override.returns(
721
- T::Array[
722
- ContextDev::Models::AIExtractProductResponse::Product::PricingModel::TaggedSymbol
723
- ]
724
- )
725
- end
726
- def self.values
727
- end
728
- end
729
-
730
- class Variant < ContextDev::Internal::Type::BaseModel
731
- OrHash =
732
- T.type_alias do
733
- T.any(
734
- ContextDev::Models::AIExtractProductResponse::Product::Variant,
735
- ContextDev::Internal::AnyHash
736
- )
737
- end
738
-
739
- # Explicit variant attributes such as color, size, material, pattern and
740
- # properties declared by page.
741
- sig { returns(T::Hash[Symbol, String]) }
742
- attr_accessor :attributes
743
-
744
- # Original source image URLs explicitly attached to this variant.
745
- sig { returns(T::Array[String]) }
746
- attr_accessor :images
747
-
748
- sig { returns(T.nilable(String)) }
749
- attr_accessor :sku
750
-
751
- # Variant or offer URL when provided by the source. May be shared by variants.
752
- sig { returns(T.nilable(String)) }
753
- attr_accessor :url
754
-
755
- sig do
756
- params(
757
- attributes: T::Hash[Symbol, String],
758
- images: T::Array[String],
759
- sku: T.nilable(String),
760
- url: T.nilable(String)
761
- ).returns(T.attached_class)
762
- end
763
- def self.new(
764
- # Explicit variant attributes such as color, size, material, pattern and
765
- # properties declared by page.
766
- attributes:,
767
- # Original source image URLs explicitly attached to this variant.
768
- images:,
769
- sku:,
770
- # Variant or offer URL when provided by the source. May be shared by variants.
771
- url:
772
- )
773
- end
774
-
775
- sig do
776
- override.returns(
777
- {
778
- attributes: T::Hash[Symbol, String],
779
- images: T::Array[String],
780
- sku: T.nilable(String),
781
- url: T.nilable(String)
782
- }
783
- )
784
- end
785
- def to_hash
786
- end
787
- end
788
- end
789
- end
790
- end
791
- end