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,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="SitemapRequestProcessType0Options")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class SitemapRequestProcessType0Options:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _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
|
+
sitemap_request_process_type_0_options = cls()
|
|
26
|
+
|
|
27
|
+
sitemap_request_process_type_0_options.additional_properties = d
|
|
28
|
+
return sitemap_request_process_type_0_options
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> 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
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import (
|
|
4
|
+
TYPE_CHECKING,
|
|
5
|
+
Any,
|
|
6
|
+
TypeVar,
|
|
7
|
+
Union,
|
|
8
|
+
cast,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from attrs import define as _attrs_define
|
|
12
|
+
from attrs import field as _attrs_field
|
|
13
|
+
from dateutil.parser import isoparse
|
|
14
|
+
|
|
15
|
+
from ..models.sitemap_response_cache import SitemapResponseCache
|
|
16
|
+
from ..models.sitemap_response_status import SitemapResponseStatus
|
|
17
|
+
from ..types import UNSET, Unset
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from ..models.sitemap_response_metadata_type_0 import SitemapResponseMetadataType0
|
|
21
|
+
from ..models.sitemap_response_process_type_0 import SitemapResponseProcessType0
|
|
22
|
+
from ..models.sitemap_response_sources_type_0 import SitemapResponseSourcesType0
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
T = TypeVar("T", bound="SitemapResponse")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@_attrs_define
|
|
29
|
+
class SitemapResponse:
|
|
30
|
+
"""
|
|
31
|
+
Attributes:
|
|
32
|
+
id (str): Example: sm_01j9abc123.
|
|
33
|
+
url (str):
|
|
34
|
+
strategy (str):
|
|
35
|
+
max_depth (int):
|
|
36
|
+
max_urls (int):
|
|
37
|
+
status (SitemapResponseStatus):
|
|
38
|
+
total_urls (Union[None, int]):
|
|
39
|
+
sources (Union['SitemapResponseSourcesType0', None]):
|
|
40
|
+
total_bytes (Union[None, int]):
|
|
41
|
+
results_url (Union[None, str]): Signed S3 URL for downloading the discovered URLs. Present when
|
|
42
|
+
completed. The payload is a gzip-compressed CSV with a two-column
|
|
43
|
+
`url,source` header (one row per discovered URL); `source` is one of
|
|
44
|
+
`sitemap` (found in a sitemap.xml), `known` (seen in prior scrape
|
|
45
|
+
history), or `links` (discovered by crawling page links). In
|
|
46
|
+
`compact: true` mode the payload is a plain newline-delimited URL
|
|
47
|
+
list with no header. `lastmod`/`depth` columns are not emitted.
|
|
48
|
+
warnings (Union[None, list[str]]):
|
|
49
|
+
error_code (Union[None, str]):
|
|
50
|
+
error_message (Union[None, str]):
|
|
51
|
+
compact (bool):
|
|
52
|
+
process (Union['SitemapResponseProcessType0', None]):
|
|
53
|
+
metadata (Union['SitemapResponseMetadataType0', None]):
|
|
54
|
+
created_at (datetime.datetime):
|
|
55
|
+
completed_at (Union[None, datetime.datetime]):
|
|
56
|
+
expires_at (Union[None, datetime.datetime]):
|
|
57
|
+
cache (Union[Unset, SitemapResponseCache]): Cache verdict for the request that produced this creation response.
|
|
58
|
+
`hit` — served from a completed cached clone of a prior matching
|
|
59
|
+
sitemap job (billed at 0.5×). `miss` — no fresh cache entry; a new
|
|
60
|
+
discovery was queued (the result is not yet cached). `bypass` —
|
|
61
|
+
`cache_ttl: '0'` skipped the cache read. Present on the 202 creation
|
|
62
|
+
response; omitted on `GET /v1/sitemap/{id}` and any response with no
|
|
63
|
+
cache verdict. Optional — pre-cache-era consumers may not observe it.
|
|
64
|
+
cache_age_s (Union[None, Unset, int]): Age in whole seconds of the cached source job (its `completed_at`)
|
|
65
|
+
replayed on a `cache: hit`. Clamped to ≥ 0 to absorb clock skew. Present only on `cache: hit`; null on
|
|
66
|
+
`miss`/`bypass`.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
id: str
|
|
70
|
+
url: str
|
|
71
|
+
strategy: str
|
|
72
|
+
max_depth: int
|
|
73
|
+
max_urls: int
|
|
74
|
+
status: SitemapResponseStatus
|
|
75
|
+
total_urls: Union[None, int]
|
|
76
|
+
sources: Union["SitemapResponseSourcesType0", None]
|
|
77
|
+
total_bytes: Union[None, int]
|
|
78
|
+
results_url: Union[None, str]
|
|
79
|
+
warnings: Union[None, list[str]]
|
|
80
|
+
error_code: Union[None, str]
|
|
81
|
+
error_message: Union[None, str]
|
|
82
|
+
compact: bool
|
|
83
|
+
process: Union["SitemapResponseProcessType0", None]
|
|
84
|
+
metadata: Union["SitemapResponseMetadataType0", None]
|
|
85
|
+
created_at: datetime.datetime
|
|
86
|
+
completed_at: Union[None, datetime.datetime]
|
|
87
|
+
expires_at: Union[None, datetime.datetime]
|
|
88
|
+
cache: Union[Unset, SitemapResponseCache] = UNSET
|
|
89
|
+
cache_age_s: Union[None, Unset, int] = UNSET
|
|
90
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
91
|
+
|
|
92
|
+
def to_dict(self) -> dict[str, Any]:
|
|
93
|
+
from ..models.sitemap_response_metadata_type_0 import (
|
|
94
|
+
SitemapResponseMetadataType0,
|
|
95
|
+
)
|
|
96
|
+
from ..models.sitemap_response_process_type_0 import SitemapResponseProcessType0
|
|
97
|
+
from ..models.sitemap_response_sources_type_0 import SitemapResponseSourcesType0
|
|
98
|
+
|
|
99
|
+
id = self.id
|
|
100
|
+
|
|
101
|
+
url = self.url
|
|
102
|
+
|
|
103
|
+
strategy = self.strategy
|
|
104
|
+
|
|
105
|
+
max_depth = self.max_depth
|
|
106
|
+
|
|
107
|
+
max_urls = self.max_urls
|
|
108
|
+
|
|
109
|
+
status = self.status.value
|
|
110
|
+
|
|
111
|
+
total_urls: Union[None, int]
|
|
112
|
+
total_urls = self.total_urls
|
|
113
|
+
|
|
114
|
+
sources: Union[None, dict[str, Any]]
|
|
115
|
+
if isinstance(self.sources, SitemapResponseSourcesType0):
|
|
116
|
+
sources = self.sources.to_dict()
|
|
117
|
+
else:
|
|
118
|
+
sources = self.sources
|
|
119
|
+
|
|
120
|
+
total_bytes: Union[None, int]
|
|
121
|
+
total_bytes = self.total_bytes
|
|
122
|
+
|
|
123
|
+
results_url: Union[None, str]
|
|
124
|
+
results_url = self.results_url
|
|
125
|
+
|
|
126
|
+
warnings: Union[None, list[str]]
|
|
127
|
+
if isinstance(self.warnings, list):
|
|
128
|
+
warnings = self.warnings
|
|
129
|
+
|
|
130
|
+
else:
|
|
131
|
+
warnings = self.warnings
|
|
132
|
+
|
|
133
|
+
error_code: Union[None, str]
|
|
134
|
+
error_code = self.error_code
|
|
135
|
+
|
|
136
|
+
error_message: Union[None, str]
|
|
137
|
+
error_message = self.error_message
|
|
138
|
+
|
|
139
|
+
compact = self.compact
|
|
140
|
+
|
|
141
|
+
process: Union[None, dict[str, Any]]
|
|
142
|
+
if isinstance(self.process, SitemapResponseProcessType0):
|
|
143
|
+
process = self.process.to_dict()
|
|
144
|
+
else:
|
|
145
|
+
process = self.process
|
|
146
|
+
|
|
147
|
+
metadata: Union[None, dict[str, Any]]
|
|
148
|
+
if isinstance(self.metadata, SitemapResponseMetadataType0):
|
|
149
|
+
metadata = self.metadata.to_dict()
|
|
150
|
+
else:
|
|
151
|
+
metadata = self.metadata
|
|
152
|
+
|
|
153
|
+
created_at = self.created_at.isoformat()
|
|
154
|
+
|
|
155
|
+
completed_at: Union[None, str]
|
|
156
|
+
if isinstance(self.completed_at, datetime.datetime):
|
|
157
|
+
completed_at = self.completed_at.isoformat()
|
|
158
|
+
else:
|
|
159
|
+
completed_at = self.completed_at
|
|
160
|
+
|
|
161
|
+
expires_at: Union[None, str]
|
|
162
|
+
if isinstance(self.expires_at, datetime.datetime):
|
|
163
|
+
expires_at = self.expires_at.isoformat()
|
|
164
|
+
else:
|
|
165
|
+
expires_at = self.expires_at
|
|
166
|
+
|
|
167
|
+
cache: Union[Unset, str] = UNSET
|
|
168
|
+
if not isinstance(self.cache, Unset):
|
|
169
|
+
cache = self.cache.value
|
|
170
|
+
|
|
171
|
+
cache_age_s: Union[None, Unset, int]
|
|
172
|
+
if isinstance(self.cache_age_s, Unset):
|
|
173
|
+
cache_age_s = UNSET
|
|
174
|
+
else:
|
|
175
|
+
cache_age_s = self.cache_age_s
|
|
176
|
+
|
|
177
|
+
field_dict: dict[str, Any] = {}
|
|
178
|
+
field_dict.update(self.additional_properties)
|
|
179
|
+
field_dict.update(
|
|
180
|
+
{
|
|
181
|
+
"id": id,
|
|
182
|
+
"url": url,
|
|
183
|
+
"strategy": strategy,
|
|
184
|
+
"max_depth": max_depth,
|
|
185
|
+
"max_urls": max_urls,
|
|
186
|
+
"status": status,
|
|
187
|
+
"total_urls": total_urls,
|
|
188
|
+
"sources": sources,
|
|
189
|
+
"total_bytes": total_bytes,
|
|
190
|
+
"results_url": results_url,
|
|
191
|
+
"warnings": warnings,
|
|
192
|
+
"error_code": error_code,
|
|
193
|
+
"error_message": error_message,
|
|
194
|
+
"compact": compact,
|
|
195
|
+
"process": process,
|
|
196
|
+
"metadata": metadata,
|
|
197
|
+
"created_at": created_at,
|
|
198
|
+
"completed_at": completed_at,
|
|
199
|
+
"expires_at": expires_at,
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
if cache is not UNSET:
|
|
203
|
+
field_dict["cache"] = cache
|
|
204
|
+
if cache_age_s is not UNSET:
|
|
205
|
+
field_dict["cache_age_s"] = cache_age_s
|
|
206
|
+
|
|
207
|
+
return field_dict
|
|
208
|
+
|
|
209
|
+
@classmethod
|
|
210
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
211
|
+
from ..models.sitemap_response_metadata_type_0 import (
|
|
212
|
+
SitemapResponseMetadataType0,
|
|
213
|
+
)
|
|
214
|
+
from ..models.sitemap_response_process_type_0 import SitemapResponseProcessType0
|
|
215
|
+
from ..models.sitemap_response_sources_type_0 import SitemapResponseSourcesType0
|
|
216
|
+
|
|
217
|
+
d = dict(src_dict)
|
|
218
|
+
id = d.pop("id")
|
|
219
|
+
|
|
220
|
+
url = d.pop("url")
|
|
221
|
+
|
|
222
|
+
strategy = d.pop("strategy")
|
|
223
|
+
|
|
224
|
+
max_depth = d.pop("max_depth")
|
|
225
|
+
|
|
226
|
+
max_urls = d.pop("max_urls")
|
|
227
|
+
|
|
228
|
+
status = SitemapResponseStatus(d.pop("status"))
|
|
229
|
+
|
|
230
|
+
def _parse_total_urls(data: object) -> Union[None, int]:
|
|
231
|
+
if data is None:
|
|
232
|
+
return data
|
|
233
|
+
return cast(Union[None, int], data)
|
|
234
|
+
|
|
235
|
+
total_urls = _parse_total_urls(d.pop("total_urls"))
|
|
236
|
+
|
|
237
|
+
def _parse_sources(data: object) -> Union["SitemapResponseSourcesType0", None]:
|
|
238
|
+
if data is None:
|
|
239
|
+
return data
|
|
240
|
+
try:
|
|
241
|
+
if not isinstance(data, dict):
|
|
242
|
+
raise TypeError()
|
|
243
|
+
sources_type_0 = SitemapResponseSourcesType0.from_dict(data)
|
|
244
|
+
|
|
245
|
+
return sources_type_0
|
|
246
|
+
except: # noqa: E722
|
|
247
|
+
pass
|
|
248
|
+
return cast(Union["SitemapResponseSourcesType0", None], data)
|
|
249
|
+
|
|
250
|
+
sources = _parse_sources(d.pop("sources"))
|
|
251
|
+
|
|
252
|
+
def _parse_total_bytes(data: object) -> Union[None, int]:
|
|
253
|
+
if data is None:
|
|
254
|
+
return data
|
|
255
|
+
return cast(Union[None, int], data)
|
|
256
|
+
|
|
257
|
+
total_bytes = _parse_total_bytes(d.pop("total_bytes"))
|
|
258
|
+
|
|
259
|
+
def _parse_results_url(data: object) -> Union[None, str]:
|
|
260
|
+
if data is None:
|
|
261
|
+
return data
|
|
262
|
+
return cast(Union[None, str], data)
|
|
263
|
+
|
|
264
|
+
results_url = _parse_results_url(d.pop("results_url"))
|
|
265
|
+
|
|
266
|
+
def _parse_warnings(data: object) -> Union[None, list[str]]:
|
|
267
|
+
if data is None:
|
|
268
|
+
return data
|
|
269
|
+
try:
|
|
270
|
+
if not isinstance(data, list):
|
|
271
|
+
raise TypeError()
|
|
272
|
+
warnings_type_0 = cast(list[str], data)
|
|
273
|
+
|
|
274
|
+
return warnings_type_0
|
|
275
|
+
except: # noqa: E722
|
|
276
|
+
pass
|
|
277
|
+
return cast(Union[None, list[str]], data)
|
|
278
|
+
|
|
279
|
+
warnings = _parse_warnings(d.pop("warnings"))
|
|
280
|
+
|
|
281
|
+
def _parse_error_code(data: object) -> Union[None, str]:
|
|
282
|
+
if data is None:
|
|
283
|
+
return data
|
|
284
|
+
return cast(Union[None, str], data)
|
|
285
|
+
|
|
286
|
+
error_code = _parse_error_code(d.pop("error_code"))
|
|
287
|
+
|
|
288
|
+
def _parse_error_message(data: object) -> Union[None, str]:
|
|
289
|
+
if data is None:
|
|
290
|
+
return data
|
|
291
|
+
return cast(Union[None, str], data)
|
|
292
|
+
|
|
293
|
+
error_message = _parse_error_message(d.pop("error_message"))
|
|
294
|
+
|
|
295
|
+
compact = d.pop("compact")
|
|
296
|
+
|
|
297
|
+
def _parse_process(data: object) -> Union["SitemapResponseProcessType0", None]:
|
|
298
|
+
if data is None:
|
|
299
|
+
return data
|
|
300
|
+
try:
|
|
301
|
+
if not isinstance(data, dict):
|
|
302
|
+
raise TypeError()
|
|
303
|
+
process_type_0 = SitemapResponseProcessType0.from_dict(data)
|
|
304
|
+
|
|
305
|
+
return process_type_0
|
|
306
|
+
except: # noqa: E722
|
|
307
|
+
pass
|
|
308
|
+
return cast(Union["SitemapResponseProcessType0", None], data)
|
|
309
|
+
|
|
310
|
+
process = _parse_process(d.pop("process"))
|
|
311
|
+
|
|
312
|
+
def _parse_metadata(
|
|
313
|
+
data: object,
|
|
314
|
+
) -> Union["SitemapResponseMetadataType0", None]:
|
|
315
|
+
if data is None:
|
|
316
|
+
return data
|
|
317
|
+
try:
|
|
318
|
+
if not isinstance(data, dict):
|
|
319
|
+
raise TypeError()
|
|
320
|
+
metadata_type_0 = SitemapResponseMetadataType0.from_dict(data)
|
|
321
|
+
|
|
322
|
+
return metadata_type_0
|
|
323
|
+
except: # noqa: E722
|
|
324
|
+
pass
|
|
325
|
+
return cast(Union["SitemapResponseMetadataType0", None], data)
|
|
326
|
+
|
|
327
|
+
metadata = _parse_metadata(d.pop("metadata"))
|
|
328
|
+
|
|
329
|
+
created_at = isoparse(d.pop("created_at"))
|
|
330
|
+
|
|
331
|
+
def _parse_completed_at(data: object) -> Union[None, datetime.datetime]:
|
|
332
|
+
if data is None:
|
|
333
|
+
return data
|
|
334
|
+
try:
|
|
335
|
+
if not isinstance(data, str):
|
|
336
|
+
raise TypeError()
|
|
337
|
+
completed_at_type_0 = isoparse(data)
|
|
338
|
+
|
|
339
|
+
return completed_at_type_0
|
|
340
|
+
except: # noqa: E722
|
|
341
|
+
pass
|
|
342
|
+
return cast(Union[None, datetime.datetime], data)
|
|
343
|
+
|
|
344
|
+
completed_at = _parse_completed_at(d.pop("completed_at"))
|
|
345
|
+
|
|
346
|
+
def _parse_expires_at(data: object) -> Union[None, datetime.datetime]:
|
|
347
|
+
if data is None:
|
|
348
|
+
return data
|
|
349
|
+
try:
|
|
350
|
+
if not isinstance(data, str):
|
|
351
|
+
raise TypeError()
|
|
352
|
+
expires_at_type_0 = isoparse(data)
|
|
353
|
+
|
|
354
|
+
return expires_at_type_0
|
|
355
|
+
except: # noqa: E722
|
|
356
|
+
pass
|
|
357
|
+
return cast(Union[None, datetime.datetime], data)
|
|
358
|
+
|
|
359
|
+
expires_at = _parse_expires_at(d.pop("expires_at"))
|
|
360
|
+
|
|
361
|
+
_cache = d.pop("cache", UNSET)
|
|
362
|
+
cache: Union[Unset, SitemapResponseCache]
|
|
363
|
+
if isinstance(_cache, Unset):
|
|
364
|
+
cache = UNSET
|
|
365
|
+
else:
|
|
366
|
+
cache = SitemapResponseCache(_cache)
|
|
367
|
+
|
|
368
|
+
def _parse_cache_age_s(data: object) -> Union[None, Unset, int]:
|
|
369
|
+
if data is None:
|
|
370
|
+
return data
|
|
371
|
+
if isinstance(data, Unset):
|
|
372
|
+
return data
|
|
373
|
+
return cast(Union[None, Unset, int], data)
|
|
374
|
+
|
|
375
|
+
cache_age_s = _parse_cache_age_s(d.pop("cache_age_s", UNSET))
|
|
376
|
+
|
|
377
|
+
sitemap_response = cls(
|
|
378
|
+
id=id,
|
|
379
|
+
url=url,
|
|
380
|
+
strategy=strategy,
|
|
381
|
+
max_depth=max_depth,
|
|
382
|
+
max_urls=max_urls,
|
|
383
|
+
status=status,
|
|
384
|
+
total_urls=total_urls,
|
|
385
|
+
sources=sources,
|
|
386
|
+
total_bytes=total_bytes,
|
|
387
|
+
results_url=results_url,
|
|
388
|
+
warnings=warnings,
|
|
389
|
+
error_code=error_code,
|
|
390
|
+
error_message=error_message,
|
|
391
|
+
compact=compact,
|
|
392
|
+
process=process,
|
|
393
|
+
metadata=metadata,
|
|
394
|
+
created_at=created_at,
|
|
395
|
+
completed_at=completed_at,
|
|
396
|
+
expires_at=expires_at,
|
|
397
|
+
cache=cache,
|
|
398
|
+
cache_age_s=cache_age_s,
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
sitemap_response.additional_properties = d
|
|
402
|
+
return sitemap_response
|
|
403
|
+
|
|
404
|
+
@property
|
|
405
|
+
def additional_keys(self) -> list[str]:
|
|
406
|
+
return list(self.additional_properties.keys())
|
|
407
|
+
|
|
408
|
+
def __getitem__(self, key: str) -> Any:
|
|
409
|
+
return self.additional_properties[key]
|
|
410
|
+
|
|
411
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
412
|
+
self.additional_properties[key] = value
|
|
413
|
+
|
|
414
|
+
def __delitem__(self, key: str) -> None:
|
|
415
|
+
del self.additional_properties[key]
|
|
416
|
+
|
|
417
|
+
def __contains__(self, key: str) -> bool:
|
|
418
|
+
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="SitemapResponseMetadataType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class SitemapResponseMetadataType0:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _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
|
+
sitemap_response_metadata_type_0 = cls()
|
|
26
|
+
|
|
27
|
+
sitemap_response_metadata_type_0.additional_properties = d
|
|
28
|
+
return sitemap_response_metadata_type_0
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> 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
|
|
@@ -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="SitemapResponseProcessType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class SitemapResponseProcessType0:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _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
|
+
sitemap_response_process_type_0 = cls()
|
|
26
|
+
|
|
27
|
+
sitemap_response_process_type_0.additional_properties = d
|
|
28
|
+
return sitemap_response_process_type_0
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> 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
|
|
@@ -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="SitemapResponseSourcesType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class SitemapResponseSourcesType0:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _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
|
+
sitemap_response_sources_type_0 = cls()
|
|
26
|
+
|
|
27
|
+
sitemap_response_sources_type_0.additional_properties = d
|
|
28
|
+
return sitemap_response_sources_type_0
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> 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
|
|
@@ -0,0 +1,67 @@
|
|
|
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="Viewport")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class Viewport:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
width (int):
|
|
15
|
+
height (int):
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
width: int
|
|
19
|
+
height: int
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
width = self.width
|
|
24
|
+
|
|
25
|
+
height = self.height
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"width": width,
|
|
32
|
+
"height": height,
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
return field_dict
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
40
|
+
d = dict(src_dict)
|
|
41
|
+
width = d.pop("width")
|
|
42
|
+
|
|
43
|
+
height = d.pop("height")
|
|
44
|
+
|
|
45
|
+
viewport = cls(
|
|
46
|
+
width=width,
|
|
47
|
+
height=height,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
viewport.additional_properties = d
|
|
51
|
+
return viewport
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def additional_keys(self) -> list[str]:
|
|
55
|
+
return list(self.additional_properties.keys())
|
|
56
|
+
|
|
57
|
+
def __getitem__(self, key: str) -> Any:
|
|
58
|
+
return self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
61
|
+
self.additional_properties[key] = value
|
|
62
|
+
|
|
63
|
+
def __delitem__(self, key: str) -> None:
|
|
64
|
+
del self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __contains__(self, key: str) -> bool:
|
|
67
|
+
return key in self.additional_properties
|