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,380 @@
|
|
|
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
|
+
from attrs import field as _attrs_field
|
|
12
|
+
|
|
13
|
+
from ..models.create_bulk_body_items_item_device import CreateBulkBodyItemsItemDevice
|
|
14
|
+
from ..models.create_bulk_body_items_item_formats_item import (
|
|
15
|
+
CreateBulkBodyItemsItemFormatsItem,
|
|
16
|
+
)
|
|
17
|
+
from ..models.create_bulk_body_items_item_scenario import (
|
|
18
|
+
CreateBulkBodyItemsItemScenario,
|
|
19
|
+
)
|
|
20
|
+
from ..models.create_bulk_body_items_item_type import CreateBulkBodyItemsItemType
|
|
21
|
+
from ..models.create_bulk_body_items_item_wait_until import (
|
|
22
|
+
CreateBulkBodyItemsItemWaitUntil,
|
|
23
|
+
)
|
|
24
|
+
from ..types import UNSET, Unset
|
|
25
|
+
|
|
26
|
+
if TYPE_CHECKING:
|
|
27
|
+
from ..models.create_bulk_body_items_item_viewport_type_0 import (
|
|
28
|
+
CreateBulkBodyItemsItemViewportType0,
|
|
29
|
+
)
|
|
30
|
+
from ..models.metadata import Metadata
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
T = TypeVar("T", bound="CreateBulkBodyItemsItem")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@_attrs_define
|
|
37
|
+
class CreateBulkBodyItemsItem:
|
|
38
|
+
"""
|
|
39
|
+
Attributes:
|
|
40
|
+
url (str):
|
|
41
|
+
type_ (Union[Unset, CreateBulkBodyItemsItemType]): Default: CreateBulkBodyItemsItemType.SCREENSHOT.
|
|
42
|
+
device (Union[Unset, CreateBulkBodyItemsItemDevice]):
|
|
43
|
+
format_ (Union[Unset, str]): Image format for screenshot entries (e.g. jpeg, png).
|
|
44
|
+
quality (Union[Unset, int]):
|
|
45
|
+
full_page (Union[Unset, bool]):
|
|
46
|
+
block_ads (Union[Unset, bool]):
|
|
47
|
+
block_cookie_banners (Union[Unset, bool]):
|
|
48
|
+
scroll (Union[Unset, bool]):
|
|
49
|
+
include_html (Union[Unset, bool]):
|
|
50
|
+
country (Union[None, Unset, str]): ISO 3166-1 alpha-2. `null` is coerced to `US`.
|
|
51
|
+
language (Union[None, Unset, str]):
|
|
52
|
+
dark_mode (Union[Unset, bool]):
|
|
53
|
+
formats (Union[Unset, list[CreateBulkBodyItemsItemFormatsItem]]): Scrape output formats (scrape entries).
|
|
54
|
+
wait_until (Union[Unset, CreateBulkBodyItemsItemWaitUntil]):
|
|
55
|
+
wait_for_selector (Union[None, Unset, str]):
|
|
56
|
+
delay_ms (Union[Unset, int]):
|
|
57
|
+
viewport (Union['CreateBulkBodyItemsItemViewportType0', None, Unset]):
|
|
58
|
+
duration (Union[Unset, int]): Recording duration (seconds). Accepted but inert while recordings are deactivated.
|
|
59
|
+
scenario (Union[Unset, CreateBulkBodyItemsItemScenario]): Recording scenario. Accepted but inert while
|
|
60
|
+
recordings are deactivated.
|
|
61
|
+
metadata (Union[Unset, Metadata]): Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
url: str
|
|
65
|
+
type_: Union[Unset, CreateBulkBodyItemsItemType] = (
|
|
66
|
+
CreateBulkBodyItemsItemType.SCREENSHOT
|
|
67
|
+
)
|
|
68
|
+
device: Union[Unset, CreateBulkBodyItemsItemDevice] = UNSET
|
|
69
|
+
format_: Union[Unset, str] = UNSET
|
|
70
|
+
quality: Union[Unset, int] = UNSET
|
|
71
|
+
full_page: Union[Unset, bool] = UNSET
|
|
72
|
+
block_ads: Union[Unset, bool] = UNSET
|
|
73
|
+
block_cookie_banners: Union[Unset, bool] = UNSET
|
|
74
|
+
scroll: Union[Unset, bool] = UNSET
|
|
75
|
+
include_html: Union[Unset, bool] = UNSET
|
|
76
|
+
country: Union[None, Unset, str] = UNSET
|
|
77
|
+
language: Union[None, Unset, str] = UNSET
|
|
78
|
+
dark_mode: Union[Unset, bool] = UNSET
|
|
79
|
+
formats: Union[Unset, list[CreateBulkBodyItemsItemFormatsItem]] = UNSET
|
|
80
|
+
wait_until: Union[Unset, CreateBulkBodyItemsItemWaitUntil] = UNSET
|
|
81
|
+
wait_for_selector: Union[None, Unset, str] = UNSET
|
|
82
|
+
delay_ms: Union[Unset, int] = UNSET
|
|
83
|
+
viewport: Union["CreateBulkBodyItemsItemViewportType0", None, Unset] = UNSET
|
|
84
|
+
duration: Union[Unset, int] = UNSET
|
|
85
|
+
scenario: Union[Unset, CreateBulkBodyItemsItemScenario] = UNSET
|
|
86
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
|
87
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
88
|
+
|
|
89
|
+
def to_dict(self) -> dict[str, Any]:
|
|
90
|
+
from ..models.create_bulk_body_items_item_viewport_type_0 import (
|
|
91
|
+
CreateBulkBodyItemsItemViewportType0,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
url = self.url
|
|
95
|
+
|
|
96
|
+
type_: Union[Unset, str] = UNSET
|
|
97
|
+
if not isinstance(self.type_, Unset):
|
|
98
|
+
type_ = self.type_.value
|
|
99
|
+
|
|
100
|
+
device: Union[Unset, str] = UNSET
|
|
101
|
+
if not isinstance(self.device, Unset):
|
|
102
|
+
device = self.device.value
|
|
103
|
+
|
|
104
|
+
format_ = self.format_
|
|
105
|
+
|
|
106
|
+
quality = self.quality
|
|
107
|
+
|
|
108
|
+
full_page = self.full_page
|
|
109
|
+
|
|
110
|
+
block_ads = self.block_ads
|
|
111
|
+
|
|
112
|
+
block_cookie_banners = self.block_cookie_banners
|
|
113
|
+
|
|
114
|
+
scroll = self.scroll
|
|
115
|
+
|
|
116
|
+
include_html = self.include_html
|
|
117
|
+
|
|
118
|
+
country: Union[None, Unset, str]
|
|
119
|
+
if isinstance(self.country, Unset):
|
|
120
|
+
country = UNSET
|
|
121
|
+
else:
|
|
122
|
+
country = self.country
|
|
123
|
+
|
|
124
|
+
language: Union[None, Unset, str]
|
|
125
|
+
if isinstance(self.language, Unset):
|
|
126
|
+
language = UNSET
|
|
127
|
+
else:
|
|
128
|
+
language = self.language
|
|
129
|
+
|
|
130
|
+
dark_mode = self.dark_mode
|
|
131
|
+
|
|
132
|
+
formats: Union[Unset, list[str]] = UNSET
|
|
133
|
+
if not isinstance(self.formats, Unset):
|
|
134
|
+
formats = []
|
|
135
|
+
for formats_item_data in self.formats:
|
|
136
|
+
formats_item = formats_item_data.value
|
|
137
|
+
formats.append(formats_item)
|
|
138
|
+
|
|
139
|
+
wait_until: Union[Unset, str] = UNSET
|
|
140
|
+
if not isinstance(self.wait_until, Unset):
|
|
141
|
+
wait_until = self.wait_until.value
|
|
142
|
+
|
|
143
|
+
wait_for_selector: Union[None, Unset, str]
|
|
144
|
+
if isinstance(self.wait_for_selector, Unset):
|
|
145
|
+
wait_for_selector = UNSET
|
|
146
|
+
else:
|
|
147
|
+
wait_for_selector = self.wait_for_selector
|
|
148
|
+
|
|
149
|
+
delay_ms = self.delay_ms
|
|
150
|
+
|
|
151
|
+
viewport: Union[None, Unset, dict[str, Any]]
|
|
152
|
+
if isinstance(self.viewport, Unset):
|
|
153
|
+
viewport = UNSET
|
|
154
|
+
elif isinstance(self.viewport, CreateBulkBodyItemsItemViewportType0):
|
|
155
|
+
viewport = self.viewport.to_dict()
|
|
156
|
+
else:
|
|
157
|
+
viewport = self.viewport
|
|
158
|
+
|
|
159
|
+
duration = self.duration
|
|
160
|
+
|
|
161
|
+
scenario: Union[Unset, str] = UNSET
|
|
162
|
+
if not isinstance(self.scenario, Unset):
|
|
163
|
+
scenario = self.scenario.value
|
|
164
|
+
|
|
165
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
|
166
|
+
if not isinstance(self.metadata, Unset):
|
|
167
|
+
metadata = self.metadata.to_dict()
|
|
168
|
+
|
|
169
|
+
field_dict: dict[str, Any] = {}
|
|
170
|
+
field_dict.update(self.additional_properties)
|
|
171
|
+
field_dict.update(
|
|
172
|
+
{
|
|
173
|
+
"url": url,
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
if type_ is not UNSET:
|
|
177
|
+
field_dict["type"] = type_
|
|
178
|
+
if device is not UNSET:
|
|
179
|
+
field_dict["device"] = device
|
|
180
|
+
if format_ is not UNSET:
|
|
181
|
+
field_dict["format"] = format_
|
|
182
|
+
if quality is not UNSET:
|
|
183
|
+
field_dict["quality"] = quality
|
|
184
|
+
if full_page is not UNSET:
|
|
185
|
+
field_dict["full_page"] = full_page
|
|
186
|
+
if block_ads is not UNSET:
|
|
187
|
+
field_dict["block_ads"] = block_ads
|
|
188
|
+
if block_cookie_banners is not UNSET:
|
|
189
|
+
field_dict["block_cookie_banners"] = block_cookie_banners
|
|
190
|
+
if scroll is not UNSET:
|
|
191
|
+
field_dict["scroll"] = scroll
|
|
192
|
+
if include_html is not UNSET:
|
|
193
|
+
field_dict["include_html"] = include_html
|
|
194
|
+
if country is not UNSET:
|
|
195
|
+
field_dict["country"] = country
|
|
196
|
+
if language is not UNSET:
|
|
197
|
+
field_dict["language"] = language
|
|
198
|
+
if dark_mode is not UNSET:
|
|
199
|
+
field_dict["dark_mode"] = dark_mode
|
|
200
|
+
if formats is not UNSET:
|
|
201
|
+
field_dict["formats"] = formats
|
|
202
|
+
if wait_until is not UNSET:
|
|
203
|
+
field_dict["wait_until"] = wait_until
|
|
204
|
+
if wait_for_selector is not UNSET:
|
|
205
|
+
field_dict["wait_for_selector"] = wait_for_selector
|
|
206
|
+
if delay_ms is not UNSET:
|
|
207
|
+
field_dict["delay_ms"] = delay_ms
|
|
208
|
+
if viewport is not UNSET:
|
|
209
|
+
field_dict["viewport"] = viewport
|
|
210
|
+
if duration is not UNSET:
|
|
211
|
+
field_dict["duration"] = duration
|
|
212
|
+
if scenario is not UNSET:
|
|
213
|
+
field_dict["scenario"] = scenario
|
|
214
|
+
if metadata is not UNSET:
|
|
215
|
+
field_dict["metadata"] = metadata
|
|
216
|
+
|
|
217
|
+
return field_dict
|
|
218
|
+
|
|
219
|
+
@classmethod
|
|
220
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
221
|
+
from ..models.create_bulk_body_items_item_viewport_type_0 import (
|
|
222
|
+
CreateBulkBodyItemsItemViewportType0,
|
|
223
|
+
)
|
|
224
|
+
from ..models.metadata import Metadata
|
|
225
|
+
|
|
226
|
+
d = dict(src_dict)
|
|
227
|
+
url = d.pop("url")
|
|
228
|
+
|
|
229
|
+
_type_ = d.pop("type", UNSET)
|
|
230
|
+
type_: Union[Unset, CreateBulkBodyItemsItemType]
|
|
231
|
+
if isinstance(_type_, Unset):
|
|
232
|
+
type_ = UNSET
|
|
233
|
+
else:
|
|
234
|
+
type_ = CreateBulkBodyItemsItemType(_type_)
|
|
235
|
+
|
|
236
|
+
_device = d.pop("device", UNSET)
|
|
237
|
+
device: Union[Unset, CreateBulkBodyItemsItemDevice]
|
|
238
|
+
if isinstance(_device, Unset):
|
|
239
|
+
device = UNSET
|
|
240
|
+
else:
|
|
241
|
+
device = CreateBulkBodyItemsItemDevice(_device)
|
|
242
|
+
|
|
243
|
+
format_ = d.pop("format", UNSET)
|
|
244
|
+
|
|
245
|
+
quality = d.pop("quality", UNSET)
|
|
246
|
+
|
|
247
|
+
full_page = d.pop("full_page", UNSET)
|
|
248
|
+
|
|
249
|
+
block_ads = d.pop("block_ads", UNSET)
|
|
250
|
+
|
|
251
|
+
block_cookie_banners = d.pop("block_cookie_banners", UNSET)
|
|
252
|
+
|
|
253
|
+
scroll = d.pop("scroll", UNSET)
|
|
254
|
+
|
|
255
|
+
include_html = d.pop("include_html", UNSET)
|
|
256
|
+
|
|
257
|
+
def _parse_country(data: object) -> Union[None, Unset, str]:
|
|
258
|
+
if data is None:
|
|
259
|
+
return data
|
|
260
|
+
if isinstance(data, Unset):
|
|
261
|
+
return data
|
|
262
|
+
return cast(Union[None, Unset, str], data)
|
|
263
|
+
|
|
264
|
+
country = _parse_country(d.pop("country", UNSET))
|
|
265
|
+
|
|
266
|
+
def _parse_language(data: object) -> Union[None, Unset, str]:
|
|
267
|
+
if data is None:
|
|
268
|
+
return data
|
|
269
|
+
if isinstance(data, Unset):
|
|
270
|
+
return data
|
|
271
|
+
return cast(Union[None, Unset, str], data)
|
|
272
|
+
|
|
273
|
+
language = _parse_language(d.pop("language", UNSET))
|
|
274
|
+
|
|
275
|
+
dark_mode = d.pop("dark_mode", UNSET)
|
|
276
|
+
|
|
277
|
+
formats = []
|
|
278
|
+
_formats = d.pop("formats", UNSET)
|
|
279
|
+
for formats_item_data in _formats or []:
|
|
280
|
+
formats_item = CreateBulkBodyItemsItemFormatsItem(formats_item_data)
|
|
281
|
+
|
|
282
|
+
formats.append(formats_item)
|
|
283
|
+
|
|
284
|
+
_wait_until = d.pop("wait_until", UNSET)
|
|
285
|
+
wait_until: Union[Unset, CreateBulkBodyItemsItemWaitUntil]
|
|
286
|
+
if isinstance(_wait_until, Unset):
|
|
287
|
+
wait_until = UNSET
|
|
288
|
+
else:
|
|
289
|
+
wait_until = CreateBulkBodyItemsItemWaitUntil(_wait_until)
|
|
290
|
+
|
|
291
|
+
def _parse_wait_for_selector(data: object) -> Union[None, Unset, str]:
|
|
292
|
+
if data is None:
|
|
293
|
+
return data
|
|
294
|
+
if isinstance(data, Unset):
|
|
295
|
+
return data
|
|
296
|
+
return cast(Union[None, Unset, str], data)
|
|
297
|
+
|
|
298
|
+
wait_for_selector = _parse_wait_for_selector(d.pop("wait_for_selector", UNSET))
|
|
299
|
+
|
|
300
|
+
delay_ms = d.pop("delay_ms", UNSET)
|
|
301
|
+
|
|
302
|
+
def _parse_viewport(
|
|
303
|
+
data: object,
|
|
304
|
+
) -> Union["CreateBulkBodyItemsItemViewportType0", None, Unset]:
|
|
305
|
+
if data is None:
|
|
306
|
+
return data
|
|
307
|
+
if isinstance(data, Unset):
|
|
308
|
+
return data
|
|
309
|
+
try:
|
|
310
|
+
if not isinstance(data, dict):
|
|
311
|
+
raise TypeError()
|
|
312
|
+
viewport_type_0 = CreateBulkBodyItemsItemViewportType0.from_dict(data)
|
|
313
|
+
|
|
314
|
+
return viewport_type_0
|
|
315
|
+
except: # noqa: E722
|
|
316
|
+
pass
|
|
317
|
+
return cast(
|
|
318
|
+
Union["CreateBulkBodyItemsItemViewportType0", None, Unset], data
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
viewport = _parse_viewport(d.pop("viewport", UNSET))
|
|
322
|
+
|
|
323
|
+
duration = d.pop("duration", UNSET)
|
|
324
|
+
|
|
325
|
+
_scenario = d.pop("scenario", UNSET)
|
|
326
|
+
scenario: Union[Unset, CreateBulkBodyItemsItemScenario]
|
|
327
|
+
if isinstance(_scenario, Unset):
|
|
328
|
+
scenario = UNSET
|
|
329
|
+
else:
|
|
330
|
+
scenario = CreateBulkBodyItemsItemScenario(_scenario)
|
|
331
|
+
|
|
332
|
+
_metadata = d.pop("metadata", UNSET)
|
|
333
|
+
metadata: Union[Unset, Metadata]
|
|
334
|
+
if isinstance(_metadata, Unset):
|
|
335
|
+
metadata = UNSET
|
|
336
|
+
else:
|
|
337
|
+
metadata = Metadata.from_dict(_metadata)
|
|
338
|
+
|
|
339
|
+
create_bulk_body_items_item = cls(
|
|
340
|
+
url=url,
|
|
341
|
+
type_=type_,
|
|
342
|
+
device=device,
|
|
343
|
+
format_=format_,
|
|
344
|
+
quality=quality,
|
|
345
|
+
full_page=full_page,
|
|
346
|
+
block_ads=block_ads,
|
|
347
|
+
block_cookie_banners=block_cookie_banners,
|
|
348
|
+
scroll=scroll,
|
|
349
|
+
include_html=include_html,
|
|
350
|
+
country=country,
|
|
351
|
+
language=language,
|
|
352
|
+
dark_mode=dark_mode,
|
|
353
|
+
formats=formats,
|
|
354
|
+
wait_until=wait_until,
|
|
355
|
+
wait_for_selector=wait_for_selector,
|
|
356
|
+
delay_ms=delay_ms,
|
|
357
|
+
viewport=viewport,
|
|
358
|
+
duration=duration,
|
|
359
|
+
scenario=scenario,
|
|
360
|
+
metadata=metadata,
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
create_bulk_body_items_item.additional_properties = d
|
|
364
|
+
return create_bulk_body_items_item
|
|
365
|
+
|
|
366
|
+
@property
|
|
367
|
+
def additional_keys(self) -> list[str]:
|
|
368
|
+
return list(self.additional_properties.keys())
|
|
369
|
+
|
|
370
|
+
def __getitem__(self, key: str) -> Any:
|
|
371
|
+
return self.additional_properties[key]
|
|
372
|
+
|
|
373
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
374
|
+
self.additional_properties[key] = value
|
|
375
|
+
|
|
376
|
+
def __delitem__(self, key: str) -> None:
|
|
377
|
+
del self.additional_properties[key]
|
|
378
|
+
|
|
379
|
+
def __contains__(self, key: str) -> bool:
|
|
380
|
+
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="CreateBulkBodyItemsItemViewportType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class CreateBulkBodyItemsItemViewportType0:
|
|
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
|
+
create_bulk_body_items_item_viewport_type_0 = cls(
|
|
46
|
+
width=width,
|
|
47
|
+
height=height,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
create_bulk_body_items_item_viewport_type_0.additional_properties = d
|
|
51
|
+
return create_bulk_body_items_item_viewport_type_0
|
|
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
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import (
|
|
4
|
+
Any,
|
|
5
|
+
TypeVar,
|
|
6
|
+
Union,
|
|
7
|
+
cast,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from attrs import define as _attrs_define
|
|
11
|
+
from attrs import field as _attrs_field
|
|
12
|
+
from dateutil.parser import isoparse
|
|
13
|
+
|
|
14
|
+
from ..models.create_bulk_response_202_status import CreateBulkResponse202Status
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="CreateBulkResponse202")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class CreateBulkResponse202:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
id (str): Example: bulk_01j9abc123.
|
|
24
|
+
status (CreateBulkResponse202Status):
|
|
25
|
+
total (int):
|
|
26
|
+
completed (int):
|
|
27
|
+
failed (int):
|
|
28
|
+
created_at (datetime.datetime):
|
|
29
|
+
completed_at (Union[None, datetime.datetime]):
|
|
30
|
+
total_credits_charged (int):
|
|
31
|
+
estimated_credits (Union[None, int]): Estimated credits at submission time. Null in GET responses.
|
|
32
|
+
webhook_url (str): Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason
|
|
33
|
+
scheme_unsupported)
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
id: str
|
|
37
|
+
status: CreateBulkResponse202Status
|
|
38
|
+
total: int
|
|
39
|
+
completed: int
|
|
40
|
+
failed: int
|
|
41
|
+
created_at: datetime.datetime
|
|
42
|
+
completed_at: Union[None, datetime.datetime]
|
|
43
|
+
total_credits_charged: int
|
|
44
|
+
estimated_credits: Union[None, int]
|
|
45
|
+
webhook_url: str
|
|
46
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
47
|
+
|
|
48
|
+
def to_dict(self) -> dict[str, Any]:
|
|
49
|
+
id = self.id
|
|
50
|
+
|
|
51
|
+
status = self.status.value
|
|
52
|
+
|
|
53
|
+
total = self.total
|
|
54
|
+
|
|
55
|
+
completed = self.completed
|
|
56
|
+
|
|
57
|
+
failed = self.failed
|
|
58
|
+
|
|
59
|
+
created_at = self.created_at.isoformat()
|
|
60
|
+
|
|
61
|
+
completed_at: Union[None, str]
|
|
62
|
+
if isinstance(self.completed_at, datetime.datetime):
|
|
63
|
+
completed_at = self.completed_at.isoformat()
|
|
64
|
+
else:
|
|
65
|
+
completed_at = self.completed_at
|
|
66
|
+
|
|
67
|
+
total_credits_charged = self.total_credits_charged
|
|
68
|
+
|
|
69
|
+
estimated_credits: Union[None, int]
|
|
70
|
+
estimated_credits = self.estimated_credits
|
|
71
|
+
|
|
72
|
+
webhook_url = self.webhook_url
|
|
73
|
+
|
|
74
|
+
field_dict: dict[str, Any] = {}
|
|
75
|
+
field_dict.update(self.additional_properties)
|
|
76
|
+
field_dict.update(
|
|
77
|
+
{
|
|
78
|
+
"id": id,
|
|
79
|
+
"status": status,
|
|
80
|
+
"total": total,
|
|
81
|
+
"completed": completed,
|
|
82
|
+
"failed": failed,
|
|
83
|
+
"created_at": created_at,
|
|
84
|
+
"completed_at": completed_at,
|
|
85
|
+
"total_credits_charged": total_credits_charged,
|
|
86
|
+
"estimated_credits": estimated_credits,
|
|
87
|
+
"webhook_url": webhook_url,
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return field_dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
95
|
+
d = dict(src_dict)
|
|
96
|
+
id = d.pop("id")
|
|
97
|
+
|
|
98
|
+
status = CreateBulkResponse202Status(d.pop("status"))
|
|
99
|
+
|
|
100
|
+
total = d.pop("total")
|
|
101
|
+
|
|
102
|
+
completed = d.pop("completed")
|
|
103
|
+
|
|
104
|
+
failed = d.pop("failed")
|
|
105
|
+
|
|
106
|
+
created_at = isoparse(d.pop("created_at"))
|
|
107
|
+
|
|
108
|
+
def _parse_completed_at(data: object) -> Union[None, datetime.datetime]:
|
|
109
|
+
if data is None:
|
|
110
|
+
return data
|
|
111
|
+
try:
|
|
112
|
+
if not isinstance(data, str):
|
|
113
|
+
raise TypeError()
|
|
114
|
+
completed_at_type_0 = isoparse(data)
|
|
115
|
+
|
|
116
|
+
return completed_at_type_0
|
|
117
|
+
except: # noqa: E722
|
|
118
|
+
pass
|
|
119
|
+
return cast(Union[None, datetime.datetime], data)
|
|
120
|
+
|
|
121
|
+
completed_at = _parse_completed_at(d.pop("completed_at"))
|
|
122
|
+
|
|
123
|
+
total_credits_charged = d.pop("total_credits_charged")
|
|
124
|
+
|
|
125
|
+
def _parse_estimated_credits(data: object) -> Union[None, int]:
|
|
126
|
+
if data is None:
|
|
127
|
+
return data
|
|
128
|
+
return cast(Union[None, int], data)
|
|
129
|
+
|
|
130
|
+
estimated_credits = _parse_estimated_credits(d.pop("estimated_credits"))
|
|
131
|
+
|
|
132
|
+
webhook_url = d.pop("webhook_url")
|
|
133
|
+
|
|
134
|
+
create_bulk_response_202 = cls(
|
|
135
|
+
id=id,
|
|
136
|
+
status=status,
|
|
137
|
+
total=total,
|
|
138
|
+
completed=completed,
|
|
139
|
+
failed=failed,
|
|
140
|
+
created_at=created_at,
|
|
141
|
+
completed_at=completed_at,
|
|
142
|
+
total_credits_charged=total_credits_charged,
|
|
143
|
+
estimated_credits=estimated_credits,
|
|
144
|
+
webhook_url=webhook_url,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
create_bulk_response_202.additional_properties = d
|
|
148
|
+
return create_bulk_response_202
|
|
149
|
+
|
|
150
|
+
@property
|
|
151
|
+
def additional_keys(self) -> list[str]:
|
|
152
|
+
return list(self.additional_properties.keys())
|
|
153
|
+
|
|
154
|
+
def __getitem__(self, key: str) -> Any:
|
|
155
|
+
return self.additional_properties[key]
|
|
156
|
+
|
|
157
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
158
|
+
self.additional_properties[key] = value
|
|
159
|
+
|
|
160
|
+
def __delitem__(self, key: str) -> None:
|
|
161
|
+
del self.additional_properties[key]
|
|
162
|
+
|
|
163
|
+
def __contains__(self, key: str) -> bool:
|
|
164
|
+
return key in self.additional_properties
|