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,164 @@
|
|
|
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
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.account_session_response_notifications import (
|
|
17
|
+
AccountSessionResponseNotifications,
|
|
18
|
+
)
|
|
19
|
+
from ..models.account_session_response_plan import AccountSessionResponsePlan
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="AccountSessionResponse")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class AccountSessionResponse:
|
|
27
|
+
"""Minimal account shape returned by GET /v1/account when authenticated with a Clerk session JWT. Omits api_key,
|
|
28
|
+
subscription, and auto_topup.
|
|
29
|
+
|
|
30
|
+
Attributes:
|
|
31
|
+
id (str):
|
|
32
|
+
email (str):
|
|
33
|
+
name (Union[None, str]):
|
|
34
|
+
plan (AccountSessionResponsePlan):
|
|
35
|
+
owner_user_id (Union[None, str]): Prefixed user id of the calling admin user. Null for non-admin members.
|
|
36
|
+
notifications (AccountSessionResponseNotifications): Account notification preferences (bandwidth alerts).
|
|
37
|
+
terms_version (str): The Terms of Service version this account has accepted. An empty string means the account
|
|
38
|
+
predates clickwrap acceptance (issue #1025). The dashboard diffs this against the published current version to
|
|
39
|
+
decide whether to show the re-acceptance prompt.
|
|
40
|
+
created_at (datetime.datetime):
|
|
41
|
+
has_activity (bool): True once the account has ever recorded billable activity (any successful
|
|
42
|
+
scrape/screenshot/fetch/… request, regardless of whether it was authenticated with a Clerk session or an API
|
|
43
|
+
key). Powers the dashboard onboarding gate — the app shows the guided onboarding flow until this is true, then
|
|
44
|
+
the dashboard.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
id: str
|
|
48
|
+
email: str
|
|
49
|
+
name: Union[None, str]
|
|
50
|
+
plan: "AccountSessionResponsePlan"
|
|
51
|
+
owner_user_id: Union[None, str]
|
|
52
|
+
notifications: "AccountSessionResponseNotifications"
|
|
53
|
+
terms_version: str
|
|
54
|
+
created_at: datetime.datetime
|
|
55
|
+
has_activity: bool
|
|
56
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> dict[str, Any]:
|
|
59
|
+
id = self.id
|
|
60
|
+
|
|
61
|
+
email = self.email
|
|
62
|
+
|
|
63
|
+
name: Union[None, str]
|
|
64
|
+
name = self.name
|
|
65
|
+
|
|
66
|
+
plan = self.plan.to_dict()
|
|
67
|
+
|
|
68
|
+
owner_user_id: Union[None, str]
|
|
69
|
+
owner_user_id = self.owner_user_id
|
|
70
|
+
|
|
71
|
+
notifications = self.notifications.to_dict()
|
|
72
|
+
|
|
73
|
+
terms_version = self.terms_version
|
|
74
|
+
|
|
75
|
+
created_at = self.created_at.isoformat()
|
|
76
|
+
|
|
77
|
+
has_activity = self.has_activity
|
|
78
|
+
|
|
79
|
+
field_dict: dict[str, Any] = {}
|
|
80
|
+
field_dict.update(self.additional_properties)
|
|
81
|
+
field_dict.update(
|
|
82
|
+
{
|
|
83
|
+
"id": id,
|
|
84
|
+
"email": email,
|
|
85
|
+
"name": name,
|
|
86
|
+
"plan": plan,
|
|
87
|
+
"owner_user_id": owner_user_id,
|
|
88
|
+
"notifications": notifications,
|
|
89
|
+
"terms_version": terms_version,
|
|
90
|
+
"created_at": created_at,
|
|
91
|
+
"has_activity": has_activity,
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return field_dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
99
|
+
from ..models.account_session_response_notifications import (
|
|
100
|
+
AccountSessionResponseNotifications,
|
|
101
|
+
)
|
|
102
|
+
from ..models.account_session_response_plan import AccountSessionResponsePlan
|
|
103
|
+
|
|
104
|
+
d = dict(src_dict)
|
|
105
|
+
id = d.pop("id")
|
|
106
|
+
|
|
107
|
+
email = d.pop("email")
|
|
108
|
+
|
|
109
|
+
def _parse_name(data: object) -> Union[None, str]:
|
|
110
|
+
if data is None:
|
|
111
|
+
return data
|
|
112
|
+
return cast(Union[None, str], data)
|
|
113
|
+
|
|
114
|
+
name = _parse_name(d.pop("name"))
|
|
115
|
+
|
|
116
|
+
plan = AccountSessionResponsePlan.from_dict(d.pop("plan"))
|
|
117
|
+
|
|
118
|
+
def _parse_owner_user_id(data: object) -> Union[None, str]:
|
|
119
|
+
if data is None:
|
|
120
|
+
return data
|
|
121
|
+
return cast(Union[None, str], data)
|
|
122
|
+
|
|
123
|
+
owner_user_id = _parse_owner_user_id(d.pop("owner_user_id"))
|
|
124
|
+
|
|
125
|
+
notifications = AccountSessionResponseNotifications.from_dict(
|
|
126
|
+
d.pop("notifications")
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
terms_version = d.pop("terms_version")
|
|
130
|
+
|
|
131
|
+
created_at = isoparse(d.pop("created_at"))
|
|
132
|
+
|
|
133
|
+
has_activity = d.pop("has_activity")
|
|
134
|
+
|
|
135
|
+
account_session_response = cls(
|
|
136
|
+
id=id,
|
|
137
|
+
email=email,
|
|
138
|
+
name=name,
|
|
139
|
+
plan=plan,
|
|
140
|
+
owner_user_id=owner_user_id,
|
|
141
|
+
notifications=notifications,
|
|
142
|
+
terms_version=terms_version,
|
|
143
|
+
created_at=created_at,
|
|
144
|
+
has_activity=has_activity,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
account_session_response.additional_properties = d
|
|
148
|
+
return account_session_response
|
|
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
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
T = TypeVar("T", bound="AccountSessionResponseNotifications")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@_attrs_define
|
|
10
|
+
class AccountSessionResponseNotifications:
|
|
11
|
+
"""Account notification preferences (bandwidth alerts).
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
bandwidth_80_enabled (bool): Whether the account admin wants an email when bandwidth reaches 80 % of the plan
|
|
15
|
+
limit.
|
|
16
|
+
bandwidth_100_enabled (bool): Whether the account admin wants an email when bandwidth reaches 100 % of the plan
|
|
17
|
+
limit.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
bandwidth_80_enabled: bool
|
|
21
|
+
bandwidth_100_enabled: bool
|
|
22
|
+
|
|
23
|
+
def to_dict(self) -> dict[str, Any]:
|
|
24
|
+
bandwidth_80_enabled = self.bandwidth_80_enabled
|
|
25
|
+
|
|
26
|
+
bandwidth_100_enabled = self.bandwidth_100_enabled
|
|
27
|
+
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
|
|
30
|
+
field_dict.update(
|
|
31
|
+
{
|
|
32
|
+
"bandwidth_80_enabled": bandwidth_80_enabled,
|
|
33
|
+
"bandwidth_100_enabled": bandwidth_100_enabled,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
bandwidth_80_enabled = d.pop("bandwidth_80_enabled")
|
|
43
|
+
|
|
44
|
+
bandwidth_100_enabled = d.pop("bandwidth_100_enabled")
|
|
45
|
+
|
|
46
|
+
account_session_response_notifications = cls(
|
|
47
|
+
bandwidth_80_enabled=bandwidth_80_enabled,
|
|
48
|
+
bandwidth_100_enabled=bandwidth_100_enabled,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return account_session_response_notifications
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import (
|
|
3
|
+
Any,
|
|
4
|
+
TypeVar,
|
|
5
|
+
Union,
|
|
6
|
+
cast,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
from attrs import define as _attrs_define
|
|
10
|
+
from attrs import field as _attrs_field
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="AccountSessionResponsePlan")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class AccountSessionResponsePlan:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
id (str):
|
|
20
|
+
slug (str):
|
|
21
|
+
name (str):
|
|
22
|
+
included_screenshots (int):
|
|
23
|
+
has_overage (bool):
|
|
24
|
+
overage_price_cents (Union[None, int]):
|
|
25
|
+
max_concurrency (int):
|
|
26
|
+
rate_limit_per_sec (int):
|
|
27
|
+
max_bulk_size (int):
|
|
28
|
+
max_monitors (int):
|
|
29
|
+
retention_days (int):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
id: str
|
|
33
|
+
slug: str
|
|
34
|
+
name: str
|
|
35
|
+
included_screenshots: int
|
|
36
|
+
has_overage: bool
|
|
37
|
+
overage_price_cents: Union[None, int]
|
|
38
|
+
max_concurrency: int
|
|
39
|
+
rate_limit_per_sec: int
|
|
40
|
+
max_bulk_size: int
|
|
41
|
+
max_monitors: int
|
|
42
|
+
retention_days: int
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
|
46
|
+
id = self.id
|
|
47
|
+
|
|
48
|
+
slug = self.slug
|
|
49
|
+
|
|
50
|
+
name = self.name
|
|
51
|
+
|
|
52
|
+
included_screenshots = self.included_screenshots
|
|
53
|
+
|
|
54
|
+
has_overage = self.has_overage
|
|
55
|
+
|
|
56
|
+
overage_price_cents: Union[None, int]
|
|
57
|
+
overage_price_cents = self.overage_price_cents
|
|
58
|
+
|
|
59
|
+
max_concurrency = self.max_concurrency
|
|
60
|
+
|
|
61
|
+
rate_limit_per_sec = self.rate_limit_per_sec
|
|
62
|
+
|
|
63
|
+
max_bulk_size = self.max_bulk_size
|
|
64
|
+
|
|
65
|
+
max_monitors = self.max_monitors
|
|
66
|
+
|
|
67
|
+
retention_days = self.retention_days
|
|
68
|
+
|
|
69
|
+
field_dict: dict[str, Any] = {}
|
|
70
|
+
field_dict.update(self.additional_properties)
|
|
71
|
+
field_dict.update(
|
|
72
|
+
{
|
|
73
|
+
"id": id,
|
|
74
|
+
"slug": slug,
|
|
75
|
+
"name": name,
|
|
76
|
+
"included_screenshots": included_screenshots,
|
|
77
|
+
"has_overage": has_overage,
|
|
78
|
+
"overage_price_cents": overage_price_cents,
|
|
79
|
+
"max_concurrency": max_concurrency,
|
|
80
|
+
"rate_limit_per_sec": rate_limit_per_sec,
|
|
81
|
+
"max_bulk_size": max_bulk_size,
|
|
82
|
+
"max_monitors": max_monitors,
|
|
83
|
+
"retention_days": retention_days,
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return field_dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
91
|
+
d = dict(src_dict)
|
|
92
|
+
id = d.pop("id")
|
|
93
|
+
|
|
94
|
+
slug = d.pop("slug")
|
|
95
|
+
|
|
96
|
+
name = d.pop("name")
|
|
97
|
+
|
|
98
|
+
included_screenshots = d.pop("included_screenshots")
|
|
99
|
+
|
|
100
|
+
has_overage = d.pop("has_overage")
|
|
101
|
+
|
|
102
|
+
def _parse_overage_price_cents(data: object) -> Union[None, int]:
|
|
103
|
+
if data is None:
|
|
104
|
+
return data
|
|
105
|
+
return cast(Union[None, int], data)
|
|
106
|
+
|
|
107
|
+
overage_price_cents = _parse_overage_price_cents(d.pop("overage_price_cents"))
|
|
108
|
+
|
|
109
|
+
max_concurrency = d.pop("max_concurrency")
|
|
110
|
+
|
|
111
|
+
rate_limit_per_sec = d.pop("rate_limit_per_sec")
|
|
112
|
+
|
|
113
|
+
max_bulk_size = d.pop("max_bulk_size")
|
|
114
|
+
|
|
115
|
+
max_monitors = d.pop("max_monitors")
|
|
116
|
+
|
|
117
|
+
retention_days = d.pop("retention_days")
|
|
118
|
+
|
|
119
|
+
account_session_response_plan = cls(
|
|
120
|
+
id=id,
|
|
121
|
+
slug=slug,
|
|
122
|
+
name=name,
|
|
123
|
+
included_screenshots=included_screenshots,
|
|
124
|
+
has_overage=has_overage,
|
|
125
|
+
overage_price_cents=overage_price_cents,
|
|
126
|
+
max_concurrency=max_concurrency,
|
|
127
|
+
rate_limit_per_sec=rate_limit_per_sec,
|
|
128
|
+
max_bulk_size=max_bulk_size,
|
|
129
|
+
max_monitors=max_monitors,
|
|
130
|
+
retention_days=retention_days,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
account_session_response_plan.additional_properties = d
|
|
134
|
+
return account_session_response_plan
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def additional_keys(self) -> list[str]:
|
|
138
|
+
return list(self.additional_properties.keys())
|
|
139
|
+
|
|
140
|
+
def __getitem__(self, key: str) -> Any:
|
|
141
|
+
return self.additional_properties[key]
|
|
142
|
+
|
|
143
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
144
|
+
self.additional_properties[key] = value
|
|
145
|
+
|
|
146
|
+
def __delitem__(self, key: str) -> None:
|
|
147
|
+
del self.additional_properties[key]
|
|
148
|
+
|
|
149
|
+
def __contains__(self, key: str) -> bool:
|
|
150
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,91 @@
|
|
|
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="BandwidthBalance")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class BandwidthBalance:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
used_bytes (int):
|
|
15
|
+
limit_bytes (int):
|
|
16
|
+
remaining_bytes (int):
|
|
17
|
+
topup_bytes (int):
|
|
18
|
+
rollover_bytes (int):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
used_bytes: int
|
|
22
|
+
limit_bytes: int
|
|
23
|
+
remaining_bytes: int
|
|
24
|
+
topup_bytes: int
|
|
25
|
+
rollover_bytes: int
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
used_bytes = self.used_bytes
|
|
30
|
+
|
|
31
|
+
limit_bytes = self.limit_bytes
|
|
32
|
+
|
|
33
|
+
remaining_bytes = self.remaining_bytes
|
|
34
|
+
|
|
35
|
+
topup_bytes = self.topup_bytes
|
|
36
|
+
|
|
37
|
+
rollover_bytes = self.rollover_bytes
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
field_dict.update(self.additional_properties)
|
|
41
|
+
field_dict.update(
|
|
42
|
+
{
|
|
43
|
+
"used_bytes": used_bytes,
|
|
44
|
+
"limit_bytes": limit_bytes,
|
|
45
|
+
"remaining_bytes": remaining_bytes,
|
|
46
|
+
"topup_bytes": topup_bytes,
|
|
47
|
+
"rollover_bytes": rollover_bytes,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
used_bytes = d.pop("used_bytes")
|
|
57
|
+
|
|
58
|
+
limit_bytes = d.pop("limit_bytes")
|
|
59
|
+
|
|
60
|
+
remaining_bytes = d.pop("remaining_bytes")
|
|
61
|
+
|
|
62
|
+
topup_bytes = d.pop("topup_bytes")
|
|
63
|
+
|
|
64
|
+
rollover_bytes = d.pop("rollover_bytes")
|
|
65
|
+
|
|
66
|
+
bandwidth_balance = cls(
|
|
67
|
+
used_bytes=used_bytes,
|
|
68
|
+
limit_bytes=limit_bytes,
|
|
69
|
+
remaining_bytes=remaining_bytes,
|
|
70
|
+
topup_bytes=topup_bytes,
|
|
71
|
+
rollover_bytes=rollover_bytes,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
bandwidth_balance.additional_properties = d
|
|
75
|
+
return bandwidth_balance
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def additional_keys(self) -> list[str]:
|
|
79
|
+
return list(self.additional_properties.keys())
|
|
80
|
+
|
|
81
|
+
def __getitem__(self, key: str) -> Any:
|
|
82
|
+
return self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
85
|
+
self.additional_properties[key] = value
|
|
86
|
+
|
|
87
|
+
def __delitem__(self, key: str) -> None:
|
|
88
|
+
del self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __contains__(self, key: str) -> bool:
|
|
91
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,216 @@
|
|
|
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.capture_response_outcome import CaptureResponseOutcome
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="CaptureResponse")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class CaptureResponse:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
id (str):
|
|
24
|
+
monitor_id (str):
|
|
25
|
+
screenshot_id (Union[None, str]):
|
|
26
|
+
scrape_id (Union[None, str]):
|
|
27
|
+
image_url (Union[None, str]):
|
|
28
|
+
content_hash (Union[None, str]):
|
|
29
|
+
previous_hash (Union[None, str]):
|
|
30
|
+
hash_distance (Union[None, int]):
|
|
31
|
+
change_pct (Union[None, str]):
|
|
32
|
+
has_change (bool):
|
|
33
|
+
title_changed (Union[None, bool]):
|
|
34
|
+
outcome (CaptureResponseOutcome): Per-cycle terminal state. `captured` = the page was fetched and a
|
|
35
|
+
screenshot/scrape was stored (screenshot_id or scrape_id non-null). `preflight_unchanged` = the page was
|
|
36
|
+
unchanged since the previous check, so no new capture was taken (both target ids null). `preflight_failed` = the
|
|
37
|
+
check could not complete (the target returned an error or timed out); both target ids null. Defaults to
|
|
38
|
+
`captured` for older rows.
|
|
39
|
+
captured_at (datetime.datetime):
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
id: str
|
|
43
|
+
monitor_id: str
|
|
44
|
+
screenshot_id: Union[None, str]
|
|
45
|
+
scrape_id: Union[None, str]
|
|
46
|
+
image_url: Union[None, str]
|
|
47
|
+
content_hash: Union[None, str]
|
|
48
|
+
previous_hash: Union[None, str]
|
|
49
|
+
hash_distance: Union[None, int]
|
|
50
|
+
change_pct: Union[None, str]
|
|
51
|
+
has_change: bool
|
|
52
|
+
title_changed: Union[None, bool]
|
|
53
|
+
outcome: CaptureResponseOutcome
|
|
54
|
+
captured_at: datetime.datetime
|
|
55
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> dict[str, Any]:
|
|
58
|
+
id = self.id
|
|
59
|
+
|
|
60
|
+
monitor_id = self.monitor_id
|
|
61
|
+
|
|
62
|
+
screenshot_id: Union[None, str]
|
|
63
|
+
screenshot_id = self.screenshot_id
|
|
64
|
+
|
|
65
|
+
scrape_id: Union[None, str]
|
|
66
|
+
scrape_id = self.scrape_id
|
|
67
|
+
|
|
68
|
+
image_url: Union[None, str]
|
|
69
|
+
image_url = self.image_url
|
|
70
|
+
|
|
71
|
+
content_hash: Union[None, str]
|
|
72
|
+
content_hash = self.content_hash
|
|
73
|
+
|
|
74
|
+
previous_hash: Union[None, str]
|
|
75
|
+
previous_hash = self.previous_hash
|
|
76
|
+
|
|
77
|
+
hash_distance: Union[None, int]
|
|
78
|
+
hash_distance = self.hash_distance
|
|
79
|
+
|
|
80
|
+
change_pct: Union[None, str]
|
|
81
|
+
change_pct = self.change_pct
|
|
82
|
+
|
|
83
|
+
has_change = self.has_change
|
|
84
|
+
|
|
85
|
+
title_changed: Union[None, bool]
|
|
86
|
+
title_changed = self.title_changed
|
|
87
|
+
|
|
88
|
+
outcome = self.outcome.value
|
|
89
|
+
|
|
90
|
+
captured_at = self.captured_at.isoformat()
|
|
91
|
+
|
|
92
|
+
field_dict: dict[str, Any] = {}
|
|
93
|
+
field_dict.update(self.additional_properties)
|
|
94
|
+
field_dict.update(
|
|
95
|
+
{
|
|
96
|
+
"id": id,
|
|
97
|
+
"monitor_id": monitor_id,
|
|
98
|
+
"screenshot_id": screenshot_id,
|
|
99
|
+
"scrape_id": scrape_id,
|
|
100
|
+
"image_url": image_url,
|
|
101
|
+
"content_hash": content_hash,
|
|
102
|
+
"previous_hash": previous_hash,
|
|
103
|
+
"hash_distance": hash_distance,
|
|
104
|
+
"change_pct": change_pct,
|
|
105
|
+
"has_change": has_change,
|
|
106
|
+
"title_changed": title_changed,
|
|
107
|
+
"outcome": outcome,
|
|
108
|
+
"captured_at": captured_at,
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return field_dict
|
|
113
|
+
|
|
114
|
+
@classmethod
|
|
115
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
116
|
+
d = dict(src_dict)
|
|
117
|
+
id = d.pop("id")
|
|
118
|
+
|
|
119
|
+
monitor_id = d.pop("monitor_id")
|
|
120
|
+
|
|
121
|
+
def _parse_screenshot_id(data: object) -> Union[None, str]:
|
|
122
|
+
if data is None:
|
|
123
|
+
return data
|
|
124
|
+
return cast(Union[None, str], data)
|
|
125
|
+
|
|
126
|
+
screenshot_id = _parse_screenshot_id(d.pop("screenshot_id"))
|
|
127
|
+
|
|
128
|
+
def _parse_scrape_id(data: object) -> Union[None, str]:
|
|
129
|
+
if data is None:
|
|
130
|
+
return data
|
|
131
|
+
return cast(Union[None, str], data)
|
|
132
|
+
|
|
133
|
+
scrape_id = _parse_scrape_id(d.pop("scrape_id"))
|
|
134
|
+
|
|
135
|
+
def _parse_image_url(data: object) -> Union[None, str]:
|
|
136
|
+
if data is None:
|
|
137
|
+
return data
|
|
138
|
+
return cast(Union[None, str], data)
|
|
139
|
+
|
|
140
|
+
image_url = _parse_image_url(d.pop("image_url"))
|
|
141
|
+
|
|
142
|
+
def _parse_content_hash(data: object) -> Union[None, str]:
|
|
143
|
+
if data is None:
|
|
144
|
+
return data
|
|
145
|
+
return cast(Union[None, str], data)
|
|
146
|
+
|
|
147
|
+
content_hash = _parse_content_hash(d.pop("content_hash"))
|
|
148
|
+
|
|
149
|
+
def _parse_previous_hash(data: object) -> Union[None, str]:
|
|
150
|
+
if data is None:
|
|
151
|
+
return data
|
|
152
|
+
return cast(Union[None, str], data)
|
|
153
|
+
|
|
154
|
+
previous_hash = _parse_previous_hash(d.pop("previous_hash"))
|
|
155
|
+
|
|
156
|
+
def _parse_hash_distance(data: object) -> Union[None, int]:
|
|
157
|
+
if data is None:
|
|
158
|
+
return data
|
|
159
|
+
return cast(Union[None, int], data)
|
|
160
|
+
|
|
161
|
+
hash_distance = _parse_hash_distance(d.pop("hash_distance"))
|
|
162
|
+
|
|
163
|
+
def _parse_change_pct(data: object) -> Union[None, str]:
|
|
164
|
+
if data is None:
|
|
165
|
+
return data
|
|
166
|
+
return cast(Union[None, str], data)
|
|
167
|
+
|
|
168
|
+
change_pct = _parse_change_pct(d.pop("change_pct"))
|
|
169
|
+
|
|
170
|
+
has_change = d.pop("has_change")
|
|
171
|
+
|
|
172
|
+
def _parse_title_changed(data: object) -> Union[None, bool]:
|
|
173
|
+
if data is None:
|
|
174
|
+
return data
|
|
175
|
+
return cast(Union[None, bool], data)
|
|
176
|
+
|
|
177
|
+
title_changed = _parse_title_changed(d.pop("title_changed"))
|
|
178
|
+
|
|
179
|
+
outcome = CaptureResponseOutcome(d.pop("outcome"))
|
|
180
|
+
|
|
181
|
+
captured_at = isoparse(d.pop("captured_at"))
|
|
182
|
+
|
|
183
|
+
capture_response = cls(
|
|
184
|
+
id=id,
|
|
185
|
+
monitor_id=monitor_id,
|
|
186
|
+
screenshot_id=screenshot_id,
|
|
187
|
+
scrape_id=scrape_id,
|
|
188
|
+
image_url=image_url,
|
|
189
|
+
content_hash=content_hash,
|
|
190
|
+
previous_hash=previous_hash,
|
|
191
|
+
hash_distance=hash_distance,
|
|
192
|
+
change_pct=change_pct,
|
|
193
|
+
has_change=has_change,
|
|
194
|
+
title_changed=title_changed,
|
|
195
|
+
outcome=outcome,
|
|
196
|
+
captured_at=captured_at,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
capture_response.additional_properties = d
|
|
200
|
+
return capture_response
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def additional_keys(self) -> list[str]:
|
|
204
|
+
return list(self.additional_properties.keys())
|
|
205
|
+
|
|
206
|
+
def __getitem__(self, key: str) -> Any:
|
|
207
|
+
return self.additional_properties[key]
|
|
208
|
+
|
|
209
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
210
|
+
self.additional_properties[key] = value
|
|
211
|
+
|
|
212
|
+
def __delitem__(self, key: str) -> None:
|
|
213
|
+
del self.additional_properties[key]
|
|
214
|
+
|
|
215
|
+
def __contains__(self, key: str) -> bool:
|
|
216
|
+
return key in self.additional_properties
|