bytekit-sdk 0.3.0__py3-none-any.whl
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.
- bytekit/__init__.py +8 -0
- bytekit/api/__init__.py +1 -0
- bytekit/api/account/__init__.py +1 -0
- bytekit/api/account/get_account.py +157 -0
- bytekit/api/bulk/__init__.py +1 -0
- bytekit/api/bulk/create_bulk.py +204 -0
- bytekit/api/bulk/delete_bulk.py +177 -0
- bytekit/api/bulk/get_bulk.py +157 -0
- bytekit/api/bulk/list_bulk_screenshots.py +152 -0
- bytekit/api/fetch/__init__.py +1 -0
- bytekit/api/fetch/get_fetch.py +254 -0
- bytekit/api/fetch/post_fetch.py +178 -0
- bytekit/api/fetch_bulk/__init__.py +1 -0
- bytekit/api/fetch_bulk/create_fetch_bulk.py +180 -0
- bytekit/api/fetch_bulk/get_fetch_bulk.py +157 -0
- bytekit/api/monitors/__init__.py +1 -0
- bytekit/api/monitors/create_monitor.py +180 -0
- bytekit/api/monitors/delete_monitor.py +155 -0
- bytekit/api/monitors/get_monitor.py +157 -0
- bytekit/api/monitors/list_monitor_captures.py +188 -0
- bytekit/api/monitors/list_monitors.py +193 -0
- bytekit/api/monitors/update_monitor.py +191 -0
- bytekit/api/scrape/__init__.py +1 -0
- bytekit/api/scrape/create_scrape.py +197 -0
- bytekit/api/scrape/get_scrape.py +231 -0
- bytekit/api/scrape_bulk/__init__.py +1 -0
- bytekit/api/scrape_bulk/create_scrape_bulk.py +188 -0
- bytekit/api/scrape_bulk/get_scrape_bulk.py +157 -0
- bytekit/api/screenshots/__init__.py +1 -0
- bytekit/api/screenshots/create_screenshot.py +208 -0
- bytekit/api/screenshots/get_screenshot.py +177 -0
- bytekit/api/search/__init__.py +1 -0
- bytekit/api/search/create_search.py +225 -0
- bytekit/api/sitemap/__init__.py +1 -0
- bytekit/api/sitemap/create_sitemap.py +192 -0
- bytekit/api/sitemap/get_sitemap.py +157 -0
- bytekit/api/usage/__init__.py +1 -0
- bytekit/api/usage/get_usage.py +126 -0
- bytekit/api/usage/get_usage_by_endpoint.py +215 -0
- bytekit/api/usage/get_usage_daily.py +203 -0
- bytekit/api/webhooks/__init__.py +1 -0
- bytekit/api/webhooks/list_webhook_deliveries.py +214 -0
- bytekit/api/webhooks/retry_webhook_delivery.py +165 -0
- bytekit/client.py +418 -0
- bytekit/errors.py +18 -0
- bytekit/models/__init__.py +401 -0
- bytekit/models/account_bearer_response.py +207 -0
- bytekit/models/account_bearer_response_api_key.py +134 -0
- bytekit/models/account_bearer_response_api_key_environment.py +8 -0
- bytekit/models/account_bearer_response_auto_topup.py +83 -0
- bytekit/models/account_bearer_response_plan.py +150 -0
- bytekit/models/account_bearer_response_subscription.py +85 -0
- bytekit/models/account_bearer_response_subscription_plan.py +99 -0
- bytekit/models/account_bearer_response_subscription_status.py +10 -0
- bytekit/models/account_session_response.py +164 -0
- bytekit/models/account_session_response_notifications.py +51 -0
- bytekit/models/account_session_response_plan.py +150 -0
- bytekit/models/bandwidth_balance.py +91 -0
- bytekit/models/capture_response.py +216 -0
- bytekit/models/capture_response_outcome.py +10 -0
- bytekit/models/clip.py +83 -0
- bytekit/models/cookie.py +90 -0
- bytekit/models/create_bulk_body.py +155 -0
- bytekit/models/create_bulk_body_defaults.py +423 -0
- bytekit/models/create_bulk_body_defaults_device.py +9 -0
- bytekit/models/create_bulk_body_defaults_device_scale_factor_type_1.py +9 -0
- bytekit/models/create_bulk_body_defaults_device_scale_factor_type_2_type_1.py +9 -0
- bytekit/models/create_bulk_body_defaults_device_scale_factor_type_3_type_1.py +9 -0
- bytekit/models/create_bulk_body_defaults_formats_item.py +12 -0
- bytekit/models/create_bulk_body_defaults_type.py +9 -0
- bytekit/models/create_bulk_body_defaults_viewport_type_0.py +67 -0
- bytekit/models/create_bulk_body_defaults_wait_until.py +10 -0
- bytekit/models/create_bulk_body_items_item.py +380 -0
- bytekit/models/create_bulk_body_items_item_device.py +9 -0
- bytekit/models/create_bulk_body_items_item_formats_item.py +12 -0
- bytekit/models/create_bulk_body_items_item_scenario.py +10 -0
- bytekit/models/create_bulk_body_items_item_type.py +9 -0
- bytekit/models/create_bulk_body_items_item_viewport_type_0.py +67 -0
- bytekit/models/create_bulk_body_items_item_wait_until.py +10 -0
- bytekit/models/create_bulk_response_202.py +164 -0
- bytekit/models/create_bulk_response_202_status.py +10 -0
- bytekit/models/create_fetch_bulk_body.py +161 -0
- bytekit/models/create_fetch_bulk_body_defaults.py +91 -0
- bytekit/models/create_fetch_bulk_body_defaults_format.py +9 -0
- bytekit/models/create_fetch_bulk_body_metadata.py +44 -0
- bytekit/models/create_fetch_bulk_body_urls_item_type_1.py +102 -0
- bytekit/models/create_fetch_bulk_body_urls_item_type_1_format.py +9 -0
- bytekit/models/create_fetch_bulk_response_202.py +44 -0
- bytekit/models/create_scrape_bulk_body.py +179 -0
- bytekit/models/create_scrape_bulk_body_custom.py +52 -0
- bytekit/models/create_scrape_bulk_body_defaults.py +167 -0
- bytekit/models/create_scrape_bulk_body_defaults_formats_item.py +12 -0
- bytekit/models/create_scrape_bulk_body_defaults_headers.py +44 -0
- bytekit/models/create_scrape_bulk_body_items_item.py +226 -0
- bytekit/models/create_scrape_bulk_body_items_item_custom.py +50 -0
- bytekit/models/create_scrape_bulk_body_items_item_formats_item.py +12 -0
- bytekit/models/create_scrape_bulk_body_items_item_headers.py +44 -0
- bytekit/models/create_scrape_bulk_body_items_item_metadata.py +44 -0
- bytekit/models/create_scrape_bulk_response_202.py +166 -0
- bytekit/models/create_scrape_bulk_response_202_status.py +10 -0
- bytekit/models/create_search_body.py +140 -0
- bytekit/models/create_search_body_date_range.py +13 -0
- bytekit/models/create_search_body_type.py +10 -0
- bytekit/models/create_search_response_200.py +119 -0
- bytekit/models/create_search_response_200_results_item.py +161 -0
- bytekit/models/create_search_response_200_results_item_image.py +113 -0
- bytekit/models/create_search_response_502.py +46 -0
- bytekit/models/create_search_response_502_error.py +8 -0
- bytekit/models/credit_balance.py +91 -0
- bytekit/models/delete_bulk_response_200.py +164 -0
- bytekit/models/delete_bulk_response_200_status.py +11 -0
- bytekit/models/error.py +83 -0
- bytekit/models/error_error.py +100 -0
- bytekit/models/error_status.py +8 -0
- bytekit/models/fetch_request.py +276 -0
- bytekit/models/fetch_request_cache_ttl_type_1.py +8 -0
- bytekit/models/fetch_request_custom.py +48 -0
- bytekit/models/fetch_request_format.py +9 -0
- bytekit/models/fetch_request_markdown_images.py +11 -0
- bytekit/models/fetch_request_markdown_links.py +11 -0
- bytekit/models/fetch_request_markdown_mode.py +10 -0
- bytekit/models/get_bulk_response_200.py +164 -0
- bytekit/models/get_bulk_response_200_status.py +11 -0
- bytekit/models/get_fetch_bulk_response_200.py +44 -0
- bytekit/models/get_fetch_cache_ttl_type_1.py +8 -0
- bytekit/models/get_fetch_format.py +9 -0
- bytekit/models/get_scrape_bulk_response_200.py +164 -0
- bytekit/models/get_scrape_bulk_response_200_status.py +11 -0
- bytekit/models/get_usage_by_endpoint_response_200.py +114 -0
- bytekit/models/get_usage_by_endpoint_response_200_rows_item.py +90 -0
- bytekit/models/get_usage_by_endpoint_response_200_rows_item_endpoint.py +17 -0
- bytekit/models/get_usage_by_endpoint_response_200_totals.py +67 -0
- bytekit/models/get_usage_daily_response_200.py +97 -0
- bytekit/models/get_usage_daily_response_200_data_item.py +219 -0
- bytekit/models/get_usage_response_200.py +344 -0
- bytekit/models/get_usage_response_200_plan_type.py +10 -0
- bytekit/models/list_bulk_screenshots_response_200.py +44 -0
- bytekit/models/list_monitor_captures_response_200.py +101 -0
- bytekit/models/list_monitors_response_200.py +101 -0
- bytekit/models/list_monitors_status.py +12 -0
- bytekit/models/list_webhook_deliveries_response_200.py +101 -0
- bytekit/models/list_webhook_deliveries_status.py +11 -0
- bytekit/models/metadata.py +44 -0
- bytekit/models/monitor_create_request.py +219 -0
- bytekit/models/monitor_create_request_interval_type.py +11 -0
- bytekit/models/monitor_create_request_notify_on.py +9 -0
- bytekit/models/monitor_create_request_options.py +44 -0
- bytekit/models/monitor_create_request_scrape_options.py +44 -0
- bytekit/models/monitor_create_request_type.py +9 -0
- bytekit/models/monitor_create_request_webhook_headers.py +44 -0
- bytekit/models/monitor_create_response.py +423 -0
- bytekit/models/monitor_response.py +411 -0
- bytekit/models/monitor_response_interval_type.py +11 -0
- bytekit/models/monitor_response_metadata_type_0.py +44 -0
- bytekit/models/monitor_response_status.py +12 -0
- bytekit/models/monitor_response_type.py +9 -0
- bytekit/models/monitor_response_webhook_headers_type_0.py +44 -0
- bytekit/models/monitor_update_request.py +223 -0
- bytekit/models/monitor_update_request_interval_type.py +11 -0
- bytekit/models/monitor_update_request_notify_on.py +9 -0
- bytekit/models/monitor_update_request_options.py +44 -0
- bytekit/models/monitor_update_request_scrape_options.py +44 -0
- bytekit/models/monitor_update_request_status.py +9 -0
- bytekit/models/monitor_update_request_webhook_headers.py +44 -0
- bytekit/models/scrape_error_envelope.py +113 -0
- bytekit/models/scrape_error_envelope_error.py +93 -0
- bytekit/models/scrape_error_envelope_error_code.py +18 -0
- bytekit/models/scrape_error_envelope_schema_version.py +8 -0
- bytekit/models/scrape_error_envelope_status.py +8 -0
- bytekit/models/scrape_formats.py +183 -0
- bytekit/models/scrape_markdown_tokens.py +75 -0
- bytekit/models/scrape_metadata.py +262 -0
- bytekit/models/scrape_queued_envelope.py +124 -0
- bytekit/models/scrape_queued_envelope_schema_version.py +8 -0
- bytekit/models/scrape_queued_envelope_status.py +8 -0
- bytekit/models/scrape_request.py +485 -0
- bytekit/models/scrape_request_cache_ttl_type_1.py +8 -0
- bytekit/models/scrape_request_custom.py +48 -0
- bytekit/models/scrape_request_events_item.py +10 -0
- bytekit/models/scrape_request_formats_item.py +12 -0
- bytekit/models/scrape_request_headers.py +44 -0
- bytekit/models/scrape_request_markdown_images.py +11 -0
- bytekit/models/scrape_request_markdown_links.py +11 -0
- bytekit/models/scrape_request_markdown_mode.py +10 -0
- bytekit/models/scrape_request_token_encoding.py +9 -0
- bytekit/models/scrape_request_x_internal_scrape_path.py +8 -0
- bytekit/models/scrape_scored_image.py +128 -0
- bytekit/models/scrape_scored_link.py +94 -0
- bytekit/models/scrape_stats.py +75 -0
- bytekit/models/scrape_success_envelope.py +345 -0
- bytekit/models/scrape_success_envelope_cache.py +10 -0
- bytekit/models/scrape_success_envelope_custom.py +48 -0
- bytekit/models/scrape_success_envelope_schema_version.py +8 -0
- bytekit/models/scrape_success_envelope_status.py +8 -0
- bytekit/models/scrape_table.py +96 -0
- bytekit/models/scrape_table_kind.py +10 -0
- bytekit/models/scrape_warning.py +88 -0
- bytekit/models/scrape_warning_code.py +17 -0
- bytekit/models/screenshot_request.py +445 -0
- bytekit/models/screenshot_request_device.py +9 -0
- bytekit/models/screenshot_request_device_scale_factor_type_1.py +9 -0
- bytekit/models/screenshot_request_device_scale_factor_type_2_type_1.py +9 -0
- bytekit/models/screenshot_request_device_scale_factor_type_3_type_1.py +9 -0
- bytekit/models/screenshot_request_format.py +9 -0
- bytekit/models/screenshot_request_headers.py +44 -0
- bytekit/models/screenshot_request_wait_until.py +10 -0
- bytekit/models/screenshot_response.py +264 -0
- bytekit/models/screenshot_response_status.py +11 -0
- bytekit/models/sitemap_request.py +210 -0
- bytekit/models/sitemap_request_process_type_0.py +90 -0
- bytekit/models/sitemap_request_process_type_0_options.py +44 -0
- bytekit/models/sitemap_request_strategy.py +10 -0
- bytekit/models/sitemap_response.py +418 -0
- bytekit/models/sitemap_response_cache.py +10 -0
- bytekit/models/sitemap_response_metadata_type_0.py +44 -0
- bytekit/models/sitemap_response_process_type_0.py +44 -0
- bytekit/models/sitemap_response_sources_type_0.py +44 -0
- bytekit/models/sitemap_response_status.py +11 -0
- bytekit/models/viewport.py +67 -0
- bytekit/models/webhook_delivery_response.py +270 -0
- bytekit/models/webhook_delivery_response_event_type.py +14 -0
- bytekit/models/webhook_delivery_response_status.py +11 -0
- bytekit/py.typed +0 -0
- bytekit/types.py +54 -0
- bytekit_sdk-0.3.0.dist-info/METADATA +141 -0
- bytekit_sdk-0.3.0.dist-info/RECORD +227 -0
- bytekit_sdk-0.3.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import (
|
|
3
|
+
TYPE_CHECKING,
|
|
4
|
+
Any,
|
|
5
|
+
TypeVar,
|
|
6
|
+
Union,
|
|
7
|
+
cast,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from attrs import define as _attrs_define
|
|
11
|
+
|
|
12
|
+
from ..models.scrape_request_cache_ttl_type_1 import ScrapeRequestCacheTtlType1
|
|
13
|
+
from ..models.scrape_request_events_item import ScrapeRequestEventsItem
|
|
14
|
+
from ..models.scrape_request_formats_item import ScrapeRequestFormatsItem
|
|
15
|
+
from ..models.scrape_request_markdown_images import ScrapeRequestMarkdownImages
|
|
16
|
+
from ..models.scrape_request_markdown_links import ScrapeRequestMarkdownLinks
|
|
17
|
+
from ..models.scrape_request_markdown_mode import ScrapeRequestMarkdownMode
|
|
18
|
+
from ..models.scrape_request_token_encoding import ScrapeRequestTokenEncoding
|
|
19
|
+
from ..models.scrape_request_x_internal_scrape_path import (
|
|
20
|
+
ScrapeRequestXInternalScrapePath,
|
|
21
|
+
)
|
|
22
|
+
from ..types import UNSET, Unset
|
|
23
|
+
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from ..models.cookie import Cookie
|
|
26
|
+
from ..models.scrape_request_custom import ScrapeRequestCustom
|
|
27
|
+
from ..models.scrape_request_headers import ScrapeRequestHeaders
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
T = TypeVar("T", bound="ScrapeRequest")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@_attrs_define
|
|
34
|
+
class ScrapeRequest:
|
|
35
|
+
r"""
|
|
36
|
+
Attributes:
|
|
37
|
+
url (str):
|
|
38
|
+
formats (Union[Unset, list[ScrapeRequestFormatsItem]]):
|
|
39
|
+
country (Union[Unset, str]):
|
|
40
|
+
cookies (Union[Unset, list['Cookie']]):
|
|
41
|
+
headers (Union[Unset, ScrapeRequestHeaders]):
|
|
42
|
+
delay_ms (Union[Unset, int]):
|
|
43
|
+
timeout_ms (Union[Unset, int]):
|
|
44
|
+
async_ (Union[Unset, bool]):
|
|
45
|
+
webhook_url (Union[Unset, str]): Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason
|
|
46
|
+
scheme_unsupported)
|
|
47
|
+
events (Union[Unset, list[ScrapeRequestEventsItem]]):
|
|
48
|
+
markdown_mode (Union[Unset, ScrapeRequestMarkdownMode]): Markdown processing mode. article=article extraction
|
|
49
|
+
(default), raw=minimal cleanup, llm=compact LLM-optimised output.
|
|
50
|
+
markdown_query (Union[Unset, str]): BM25 query string for relevance-ranked content filtering. Omit or leave
|
|
51
|
+
empty to disable.
|
|
52
|
+
markdown_links (Union[Unset, ScrapeRequestMarkdownLinks]): Link rendering style in the markdown output. 'inline'
|
|
53
|
+
(default) keeps `[text](url)` as-is. 'text' strips URLs, keeping only anchor text. 'none' strips URLs and
|
|
54
|
+
removes reference definitions. 'references' converts to numbered `[text][N]` refs with a Links footer.
|
|
55
|
+
markdown_images (Union[Unset, ScrapeRequestMarkdownImages]): Image retention mode in the markdown output.
|
|
56
|
+
'inline' (default) keeps `` as-is. 'text' strips the URL, keeping only alt text. 'none' removes
|
|
57
|
+
images entirely. 'references' converts to numbered `![alt][N]` refs with an Images footer. Distinct from
|
|
58
|
+
markdown_filter_images (which drops low-signal images before conversion).
|
|
59
|
+
with_links_summary (Union[Unset, bool]): When true, appends a 'Links:\n[1]: url\n...' footer to the markdown
|
|
60
|
+
output, built from the extracted link list. Automatically enabled when markdown_links is 'references'.
|
|
61
|
+
with_images_summary (Union[Unset, bool]): When true, appends an 'Images:\n[1]: url\n...' footer to the markdown
|
|
62
|
+
output, built from the extracted image list.
|
|
63
|
+
markdown_compact (Union[Unset, bool]): Collapse excessive whitespace for a more compact output.
|
|
64
|
+
markdown_filter_images (Union[Unset, bool]): Filter low-signal images from the markdown output.
|
|
65
|
+
markdown_include_media (Union[Unset, bool]): When true, `formats.links` and `formats.images` return
|
|
66
|
+
`ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables`
|
|
67
|
+
array is included. Only effective when `markdown` is in `formats`.
|
|
68
|
+
markdown_include_warnings (Union[Unset, bool]): When true, enables markdown-pipeline and tag-filter warnings for
|
|
69
|
+
affected `html` and `markdown` requests. Artifact availability warnings such as `artifact_unavailable` may
|
|
70
|
+
appear independently of this flag.
|
|
71
|
+
markdown_include_stats (Union[Unset, bool]): When true, the response includes a top-level `stats` object with
|
|
72
|
+
`ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.
|
|
73
|
+
token_budget (Union[Unset, int]): Maximum token count for the markdown output. When set and `markdown` is in
|
|
74
|
+
`formats`, the output is truncated at the last paragraph → sentence → token boundary that keeps the estimated
|
|
75
|
+
count under this limit. Absent → no truncation. Triggers a `markdown_tokens` field in the response.
|
|
76
|
+
token_encoding (Union[Unset, ScrapeRequestTokenEncoding]): Tokenizer encoding hint for `token_budget`.
|
|
77
|
+
`cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series. Both use the same
|
|
78
|
+
4-char/token heuristic internally.
|
|
79
|
+
mobile (Union[Unset, bool]): When true, emulate a mobile device — the request uses a mobile (Android) user agent
|
|
80
|
+
and a mobile viewport, so the upstream serves the mobile version of the page. Default false (desktop). The value
|
|
81
|
+
is part of the cache key, so mobile and desktop responses are cached independently.
|
|
82
|
+
remove_base64_images (Union[Unset, bool]): When true (default), base64-encoded `data:` image sources are
|
|
83
|
+
stripped from the HTML before markdown conversion and from the `html` format output. Set to false to preserve
|
|
84
|
+
base64 images in the pipeline output. Does not affect `raw_html`, which always returns the original HTML
|
|
85
|
+
unchanged.
|
|
86
|
+
include_tags (Union[Unset, list[str]]): HTML element names (not CSS selectors) to keep. When non-empty, only
|
|
87
|
+
content within these elements is included in the `html` and `markdown` output. Applied before `exclude_tags`.
|
|
88
|
+
Does not affect `raw_html`, which always returns the full page.
|
|
89
|
+
exclude_tags (Union[Unset, list[str]]): HTML element names (not CSS selectors) to strip from the `html` and
|
|
90
|
+
`markdown` output. Applied after `include_tags` when both are present. Does not affect `raw_html`, which always
|
|
91
|
+
returns the full page.
|
|
92
|
+
cache_ttl (Union[ScrapeRequestCacheTtlType1, Unset, str]): How long a freshly fetched URL may be served from
|
|
93
|
+
cache. `0` (string or integer) skips the cache read; cache-eligible results are still written. `Nh`/`Nd` set a
|
|
94
|
+
TTL (capped at 168 h / 7 d). Safety-classified WAF husks are returned live but never stored in the shared cache.
|
|
95
|
+
Honoured on both the synchronous and asynchronous paths; the async success envelope reports the lookup outcome
|
|
96
|
+
via the `cache` field.
|
|
97
|
+
custom (Union[Unset, ScrapeRequestCustom]): User-supplied JSON payload, echoed back on the success envelope
|
|
98
|
+
(sync, async, webhook). Capped at 4096 UTF-8 bytes (`Buffer.byteLength`). Distinct from the system-owned
|
|
99
|
+
`metadata` column. Does NOT affect cache-key inputs — two requests differing only in `custom` resolve to the
|
|
100
|
+
same cache entry.
|
|
101
|
+
clean_markdown (Union[Unset, bool]): When `true` and `markdown` is in `formats`, the converted markdown is sent
|
|
102
|
+
to Groq LLM for cleaning (boilerplate removal, ad stripping, formatting improvement) before being returned.
|
|
103
|
+
Graceful degradation: any Groq failure (key unset, 4xx/5xx, timeout, empty response) returns the raw markdown
|
|
104
|
+
unchanged plus a warning in the `warnings` array. Billing: 3× credits and bytes applied only when cleaning
|
|
105
|
+
succeeds.
|
|
106
|
+
x_internal_scrape_path (Union[Unset, ScrapeRequestXInternalScrapePath]): Internal-only: forces the request onto
|
|
107
|
+
the worker enqueue branch and the lean-forced code path in scrape-worker. Requires X-Internal-Probe-Token
|
|
108
|
+
header. Not exposed via SDK generators.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
url: str
|
|
112
|
+
formats: Union[Unset, list[ScrapeRequestFormatsItem]] = UNSET
|
|
113
|
+
country: Union[Unset, str] = UNSET
|
|
114
|
+
cookies: Union[Unset, list["Cookie"]] = UNSET
|
|
115
|
+
headers: Union[Unset, "ScrapeRequestHeaders"] = UNSET
|
|
116
|
+
delay_ms: Union[Unset, int] = UNSET
|
|
117
|
+
timeout_ms: Union[Unset, int] = UNSET
|
|
118
|
+
async_: Union[Unset, bool] = UNSET
|
|
119
|
+
webhook_url: Union[Unset, str] = UNSET
|
|
120
|
+
events: Union[Unset, list[ScrapeRequestEventsItem]] = UNSET
|
|
121
|
+
markdown_mode: Union[Unset, ScrapeRequestMarkdownMode] = UNSET
|
|
122
|
+
markdown_query: Union[Unset, str] = UNSET
|
|
123
|
+
markdown_links: Union[Unset, ScrapeRequestMarkdownLinks] = UNSET
|
|
124
|
+
markdown_images: Union[Unset, ScrapeRequestMarkdownImages] = UNSET
|
|
125
|
+
with_links_summary: Union[Unset, bool] = UNSET
|
|
126
|
+
with_images_summary: Union[Unset, bool] = UNSET
|
|
127
|
+
markdown_compact: Union[Unset, bool] = UNSET
|
|
128
|
+
markdown_filter_images: Union[Unset, bool] = UNSET
|
|
129
|
+
markdown_include_media: Union[Unset, bool] = UNSET
|
|
130
|
+
markdown_include_warnings: Union[Unset, bool] = UNSET
|
|
131
|
+
markdown_include_stats: Union[Unset, bool] = UNSET
|
|
132
|
+
token_budget: Union[Unset, int] = UNSET
|
|
133
|
+
token_encoding: Union[Unset, ScrapeRequestTokenEncoding] = UNSET
|
|
134
|
+
mobile: Union[Unset, bool] = UNSET
|
|
135
|
+
remove_base64_images: Union[Unset, bool] = UNSET
|
|
136
|
+
include_tags: Union[Unset, list[str]] = UNSET
|
|
137
|
+
exclude_tags: Union[Unset, list[str]] = UNSET
|
|
138
|
+
cache_ttl: Union[ScrapeRequestCacheTtlType1, Unset, str] = UNSET
|
|
139
|
+
custom: Union[Unset, "ScrapeRequestCustom"] = UNSET
|
|
140
|
+
clean_markdown: Union[Unset, bool] = UNSET
|
|
141
|
+
x_internal_scrape_path: Union[Unset, ScrapeRequestXInternalScrapePath] = UNSET
|
|
142
|
+
|
|
143
|
+
def to_dict(self) -> dict[str, Any]:
|
|
144
|
+
url = self.url
|
|
145
|
+
|
|
146
|
+
formats: Union[Unset, list[str]] = UNSET
|
|
147
|
+
if not isinstance(self.formats, Unset):
|
|
148
|
+
formats = []
|
|
149
|
+
for formats_item_data in self.formats:
|
|
150
|
+
formats_item = formats_item_data.value
|
|
151
|
+
formats.append(formats_item)
|
|
152
|
+
|
|
153
|
+
country = self.country
|
|
154
|
+
|
|
155
|
+
cookies: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
156
|
+
if not isinstance(self.cookies, Unset):
|
|
157
|
+
cookies = []
|
|
158
|
+
for cookies_item_data in self.cookies:
|
|
159
|
+
cookies_item = cookies_item_data.to_dict()
|
|
160
|
+
cookies.append(cookies_item)
|
|
161
|
+
|
|
162
|
+
headers: Union[Unset, dict[str, Any]] = UNSET
|
|
163
|
+
if not isinstance(self.headers, Unset):
|
|
164
|
+
headers = self.headers.to_dict()
|
|
165
|
+
|
|
166
|
+
delay_ms = self.delay_ms
|
|
167
|
+
|
|
168
|
+
timeout_ms = self.timeout_ms
|
|
169
|
+
|
|
170
|
+
async_ = self.async_
|
|
171
|
+
|
|
172
|
+
webhook_url = self.webhook_url
|
|
173
|
+
|
|
174
|
+
events: Union[Unset, list[str]] = UNSET
|
|
175
|
+
if not isinstance(self.events, Unset):
|
|
176
|
+
events = []
|
|
177
|
+
for events_item_data in self.events:
|
|
178
|
+
events_item = events_item_data.value
|
|
179
|
+
events.append(events_item)
|
|
180
|
+
|
|
181
|
+
markdown_mode: Union[Unset, str] = UNSET
|
|
182
|
+
if not isinstance(self.markdown_mode, Unset):
|
|
183
|
+
markdown_mode = self.markdown_mode.value
|
|
184
|
+
|
|
185
|
+
markdown_query = self.markdown_query
|
|
186
|
+
|
|
187
|
+
markdown_links: Union[Unset, str] = UNSET
|
|
188
|
+
if not isinstance(self.markdown_links, Unset):
|
|
189
|
+
markdown_links = self.markdown_links.value
|
|
190
|
+
|
|
191
|
+
markdown_images: Union[Unset, str] = UNSET
|
|
192
|
+
if not isinstance(self.markdown_images, Unset):
|
|
193
|
+
markdown_images = self.markdown_images.value
|
|
194
|
+
|
|
195
|
+
with_links_summary = self.with_links_summary
|
|
196
|
+
|
|
197
|
+
with_images_summary = self.with_images_summary
|
|
198
|
+
|
|
199
|
+
markdown_compact = self.markdown_compact
|
|
200
|
+
|
|
201
|
+
markdown_filter_images = self.markdown_filter_images
|
|
202
|
+
|
|
203
|
+
markdown_include_media = self.markdown_include_media
|
|
204
|
+
|
|
205
|
+
markdown_include_warnings = self.markdown_include_warnings
|
|
206
|
+
|
|
207
|
+
markdown_include_stats = self.markdown_include_stats
|
|
208
|
+
|
|
209
|
+
token_budget = self.token_budget
|
|
210
|
+
|
|
211
|
+
token_encoding: Union[Unset, str] = UNSET
|
|
212
|
+
if not isinstance(self.token_encoding, Unset):
|
|
213
|
+
token_encoding = self.token_encoding.value
|
|
214
|
+
|
|
215
|
+
mobile = self.mobile
|
|
216
|
+
|
|
217
|
+
remove_base64_images = self.remove_base64_images
|
|
218
|
+
|
|
219
|
+
include_tags: Union[Unset, list[str]] = UNSET
|
|
220
|
+
if not isinstance(self.include_tags, Unset):
|
|
221
|
+
include_tags = self.include_tags
|
|
222
|
+
|
|
223
|
+
exclude_tags: Union[Unset, list[str]] = UNSET
|
|
224
|
+
if not isinstance(self.exclude_tags, Unset):
|
|
225
|
+
exclude_tags = self.exclude_tags
|
|
226
|
+
|
|
227
|
+
cache_ttl: Union[Unset, int, str]
|
|
228
|
+
if isinstance(self.cache_ttl, Unset):
|
|
229
|
+
cache_ttl = UNSET
|
|
230
|
+
elif isinstance(self.cache_ttl, ScrapeRequestCacheTtlType1):
|
|
231
|
+
cache_ttl = self.cache_ttl.value
|
|
232
|
+
else:
|
|
233
|
+
cache_ttl = self.cache_ttl
|
|
234
|
+
|
|
235
|
+
custom: Union[Unset, dict[str, Any]] = UNSET
|
|
236
|
+
if not isinstance(self.custom, Unset):
|
|
237
|
+
custom = self.custom.to_dict()
|
|
238
|
+
|
|
239
|
+
clean_markdown = self.clean_markdown
|
|
240
|
+
|
|
241
|
+
x_internal_scrape_path: Union[Unset, str] = UNSET
|
|
242
|
+
if not isinstance(self.x_internal_scrape_path, Unset):
|
|
243
|
+
x_internal_scrape_path = self.x_internal_scrape_path.value
|
|
244
|
+
|
|
245
|
+
field_dict: dict[str, Any] = {}
|
|
246
|
+
|
|
247
|
+
field_dict.update(
|
|
248
|
+
{
|
|
249
|
+
"url": url,
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
if formats is not UNSET:
|
|
253
|
+
field_dict["formats"] = formats
|
|
254
|
+
if country is not UNSET:
|
|
255
|
+
field_dict["country"] = country
|
|
256
|
+
if cookies is not UNSET:
|
|
257
|
+
field_dict["cookies"] = cookies
|
|
258
|
+
if headers is not UNSET:
|
|
259
|
+
field_dict["headers"] = headers
|
|
260
|
+
if delay_ms is not UNSET:
|
|
261
|
+
field_dict["delay_ms"] = delay_ms
|
|
262
|
+
if timeout_ms is not UNSET:
|
|
263
|
+
field_dict["timeout_ms"] = timeout_ms
|
|
264
|
+
if async_ is not UNSET:
|
|
265
|
+
field_dict["async"] = async_
|
|
266
|
+
if webhook_url is not UNSET:
|
|
267
|
+
field_dict["webhook_url"] = webhook_url
|
|
268
|
+
if events is not UNSET:
|
|
269
|
+
field_dict["events"] = events
|
|
270
|
+
if markdown_mode is not UNSET:
|
|
271
|
+
field_dict["markdown_mode"] = markdown_mode
|
|
272
|
+
if markdown_query is not UNSET:
|
|
273
|
+
field_dict["markdown_query"] = markdown_query
|
|
274
|
+
if markdown_links is not UNSET:
|
|
275
|
+
field_dict["markdown_links"] = markdown_links
|
|
276
|
+
if markdown_images is not UNSET:
|
|
277
|
+
field_dict["markdown_images"] = markdown_images
|
|
278
|
+
if with_links_summary is not UNSET:
|
|
279
|
+
field_dict["with_links_summary"] = with_links_summary
|
|
280
|
+
if with_images_summary is not UNSET:
|
|
281
|
+
field_dict["with_images_summary"] = with_images_summary
|
|
282
|
+
if markdown_compact is not UNSET:
|
|
283
|
+
field_dict["markdown_compact"] = markdown_compact
|
|
284
|
+
if markdown_filter_images is not UNSET:
|
|
285
|
+
field_dict["markdown_filter_images"] = markdown_filter_images
|
|
286
|
+
if markdown_include_media is not UNSET:
|
|
287
|
+
field_dict["markdown_include_media"] = markdown_include_media
|
|
288
|
+
if markdown_include_warnings is not UNSET:
|
|
289
|
+
field_dict["markdown_include_warnings"] = markdown_include_warnings
|
|
290
|
+
if markdown_include_stats is not UNSET:
|
|
291
|
+
field_dict["markdown_include_stats"] = markdown_include_stats
|
|
292
|
+
if token_budget is not UNSET:
|
|
293
|
+
field_dict["token_budget"] = token_budget
|
|
294
|
+
if token_encoding is not UNSET:
|
|
295
|
+
field_dict["token_encoding"] = token_encoding
|
|
296
|
+
if mobile is not UNSET:
|
|
297
|
+
field_dict["mobile"] = mobile
|
|
298
|
+
if remove_base64_images is not UNSET:
|
|
299
|
+
field_dict["remove_base64_images"] = remove_base64_images
|
|
300
|
+
if include_tags is not UNSET:
|
|
301
|
+
field_dict["include_tags"] = include_tags
|
|
302
|
+
if exclude_tags is not UNSET:
|
|
303
|
+
field_dict["exclude_tags"] = exclude_tags
|
|
304
|
+
if cache_ttl is not UNSET:
|
|
305
|
+
field_dict["cache_ttl"] = cache_ttl
|
|
306
|
+
if custom is not UNSET:
|
|
307
|
+
field_dict["custom"] = custom
|
|
308
|
+
if clean_markdown is not UNSET:
|
|
309
|
+
field_dict["clean_markdown"] = clean_markdown
|
|
310
|
+
if x_internal_scrape_path is not UNSET:
|
|
311
|
+
field_dict["x_internal_scrape_path"] = x_internal_scrape_path
|
|
312
|
+
|
|
313
|
+
return field_dict
|
|
314
|
+
|
|
315
|
+
@classmethod
|
|
316
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
317
|
+
from ..models.cookie import Cookie
|
|
318
|
+
from ..models.scrape_request_custom import ScrapeRequestCustom
|
|
319
|
+
from ..models.scrape_request_headers import ScrapeRequestHeaders
|
|
320
|
+
|
|
321
|
+
d = dict(src_dict)
|
|
322
|
+
url = d.pop("url")
|
|
323
|
+
|
|
324
|
+
formats = []
|
|
325
|
+
_formats = d.pop("formats", UNSET)
|
|
326
|
+
for formats_item_data in _formats or []:
|
|
327
|
+
formats_item = ScrapeRequestFormatsItem(formats_item_data)
|
|
328
|
+
|
|
329
|
+
formats.append(formats_item)
|
|
330
|
+
|
|
331
|
+
country = d.pop("country", UNSET)
|
|
332
|
+
|
|
333
|
+
cookies = []
|
|
334
|
+
_cookies = d.pop("cookies", UNSET)
|
|
335
|
+
for cookies_item_data in _cookies or []:
|
|
336
|
+
cookies_item = Cookie.from_dict(cookies_item_data)
|
|
337
|
+
|
|
338
|
+
cookies.append(cookies_item)
|
|
339
|
+
|
|
340
|
+
_headers = d.pop("headers", UNSET)
|
|
341
|
+
headers: Union[Unset, ScrapeRequestHeaders]
|
|
342
|
+
if isinstance(_headers, Unset):
|
|
343
|
+
headers = UNSET
|
|
344
|
+
else:
|
|
345
|
+
headers = ScrapeRequestHeaders.from_dict(_headers)
|
|
346
|
+
|
|
347
|
+
delay_ms = d.pop("delay_ms", UNSET)
|
|
348
|
+
|
|
349
|
+
timeout_ms = d.pop("timeout_ms", UNSET)
|
|
350
|
+
|
|
351
|
+
async_ = d.pop("async", UNSET)
|
|
352
|
+
|
|
353
|
+
webhook_url = d.pop("webhook_url", UNSET)
|
|
354
|
+
|
|
355
|
+
events = []
|
|
356
|
+
_events = d.pop("events", UNSET)
|
|
357
|
+
for events_item_data in _events or []:
|
|
358
|
+
events_item = ScrapeRequestEventsItem(events_item_data)
|
|
359
|
+
|
|
360
|
+
events.append(events_item)
|
|
361
|
+
|
|
362
|
+
_markdown_mode = d.pop("markdown_mode", UNSET)
|
|
363
|
+
markdown_mode: Union[Unset, ScrapeRequestMarkdownMode]
|
|
364
|
+
if isinstance(_markdown_mode, Unset):
|
|
365
|
+
markdown_mode = UNSET
|
|
366
|
+
else:
|
|
367
|
+
markdown_mode = ScrapeRequestMarkdownMode(_markdown_mode)
|
|
368
|
+
|
|
369
|
+
markdown_query = d.pop("markdown_query", UNSET)
|
|
370
|
+
|
|
371
|
+
_markdown_links = d.pop("markdown_links", UNSET)
|
|
372
|
+
markdown_links: Union[Unset, ScrapeRequestMarkdownLinks]
|
|
373
|
+
if isinstance(_markdown_links, Unset):
|
|
374
|
+
markdown_links = UNSET
|
|
375
|
+
else:
|
|
376
|
+
markdown_links = ScrapeRequestMarkdownLinks(_markdown_links)
|
|
377
|
+
|
|
378
|
+
_markdown_images = d.pop("markdown_images", UNSET)
|
|
379
|
+
markdown_images: Union[Unset, ScrapeRequestMarkdownImages]
|
|
380
|
+
if isinstance(_markdown_images, Unset):
|
|
381
|
+
markdown_images = UNSET
|
|
382
|
+
else:
|
|
383
|
+
markdown_images = ScrapeRequestMarkdownImages(_markdown_images)
|
|
384
|
+
|
|
385
|
+
with_links_summary = d.pop("with_links_summary", UNSET)
|
|
386
|
+
|
|
387
|
+
with_images_summary = d.pop("with_images_summary", UNSET)
|
|
388
|
+
|
|
389
|
+
markdown_compact = d.pop("markdown_compact", UNSET)
|
|
390
|
+
|
|
391
|
+
markdown_filter_images = d.pop("markdown_filter_images", UNSET)
|
|
392
|
+
|
|
393
|
+
markdown_include_media = d.pop("markdown_include_media", UNSET)
|
|
394
|
+
|
|
395
|
+
markdown_include_warnings = d.pop("markdown_include_warnings", UNSET)
|
|
396
|
+
|
|
397
|
+
markdown_include_stats = d.pop("markdown_include_stats", UNSET)
|
|
398
|
+
|
|
399
|
+
token_budget = d.pop("token_budget", UNSET)
|
|
400
|
+
|
|
401
|
+
_token_encoding = d.pop("token_encoding", UNSET)
|
|
402
|
+
token_encoding: Union[Unset, ScrapeRequestTokenEncoding]
|
|
403
|
+
if isinstance(_token_encoding, Unset):
|
|
404
|
+
token_encoding = UNSET
|
|
405
|
+
else:
|
|
406
|
+
token_encoding = ScrapeRequestTokenEncoding(_token_encoding)
|
|
407
|
+
|
|
408
|
+
mobile = d.pop("mobile", UNSET)
|
|
409
|
+
|
|
410
|
+
remove_base64_images = d.pop("remove_base64_images", UNSET)
|
|
411
|
+
|
|
412
|
+
include_tags = cast(list[str], d.pop("include_tags", UNSET))
|
|
413
|
+
|
|
414
|
+
exclude_tags = cast(list[str], d.pop("exclude_tags", UNSET))
|
|
415
|
+
|
|
416
|
+
def _parse_cache_ttl(
|
|
417
|
+
data: object,
|
|
418
|
+
) -> Union[ScrapeRequestCacheTtlType1, Unset, str]:
|
|
419
|
+
if isinstance(data, Unset):
|
|
420
|
+
return data
|
|
421
|
+
try:
|
|
422
|
+
if not isinstance(data, int):
|
|
423
|
+
raise TypeError()
|
|
424
|
+
cache_ttl_type_1 = ScrapeRequestCacheTtlType1(data)
|
|
425
|
+
|
|
426
|
+
return cache_ttl_type_1
|
|
427
|
+
except: # noqa: E722
|
|
428
|
+
pass
|
|
429
|
+
return cast(Union[ScrapeRequestCacheTtlType1, Unset, str], data)
|
|
430
|
+
|
|
431
|
+
cache_ttl = _parse_cache_ttl(d.pop("cache_ttl", UNSET))
|
|
432
|
+
|
|
433
|
+
_custom = d.pop("custom", UNSET)
|
|
434
|
+
custom: Union[Unset, ScrapeRequestCustom]
|
|
435
|
+
if isinstance(_custom, Unset):
|
|
436
|
+
custom = UNSET
|
|
437
|
+
else:
|
|
438
|
+
custom = ScrapeRequestCustom.from_dict(_custom)
|
|
439
|
+
|
|
440
|
+
clean_markdown = d.pop("clean_markdown", UNSET)
|
|
441
|
+
|
|
442
|
+
_x_internal_scrape_path = d.pop("x_internal_scrape_path", UNSET)
|
|
443
|
+
x_internal_scrape_path: Union[Unset, ScrapeRequestXInternalScrapePath]
|
|
444
|
+
if isinstance(_x_internal_scrape_path, Unset):
|
|
445
|
+
x_internal_scrape_path = UNSET
|
|
446
|
+
else:
|
|
447
|
+
x_internal_scrape_path = ScrapeRequestXInternalScrapePath(
|
|
448
|
+
_x_internal_scrape_path
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
scrape_request = cls(
|
|
452
|
+
url=url,
|
|
453
|
+
formats=formats,
|
|
454
|
+
country=country,
|
|
455
|
+
cookies=cookies,
|
|
456
|
+
headers=headers,
|
|
457
|
+
delay_ms=delay_ms,
|
|
458
|
+
timeout_ms=timeout_ms,
|
|
459
|
+
async_=async_,
|
|
460
|
+
webhook_url=webhook_url,
|
|
461
|
+
events=events,
|
|
462
|
+
markdown_mode=markdown_mode,
|
|
463
|
+
markdown_query=markdown_query,
|
|
464
|
+
markdown_links=markdown_links,
|
|
465
|
+
markdown_images=markdown_images,
|
|
466
|
+
with_links_summary=with_links_summary,
|
|
467
|
+
with_images_summary=with_images_summary,
|
|
468
|
+
markdown_compact=markdown_compact,
|
|
469
|
+
markdown_filter_images=markdown_filter_images,
|
|
470
|
+
markdown_include_media=markdown_include_media,
|
|
471
|
+
markdown_include_warnings=markdown_include_warnings,
|
|
472
|
+
markdown_include_stats=markdown_include_stats,
|
|
473
|
+
token_budget=token_budget,
|
|
474
|
+
token_encoding=token_encoding,
|
|
475
|
+
mobile=mobile,
|
|
476
|
+
remove_base64_images=remove_base64_images,
|
|
477
|
+
include_tags=include_tags,
|
|
478
|
+
exclude_tags=exclude_tags,
|
|
479
|
+
cache_ttl=cache_ttl,
|
|
480
|
+
custom=custom,
|
|
481
|
+
clean_markdown=clean_markdown,
|
|
482
|
+
x_internal_scrape_path=x_internal_scrape_path,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
return scrape_request
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="ScrapeRequestCustom")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class ScrapeRequestCustom:
|
|
12
|
+
"""User-supplied JSON payload, echoed back on the success envelope (sync, async, webhook). Capped at 4096 UTF-8 bytes
|
|
13
|
+
(`Buffer.byteLength`). Distinct from the system-owned `metadata` column. Does NOT affect cache-key inputs — two
|
|
14
|
+
requests differing only in `custom` resolve to the same cache entry.
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
19
|
+
|
|
20
|
+
def to_dict(self) -> dict[str, Any]:
|
|
21
|
+
field_dict: dict[str, Any] = {}
|
|
22
|
+
field_dict.update(self.additional_properties)
|
|
23
|
+
|
|
24
|
+
return field_dict
|
|
25
|
+
|
|
26
|
+
@classmethod
|
|
27
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
28
|
+
d = dict(src_dict)
|
|
29
|
+
scrape_request_custom = cls()
|
|
30
|
+
|
|
31
|
+
scrape_request_custom.additional_properties = d
|
|
32
|
+
return scrape_request_custom
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def additional_keys(self) -> list[str]:
|
|
36
|
+
return list(self.additional_properties.keys())
|
|
37
|
+
|
|
38
|
+
def __getitem__(self, key: str) -> Any:
|
|
39
|
+
return self.additional_properties[key]
|
|
40
|
+
|
|
41
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
42
|
+
self.additional_properties[key] = value
|
|
43
|
+
|
|
44
|
+
def __delitem__(self, key: str) -> None:
|
|
45
|
+
del self.additional_properties[key]
|
|
46
|
+
|
|
47
|
+
def __contains__(self, key: str) -> bool:
|
|
48
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="ScrapeRequestHeaders")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class ScrapeRequestHeaders:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
field_dict.update(self.additional_properties)
|
|
19
|
+
|
|
20
|
+
return field_dict
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
|
+
d = dict(src_dict)
|
|
25
|
+
scrape_request_headers = cls()
|
|
26
|
+
|
|
27
|
+
scrape_request_headers.additional_properties = d
|
|
28
|
+
return scrape_request_headers
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> str:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: str) -> None:
|
|
38
|
+
self.additional_properties[key] = value
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key: str) -> None:
|
|
41
|
+
del self.additional_properties[key]
|
|
42
|
+
|
|
43
|
+
def __contains__(self, key: str) -> bool:
|
|
44
|
+
return key in self.additional_properties
|