context.dev 2.18.0 → 2.19.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -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 +906 -0
  12. data/lib/context_dev/models/web_scrape_response.rb +659 -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 +106 -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 +2000 -0
  29. data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +539 -510
  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 +135 -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 +834 -0
  44. data/sig/context_dev/models/web_scrape_response.rbs +552 -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 +30 -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_images_params.rbi +0 -728
  87. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  88. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1052
  89. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  90. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +0 -1580
  91. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +0 -332
  92. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  93. data/rbi/context_dev/resources/ai.rbi +0 -63
  94. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -106
  95. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -314
  96. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  97. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -293
  98. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  99. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  100. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  101. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  102. data/sig/context_dev/models/web_extract_params.rbs +0 -324
  103. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  104. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  105. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  106. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -878
  107. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -525
  108. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -281
  109. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  110. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  111. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  112. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +0 -619
  113. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +0 -127
  114. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  115. data/sig/context_dev/resources/ai.rbs +0 -21
@@ -1,402 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ContextDev
4
- module Models
5
- # @see ContextDev::Resources::AI#extract_product
6
- class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
7
- # @!attribute cache_metadata
8
- # Cache outcome for this response. Composite responses are hits only when every
9
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
10
- # oldest contributing hit.
11
- #
12
- # @return [ContextDev::Models::AIExtractProductResponse::CacheMetadata]
13
- required :cache_metadata, -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata }
14
-
15
- # @!attribute request_id
16
- # Unique id of this API call, also sent in the X-Request-Id response header. Quote
17
- # it when contacting support about a failed request.
18
- #
19
- # @return [String]
20
- required :request_id, String
21
-
22
- # @!attribute is_product_page
23
- # Whether the given URL is a product detail page
24
- #
25
- # @return [Boolean, nil]
26
- optional :is_product_page, ContextDev::Internal::Type::Boolean
27
-
28
- # @!attribute key_metadata
29
- # Credit usage, included whenever a valid API key is provided.
30
- #
31
- # @return [ContextDev::Models::AIExtractProductResponse::KeyMetadata, nil]
32
- optional :key_metadata, -> { ContextDev::Models::AIExtractProductResponse::KeyMetadata }
33
-
34
- # @!attribute partial
35
- # True when the timeout ended processing and this response contains only usable
36
- # results completed so far. Unfinished results are omitted.
37
- #
38
- # @return [Boolean, nil]
39
- optional :partial, ContextDev::Internal::Type::Boolean
40
-
41
- # @!attribute platform
42
- # The detected ecommerce platform, or null if not a product page
43
- #
44
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Platform, nil]
45
- optional :platform, enum: -> { ContextDev::Models::AIExtractProductResponse::Platform }, nil?: true
46
-
47
- # @!attribute product
48
- # The extracted product data, or null if not a product page
49
- #
50
- # @return [ContextDev::Models::AIExtractProductResponse::Product, nil]
51
- optional :product, -> { ContextDev::Models::AIExtractProductResponse::Product }, nil?: true
52
-
53
- # @!method initialize(cache_metadata:, request_id:, is_product_page: nil, key_metadata: nil, partial: nil, platform: nil, product: nil)
54
- # Some parameter documentations has been truncated, see
55
- # {ContextDev::Models::AIExtractProductResponse} for more details.
56
- #
57
- # @param cache_metadata [ContextDev::Models::AIExtractProductResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
58
- #
59
- # @param request_id [String] Unique id of this API call, also sent in the X-Request-Id response header. Quote
60
- #
61
- # @param is_product_page [Boolean] Whether the given URL is a product detail page
62
- #
63
- # @param key_metadata [ContextDev::Models::AIExtractProductResponse::KeyMetadata] Credit usage, included whenever a valid API key is provided.
64
- #
65
- # @param partial [Boolean] True when the timeout ended processing and this response contains only usable re
66
- #
67
- # @param platform [Symbol, ContextDev::Models::AIExtractProductResponse::Platform, nil] The detected ecommerce platform, or null if not a product page
68
- #
69
- # @param product [ContextDev::Models::AIExtractProductResponse::Product, nil] The extracted product data, or null if not a product page
70
-
71
- # @see ContextDev::Models::AIExtractProductResponse#cache_metadata
72
- class CacheMetadata < ContextDev::Internal::Type::BaseModel
73
- # @!attribute age_ms
74
- # Age of the cached data in milliseconds. Zero for miss and zdr responses.
75
- #
76
- # @return [Integer]
77
- required :age_ms, Integer
78
-
79
- # @!attribute status
80
- # Whether the response was served from cache, required fresh work, or honored
81
- # zero-data-retention cache bypass.
82
- #
83
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status]
84
- required :status, enum: -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status }
85
-
86
- # @!method initialize(age_ms:, status:)
87
- # Some parameter documentations has been truncated, see
88
- # {ContextDev::Models::AIExtractProductResponse::CacheMetadata} for more details.
89
- #
90
- # Cache outcome for this response. Composite responses are hits only when every
91
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
92
- # oldest contributing hit.
93
- #
94
- # @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
95
- #
96
- # @param status [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero
97
-
98
- # Whether the response was served from cache, required fresh work, or honored
99
- # zero-data-retention cache bypass.
100
- #
101
- # @see ContextDev::Models::AIExtractProductResponse::CacheMetadata#status
102
- module Status
103
- extend ContextDev::Internal::Type::Enum
104
-
105
- HIT = :hit
106
- MISS = :miss
107
- ZDR = :zdr
108
-
109
- # @!method self.values
110
- # @return [Array<Symbol>]
111
- end
112
- end
113
-
114
- # @see ContextDev::Models::AIExtractProductResponse#key_metadata
115
- class KeyMetadata < ContextDev::Internal::Type::BaseModel
116
- # @!attribute credits_consumed
117
- # Credits used by this request.
118
- #
119
- # @return [Integer]
120
- required :credits_consumed, Integer
121
-
122
- # @!attribute credits_remaining
123
- # Credits remaining for your organization.
124
- #
125
- # @return [Integer]
126
- required :credits_remaining, Integer
127
-
128
- # @!method initialize(credits_consumed:, credits_remaining:)
129
- # Credit usage, included whenever a valid API key is provided.
130
- #
131
- # @param credits_consumed [Integer] Credits used by this request.
132
- #
133
- # @param credits_remaining [Integer] Credits remaining for your organization.
134
- end
135
-
136
- # The detected ecommerce platform, or null if not a product page
137
- #
138
- # @see ContextDev::Models::AIExtractProductResponse#platform
139
- module Platform
140
- extend ContextDev::Internal::Type::Enum
141
-
142
- AMAZON = :amazon
143
- TIKTOK_SHOP = :tiktok_shop
144
- ETSY = :etsy
145
- GENERIC = :generic
146
-
147
- # @!method self.values
148
- # @return [Array<Symbol>]
149
- end
150
-
151
- # @see ContextDev::Models::AIExtractProductResponse#product
152
- class Product < ContextDev::Internal::Type::BaseModel
153
- # @!attribute description
154
- # Description of the product
155
- #
156
- # @return [String]
157
- required :description, String
158
-
159
- # @!attribute features
160
- # List of product features
161
- #
162
- # @return [Array<String>]
163
- required :features, ContextDev::Internal::Type::ArrayOf[String]
164
-
165
- # @!attribute images
166
- # URLs to product images on the page (up to 7)
167
- #
168
- # @return [Array<String>]
169
- required :images, ContextDev::Internal::Type::ArrayOf[String]
170
-
171
- # @!attribute name
172
- # Name of the product
173
- #
174
- # @return [String]
175
- required :name, String
176
-
177
- # @!attribute sku
178
- # Stock Keeping Unit (product identifier). Null if no identifier is found.
179
- #
180
- # @return [String, nil]
181
- required :sku, String, nil?: true
182
-
183
- # @!attribute tags
184
- # Tags associated with the product
185
- #
186
- # @return [Array<String>]
187
- required :tags, ContextDev::Internal::Type::ArrayOf[String]
188
-
189
- # @!attribute target_audience
190
- # Target audience for the product (array of strings)
191
- #
192
- # @return [Array<String>]
193
- required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
194
-
195
- # @!attribute availability
196
- # Normalized stock or ordering availability
197
- #
198
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil]
199
- optional :availability,
200
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::Availability },
201
- nil?: true
202
-
203
- # @!attribute billing_frequency
204
- # Billing frequency for the product
205
- #
206
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil]
207
- optional :billing_frequency,
208
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency },
209
- nil?: true
210
-
211
- # @!attribute category
212
- # Category of the product
213
- #
214
- # @return [String, nil]
215
- optional :category, String, nil?: true
216
-
217
- # @!attribute currency
218
- # Currency code for the price (e.g., USD, EUR)
219
- #
220
- # @return [String, nil]
221
- optional :currency, String, nil?: true
222
-
223
- # @!attribute dimensions
224
- # Dimension statements shown for the product, preserving labels, values, and units
225
- #
226
- # @return [Array<String>, nil]
227
- optional :dimensions, ContextDev::Internal::Type::ArrayOf[String]
228
-
229
- # @!attribute image_url
230
- # URL to the product image
231
- #
232
- # @return [String, nil]
233
- optional :image_url, String, nil?: true
234
-
235
- # @!attribute price
236
- # Price of the product
237
- #
238
- # @return [Float, nil]
239
- optional :price, Float, nil?: true
240
-
241
- # @!attribute pricing_model
242
- # Pricing model for the product
243
- #
244
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil]
245
- optional :pricing_model,
246
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::PricingModel },
247
- nil?: true
248
-
249
- # @!attribute regular_price
250
- # Original or regular price before a displayed discount
251
- #
252
- # @return [Float, nil]
253
- optional :regular_price, Float, nil?: true
254
-
255
- # @!attribute url
256
- # URL to the product page
257
- #
258
- # @return [String, nil]
259
- optional :url, String, nil?: true
260
-
261
- # @!attribute variants
262
- # Product variations, such as different colors or sizes, with their attributes and
263
- # images. Empty if none are found. May not include every variation offered by the
264
- # store.
265
- #
266
- # @return [Array<ContextDev::Models::AIExtractProductResponse::Product::Variant>, nil]
267
- optional :variants,
268
- -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::AIExtractProductResponse::Product::Variant] }
269
-
270
- # @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, availability: nil, billing_frequency: nil, category: nil, currency: nil, dimensions: nil, image_url: nil, price: nil, pricing_model: nil, regular_price: nil, url: nil, variants: nil)
271
- # Some parameter documentations has been truncated, see
272
- # {ContextDev::Models::AIExtractProductResponse::Product} for more details.
273
- #
274
- # The extracted product data, or null if not a product page
275
- #
276
- # @param description [String] Description of the product
277
- #
278
- # @param features [Array<String>] List of product features
279
- #
280
- # @param images [Array<String>] URLs to product images on the page (up to 7)
281
- #
282
- # @param name [String] Name of the product
283
- #
284
- # @param sku [String, nil] Stock Keeping Unit (product identifier). Null if no identifier is found.
285
- #
286
- # @param tags [Array<String>] Tags associated with the product
287
- #
288
- # @param target_audience [Array<String>] Target audience for the product (array of strings)
289
- #
290
- # @param availability [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil] Normalized stock or ordering availability
291
- #
292
- # @param billing_frequency [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
293
- #
294
- # @param category [String, nil] Category of the product
295
- #
296
- # @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
297
- #
298
- # @param dimensions [Array<String>] Dimension statements shown for the product, preserving labels, values, and units
299
- #
300
- # @param image_url [String, nil] URL to the product image
301
- #
302
- # @param price [Float, nil] Price of the product
303
- #
304
- # @param pricing_model [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil] Pricing model for the product
305
- #
306
- # @param regular_price [Float, nil] Original or regular price before a displayed discount
307
- #
308
- # @param url [String, nil] URL to the product page
309
- #
310
- # @param variants [Array<ContextDev::Models::AIExtractProductResponse::Product::Variant>] Product variations, such as different colors or sizes, with their attributes and
311
-
312
- # Normalized stock or ordering availability
313
- #
314
- # @see ContextDev::Models::AIExtractProductResponse::Product#availability
315
- module Availability
316
- extend ContextDev::Internal::Type::Enum
317
-
318
- IN_STOCK = :in_stock
319
- OUT_OF_STOCK = :out_of_stock
320
- LIMITED_AVAILABILITY = :limited_availability
321
- PREORDER = :preorder
322
- BACKORDER = :backorder
323
- MADE_TO_ORDER = :made_to_order
324
- DISCONTINUED = :discontinued
325
-
326
- # @!method self.values
327
- # @return [Array<Symbol>]
328
- end
329
-
330
- # Billing frequency for the product
331
- #
332
- # @see ContextDev::Models::AIExtractProductResponse::Product#billing_frequency
333
- module BillingFrequency
334
- extend ContextDev::Internal::Type::Enum
335
-
336
- MONTHLY = :monthly
337
- YEARLY = :yearly
338
- ONE_TIME = :one_time
339
- USAGE_BASED = :usage_based
340
-
341
- # @!method self.values
342
- # @return [Array<Symbol>]
343
- end
344
-
345
- # Pricing model for the product
346
- #
347
- # @see ContextDev::Models::AIExtractProductResponse::Product#pricing_model
348
- module PricingModel
349
- extend ContextDev::Internal::Type::Enum
350
-
351
- PER_SEAT = :per_seat
352
- FLAT = :flat
353
- TIERED = :tiered
354
- FREEMIUM = :freemium
355
- CUSTOM = :custom
356
-
357
- # @!method self.values
358
- # @return [Array<Symbol>]
359
- end
360
-
361
- class Variant < ContextDev::Internal::Type::BaseModel
362
- # @!attribute attributes
363
- # Explicit variant attributes such as color, size, material, pattern and
364
- # properties declared by page.
365
- #
366
- # @return [Hash{Symbol=>String}]
367
- required :attributes, ContextDev::Internal::Type::HashOf[String]
368
-
369
- # @!attribute images
370
- # Original source image URLs explicitly attached to this variant.
371
- #
372
- # @return [Array<String>]
373
- required :images, ContextDev::Internal::Type::ArrayOf[String]
374
-
375
- # @!attribute sku
376
- #
377
- # @return [String, nil]
378
- required :sku, String, nil?: true
379
-
380
- # @!attribute url
381
- # Variant or offer URL when provided by the source. May be shared by variants.
382
- #
383
- # @return [String, nil]
384
- required :url, String, nil?: true
385
-
386
- # @!method initialize(attributes:, images:, sku:, url:)
387
- # Some parameter documentations has been truncated, see
388
- # {ContextDev::Models::AIExtractProductResponse::Product::Variant} for more
389
- # details.
390
- #
391
- # @param attributes [Hash{Symbol=>String}] Explicit variant attributes such as color, size, material, pattern and propertie
392
- #
393
- # @param images [Array<String>] Original source image URLs explicitly attached to this variant.
394
- #
395
- # @param sku [String, nil]
396
- #
397
- # @param url [String, nil] Variant or offer URL when provided by the source. May be shared by variants.
398
- end
399
- end
400
- end
401
- end
402
- end
@@ -1,233 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ContextDev
4
- module Models
5
- # @see ContextDev::Resources::AI#extract_products
6
- class AIExtractProductsParams < ContextDev::Internal::Type::BaseModel
7
- extend ContextDev::Internal::Type::RequestParameters::Converter
8
- include ContextDev::Internal::Type::RequestParameters
9
-
10
- # @!attribute body
11
- #
12
- # @return [ContextDev::Models::AIExtractProductsParams::Body::ByDomain, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL]
13
- required :body, union: -> { ContextDev::AIExtractProductsParams::Body }
14
-
15
- # @!method initialize(body:, request_options: {})
16
- # @param body [ContextDev::Models::AIExtractProductsParams::Body::ByDomain, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL]
17
- # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
18
-
19
- module Body
20
- extend ContextDev::Internal::Type::Union
21
-
22
- variant -> { ContextDev::AIExtractProductsParams::Body::ByDomain }
23
-
24
- variant -> { ContextDev::AIExtractProductsParams::Body::ByDirectURL }
25
-
26
- class ByDomain < ContextDev::Internal::Type::BaseModel
27
- # @!attribute domain
28
- # The domain name to analyze.
29
- #
30
- # @return [String]
31
- required :domain, String
32
-
33
- # @!attribute max_age_ms
34
- # Return a cached result if a prior scrape for the same parameters exists and is
35
- # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
36
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
37
- #
38
- # @return [Integer, nil]
39
- optional :max_age_ms, Integer, api_name: :maxAgeMs
40
-
41
- # @!attribute max_products
42
- # Maximum number of products to extract.
43
- #
44
- # @return [Integer, nil]
45
- optional :max_products, Integer, api_name: :maxProducts
46
-
47
- # @!attribute tags
48
- # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
49
- #
50
- # @return [Array<String>, nil]
51
- optional :tags, ContextDev::Internal::Type::ArrayOf[String]
52
-
53
- # @!attribute timeout_opts
54
- # Optional request deadline and behavior on timeout. For GET requests, use
55
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
56
- # timeoutOpts object.
57
- #
58
- # @return [ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts, nil]
59
- optional :timeout_opts,
60
- -> { ContextDev::AIExtractProductsParams::Body::ByDomain::TimeoutOpts },
61
- api_name: :timeoutOpts
62
-
63
- # @!method initialize(domain:, max_age_ms: nil, max_products: nil, tags: nil, timeout_opts: nil)
64
- # Some parameter documentations has been truncated, see
65
- # {ContextDev::Models::AIExtractProductsParams::Body::ByDomain} for more details.
66
- #
67
- # @param domain [String] The domain name to analyze.
68
- #
69
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
70
- #
71
- # @param max_products [Integer] Maximum number of products to extract.
72
- #
73
- # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
74
- #
75
- # @param timeout_opts [ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
76
-
77
- # @see ContextDev::Models::AIExtractProductsParams::Body::ByDomain#timeout_opts
78
- class TimeoutOpts < ContextDev::Internal::Type::BaseModel
79
- # @!attribute milliseconds
80
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
81
- #
82
- # @return [Integer]
83
- required :milliseconds, Integer
84
-
85
- # @!attribute behavior
86
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
87
- # credits. "return-partial" returns usable results collected so far; if none are
88
- # available, the request still fails without charging credits. Partial results are
89
- # not cached as complete results.
90
- #
91
- # @return [Symbol, ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts::Behavior, nil]
92
- optional :behavior,
93
- enum: -> { ContextDev::AIExtractProductsParams::Body::ByDomain::TimeoutOpts::Behavior }
94
-
95
- # @!method initialize(milliseconds:, behavior: nil)
96
- # Some parameter documentations has been truncated, see
97
- # {ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts} for
98
- # more details.
99
- #
100
- # Optional request deadline and behavior on timeout. For GET requests, use
101
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
102
- # timeoutOpts object.
103
- #
104
- # @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
105
- #
106
- # @param behavior [Symbol, ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
107
-
108
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
109
- # credits. "return-partial" returns usable results collected so far; if none are
110
- # available, the request still fails without charging credits. Partial results are
111
- # not cached as complete results.
112
- #
113
- # @see ContextDev::Models::AIExtractProductsParams::Body::ByDomain::TimeoutOpts#behavior
114
- module Behavior
115
- extend ContextDev::Internal::Type::Enum
116
-
117
- FAIL = :fail
118
- RETURN_PARTIAL = :"return-partial"
119
-
120
- # @!method self.values
121
- # @return [Array<Symbol>]
122
- end
123
- end
124
- end
125
-
126
- class ByDirectURL < ContextDev::Internal::Type::BaseModel
127
- # @!attribute direct_url
128
- # A specific URL to use directly as the starting point for extraction without
129
- # domain resolution.
130
- #
131
- # @return [String]
132
- required :direct_url, String, api_name: :directUrl
133
-
134
- # @!attribute max_age_ms
135
- # Return a cached result if a prior scrape for the same parameters exists and is
136
- # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
137
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
138
- #
139
- # @return [Integer, nil]
140
- optional :max_age_ms, Integer, api_name: :maxAgeMs
141
-
142
- # @!attribute max_products
143
- # Maximum number of products to extract.
144
- #
145
- # @return [Integer, nil]
146
- optional :max_products, Integer, api_name: :maxProducts
147
-
148
- # @!attribute tags
149
- # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
150
- #
151
- # @return [Array<String>, nil]
152
- optional :tags, ContextDev::Internal::Type::ArrayOf[String]
153
-
154
- # @!attribute timeout_opts
155
- # Optional request deadline and behavior on timeout. For GET requests, use
156
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
157
- # timeoutOpts object.
158
- #
159
- # @return [ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts, nil]
160
- optional :timeout_opts,
161
- -> { ContextDev::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts },
162
- api_name: :timeoutOpts
163
-
164
- # @!method initialize(direct_url:, max_age_ms: nil, max_products: nil, tags: nil, timeout_opts: nil)
165
- # Some parameter documentations has been truncated, see
166
- # {ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL} for more
167
- # details.
168
- #
169
- # @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
170
- #
171
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
172
- #
173
- # @param max_products [Integer] Maximum number of products to extract.
174
- #
175
- # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
176
- #
177
- # @param timeout_opts [ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
178
-
179
- # @see ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL#timeout_opts
180
- class TimeoutOpts < ContextDev::Internal::Type::BaseModel
181
- # @!attribute milliseconds
182
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
183
- #
184
- # @return [Integer]
185
- required :milliseconds, Integer
186
-
187
- # @!attribute behavior
188
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
189
- # credits. "return-partial" returns usable results collected so far; if none are
190
- # available, the request still fails without charging credits. Partial results are
191
- # not cached as complete results.
192
- #
193
- # @return [Symbol, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts::Behavior, nil]
194
- optional :behavior,
195
- enum: -> { ContextDev::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts::Behavior }
196
-
197
- # @!method initialize(milliseconds:, behavior: nil)
198
- # Some parameter documentations has been truncated, see
199
- # {ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts}
200
- # for more details.
201
- #
202
- # Optional request deadline and behavior on timeout. For GET requests, use
203
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
204
- # timeoutOpts object.
205
- #
206
- # @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
207
- #
208
- # @param behavior [Symbol, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
209
-
210
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
211
- # credits. "return-partial" returns usable results collected so far; if none are
212
- # available, the request still fails without charging credits. Partial results are
213
- # not cached as complete results.
214
- #
215
- # @see ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL::TimeoutOpts#behavior
216
- module Behavior
217
- extend ContextDev::Internal::Type::Enum
218
-
219
- FAIL = :fail
220
- RETURN_PARTIAL = :"return-partial"
221
-
222
- # @!method self.values
223
- # @return [Array<Symbol>]
224
- end
225
- end
226
- end
227
-
228
- # @!method self.variants
229
- # @return [Array(ContextDev::Models::AIExtractProductsParams::Body::ByDomain, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL)]
230
- end
231
- end
232
- end
233
- end