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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +220 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- 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/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +14 -14
- data/lib/context_dev/models/web_map_urls_response.rb +123 -0
- data/lib/context_dev/models/web_scrape_params.rb +1035 -0
- data/lib/context_dev/models/web_scrape_response.rb +974 -0
- data/lib/context_dev/models/web_screenshot_params.rb +15 -1
- data/lib/context_dev/models/web_screenshot_response.rb +3 -3
- data/lib/context_dev/models.rb +8 -22
- data/lib/context_dev/resources/brand.rb +0 -36
- data/lib/context_dev/resources/monitors.rb +47 -0
- data/lib/context_dev/resources/web.rb +118 -486
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -23
- data/rbi/context_dev/client.rbi +0 -3
- 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/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +23 -45
- data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
- data/rbi/context_dev/models/web_scrape_params.rbi +2221 -0
- data/rbi/context_dev/models/web_scrape_response.rbi +1874 -0
- data/rbi/context_dev/models/web_screenshot_params.rbi +23 -0
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
- data/rbi/context_dev/models.rbi +9 -24
- data/rbi/context_dev/resources/brand.rbi +0 -35
- data/rbi/context_dev/resources/monitors.rbi +24 -0
- data/rbi/context_dev/resources/web.rbi +152 -654
- data/sig/context_dev/client.rbs +0 -2
- 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/{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 +925 -0
- data/sig/context_dev/models/web_scrape_response.rbs +782 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
- data/sig/context_dev/models.rbs +8 -22
- data/sig/context_dev/resources/brand.rbs +0 -9
- data/sig/context_dev/resources/monitors.rbs +11 -0
- data/sig/context_dev/resources/web.rbs +33 -128
- metadata +26 -71
- data/lib/context_dev/models/ai_extract_product_params.rb +0 -125
- data/lib/context_dev/models/ai_extract_product_response.rb +0 -402
- data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
- data/lib/context_dev/models/ai_extract_products_response.rb +0 -370
- 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 -419
- data/lib/context_dev/models/web_extract_response.rb +0 -287
- data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -346
- 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 -812
- data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -628
- data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -373
- 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 -670
- data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
- data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +0 -471
- data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +0 -169
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
- data/lib/context_dev/resources/ai.rb +0 -71
- data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -253
- data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -791
- data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
- data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -718
- 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 -781
- data/rbi/context_dev/models/web_extract_response.rbi +0 -512
- data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -702
- 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 -1690
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +0 -1287
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -728
- 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 -1052
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
- data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +0 -1580
- data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +0 -332
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
- data/rbi/context_dev/resources/ai.rbi +0 -63
- data/sig/context_dev/models/ai_extract_product_params.rbs +0 -106
- data/sig/context_dev/models/ai_extract_product_response.rbs +0 -314
- data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
- data/sig/context_dev/models/ai_extract_products_response.rbs +0 -293
- 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 -324
- 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 -878
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -525
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -281
- 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_screenshot_params.rbs +0 -619
- data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +0 -127
- data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
- data/sig/context_dev/resources/ai.rbs +0 -21
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Models
|
|
5
|
-
# @see ContextDev::Resources::Web#web_scrape_images
|
|
6
|
-
class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel
|
|
7
|
-
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
|
-
include ContextDev::Internal::Type::RequestParameters
|
|
9
|
-
|
|
10
|
-
# @!attribute url
|
|
11
|
-
# Page URL to inspect. Must include http:// or https://.
|
|
12
|
-
#
|
|
13
|
-
# @return [String]
|
|
14
|
-
required :url, String
|
|
15
|
-
|
|
16
|
-
# @!attribute actions
|
|
17
|
-
# Optional browser actions executed in array order after the page loads and before
|
|
18
|
-
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
19
|
-
# parameter. Maximum: 5 actions.
|
|
20
|
-
#
|
|
21
|
-
# @return [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll>, nil]
|
|
22
|
-
optional :actions,
|
|
23
|
-
-> {
|
|
24
|
-
ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeImagesParams::Action]
|
|
25
|
-
},
|
|
26
|
-
nil?: true
|
|
27
|
-
|
|
28
|
-
# @!attribute dedupe
|
|
29
|
-
# When true, visually duplicate images are removed: every image is loaded and
|
|
30
|
-
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
31
|
-
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
32
|
-
# false.
|
|
33
|
-
#
|
|
34
|
-
# @return [Boolean, nil]
|
|
35
|
-
optional :dedupe, ContextDev::Internal::Type::Boolean
|
|
36
|
-
|
|
37
|
-
# @!attribute enrichment
|
|
38
|
-
# Optional per-image processing, sent as deep-object query params such as
|
|
39
|
-
# enrichment[resolution]=true.
|
|
40
|
-
#
|
|
41
|
-
# @return [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil]
|
|
42
|
-
optional :enrichment, -> { ContextDev::WebWebScrapeImagesParams::Enrichment }, nil?: true
|
|
43
|
-
|
|
44
|
-
# @!attribute headers
|
|
45
|
-
# Optional outbound HTTP headers forwarded only to the target URL, sent as
|
|
46
|
-
# deep-object query params such as headers[X-Custom]=value. When provided, caching
|
|
47
|
-
# is bypassed: the result is neither read from nor written to cache.
|
|
48
|
-
#
|
|
49
|
-
# @return [Hash{Symbol=>String}, nil]
|
|
50
|
-
optional :headers, ContextDev::Internal::Type::HashOf[String]
|
|
51
|
-
|
|
52
|
-
# @!attribute max_age_ms
|
|
53
|
-
# Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
|
|
54
|
-
# day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
|
|
55
|
-
#
|
|
56
|
-
# @return [Integer, nil]
|
|
57
|
-
optional :max_age_ms, Integer, nil?: true
|
|
58
|
-
|
|
59
|
-
# @!attribute tags
|
|
60
|
-
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
61
|
-
# characters.
|
|
62
|
-
#
|
|
63
|
-
# @return [Array<String>, nil]
|
|
64
|
-
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
65
|
-
|
|
66
|
-
# @!attribute timeout_opts
|
|
67
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
68
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
69
|
-
# timeoutOpts object.
|
|
70
|
-
#
|
|
71
|
-
# @return [ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts, nil]
|
|
72
|
-
optional :timeout_opts, -> { ContextDev::WebWebScrapeImagesParams::TimeoutOpts }
|
|
73
|
-
|
|
74
|
-
# @!attribute wait_for_ms
|
|
75
|
-
# Optional browser wait time in milliseconds after initial page load before
|
|
76
|
-
# collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
|
|
77
|
-
# timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000 ms; a
|
|
78
|
-
# shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
79
|
-
#
|
|
80
|
-
# @return [Integer, nil]
|
|
81
|
-
optional :wait_for_ms, Integer, nil?: true
|
|
82
|
-
|
|
83
|
-
# @!attribute zdr
|
|
84
|
-
# Set to enabled to bypass shared caches and omit request and response content
|
|
85
|
-
# from retained usage logs. Asset uploads are skipped, so hosted image URLs are
|
|
86
|
-
# omitted. Requires zero data retention to be enabled for your organization
|
|
87
|
-
# (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
|
|
88
|
-
# Successful ZDR responses include X-Context-ZDR: true.
|
|
89
|
-
#
|
|
90
|
-
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Zdr, nil]
|
|
91
|
-
optional :zdr, enum: -> { ContextDev::WebWebScrapeImagesParams::Zdr }
|
|
92
|
-
|
|
93
|
-
# @!method initialize(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
94
|
-
# Some parameter documentations has been truncated, see
|
|
95
|
-
# {ContextDev::Models::WebWebScrapeImagesParams} for more details.
|
|
96
|
-
#
|
|
97
|
-
# @param url [String] Page URL to inspect. Must include http:// or https://.
|
|
98
|
-
#
|
|
99
|
-
# @param actions [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
|
|
100
|
-
#
|
|
101
|
-
# @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc
|
|
102
|
-
#
|
|
103
|
-
# @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme
|
|
104
|
-
#
|
|
105
|
-
# @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
|
|
106
|
-
#
|
|
107
|
-
# @param max_age_ms [Integer, nil] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
|
|
108
|
-
#
|
|
109
|
-
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
110
|
-
#
|
|
111
|
-
# @param timeout_opts [ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
112
|
-
#
|
|
113
|
-
# @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec
|
|
114
|
-
#
|
|
115
|
-
# @param zdr [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
|
|
116
|
-
#
|
|
117
|
-
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
118
|
-
|
|
119
|
-
# Browser action discriminated by `do`. Each variant exposes only its applicable
|
|
120
|
-
# fields.
|
|
121
|
-
module Action
|
|
122
|
-
extend ContextDev::Internal::Type::Union
|
|
123
|
-
|
|
124
|
-
discriminator :do
|
|
125
|
-
|
|
126
|
-
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
127
|
-
variant :wait, -> { ContextDev::WebWebScrapeImagesParams::Action::Wait }
|
|
128
|
-
|
|
129
|
-
# Resolve and perform one natural-language browser action.
|
|
130
|
-
variant :perform, -> { ContextDev::WebWebScrapeImagesParams::Action::Perform }
|
|
131
|
-
|
|
132
|
-
# Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
|
|
133
|
-
variant :scroll, -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll }
|
|
134
|
-
|
|
135
|
-
class Wait < ContextDev::Internal::Type::BaseModel
|
|
136
|
-
# @!attribute do_
|
|
137
|
-
#
|
|
138
|
-
# @return [Symbol, :wait]
|
|
139
|
-
required :do_, const: :wait, api_name: :do
|
|
140
|
-
|
|
141
|
-
# @!attribute time_ms
|
|
142
|
-
#
|
|
143
|
-
# @return [Integer]
|
|
144
|
-
required :time_ms, Integer, api_name: :timeMs
|
|
145
|
-
|
|
146
|
-
# @!method initialize(time_ms:, do_: :wait)
|
|
147
|
-
# Pause for a fixed number of milliseconds before continuing to the next action.
|
|
148
|
-
#
|
|
149
|
-
# @param time_ms [Integer]
|
|
150
|
-
# @param do_ [Symbol, :wait]
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
class Perform < ContextDev::Internal::Type::BaseModel
|
|
154
|
-
# @!attribute action
|
|
155
|
-
#
|
|
156
|
-
# @return [String]
|
|
157
|
-
required :action, String
|
|
158
|
-
|
|
159
|
-
# @!attribute do_
|
|
160
|
-
#
|
|
161
|
-
# @return [Symbol, :perform]
|
|
162
|
-
required :do_, const: :perform, api_name: :do
|
|
163
|
-
|
|
164
|
-
# @!method initialize(action:, do_: :perform)
|
|
165
|
-
# Resolve and perform one natural-language browser action.
|
|
166
|
-
#
|
|
167
|
-
# @param action [String]
|
|
168
|
-
# @param do_ [Symbol, :perform]
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
class Scroll < ContextDev::Internal::Type::BaseModel
|
|
172
|
-
# @!attribute do_
|
|
173
|
-
#
|
|
174
|
-
# @return [Symbol, :scroll]
|
|
175
|
-
required :do_, const: :scroll, api_name: :do
|
|
176
|
-
|
|
177
|
-
# @!attribute amount
|
|
178
|
-
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
179
|
-
# Defaults to viewport.
|
|
180
|
-
#
|
|
181
|
-
# @return [Integer, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount, nil]
|
|
182
|
-
optional :amount, union: -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount }
|
|
183
|
-
|
|
184
|
-
# @!attribute container
|
|
185
|
-
# CSS selector for the first matching scroll container. Defaults to the page.
|
|
186
|
-
#
|
|
187
|
-
# @return [String, nil]
|
|
188
|
-
optional :container, String
|
|
189
|
-
|
|
190
|
-
# @!attribute direction
|
|
191
|
-
# Direction to scroll. Defaults to down.
|
|
192
|
-
#
|
|
193
|
-
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Direction, nil]
|
|
194
|
-
optional :direction, enum: -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction }
|
|
195
|
-
|
|
196
|
-
# @!attribute max_scrolls
|
|
197
|
-
# Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
198
|
-
# changing. Defaults to 1.
|
|
199
|
-
#
|
|
200
|
-
# @return [Integer, nil]
|
|
201
|
-
optional :max_scrolls, Integer, api_name: :maxScrolls
|
|
202
|
-
|
|
203
|
-
# @!method initialize(amount: nil, container: nil, direction: nil, max_scrolls: nil, do_: :scroll)
|
|
204
|
-
# Some parameter documentations has been truncated, see
|
|
205
|
-
# {ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll} for more details.
|
|
206
|
-
#
|
|
207
|
-
# Scroll the page or a selected scrollable container, waiting adaptively for
|
|
208
|
-
# content and dimensions to settle after each iteration.
|
|
209
|
-
#
|
|
210
|
-
# @param amount [Integer, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount] Pixels per scroll, one visible viewport, or the current scroll boundary. Default
|
|
211
|
-
#
|
|
212
|
-
# @param container [String] CSS selector for the first matching scroll container. Defaults to the page.
|
|
213
|
-
#
|
|
214
|
-
# @param direction [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Direction] Direction to scroll. Defaults to down.
|
|
215
|
-
#
|
|
216
|
-
# @param max_scrolls [Integer] Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
|
|
217
|
-
#
|
|
218
|
-
# @param do_ [Symbol, :scroll]
|
|
219
|
-
|
|
220
|
-
# Pixels per scroll, one visible viewport, or the current scroll boundary.
|
|
221
|
-
# Defaults to viewport.
|
|
222
|
-
#
|
|
223
|
-
# @see ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll#amount
|
|
224
|
-
module Amount
|
|
225
|
-
extend ContextDev::Internal::Type::Union
|
|
226
|
-
|
|
227
|
-
variant Integer
|
|
228
|
-
|
|
229
|
-
variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount::VIEWPORT }
|
|
230
|
-
|
|
231
|
-
variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount::MAX }
|
|
232
|
-
|
|
233
|
-
# @!method self.variants
|
|
234
|
-
# @return [Array(Integer, Symbol)]
|
|
235
|
-
|
|
236
|
-
define_sorbet_constant!(:Variants) do
|
|
237
|
-
T.type_alias { T.any(Integer, ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::TaggedSymbol) }
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
# @!group
|
|
241
|
-
|
|
242
|
-
VIEWPORT = :viewport
|
|
243
|
-
MAX = :max
|
|
244
|
-
|
|
245
|
-
# @!endgroup
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
# Direction to scroll. Defaults to down.
|
|
249
|
-
#
|
|
250
|
-
# @see ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll#direction
|
|
251
|
-
module Direction
|
|
252
|
-
extend ContextDev::Internal::Type::Enum
|
|
253
|
-
|
|
254
|
-
UP = :up
|
|
255
|
-
DOWN = :down
|
|
256
|
-
LEFT = :left
|
|
257
|
-
RIGHT = :right
|
|
258
|
-
|
|
259
|
-
# @!method self.values
|
|
260
|
-
# @return [Array<Symbol>]
|
|
261
|
-
end
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
# @!method self.variants
|
|
265
|
-
# @return [Array(ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll)]
|
|
266
|
-
end
|
|
267
|
-
|
|
268
|
-
class Enrichment < ContextDev::Internal::Type::BaseModel
|
|
269
|
-
# @!attribute classification
|
|
270
|
-
# Classify each image by visual asset type.
|
|
271
|
-
#
|
|
272
|
-
# @return [Boolean, nil]
|
|
273
|
-
optional :classification, ContextDev::Internal::Type::Boolean
|
|
274
|
-
|
|
275
|
-
# @!attribute hosted_url
|
|
276
|
-
# Host materializable images on the Brand.dev CDN and return their URL and MIME
|
|
277
|
-
# type. Ignored when zero data retention is enabled.
|
|
278
|
-
#
|
|
279
|
-
# @return [Boolean, nil]
|
|
280
|
-
optional :hosted_url, ContextDev::Internal::Type::Boolean, api_name: :hostedUrl
|
|
281
|
-
|
|
282
|
-
# @!attribute max_time_per_ms
|
|
283
|
-
# Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
|
|
284
|
-
#
|
|
285
|
-
# @return [Integer, nil]
|
|
286
|
-
optional :max_time_per_ms, Integer, api_name: :maxTimePerMs
|
|
287
|
-
|
|
288
|
-
# @!attribute resolution
|
|
289
|
-
# Measure image width and height when possible.
|
|
290
|
-
#
|
|
291
|
-
# @return [Boolean, nil]
|
|
292
|
-
optional :resolution, ContextDev::Internal::Type::Boolean
|
|
293
|
-
|
|
294
|
-
# @!method initialize(classification: nil, hosted_url: nil, max_time_per_ms: nil, resolution: nil)
|
|
295
|
-
# Some parameter documentations has been truncated, see
|
|
296
|
-
# {ContextDev::Models::WebWebScrapeImagesParams::Enrichment} for more details.
|
|
297
|
-
#
|
|
298
|
-
# Optional per-image processing, sent as deep-object query params such as
|
|
299
|
-
# enrichment[resolution]=true.
|
|
300
|
-
#
|
|
301
|
-
# @param classification [Boolean] Classify each image by visual asset type.
|
|
302
|
-
#
|
|
303
|
-
# @param hosted_url [Boolean] Host materializable images on the Brand.dev CDN and return their URL and MIME ty
|
|
304
|
-
#
|
|
305
|
-
# @param max_time_per_ms [Integer] Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
|
|
306
|
-
#
|
|
307
|
-
# @param resolution [Boolean] Measure image width and height when possible.
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
class TimeoutOpts < ContextDev::Internal::Type::BaseModel
|
|
311
|
-
# @!attribute milliseconds
|
|
312
|
-
# Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
313
|
-
#
|
|
314
|
-
# @return [Integer]
|
|
315
|
-
required :milliseconds, Integer
|
|
316
|
-
|
|
317
|
-
# @!attribute behavior
|
|
318
|
-
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
319
|
-
# credits. "return-partial" returns usable results collected so far; if none are
|
|
320
|
-
# available, the request still fails without charging credits. Partial results are
|
|
321
|
-
# not cached as complete results. "return-partial" requires milliseconds of at
|
|
322
|
-
# least 5000.
|
|
323
|
-
#
|
|
324
|
-
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts::Behavior, nil]
|
|
325
|
-
optional :behavior, enum: -> { ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior }
|
|
326
|
-
|
|
327
|
-
# @!method initialize(milliseconds:, behavior: nil)
|
|
328
|
-
# Some parameter documentations has been truncated, see
|
|
329
|
-
# {ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts} for more details.
|
|
330
|
-
#
|
|
331
|
-
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
332
|
-
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
333
|
-
# timeoutOpts object.
|
|
334
|
-
#
|
|
335
|
-
# @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
336
|
-
#
|
|
337
|
-
# @param behavior [Symbol, ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
338
|
-
|
|
339
|
-
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
340
|
-
# credits. "return-partial" returns usable results collected so far; if none are
|
|
341
|
-
# available, the request still fails without charging credits. Partial results are
|
|
342
|
-
# not cached as complete results. "return-partial" requires milliseconds of at
|
|
343
|
-
# least 5000.
|
|
344
|
-
#
|
|
345
|
-
# @see ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts#behavior
|
|
346
|
-
module Behavior
|
|
347
|
-
extend ContextDev::Internal::Type::Enum
|
|
348
|
-
|
|
349
|
-
FAIL = :fail
|
|
350
|
-
RETURN_PARTIAL = :"return-partial"
|
|
351
|
-
|
|
352
|
-
# @!method self.values
|
|
353
|
-
# @return [Array<Symbol>]
|
|
354
|
-
end
|
|
355
|
-
end
|
|
356
|
-
|
|
357
|
-
# Set to enabled to bypass shared caches and omit request and response content
|
|
358
|
-
# from retained usage logs. Asset uploads are skipped, so hosted image URLs are
|
|
359
|
-
# omitted. Requires zero data retention to be enabled for your organization
|
|
360
|
-
# (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
|
|
361
|
-
# Successful ZDR responses include X-Context-ZDR: true.
|
|
362
|
-
module Zdr
|
|
363
|
-
extend ContextDev::Internal::Type::Enum
|
|
364
|
-
|
|
365
|
-
ENABLED = :enabled
|
|
366
|
-
DISABLED = :disabled
|
|
367
|
-
|
|
368
|
-
# @!method self.values
|
|
369
|
-
# @return [Array<Symbol>]
|
|
370
|
-
end
|
|
371
|
-
end
|
|
372
|
-
end
|
|
373
|
-
end
|