context.dev 2.17.1 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
- data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
- data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
- data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
- data/lib/context_dev/models/parse_handle_params.rb +8 -6
- data/lib/context_dev/models/person_enrich_params.rb +28 -1
- data/lib/context_dev/models/web_answers_params.rb +28 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
- data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +22 -20
- data/lib/context_dev/models/web_map_urls_response.rb +123 -0
- data/lib/context_dev/models/web_scrape_params.rb +906 -0
- data/lib/context_dev/models/web_scrape_response.rb +659 -0
- data/lib/context_dev/models/web_screenshot_params.rb +25 -9
- data/lib/context_dev/models/web_screenshot_response.rb +3 -3
- data/lib/context_dev/models/web_search_params.rb +30 -3
- data/lib/context_dev/models.rb +8 -20
- data/lib/context_dev/resources/brand.rb +0 -36
- data/lib/context_dev/resources/industry.rb +6 -2
- data/lib/context_dev/resources/monitors.rb +47 -0
- data/lib/context_dev/resources/people.rb +3 -1
- data/lib/context_dev/resources/web.rb +116 -413
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -21
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
- data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
- data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
- data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
- data/rbi/context_dev/models/web_answers_params.rbi +45 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
- data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +35 -54
- data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
- data/rbi/context_dev/models/web_scrape_params.rbi +2000 -0
- data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +550 -418
- data/rbi/context_dev/models/web_screenshot_params.rbi +38 -12
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
- data/rbi/context_dev/models/web_search_params.rbi +48 -3
- data/rbi/context_dev/models.rbi +9 -21
- data/rbi/context_dev/resources/brand.rbi +0 -35
- data/rbi/context_dev/resources/industry.rbi +14 -0
- data/rbi/context_dev/resources/monitors.rbi +24 -0
- data/rbi/context_dev/resources/parse.rbi +4 -4
- data/rbi/context_dev/resources/people.rbi +7 -0
- data/rbi/context_dev/resources/web.rbi +166 -533
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
- data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
- data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
- data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
- data/sig/context_dev/models/person_enrich_params.rbs +21 -1
- data/sig/context_dev/models/web_answers_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
- data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
- data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
- data/sig/context_dev/models/web_scrape_params.rbs +834 -0
- data/sig/context_dev/models/web_scrape_response.rbs +552 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
- data/sig/context_dev/models/web_search_params.rbs +21 -1
- data/sig/context_dev/models.rbs +8 -20
- data/sig/context_dev/resources/brand.rbs +0 -9
- data/sig/context_dev/resources/industry.rbs +2 -0
- data/sig/context_dev/resources/monitors.rbs +11 -0
- data/sig/context_dev/resources/people.rbs +1 -0
- data/sig/context_dev/resources/web.rbs +34 -108
- metadata +26 -65
- data/lib/context_dev/models/ai_extract_product_params.rb +0 -98
- data/lib/context_dev/models/ai_extract_product_response.rb +0 -352
- data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
- data/lib/context_dev/models/ai_extract_products_response.rb +0 -320
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
- data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
- data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
- data/lib/context_dev/models/web_extract_params.rb +0 -392
- data/lib/context_dev/models/web_extract_response.rb +0 -287
- data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -344
- data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
- data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -633
- data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -588
- data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -346
- data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
- data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -668
- data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
- data/lib/context_dev/resources/ai.rb +0 -69
- data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -199
- data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -696
- data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
- data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -623
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
- data/rbi/context_dev/models/web_extract_params.rbi +0 -736
- data/rbi/context_dev/models/web_extract_response.rbi +0 -512
- data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -699
- data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1217
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -671
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1049
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
- data/rbi/context_dev/resources/ai.rbi +0 -56
- data/sig/context_dev/models/ai_extract_product_params.rbs +0 -86
- data/sig/context_dev/models/ai_extract_product_response.rbs +0 -273
- data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
- data/sig/context_dev/models/ai_extract_products_response.rbs +0 -252
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
- data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
- data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
- data/sig/context_dev/models/web_extract_params.rbs +0 -304
- data/sig/context_dev/models/web_extract_response.rbs +0 -239
- data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
- data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -730
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -495
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -261
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
- data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
- data/sig/context_dev/resources/ai.rbs +0 -20
|
@@ -1,352 +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
|
-
# @!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)
|
|
262
|
-
# Some parameter documentations has been truncated, see
|
|
263
|
-
# {ContextDev::Models::AIExtractProductResponse::Product} for more details.
|
|
264
|
-
#
|
|
265
|
-
# The extracted product data, or null if not a product page
|
|
266
|
-
#
|
|
267
|
-
# @param description [String] Description of the product
|
|
268
|
-
#
|
|
269
|
-
# @param features [Array<String>] List of product features
|
|
270
|
-
#
|
|
271
|
-
# @param images [Array<String>] URLs to product images on the page (up to 7)
|
|
272
|
-
#
|
|
273
|
-
# @param name [String] Name of the product
|
|
274
|
-
#
|
|
275
|
-
# @param sku [String, nil] Stock Keeping Unit (product identifier). Null if no identifier is found.
|
|
276
|
-
#
|
|
277
|
-
# @param tags [Array<String>] Tags associated with the product
|
|
278
|
-
#
|
|
279
|
-
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
280
|
-
#
|
|
281
|
-
# @param availability [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil] Normalized stock or ordering availability
|
|
282
|
-
#
|
|
283
|
-
# @param billing_frequency [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
284
|
-
#
|
|
285
|
-
# @param category [String, nil] Category of the product
|
|
286
|
-
#
|
|
287
|
-
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
288
|
-
#
|
|
289
|
-
# @param dimensions [Array<String>] Dimension statements shown for the product, preserving labels, values, and units
|
|
290
|
-
#
|
|
291
|
-
# @param image_url [String, nil] URL to the product image
|
|
292
|
-
#
|
|
293
|
-
# @param price [Float, nil] Price of the product
|
|
294
|
-
#
|
|
295
|
-
# @param pricing_model [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil] Pricing model for the product
|
|
296
|
-
#
|
|
297
|
-
# @param regular_price [Float, nil] Original or regular price before a displayed discount
|
|
298
|
-
#
|
|
299
|
-
# @param url [String, nil] URL to the product page
|
|
300
|
-
|
|
301
|
-
# Normalized stock or ordering availability
|
|
302
|
-
#
|
|
303
|
-
# @see ContextDev::Models::AIExtractProductResponse::Product#availability
|
|
304
|
-
module Availability
|
|
305
|
-
extend ContextDev::Internal::Type::Enum
|
|
306
|
-
|
|
307
|
-
IN_STOCK = :in_stock
|
|
308
|
-
OUT_OF_STOCK = :out_of_stock
|
|
309
|
-
LIMITED_AVAILABILITY = :limited_availability
|
|
310
|
-
PREORDER = :preorder
|
|
311
|
-
BACKORDER = :backorder
|
|
312
|
-
MADE_TO_ORDER = :made_to_order
|
|
313
|
-
DISCONTINUED = :discontinued
|
|
314
|
-
|
|
315
|
-
# @!method self.values
|
|
316
|
-
# @return [Array<Symbol>]
|
|
317
|
-
end
|
|
318
|
-
|
|
319
|
-
# Billing frequency for the product
|
|
320
|
-
#
|
|
321
|
-
# @see ContextDev::Models::AIExtractProductResponse::Product#billing_frequency
|
|
322
|
-
module BillingFrequency
|
|
323
|
-
extend ContextDev::Internal::Type::Enum
|
|
324
|
-
|
|
325
|
-
MONTHLY = :monthly
|
|
326
|
-
YEARLY = :yearly
|
|
327
|
-
ONE_TIME = :one_time
|
|
328
|
-
USAGE_BASED = :usage_based
|
|
329
|
-
|
|
330
|
-
# @!method self.values
|
|
331
|
-
# @return [Array<Symbol>]
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
# Pricing model for the product
|
|
335
|
-
#
|
|
336
|
-
# @see ContextDev::Models::AIExtractProductResponse::Product#pricing_model
|
|
337
|
-
module PricingModel
|
|
338
|
-
extend ContextDev::Internal::Type::Enum
|
|
339
|
-
|
|
340
|
-
PER_SEAT = :per_seat
|
|
341
|
-
FLAT = :flat
|
|
342
|
-
TIERED = :tiered
|
|
343
|
-
FREEMIUM = :freemium
|
|
344
|
-
CUSTOM = :custom
|
|
345
|
-
|
|
346
|
-
# @!method self.values
|
|
347
|
-
# @return [Array<Symbol>]
|
|
348
|
-
end
|
|
349
|
-
end
|
|
350
|
-
end
|
|
351
|
-
end
|
|
352
|
-
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
|