context.dev 2.18.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +220 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
  6. data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
  7. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
  8. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
  9. data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +14 -14
  10. data/lib/context_dev/models/web_map_urls_response.rb +123 -0
  11. data/lib/context_dev/models/web_scrape_params.rb +1035 -0
  12. data/lib/context_dev/models/web_scrape_response.rb +974 -0
  13. data/lib/context_dev/models/web_screenshot_params.rb +15 -1
  14. data/lib/context_dev/models/web_screenshot_response.rb +3 -3
  15. data/lib/context_dev/models.rb +8 -22
  16. data/lib/context_dev/resources/brand.rb +0 -36
  17. data/lib/context_dev/resources/monitors.rb +47 -0
  18. data/lib/context_dev/resources/web.rb +118 -486
  19. data/lib/context_dev/version.rb +1 -1
  20. data/lib/context_dev.rb +8 -23
  21. data/rbi/context_dev/client.rbi +0 -3
  22. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
  23. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
  24. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
  25. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
  26. data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +23 -45
  27. data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
  28. data/rbi/context_dev/models/web_scrape_params.rbi +2221 -0
  29. data/rbi/context_dev/models/web_scrape_response.rbi +1874 -0
  30. data/rbi/context_dev/models/web_screenshot_params.rbi +23 -0
  31. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
  32. data/rbi/context_dev/models.rbi +9 -24
  33. data/rbi/context_dev/resources/brand.rbi +0 -35
  34. data/rbi/context_dev/resources/monitors.rbi +24 -0
  35. data/rbi/context_dev/resources/web.rbi +152 -654
  36. data/sig/context_dev/client.rbs +0 -2
  37. data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
  38. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
  39. data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
  40. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
  41. data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
  42. data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
  43. data/sig/context_dev/models/web_scrape_params.rbs +925 -0
  44. data/sig/context_dev/models/web_scrape_response.rbs +782 -0
  45. data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
  46. data/sig/context_dev/models.rbs +8 -22
  47. data/sig/context_dev/resources/brand.rbs +0 -9
  48. data/sig/context_dev/resources/monitors.rbs +11 -0
  49. data/sig/context_dev/resources/web.rbs +33 -128
  50. metadata +26 -71
  51. data/lib/context_dev/models/ai_extract_product_params.rb +0 -125
  52. data/lib/context_dev/models/ai_extract_product_response.rb +0 -402
  53. data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
  54. data/lib/context_dev/models/ai_extract_products_response.rb +0 -370
  55. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
  56. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
  57. data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
  58. data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
  59. data/lib/context_dev/models/web_extract_params.rb +0 -419
  60. data/lib/context_dev/models/web_extract_response.rb +0 -287
  61. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -346
  62. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
  63. data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -812
  64. data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -628
  65. data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -373
  66. data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
  67. data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -670
  68. data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
  69. data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +0 -471
  70. data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +0 -169
  71. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
  72. data/lib/context_dev/resources/ai.rb +0 -71
  73. data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -253
  74. data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -791
  75. data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
  76. data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -718
  77. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
  78. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
  79. data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
  80. data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
  81. data/rbi/context_dev/models/web_extract_params.rbi +0 -781
  82. data/rbi/context_dev/models/web_extract_response.rbi +0 -512
  83. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -702
  84. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
  85. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1690
  86. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +0 -1287
  87. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -728
  88. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  89. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1052
  90. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  91. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +0 -1580
  92. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +0 -332
  93. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  94. data/rbi/context_dev/resources/ai.rbi +0 -63
  95. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -106
  96. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -314
  97. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  98. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -293
  99. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  100. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  101. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  102. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  103. data/sig/context_dev/models/web_extract_params.rbs +0 -324
  104. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  105. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  106. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  107. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -878
  108. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -525
  109. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -281
  110. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  111. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  112. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  113. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +0 -619
  114. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +0 -127
  115. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  116. data/sig/context_dev/resources/ai.rbs +0 -21
@@ -0,0 +1,1035 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Web#scrape
6
+ class WebScrapeParams < ContextDev::Internal::Type::BaseModel
7
+ extend ContextDev::Internal::Type::RequestParameters::Converter
8
+ include ContextDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute formats
11
+ # Outputs to return. Enable at least one; omitted formats are false.
12
+ #
13
+ # @return [ContextDev::Models::WebScrapeParams::Formats]
14
+ required :formats, -> { ContextDev::WebScrapeParams::Formats }
15
+
16
+ # @!attribute url
17
+ # The URL to scrape.
18
+ #
19
+ # @return [String]
20
+ required :url, String
21
+
22
+ # @!attribute highlights_params
23
+ # Highlight options. Requires formats.highlights: true.
24
+ #
25
+ # @return [ContextDev::Models::WebScrapeParams::HighlightsParams, nil]
26
+ optional :highlights_params,
27
+ -> { ContextDev::WebScrapeParams::HighlightsParams },
28
+ api_name: :highlightsParams
29
+
30
+ # @!attribute image_params
31
+ # Image options. Requires formats.images: true.
32
+ #
33
+ # @return [ContextDev::Models::WebScrapeParams::ImageParams, nil]
34
+ optional :image_params, -> { ContextDev::WebScrapeParams::ImageParams }, api_name: :imageParams
35
+
36
+ # @!attribute json_params
37
+ # Required when formats.json is true.
38
+ #
39
+ # @return [ContextDev::Models::WebScrapeParams::JsonParams, nil]
40
+ optional :json_params, -> { ContextDev::WebScrapeParams::JsonParams }, api_name: :jsonParams
41
+
42
+ # @!attribute markdown_params
43
+ # Markdown options. Requires formats.markdown: true.
44
+ #
45
+ # @return [ContextDev::Models::WebScrapeParams::MarkdownParams, nil]
46
+ optional :markdown_params, -> { ContextDev::WebScrapeParams::MarkdownParams }, api_name: :markdownParams
47
+
48
+ # @!attribute max_age_ms
49
+ # Maximum age of each cached output. Defaults to 1 day; 0 fetches fresh and
50
+ # updates the requested outputs. Compatible outputs are shared with the individual
51
+ # scrape endpoints. Image results with hosted files refresh after 23 hours; other
52
+ # outputs retain their own freshness.
53
+ #
54
+ # @return [Integer, nil]
55
+ optional :max_age_ms, Integer, api_name: :maxAgeMs
56
+
57
+ # @!attribute parse_params
58
+ # Required when formats.parse is true.
59
+ #
60
+ # @return [ContextDev::Models::WebScrapeParams::ParseParams, nil]
61
+ optional :parse_params, -> { ContextDev::WebScrapeParams::ParseParams }, api_name: :parseParams
62
+
63
+ # @!attribute product_params
64
+ # Product options. Requires formats.product: true.
65
+ #
66
+ # @return [ContextDev::Models::WebScrapeParams::ProductParams, nil]
67
+ optional :product_params, -> { ContextDev::WebScrapeParams::ProductParams }, api_name: :productParams
68
+
69
+ # @!attribute screenshot_params
70
+ # Screenshot options. Requires formats.screenshot: true.
71
+ #
72
+ # @return [ContextDev::Models::WebScrapeParams::ScreenshotParams, nil]
73
+ optional :screenshot_params,
74
+ -> { ContextDev::WebScrapeParams::ScreenshotParams },
75
+ api_name: :screenshotParams
76
+
77
+ # @!attribute shared_params
78
+ # Shared browser and content settings. Content filters leave screenshots and
79
+ # original bytes unchanged.
80
+ #
81
+ # @return [ContextDev::Models::WebScrapeParams::SharedParams, nil]
82
+ optional :shared_params, -> { ContextDev::WebScrapeParams::SharedParams }, api_name: :sharedParams
83
+
84
+ # @!attribute tags
85
+ # Labels for tracking request usage. Not retained when zdr is enabled.
86
+ #
87
+ # @return [Array<String>, nil]
88
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
89
+
90
+ # @!attribute timeout_opts
91
+ # Total deadline, including navigation, actions, waiting, and all outputs.
92
+ # Defaults to 60000 milliseconds with behavior fail. Use return-partial to capture
93
+ # the current page state and return captured images if image processing cannot
94
+ # finish before the deadline; these responses set isPartial and are not cached.
95
+ # Every requested format must still be available. Fixed waits must fit before a
96
+ # response reserve of up to 5000 milliseconds (at most one quarter of the timeout)
97
+ # when using return-partial.
98
+ #
99
+ # @return [ContextDev::Models::WebScrapeParams::TimeoutOpts, nil]
100
+ optional :timeout_opts, -> { ContextDev::WebScrapeParams::TimeoutOpts }, api_name: :timeoutOpts
101
+
102
+ # @!attribute zdr
103
+ # Zero data retention. Bypasses caches and uploads; excludes request/response
104
+ # content and tags from logs. Must be enabled for your organization. Not available
105
+ # with the highlights output.
106
+ #
107
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::Zdr, nil]
108
+ optional :zdr, enum: -> { ContextDev::WebScrapeParams::Zdr }
109
+
110
+ # @!method initialize(formats:, url:, highlights_params: nil, image_params: nil, json_params: nil, markdown_params: nil, max_age_ms: nil, parse_params: nil, product_params: nil, screenshot_params: nil, shared_params: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
111
+ # Some parameter documentations has been truncated, see
112
+ # {ContextDev::Models::WebScrapeParams} for more details.
113
+ #
114
+ # @param formats [ContextDev::Models::WebScrapeParams::Formats] Outputs to return. Enable at least one; omitted formats are false.
115
+ #
116
+ # @param url [String] The URL to scrape.
117
+ #
118
+ # @param highlights_params [ContextDev::Models::WebScrapeParams::HighlightsParams] Highlight options. Requires formats.highlights: true.
119
+ #
120
+ # @param image_params [ContextDev::Models::WebScrapeParams::ImageParams] Image options. Requires formats.images: true.
121
+ #
122
+ # @param json_params [ContextDev::Models::WebScrapeParams::JsonParams] Required when formats.json is true.
123
+ #
124
+ # @param markdown_params [ContextDev::Models::WebScrapeParams::MarkdownParams] Markdown options. Requires formats.markdown: true.
125
+ #
126
+ # @param max_age_ms [Integer] Maximum age of each cached output. Defaults to 1 day; 0 fetches fresh and update
127
+ #
128
+ # @param parse_params [ContextDev::Models::WebScrapeParams::ParseParams] Required when formats.parse is true.
129
+ #
130
+ # @param product_params [ContextDev::Models::WebScrapeParams::ProductParams] Product options. Requires formats.product: true.
131
+ #
132
+ # @param screenshot_params [ContextDev::Models::WebScrapeParams::ScreenshotParams] Screenshot options. Requires formats.screenshot: true.
133
+ #
134
+ # @param shared_params [ContextDev::Models::WebScrapeParams::SharedParams] Shared browser and content settings. Content filters leave screenshots and origi
135
+ #
136
+ # @param tags [Array<String>] Labels for tracking request usage. Not retained when zdr is enabled.
137
+ #
138
+ # @param timeout_opts [ContextDev::Models::WebScrapeParams::TimeoutOpts] Total deadline, including navigation, actions, waiting, and all outputs. Default
139
+ #
140
+ # @param zdr [Symbol, ContextDev::Models::WebScrapeParams::Zdr] Zero data retention. Bypasses caches and uploads; excludes request/response cont
141
+ #
142
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
143
+
144
+ class Formats < ContextDev::Internal::Type::BaseModel
145
+ # @!attribute bytes
146
+ # The original HTTP response body.
147
+ #
148
+ # @return [Boolean, nil]
149
+ optional :bytes, ContextDev::Internal::Type::Boolean
150
+
151
+ # @!attribute highlights
152
+ # Plain-text passages from the page that are most relevant to
153
+ # highlightsParams.query, each prefixed with its section heading. Adds 3 credits.
154
+ # Not available with zdr enabled.
155
+ #
156
+ # @return [Boolean, nil]
157
+ optional :highlights, ContextDev::Internal::Type::Boolean
158
+
159
+ # @!attribute html
160
+ # Rendered HTML.
161
+ #
162
+ # @return [Boolean, nil]
163
+ optional :html, ContextDev::Internal::Type::Boolean
164
+
165
+ # @!attribute images
166
+ # Images found on the page.
167
+ #
168
+ # @return [Boolean, nil]
169
+ optional :images, ContextDev::Internal::Type::Boolean
170
+
171
+ # @!attribute json
172
+ # Page data extracted by an LLM from the page Markdown into jsonParams.schema;
173
+ # values carried only in attributes or CSS classes need formats.parse instead.
174
+ # Adds four credits when the page has text to extract; when shared content filters
175
+ # leave no text the result is an empty object and only the base price applies.
176
+ #
177
+ # @return [Boolean, nil]
178
+ optional :json, ContextDev::Internal::Type::Boolean
179
+
180
+ # @!attribute markdown
181
+ # Page content as Markdown.
182
+ #
183
+ # @return [Boolean, nil]
184
+ optional :markdown, ContextDev::Internal::Type::Boolean
185
+
186
+ # @!attribute parse
187
+ # Fields selected by parseParams.rules.
188
+ #
189
+ # @return [Boolean, nil]
190
+ optional :parse, ContextDev::Internal::Type::Boolean
191
+
192
+ # @!attribute product
193
+ # Structured product data for product detail pages. Adds one credit.
194
+ #
195
+ # @return [Boolean, nil]
196
+ optional :product, ContextDev::Internal::Type::Boolean
197
+
198
+ # @!attribute screenshot
199
+ # An inline image of the page.
200
+ #
201
+ # @return [Boolean, nil]
202
+ optional :screenshot, ContextDev::Internal::Type::Boolean
203
+
204
+ # @!method initialize(bytes: nil, highlights: nil, html: nil, images: nil, json: nil, markdown: nil, parse: nil, product: nil, screenshot: nil)
205
+ # Some parameter documentations has been truncated, see
206
+ # {ContextDev::Models::WebScrapeParams::Formats} for more details.
207
+ #
208
+ # Outputs to return. Enable at least one; omitted formats are false.
209
+ #
210
+ # @param bytes [Boolean] The original HTTP response body.
211
+ #
212
+ # @param highlights [Boolean] Plain-text passages from the page that are most relevant to highlightsParams.que
213
+ #
214
+ # @param html [Boolean] Rendered HTML.
215
+ #
216
+ # @param images [Boolean] Images found on the page.
217
+ #
218
+ # @param json [Boolean] Page data extracted by an LLM from the page Markdown into jsonParams.schema; val
219
+ #
220
+ # @param markdown [Boolean] Page content as Markdown.
221
+ #
222
+ # @param parse [Boolean] Fields selected by parseParams.rules.
223
+ #
224
+ # @param product [Boolean] Structured product data for product detail pages. Adds one credit.
225
+ #
226
+ # @param screenshot [Boolean] An inline image of the page.
227
+ end
228
+
229
+ class HighlightsParams < ContextDev::Internal::Type::BaseModel
230
+ # @!attribute query
231
+ # The question or topic to find passages for.
232
+ #
233
+ # @return [String]
234
+ required :query, String
235
+
236
+ # @!attribute max_characters
237
+ # Maximum combined length of the returned passages, in characters.
238
+ #
239
+ # @return [Integer, nil]
240
+ optional :max_characters, Integer, api_name: :maxCharacters
241
+
242
+ # @!method initialize(query:, max_characters: nil)
243
+ # Highlight options. Requires formats.highlights: true.
244
+ #
245
+ # @param query [String] The question or topic to find passages for.
246
+ #
247
+ # @param max_characters [Integer] Maximum combined length of the returned passages, in characters.
248
+ end
249
+
250
+ class ImageParams < ContextDev::Internal::Type::BaseModel
251
+ # @!attribute dedupe
252
+ # For visual duplicates, keep the largest image.
253
+ #
254
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::ImageParams::Dedupe, nil]
255
+ optional :dedupe, enum: -> { ContextDev::WebScrapeParams::ImageParams::Dedupe }
256
+
257
+ # @!attribute enrich
258
+ # Add dimensions, a visual category, or a hosted file URL. Each image has a
259
+ # maximum processing time of 30000 milliseconds, bounded by the remaining request
260
+ # deadline.
261
+ #
262
+ # @return [Array<Symbol, ContextDev::Models::WebScrapeParams::ImageParams::Enrich>, nil]
263
+ optional :enrich,
264
+ -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::WebScrapeParams::ImageParams::Enrich] }
265
+
266
+ # @!method initialize(dedupe: nil, enrich: nil)
267
+ # Some parameter documentations has been truncated, see
268
+ # {ContextDev::Models::WebScrapeParams::ImageParams} for more details.
269
+ #
270
+ # Image options. Requires formats.images: true.
271
+ #
272
+ # @param dedupe [Symbol, ContextDev::Models::WebScrapeParams::ImageParams::Dedupe] For visual duplicates, keep the largest image.
273
+ #
274
+ # @param enrich [Array<Symbol, ContextDev::Models::WebScrapeParams::ImageParams::Enrich>] Add dimensions, a visual category, or a hosted file URL. Each image has a maximu
275
+
276
+ # For visual duplicates, keep the largest image.
277
+ #
278
+ # @see ContextDev::Models::WebScrapeParams::ImageParams#dedupe
279
+ module Dedupe
280
+ extend ContextDev::Internal::Type::Enum
281
+
282
+ NONE = :none
283
+ VISUAL = :visual
284
+
285
+ # @!method self.values
286
+ # @return [Array<Symbol>]
287
+ end
288
+
289
+ module Enrich
290
+ extend ContextDev::Internal::Type::Enum
291
+
292
+ DIMENSIONS = :dimensions
293
+ CLASSIFICATION = :classification
294
+ FILE = :file
295
+
296
+ # @!method self.values
297
+ # @return [Array<Symbol>]
298
+ end
299
+ end
300
+
301
+ class JsonParams < ContextDev::Internal::Type::BaseModel
302
+ # @!attribute schema
303
+ # JSON Schema for the returned object. Must describe a top-level object; at most
304
+ # 50 KB serialized. Optional fields the page does not state are omitted, or null
305
+ # when their type allows null, while required non-nullable fields always receive a
306
+ # best-effort value, so prefer nullable or optional fields for data a page may
307
+ # omit. Zod users can pass the output of z.toJSONSchema().
308
+ #
309
+ # @return [Hash{Symbol=>Object}]
310
+ required :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
311
+
312
+ # @!attribute instructions
313
+ # Optional guidance on which facts to prioritize or how to interpret schema
314
+ # fields.
315
+ #
316
+ # @return [String, nil]
317
+ optional :instructions, String
318
+
319
+ # @!method initialize(schema:, instructions: nil)
320
+ # Some parameter documentations has been truncated, see
321
+ # {ContextDev::Models::WebScrapeParams::JsonParams} for more details.
322
+ #
323
+ # Required when formats.json is true.
324
+ #
325
+ # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned object. Must describe a top-level object; at most 5
326
+ #
327
+ # @param instructions [String] Optional guidance on which facts to prioritize or how to interpret schema fields
328
+ end
329
+
330
+ class MarkdownParams < ContextDev::Internal::Type::BaseModel
331
+ # @!attribute include_images
332
+ #
333
+ # @return [Boolean, nil]
334
+ optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages
335
+
336
+ # @!attribute include_links
337
+ #
338
+ # @return [Boolean, nil]
339
+ optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks
340
+
341
+ # @!attribute inline_images
342
+ # Base64 images use placeholders by default. Requires includeImages: true.
343
+ #
344
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::InlineImages, nil]
345
+ optional :inline_images,
346
+ enum: -> { ContextDev::WebScrapeParams::MarkdownParams::InlineImages },
347
+ api_name: :inlineImages
348
+
349
+ # @!method initialize(include_images: nil, include_links: nil, inline_images: nil)
350
+ # Markdown options. Requires formats.markdown: true.
351
+ #
352
+ # @param include_images [Boolean]
353
+ #
354
+ # @param include_links [Boolean]
355
+ #
356
+ # @param inline_images [Symbol, ContextDev::Models::WebScrapeParams::MarkdownParams::InlineImages] Base64 images use placeholders by default. Requires includeImages: true.
357
+
358
+ # Base64 images use placeholders by default. Requires includeImages: true.
359
+ #
360
+ # @see ContextDev::Models::WebScrapeParams::MarkdownParams#inline_images
361
+ module InlineImages
362
+ extend ContextDev::Internal::Type::Enum
363
+
364
+ PLACEHOLDER = :placeholder
365
+ PRESERVE = :preserve
366
+
367
+ # @!method self.values
368
+ # @return [Array<Symbol>]
369
+ end
370
+ end
371
+
372
+ class ParseParams < ContextDev::Internal::Type::BaseModel
373
+ # @!attribute rules
374
+ # Map field names to CSS selectors or rules. Missing items return null; missing
375
+ # lists return [].
376
+ #
377
+ # @return [Hash{Symbol=>String, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1}]
378
+ required :rules,
379
+ -> { ContextDev::Internal::Type::HashOf[union: ContextDev::WebScrapeParams::ParseParams::Rule] }
380
+
381
+ # @!method initialize(rules:)
382
+ # Some parameter documentations has been truncated, see
383
+ # {ContextDev::Models::WebScrapeParams::ParseParams} for more details.
384
+ #
385
+ # Required when formats.parse is true.
386
+ #
387
+ # @param rules [Hash{Symbol=>String, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1}] Map field names to CSS selectors or rules. Missing items return null; missing li
388
+
389
+ module Rule
390
+ extend ContextDev::Internal::Type::Union
391
+
392
+ variant String
393
+
394
+ variant -> { ContextDev::WebScrapeParams::ParseParams::Rule::UnionMember1 }
395
+
396
+ class UnionMember1 < ContextDev::Internal::Type::BaseModel
397
+ # @!attribute selector
398
+ #
399
+ # @return [String]
400
+ required :selector, String
401
+
402
+ # @!attribute output
403
+ #
404
+ # @return [Symbol, String, Object, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Output, nil]
405
+ optional :output, union: -> { ContextDev::WebScrapeParams::ParseParams::Rule::UnionMember1::Output }
406
+
407
+ # @!attribute type
408
+ #
409
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Type, nil]
410
+ optional :type, enum: -> { ContextDev::WebScrapeParams::ParseParams::Rule::UnionMember1::Type }
411
+
412
+ # @!method initialize(selector:, output: nil, type: nil)
413
+ # @param selector [String]
414
+ # @param output [Symbol, String, Object, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Output]
415
+ # @param type [Symbol, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Type]
416
+
417
+ # @see ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1#output
418
+ module Output
419
+ extend ContextDev::Internal::Type::Union
420
+
421
+ variant const: -> { ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Output::TEXT }
422
+
423
+ variant const: -> { ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1::Output::HTML }
424
+
425
+ variant String
426
+
427
+ variant ContextDev::Internal::Type::Unknown
428
+
429
+ # @!method self.variants
430
+ # @return [Array(Symbol, String, Object)]
431
+
432
+ define_sorbet_constant!(:Variants) do
433
+ T.type_alias do
434
+ T.any(
435
+ ContextDev::WebScrapeParams::ParseParams::Rule::UnionMember1::Output::TaggedSymbol,
436
+ String,
437
+ T.anything
438
+ )
439
+ end
440
+ end
441
+
442
+ # @!group
443
+
444
+ TEXT = :text
445
+ HTML = :html
446
+
447
+ # @!endgroup
448
+ end
449
+
450
+ # @see ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1#type
451
+ module Type
452
+ extend ContextDev::Internal::Type::Enum
453
+
454
+ ITEM = :item
455
+ LIST = :list
456
+
457
+ # @!method self.values
458
+ # @return [Array<Symbol>]
459
+ end
460
+ end
461
+
462
+ # @!method self.variants
463
+ # @return [Array(String, ContextDev::Models::WebScrapeParams::ParseParams::Rule::UnionMember1)]
464
+ end
465
+ end
466
+
467
+ class ProductParams < ContextDev::Internal::Type::BaseModel
468
+ # @!attribute use_ai_fallback
469
+ # Extract the product with a specialized model when the page has no structured
470
+ # product data. Adds six credits when the model returns a verdict. If the fallback
471
+ # fails, returns a partial response with the deterministic result and no fallback
472
+ # charge. Request deadlines and client disconnects still apply.
473
+ #
474
+ # @return [Boolean, nil]
475
+ optional :use_ai_fallback, ContextDev::Internal::Type::Boolean, api_name: :useAIFallback
476
+
477
+ # @!method initialize(use_ai_fallback: nil)
478
+ # Some parameter documentations has been truncated, see
479
+ # {ContextDev::Models::WebScrapeParams::ProductParams} for more details.
480
+ #
481
+ # Product options. Requires formats.product: true.
482
+ #
483
+ # @param use_ai_fallback [Boolean] Extract the product with a specialized model when the page has no structured pro
484
+ end
485
+
486
+ class ScreenshotParams < ContextDev::Internal::Type::BaseModel
487
+ # @!attribute area
488
+ # Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
489
+ #
490
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Page, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Element, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Rectangle, nil]
491
+ optional :area, union: -> { ContextDev::WebScrapeParams::ScreenshotParams::Area }
492
+
493
+ # @!attribute format_
494
+ #
495
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::ScreenshotParams::Format, nil]
496
+ optional :format_,
497
+ enum: -> {
498
+ ContextDev::WebScrapeParams::ScreenshotParams::Format
499
+ },
500
+ api_name: :format
501
+
502
+ # @!method initialize(area: nil, format_: nil)
503
+ # Some parameter documentations has been truncated, see
504
+ # {ContextDev::Models::WebScrapeParams::ScreenshotParams} for more details.
505
+ #
506
+ # Screenshot options. Requires formats.screenshot: true.
507
+ #
508
+ # @param area [Symbol, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Page, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Element, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Rectangle] Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
509
+ #
510
+ # @param format_ [Symbol, ContextDev::Models::WebScrapeParams::ScreenshotParams::Format]
511
+
512
+ # Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
513
+ #
514
+ # @see ContextDev::Models::WebScrapeParams::ScreenshotParams#area
515
+ module Area
516
+ extend ContextDev::Internal::Type::Union
517
+
518
+ variant enum: -> { ContextDev::WebScrapeParams::ScreenshotParams::Area::Page }
519
+
520
+ variant -> { ContextDev::WebScrapeParams::ScreenshotParams::Area::Element }
521
+
522
+ # Pixels from the document origin.
523
+ variant -> { ContextDev::WebScrapeParams::ScreenshotParams::Area::Rectangle }
524
+
525
+ module Page
526
+ extend ContextDev::Internal::Type::Enum
527
+
528
+ VIEWPORT = :viewport
529
+ FULL_PAGE = :fullPage
530
+
531
+ # @!method self.values
532
+ # @return [Array<Symbol>]
533
+ end
534
+
535
+ class Element < ContextDev::Internal::Type::BaseModel
536
+ # @!attribute selector
537
+ # Must match one visible element.
538
+ #
539
+ # @return [String]
540
+ required :selector, String
541
+
542
+ # @!method initialize(selector:)
543
+ # @param selector [String] Must match one visible element.
544
+ end
545
+
546
+ class Rectangle < ContextDev::Internal::Type::BaseModel
547
+ # @!attribute height
548
+ #
549
+ # @return [Integer]
550
+ required :height, Integer
551
+
552
+ # @!attribute width
553
+ #
554
+ # @return [Integer]
555
+ required :width, Integer
556
+
557
+ # @!attribute x
558
+ #
559
+ # @return [Integer]
560
+ required :x, Integer
561
+
562
+ # @!attribute y_
563
+ #
564
+ # @return [Integer]
565
+ required :y_, Integer, api_name: :y
566
+
567
+ # @!method initialize(height:, width:, x:, y_:)
568
+ # Pixels from the document origin.
569
+ #
570
+ # @param height [Integer]
571
+ # @param width [Integer]
572
+ # @param x [Integer]
573
+ # @param y_ [Integer]
574
+ end
575
+
576
+ # @!method self.variants
577
+ # @return [Array(Symbol, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Page, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Element, ContextDev::Models::WebScrapeParams::ScreenshotParams::Area::Rectangle)]
578
+ end
579
+
580
+ # @see ContextDev::Models::WebScrapeParams::ScreenshotParams#format_
581
+ module Format
582
+ extend ContextDev::Internal::Type::Enum
583
+
584
+ PNG = :png
585
+ JPEG = :jpeg
586
+ WEBP = :webp
587
+
588
+ # @!method self.values
589
+ # @return [Array<Symbol>]
590
+ end
591
+ end
592
+
593
+ class SharedParams < ContextDev::Internal::Type::BaseModel
594
+ # @!attribute actions
595
+ # Run in order before capture. A failed action fails the request. Bypasses
596
+ # caching.
597
+ #
598
+ # @return [Array<ContextDev::Models::WebScrapeParams::SharedParams::Action::Perform, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll, ContextDev::Models::WebScrapeParams::SharedParams::Action::Wait, ContextDev::Models::WebScrapeParams::SharedParams::Action::WaitFor>, nil]
599
+ optional :actions,
600
+ -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebScrapeParams::SharedParams::Action] }
601
+
602
+ # @!attribute country
603
+ # Supported two-letter country code, case-insensitive. Applies to every output,
604
+ # including image downloads.
605
+ #
606
+ # @return [String, nil]
607
+ optional :country, String
608
+
609
+ # @!attribute dismiss_cookies
610
+ # Dismiss cookie banners by accepting cookies before actions.
611
+ #
612
+ # @return [Boolean, nil]
613
+ optional :dismiss_cookies, ContextDev::Internal::Type::Boolean, api_name: :dismissCookies
614
+
615
+ # @!attribute dismiss_popups
616
+ # Dismiss other popups before actions.
617
+ #
618
+ # @return [Boolean, nil]
619
+ optional :dismiss_popups, ContextDev::Internal::Type::Boolean, api_name: :dismissPopups
620
+
621
+ # @!attribute exclude_selectors
622
+ # Remove matching content. Exclusions win.
623
+ #
624
+ # @return [Array<String>, nil]
625
+ optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], api_name: :excludeSelectors
626
+
627
+ # @!attribute headers
628
+ # Headers for the target origin. Requests with custom headers bypass caching.
629
+ #
630
+ # @return [Hash{Symbol=>String}, nil]
631
+ optional :headers, ContextDev::Internal::Type::HashOf[String]
632
+
633
+ # @!attribute include_frames
634
+ # Include iframe content in extraction. Screenshots show visible frames
635
+ # regardless.
636
+ #
637
+ # @return [Boolean, nil]
638
+ optional :include_frames, ContextDev::Internal::Type::Boolean, api_name: :includeFrames
639
+
640
+ # @!attribute include_selectors
641
+ # Keep matching content after mainContentOnly.
642
+ #
643
+ # @return [Array<String>, nil]
644
+ optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], api_name: :includeSelectors
645
+
646
+ # @!attribute main_content_only
647
+ # Keep only main content in HTML, Markdown, images, and parsed fields.
648
+ #
649
+ # @return [Boolean, nil]
650
+ optional :main_content_only, ContextDev::Internal::Type::Boolean, api_name: :mainContentOnly
651
+
652
+ # @!attribute parsers
653
+ # Document parsing options.
654
+ #
655
+ # @return [ContextDev::Models::WebScrapeParams::SharedParams::Parsers, nil]
656
+ optional :parsers, -> { ContextDev::WebScrapeParams::SharedParams::Parsers }
657
+
658
+ # @!attribute settle_animations
659
+ # Settle animations before capture. Defaults to true with screenshots, otherwise
660
+ # false.
661
+ #
662
+ # @return [Boolean, nil]
663
+ optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations
664
+
665
+ # @!attribute theme
666
+ # Override the browser color scheme.
667
+ #
668
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Theme, nil]
669
+ optional :theme, enum: -> { ContextDev::WebScrapeParams::SharedParams::Theme }
670
+
671
+ # @!attribute viewport
672
+ # Browser dimensions in pixels.
673
+ #
674
+ # @return [ContextDev::Models::WebScrapeParams::SharedParams::Viewport, nil]
675
+ optional :viewport, -> { ContextDev::WebScrapeParams::SharedParams::Viewport }
676
+
677
+ # @!attribute wait_for
678
+ # After actions, wait this many milliseconds or until a CSS selector is visible.
679
+ # Defaults to 500 ms, or 2000 ms with frames or an XML URL. Set 0 to skip.
680
+ #
681
+ # @return [Integer, String, nil]
682
+ optional :wait_for,
683
+ union: -> {
684
+ ContextDev::WebScrapeParams::SharedParams::WaitFor
685
+ },
686
+ api_name: :waitFor
687
+
688
+ # @!method initialize(actions: nil, country: nil, dismiss_cookies: nil, dismiss_popups: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, main_content_only: nil, parsers: nil, settle_animations: nil, theme: nil, viewport: nil, wait_for: nil)
689
+ # Some parameter documentations has been truncated, see
690
+ # {ContextDev::Models::WebScrapeParams::SharedParams} for more details.
691
+ #
692
+ # Shared browser and content settings. Content filters leave screenshots and
693
+ # original bytes unchanged.
694
+ #
695
+ # @param actions [Array<ContextDev::Models::WebScrapeParams::SharedParams::Action::Perform, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll, ContextDev::Models::WebScrapeParams::SharedParams::Action::Wait, ContextDev::Models::WebScrapeParams::SharedParams::Action::WaitFor>] Run in order before capture. A failed action fails the request. Bypasses caching
696
+ #
697
+ # @param country [String] Supported two-letter country code, case-insensitive. Applies to every output, in
698
+ #
699
+ # @param dismiss_cookies [Boolean] Dismiss cookie banners by accepting cookies before actions.
700
+ #
701
+ # @param dismiss_popups [Boolean] Dismiss other popups before actions.
702
+ #
703
+ # @param exclude_selectors [Array<String>] Remove matching content. Exclusions win.
704
+ #
705
+ # @param headers [Hash{Symbol=>String}] Headers for the target origin. Requests with custom headers bypass caching.
706
+ #
707
+ # @param include_frames [Boolean] Include iframe content in extraction. Screenshots show visible frames regardless
708
+ #
709
+ # @param include_selectors [Array<String>] Keep matching content after mainContentOnly.
710
+ #
711
+ # @param main_content_only [Boolean] Keep only main content in HTML, Markdown, images, and parsed fields.
712
+ #
713
+ # @param parsers [ContextDev::Models::WebScrapeParams::SharedParams::Parsers] Document parsing options.
714
+ #
715
+ # @param settle_animations [Boolean] Settle animations before capture. Defaults to true with screenshots, otherwise f
716
+ #
717
+ # @param theme [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Theme] Override the browser color scheme.
718
+ #
719
+ # @param viewport [ContextDev::Models::WebScrapeParams::SharedParams::Viewport] Browser dimensions in pixels.
720
+ #
721
+ # @param wait_for [Integer, String] After actions, wait this many milliseconds or until a CSS selector is visible. D
722
+
723
+ module Action
724
+ extend ContextDev::Internal::Type::Union
725
+
726
+ discriminator :type
727
+
728
+ variant :perform, -> { ContextDev::WebScrapeParams::SharedParams::Action::Perform }
729
+
730
+ variant :scroll, -> { ContextDev::WebScrapeParams::SharedParams::Action::Scroll }
731
+
732
+ variant :wait, -> { ContextDev::WebScrapeParams::SharedParams::Action::Wait }
733
+
734
+ variant :waitFor, -> { ContextDev::WebScrapeParams::SharedParams::Action::WaitFor }
735
+
736
+ class Perform < ContextDev::Internal::Type::BaseModel
737
+ # @!attribute action
738
+ #
739
+ # @return [String]
740
+ required :action, String
741
+
742
+ # @!attribute type
743
+ #
744
+ # @return [Symbol, :perform]
745
+ required :type, const: :perform
746
+
747
+ # @!method initialize(action:, type: :perform)
748
+ # @param action [String]
749
+ # @param type [Symbol, :perform]
750
+ end
751
+
752
+ class Scroll < ContextDev::Internal::Type::BaseModel
753
+ # @!attribute type
754
+ #
755
+ # @return [Symbol, :scroll]
756
+ required :type, const: :scroll
757
+
758
+ # @!attribute amount
759
+ #
760
+ # @return [Integer, Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Amount, nil]
761
+ optional :amount, union: -> { ContextDev::WebScrapeParams::SharedParams::Action::Scroll::Amount }
762
+
763
+ # @!attribute direction
764
+ #
765
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Direction, nil]
766
+ optional :direction, enum: -> { ContextDev::WebScrapeParams::SharedParams::Action::Scroll::Direction }
767
+
768
+ # @!attribute max_scrolls
769
+ #
770
+ # @return [Integer, nil]
771
+ optional :max_scrolls, Integer, api_name: :maxScrolls
772
+
773
+ # @!attribute selector
774
+ # Scroll this container. Omit to scroll the page.
775
+ #
776
+ # @return [String, nil]
777
+ optional :selector, String
778
+
779
+ # @!method initialize(amount: nil, direction: nil, max_scrolls: nil, selector: nil, type: :scroll)
780
+ # @param amount [Integer, Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Amount]
781
+ #
782
+ # @param direction [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Direction]
783
+ #
784
+ # @param max_scrolls [Integer]
785
+ #
786
+ # @param selector [String] Scroll this container. Omit to scroll the page.
787
+ #
788
+ # @param type [Symbol, :scroll]
789
+
790
+ # @see ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll#amount
791
+ module Amount
792
+ extend ContextDev::Internal::Type::Union
793
+
794
+ variant Integer
795
+
796
+ variant const: -> { ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Amount::VIEWPORT }
797
+
798
+ variant const: -> { ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll::Amount::MAX }
799
+
800
+ # @!method self.variants
801
+ # @return [Array(Integer, Symbol)]
802
+
803
+ define_sorbet_constant!(:Variants) do
804
+ T.type_alias { T.any(Integer, ContextDev::WebScrapeParams::SharedParams::Action::Scroll::Amount::TaggedSymbol) }
805
+ end
806
+
807
+ # @!group
808
+
809
+ VIEWPORT = :viewport
810
+ MAX = :max
811
+
812
+ # @!endgroup
813
+ end
814
+
815
+ # @see ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll#direction
816
+ module Direction
817
+ extend ContextDev::Internal::Type::Enum
818
+
819
+ DOWN = :down
820
+ UP = :up
821
+ LEFT = :left
822
+ RIGHT = :right
823
+
824
+ # @!method self.values
825
+ # @return [Array<Symbol>]
826
+ end
827
+ end
828
+
829
+ class Wait < ContextDev::Internal::Type::BaseModel
830
+ # @!attribute milliseconds
831
+ #
832
+ # @return [Integer]
833
+ required :milliseconds, Integer
834
+
835
+ # @!attribute type
836
+ #
837
+ # @return [Symbol, :wait]
838
+ required :type, const: :wait
839
+
840
+ # @!method initialize(milliseconds:, type: :wait)
841
+ # @param milliseconds [Integer]
842
+ # @param type [Symbol, :wait]
843
+ end
844
+
845
+ class WaitFor < ContextDev::Internal::Type::BaseModel
846
+ # @!attribute selector
847
+ #
848
+ # @return [String]
849
+ required :selector, String
850
+
851
+ # @!attribute type
852
+ #
853
+ # @return [Symbol, :waitFor]
854
+ required :type, const: :waitFor
855
+
856
+ # @!method initialize(selector:, type: :waitFor)
857
+ # @param selector [String]
858
+ # @param type [Symbol, :waitFor]
859
+ end
860
+
861
+ # @!method self.variants
862
+ # @return [Array(ContextDev::Models::WebScrapeParams::SharedParams::Action::Perform, ContextDev::Models::WebScrapeParams::SharedParams::Action::Scroll, ContextDev::Models::WebScrapeParams::SharedParams::Action::Wait, ContextDev::Models::WebScrapeParams::SharedParams::Action::WaitFor)]
863
+ end
864
+
865
+ # @see ContextDev::Models::WebScrapeParams::SharedParams#parsers
866
+ class Parsers < ContextDev::Internal::Type::BaseModel
867
+ # @!attribute pdf
868
+ # PDF text options for HTML, Markdown, and parsed fields.
869
+ #
870
+ # @return [ContextDev::Models::WebScrapeParams::SharedParams::Parsers::Pdf, nil]
871
+ optional :pdf, -> { ContextDev::WebScrapeParams::SharedParams::Parsers::Pdf }
872
+
873
+ # @!method initialize(pdf: nil)
874
+ # Document parsing options.
875
+ #
876
+ # @param pdf [ContextDev::Models::WebScrapeParams::SharedParams::Parsers::Pdf] PDF text options for HTML, Markdown, and parsed fields.
877
+
878
+ # @see ContextDev::Models::WebScrapeParams::SharedParams::Parsers#pdf
879
+ class Pdf < ContextDev::Internal::Type::BaseModel
880
+ # @!attribute end_page
881
+ # Last page to parse. Must be at least startPage.
882
+ #
883
+ # @return [Integer, nil]
884
+ optional :end_page, Integer, api_name: :endPage
885
+
886
+ # @!attribute ocr
887
+ # Read text from scanned pages.
888
+ #
889
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Parsers::Pdf::Ocr, nil]
890
+ optional :ocr, enum: -> { ContextDev::WebScrapeParams::SharedParams::Parsers::Pdf::Ocr }
891
+
892
+ # @!attribute start_page
893
+ # First page to parse, starting at 1.
894
+ #
895
+ # @return [Integer, nil]
896
+ optional :start_page, Integer, api_name: :startPage
897
+
898
+ # @!method initialize(end_page: nil, ocr: nil, start_page: nil)
899
+ # PDF text options for HTML, Markdown, and parsed fields.
900
+ #
901
+ # @param end_page [Integer] Last page to parse. Must be at least startPage.
902
+ #
903
+ # @param ocr [Symbol, ContextDev::Models::WebScrapeParams::SharedParams::Parsers::Pdf::Ocr] Read text from scanned pages.
904
+ #
905
+ # @param start_page [Integer] First page to parse, starting at 1.
906
+
907
+ # Read text from scanned pages.
908
+ #
909
+ # @see ContextDev::Models::WebScrapeParams::SharedParams::Parsers::Pdf#ocr
910
+ module Ocr
911
+ extend ContextDev::Internal::Type::Enum
912
+
913
+ OFF = :off
914
+ AUTO = :auto
915
+
916
+ # @!method self.values
917
+ # @return [Array<Symbol>]
918
+ end
919
+ end
920
+ end
921
+
922
+ # Override the browser color scheme.
923
+ #
924
+ # @see ContextDev::Models::WebScrapeParams::SharedParams#theme
925
+ module Theme
926
+ extend ContextDev::Internal::Type::Enum
927
+
928
+ LIGHT = :light
929
+ DARK = :dark
930
+
931
+ # @!method self.values
932
+ # @return [Array<Symbol>]
933
+ end
934
+
935
+ # @see ContextDev::Models::WebScrapeParams::SharedParams#viewport
936
+ class Viewport < ContextDev::Internal::Type::BaseModel
937
+ # @!attribute height
938
+ #
939
+ # @return [Integer, nil]
940
+ optional :height, Integer
941
+
942
+ # @!attribute width
943
+ #
944
+ # @return [Integer, nil]
945
+ optional :width, Integer
946
+
947
+ # @!method initialize(height: nil, width: nil)
948
+ # Browser dimensions in pixels.
949
+ #
950
+ # @param height [Integer]
951
+ # @param width [Integer]
952
+ end
953
+
954
+ # After actions, wait this many milliseconds or until a CSS selector is visible.
955
+ # Defaults to 500 ms, or 2000 ms with frames or an XML URL. Set 0 to skip.
956
+ #
957
+ # @see ContextDev::Models::WebScrapeParams::SharedParams#wait_for
958
+ module WaitFor
959
+ extend ContextDev::Internal::Type::Union
960
+
961
+ variant Integer
962
+
963
+ variant String
964
+
965
+ # @!method self.variants
966
+ # @return [Array(Integer, String)]
967
+ end
968
+ end
969
+
970
+ class TimeoutOpts < ContextDev::Internal::Type::BaseModel
971
+ # @!attribute milliseconds
972
+ # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
973
+ #
974
+ # @return [Integer]
975
+ required :milliseconds, Integer
976
+
977
+ # @!attribute behavior
978
+ # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
979
+ # credits. "return-partial" returns usable results collected so far; if none are
980
+ # available, the request still fails without charging credits. Partial results are
981
+ # not cached as complete results. "return-partial" requires milliseconds of at
982
+ # least 5000.
983
+ #
984
+ # @return [Symbol, ContextDev::Models::WebScrapeParams::TimeoutOpts::Behavior, nil]
985
+ optional :behavior, enum: -> { ContextDev::WebScrapeParams::TimeoutOpts::Behavior }
986
+
987
+ # @!method initialize(milliseconds:, behavior: nil)
988
+ # Some parameter documentations has been truncated, see
989
+ # {ContextDev::Models::WebScrapeParams::TimeoutOpts} for more details.
990
+ #
991
+ # Total deadline, including navigation, actions, waiting, and all outputs.
992
+ # Defaults to 60000 milliseconds with behavior fail. Use return-partial to capture
993
+ # the current page state and return captured images if image processing cannot
994
+ # finish before the deadline; these responses set isPartial and are not cached.
995
+ # Every requested format must still be available. Fixed waits must fit before a
996
+ # response reserve of up to 5000 milliseconds (at most one quarter of the timeout)
997
+ # when using return-partial.
998
+ #
999
+ # @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
1000
+ #
1001
+ # @param behavior [Symbol, ContextDev::Models::WebScrapeParams::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
1002
+
1003
+ # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
1004
+ # credits. "return-partial" returns usable results collected so far; if none are
1005
+ # available, the request still fails without charging credits. Partial results are
1006
+ # not cached as complete results. "return-partial" requires milliseconds of at
1007
+ # least 5000.
1008
+ #
1009
+ # @see ContextDev::Models::WebScrapeParams::TimeoutOpts#behavior
1010
+ module Behavior
1011
+ extend ContextDev::Internal::Type::Enum
1012
+
1013
+ FAIL = :fail
1014
+ RETURN_PARTIAL = :"return-partial"
1015
+
1016
+ # @!method self.values
1017
+ # @return [Array<Symbol>]
1018
+ end
1019
+ end
1020
+
1021
+ # Zero data retention. Bypasses caches and uploads; excludes request/response
1022
+ # content and tags from logs. Must be enabled for your organization. Not available
1023
+ # with the highlights output.
1024
+ module Zdr
1025
+ extend ContextDev::Internal::Type::Enum
1026
+
1027
+ ENABLED = :enabled
1028
+ DISABLED = :disabled
1029
+
1030
+ # @!method self.values
1031
+ # @return [Array<Symbol>]
1032
+ end
1033
+ end
1034
+ end
1035
+ end