hushscript 1.0.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.
- hushscript/__init__.py +97 -0
- hushscript/_client.py +687 -0
- hushscript/_clock.py +36 -0
- hushscript/_config.py +139 -0
- hushscript/_errors.py +563 -0
- hushscript/_guard.py +61 -0
- hushscript/_http.py +624 -0
- hushscript/_json.py +55 -0
- hushscript/_log.py +155 -0
- hushscript/_models.py +144 -0
- hushscript/_pacing.py +51 -0
- hushscript/_redact.py +140 -0
- hushscript/_response.py +67 -0
- hushscript/_retry.py +205 -0
- hushscript/_shape.py +197 -0
- hushscript/_shapes.py +248 -0
- hushscript/_version.py +1 -0
- hushscript/format.py +224 -0
- hushscript/generated/__init__.py +8 -0
- hushscript/generated/api/__init__.py +1 -0
- hushscript/generated/api/default/__init__.py +1 -0
- hushscript/generated/api/default/buy_minutes.py +248 -0
- hushscript/generated/api/default/claim_agent_account.py +238 -0
- hushscript/generated/api/default/complete_upload.py +238 -0
- hushscript/generated/api/default/create_agent_account_signup.py +261 -0
- hushscript/generated/api/default/create_setup_session.py +244 -0
- hushscript/generated/api/default/create_upload.py +225 -0
- hushscript/generated/api/default/get_account.py +169 -0
- hushscript/generated/api/default/get_job.py +198 -0
- hushscript/generated/api/default/get_org.py +169 -0
- hushscript/generated/api/default/get_transcript.py +226 -0
- hushscript/generated/api/default/get_transcription_context.py +173 -0
- hushscript/generated/api/default/get_upload_part_urls.py +246 -0
- hushscript/generated/api/default/heartbeat_upload.py +197 -0
- hushscript/generated/api/default/lift_transcript_hold.py +206 -0
- hushscript/generated/api/default/list_credit_ledger.py +229 -0
- hushscript/generated/api/default/list_deleted_transcripts.py +237 -0
- hushscript/generated/api/default/list_holds.py +233 -0
- hushscript/generated/api/default/list_jobs.py +249 -0
- hushscript/generated/api/default/list_org_audit.py +221 -0
- hushscript/generated/api/default/list_org_invoices.py +221 -0
- hushscript/generated/api/default/list_org_ledger.py +221 -0
- hushscript/generated/api/default/list_org_matters.py +247 -0
- hushscript/generated/api/default/list_org_members.py +221 -0
- hushscript/generated/api/default/list_org_transcripts.py +233 -0
- hushscript/generated/api/default/list_packs.py +169 -0
- hushscript/generated/api/default/list_saved_cards.py +169 -0
- hushscript/generated/api/default/list_transactions.py +225 -0
- hushscript/generated/api/default/list_transcripts.py +225 -0
- hushscript/generated/api/default/org_audit_csv.py +163 -0
- hushscript/generated/api/default/org_ledger_csv.py +163 -0
- hushscript/generated/api/default/org_usage_report.py +247 -0
- hushscript/generated/api/default/org_usage_report_csv.py +229 -0
- hushscript/generated/api/default/patch_org_member.py +237 -0
- hushscript/generated/api/default/place_transcript_hold.py +206 -0
- hushscript/generated/api/default/rotate_agent_credentials.py +177 -0
- hushscript/generated/api/default/schedule_org_custody.py +215 -0
- hushscript/generated/api/default/set_default_card.py +223 -0
- hushscript/generated/api/default/upload_part.py +249 -0
- hushscript/generated/catalog.py +138 -0
- hushscript/generated/client.py +282 -0
- hushscript/generated/errors.py +16 -0
- hushscript/generated/hints.py +28 -0
- hushscript/generated/models/__init__.py +193 -0
- hushscript/generated/models/account_response.py +114 -0
- hushscript/generated/models/active_hold.py +88 -0
- hushscript/generated/models/active_hold_kind.py +18 -0
- hushscript/generated/models/agent_claim_request.py +61 -0
- hushscript/generated/models/agent_claim_response.py +85 -0
- hushscript/generated/models/agent_credentials_rotate_response.py +101 -0
- hushscript/generated/models/agent_signup_request.py +118 -0
- hushscript/generated/models/agent_signup_request_agent.py +80 -0
- hushscript/generated/models/agent_signup_response.py +111 -0
- hushscript/generated/models/buy_minutes_body.py +89 -0
- hushscript/generated/models/card.py +132 -0
- hushscript/generated/models/cards_response.py +90 -0
- hushscript/generated/models/complete_upload_body.py +107 -0
- hushscript/generated/models/complete_upload_body_parts_type_0_item.py +69 -0
- hushscript/generated/models/context_dictionary.py +143 -0
- hushscript/generated/models/context_prompt_preset.py +118 -0
- hushscript/generated/models/create_setup_session_body.py +62 -0
- hushscript/generated/models/create_upload_body.py +254 -0
- hushscript/generated/models/create_upload_body_transcription_options_type_0.py +178 -0
- hushscript/generated/models/credit_ledger_entry.py +113 -0
- hushscript/generated/models/credit_ledger_response.py +90 -0
- hushscript/generated/models/deleted_transcript.py +148 -0
- hushscript/generated/models/deleted_transcript_cause.py +18 -0
- hushscript/generated/models/deleted_transcript_receipt_type_0.py +107 -0
- hushscript/generated/models/deleted_transcript_receipt_type_0_items_item.py +69 -0
- hushscript/generated/models/deleted_transcripts_response.py +90 -0
- hushscript/generated/models/dictionary_entry.py +123 -0
- hushscript/generated/models/dictionary_entry_category.py +37 -0
- hushscript/generated/models/error.py +155 -0
- hushscript/generated/models/error_details.py +94 -0
- hushscript/generated/models/get_upload_part_urls_response_200_type_0.py +108 -0
- hushscript/generated/models/heartbeat_upload_response_200.py +61 -0
- hushscript/generated/models/holds_response.py +90 -0
- hushscript/generated/models/job.py +309 -0
- hushscript/generated/models/job_failure_kind_type_1.py +16 -0
- hushscript/generated/models/job_failure_kind_type_2_type_1.py +16 -0
- hushscript/generated/models/job_failure_kind_type_3_type_1.py +16 -0
- hushscript/generated/models/job_list.py +90 -0
- hushscript/generated/models/lift_transcript_hold_response_200.py +61 -0
- hushscript/generated/models/list_jobs_active.py +17 -0
- hushscript/generated/models/list_org_matters_status.py +16 -0
- hushscript/generated/models/options_summary.py +135 -0
- hushscript/generated/models/org_audit_entry.py +105 -0
- hushscript/generated/models/org_audit_response.py +90 -0
- hushscript/generated/models/org_invoice.py +175 -0
- hushscript/generated/models/org_invoices_response.py +90 -0
- hushscript/generated/models/org_ledger_entry.py +155 -0
- hushscript/generated/models/org_ledger_response.py +90 -0
- hushscript/generated/models/org_matter.py +79 -0
- hushscript/generated/models/org_matter_status.py +16 -0
- hushscript/generated/models/org_matters_response.py +75 -0
- hushscript/generated/models/org_member.py +123 -0
- hushscript/generated/models/org_members_response.py +90 -0
- hushscript/generated/models/org_summary_response.py +482 -0
- hushscript/generated/models/org_transcript.py +103 -0
- hushscript/generated/models/org_transcripts_response.py +90 -0
- hushscript/generated/models/org_usage_report_csv_group_by.py +17 -0
- hushscript/generated/models/org_usage_report_group_by.py +17 -0
- hushscript/generated/models/org_usage_response.py +112 -0
- hushscript/generated/models/org_usage_response_group_by.py +17 -0
- hushscript/generated/models/org_usage_row.py +86 -0
- hushscript/generated/models/pack.py +107 -0
- hushscript/generated/models/packs_response.py +75 -0
- hushscript/generated/models/patch_org_member_body.py +102 -0
- hushscript/generated/models/patch_org_member_response_200.py +61 -0
- hushscript/generated/models/place_transcript_hold_response_200.py +61 -0
- hushscript/generated/models/presigned_part_url.py +69 -0
- hushscript/generated/models/purchase_response.py +76 -0
- hushscript/generated/models/schedule_org_custody_body.py +66 -0
- hushscript/generated/models/schedule_org_custody_body_custody.py +17 -0
- hushscript/generated/models/schedule_org_custody_response_200.py +69 -0
- hushscript/generated/models/set_default_card_body.py +61 -0
- hushscript/generated/models/set_default_card_response_200.py +61 -0
- hushscript/generated/models/setup_session_response.py +77 -0
- hushscript/generated/models/transaction.py +183 -0
- hushscript/generated/models/transactions_response.py +98 -0
- hushscript/generated/models/transcript_detail.py +194 -0
- hushscript/generated/models/transcript_detail_speaker_names.py +47 -0
- hushscript/generated/models/transcript_envelope.py +89 -0
- hushscript/generated/models/transcript_envelope_translations.py +62 -0
- hushscript/generated/models/transcript_language.py +75 -0
- hushscript/generated/models/transcript_list.py +90 -0
- hushscript/generated/models/transcript_list_row.py +152 -0
- hushscript/generated/models/transcript_list_row_insights_state.py +20 -0
- hushscript/generated/models/transcription_context_response.py +95 -0
- hushscript/generated/models/upload_complete_response.py +100 -0
- hushscript/generated/models/upload_create_response.py +148 -0
- hushscript/generated/models/upload_create_response_funding.py +16 -0
- hushscript/generated/models/upload_create_response_upload_type_0.py +108 -0
- hushscript/generated/models/upload_limits.py +86 -0
- hushscript/generated/models/upload_part_response_200.py +69 -0
- hushscript/generated/models/utterance.py +85 -0
- hushscript/generated/scopes.py +42 -0
- hushscript/generated/types.py +54 -0
- hushscript/money.py +79 -0
- hushscript/paginate.py +78 -0
- hushscript/py.typed +0 -0
- hushscript/resources/__init__.py +1 -0
- hushscript/resources/_params.py +33 -0
- hushscript/resources/account.py +121 -0
- hushscript/resources/agent.py +421 -0
- hushscript/resources/billing.py +567 -0
- hushscript/resources/jobs.py +105 -0
- hushscript/resources/transcripts.py +209 -0
- hushscript/transcribe/__init__.py +1 -0
- hushscript/transcribe/apipeline.py +234 -0
- hushscript/transcribe/aupload.py +197 -0
- hushscript/transcribe/heartbeat.py +78 -0
- hushscript/transcribe/pipeline.py +312 -0
- hushscript/transcribe/preflight.py +272 -0
- hushscript/transcribe/probe.py +185 -0
- hushscript/transcribe/resume.py +115 -0
- hushscript/transcribe/segment.py +23 -0
- hushscript/transcribe/session.py +34 -0
- hushscript/transcribe/sniff.py +30 -0
- hushscript/transcribe/source.py +218 -0
- hushscript/transcribe/upload.py +498 -0
- hushscript/transcribe/wait.py +124 -0
- hushscript/transcript.py +197 -0
- hushscript-1.0.0.dist-info/METADATA +502 -0
- hushscript-1.0.0.dist-info/RECORD +187 -0
- hushscript-1.0.0.dist-info/WHEEL +4 -0
- hushscript-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.error_details import ErrorDetails
|
|
13
|
+
from ..models.upload_limits import UploadLimits
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="Error")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class Error:
|
|
21
|
+
"""The frozen /v1 error body. error and code are always present together; the remaining keys are optional detail this
|
|
22
|
+
API includes only when the specific error carries them, and they are omitted rather than emitted as null when
|
|
23
|
+
absent.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
error (str): The error's slug. See x-error-catalog for the full list.
|
|
27
|
+
code (int): The error's stable numeric code. See x-error-catalog. Never reused or renumbered.
|
|
28
|
+
needed_seconds (int | Unset): Seconds the failed action needed. Present on a balance-shortfall error.
|
|
29
|
+
balance_seconds (int | Unset): The account's personal balance in seconds. Present on a personal balance-
|
|
30
|
+
shortfall error.
|
|
31
|
+
held_seconds (int | Unset): Seconds already committed to other in-flight jobs. Present alongside
|
|
32
|
+
balance_seconds.
|
|
33
|
+
org_balance_seconds (int | Unset): The organization's shared pool balance in seconds. Present on an org-funded
|
|
34
|
+
balance-shortfall error instead of balance_seconds.
|
|
35
|
+
limits (UploadLimits | Unset): The caller's current upload admission limits, shared by every response that
|
|
36
|
+
carries them.
|
|
37
|
+
details (ErrorDetails | Unset): Structured recovery detail for an error that is not a plain balance shortfall.
|
|
38
|
+
Present on agent_pack_locked and agent_purchase_capped.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
error: str
|
|
42
|
+
code: int
|
|
43
|
+
needed_seconds: int | Unset = UNSET
|
|
44
|
+
balance_seconds: int | Unset = UNSET
|
|
45
|
+
held_seconds: int | Unset = UNSET
|
|
46
|
+
org_balance_seconds: int | Unset = UNSET
|
|
47
|
+
limits: UploadLimits | Unset = UNSET
|
|
48
|
+
details: ErrorDetails | Unset = UNSET
|
|
49
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
error = self.error
|
|
53
|
+
|
|
54
|
+
code = self.code
|
|
55
|
+
|
|
56
|
+
needed_seconds = self.needed_seconds
|
|
57
|
+
|
|
58
|
+
balance_seconds = self.balance_seconds
|
|
59
|
+
|
|
60
|
+
held_seconds = self.held_seconds
|
|
61
|
+
|
|
62
|
+
org_balance_seconds = self.org_balance_seconds
|
|
63
|
+
|
|
64
|
+
limits: dict[str, Any] | Unset = UNSET
|
|
65
|
+
if not isinstance(self.limits, Unset):
|
|
66
|
+
limits = self.limits.to_dict()
|
|
67
|
+
|
|
68
|
+
details: dict[str, Any] | Unset = UNSET
|
|
69
|
+
if not isinstance(self.details, Unset):
|
|
70
|
+
details = self.details.to_dict()
|
|
71
|
+
|
|
72
|
+
field_dict: dict[str, Any] = {}
|
|
73
|
+
field_dict.update(self.additional_properties)
|
|
74
|
+
field_dict.update(
|
|
75
|
+
{
|
|
76
|
+
"error": error,
|
|
77
|
+
"code": code,
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
if needed_seconds is not UNSET:
|
|
81
|
+
field_dict["needed_seconds"] = needed_seconds
|
|
82
|
+
if balance_seconds is not UNSET:
|
|
83
|
+
field_dict["balance_seconds"] = balance_seconds
|
|
84
|
+
if held_seconds is not UNSET:
|
|
85
|
+
field_dict["held_seconds"] = held_seconds
|
|
86
|
+
if org_balance_seconds is not UNSET:
|
|
87
|
+
field_dict["org_balance_seconds"] = org_balance_seconds
|
|
88
|
+
if limits is not UNSET:
|
|
89
|
+
field_dict["limits"] = limits
|
|
90
|
+
if details is not UNSET:
|
|
91
|
+
field_dict["details"] = details
|
|
92
|
+
|
|
93
|
+
return field_dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
97
|
+
from ..models.error_details import ErrorDetails # noqa: PLC0415
|
|
98
|
+
from ..models.upload_limits import UploadLimits # noqa: PLC0415
|
|
99
|
+
|
|
100
|
+
d = dict(src_dict)
|
|
101
|
+
error = d.pop("error")
|
|
102
|
+
|
|
103
|
+
code = d.pop("code")
|
|
104
|
+
|
|
105
|
+
needed_seconds = d.pop("needed_seconds", UNSET)
|
|
106
|
+
|
|
107
|
+
balance_seconds = d.pop("balance_seconds", UNSET)
|
|
108
|
+
|
|
109
|
+
held_seconds = d.pop("held_seconds", UNSET)
|
|
110
|
+
|
|
111
|
+
org_balance_seconds = d.pop("org_balance_seconds", UNSET)
|
|
112
|
+
|
|
113
|
+
_limits = d.pop("limits", UNSET)
|
|
114
|
+
limits: UploadLimits | Unset
|
|
115
|
+
if isinstance(_limits, Unset):
|
|
116
|
+
limits = UNSET
|
|
117
|
+
else:
|
|
118
|
+
limits = UploadLimits.from_dict(_limits)
|
|
119
|
+
|
|
120
|
+
_details = d.pop("details", UNSET)
|
|
121
|
+
details: ErrorDetails | Unset
|
|
122
|
+
if isinstance(_details, Unset):
|
|
123
|
+
details = UNSET
|
|
124
|
+
else:
|
|
125
|
+
details = ErrorDetails.from_dict(_details)
|
|
126
|
+
|
|
127
|
+
error = cls(
|
|
128
|
+
error=error,
|
|
129
|
+
code=code,
|
|
130
|
+
needed_seconds=needed_seconds,
|
|
131
|
+
balance_seconds=balance_seconds,
|
|
132
|
+
held_seconds=held_seconds,
|
|
133
|
+
org_balance_seconds=org_balance_seconds,
|
|
134
|
+
limits=limits,
|
|
135
|
+
details=details,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
error.additional_properties = d
|
|
139
|
+
return error
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
def additional_keys(self) -> list[str]:
|
|
143
|
+
return list(self.additional_properties.keys())
|
|
144
|
+
|
|
145
|
+
def __getitem__(self, key: str) -> Any:
|
|
146
|
+
return self.additional_properties[key]
|
|
147
|
+
|
|
148
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
149
|
+
self.additional_properties[key] = value
|
|
150
|
+
|
|
151
|
+
def __delitem__(self, key: str) -> None:
|
|
152
|
+
del self.additional_properties[key]
|
|
153
|
+
|
|
154
|
+
def __contains__(self, key: str) -> bool:
|
|
155
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="ErrorDetails")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class ErrorDetails:
|
|
16
|
+
"""Structured recovery detail for an error that is not a plain balance shortfall. Present on agent_pack_locked and
|
|
17
|
+
agent_purchase_capped.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
allowed_packs (list[str] | Unset): Pack ids the agent account may buy right now. Present on agent_pack_locked;
|
|
21
|
+
retry with one of these.
|
|
22
|
+
limit (int | Unset): The per-credential purchase cap for the rolling window. Present on agent_purchase_capped.
|
|
23
|
+
window_seconds (int | Unset): The length of the rolling window in seconds. Present on agent_purchase_capped.
|
|
24
|
+
retry_after_seconds (int | Unset): Seconds until the oldest purchase counted toward the cap leaves the window.
|
|
25
|
+
Present on agent_purchase_capped; matches the Retry-After header.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
allowed_packs: list[str] | Unset = UNSET
|
|
29
|
+
limit: int | Unset = UNSET
|
|
30
|
+
window_seconds: int | Unset = UNSET
|
|
31
|
+
retry_after_seconds: int | Unset = UNSET
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
allowed_packs: list[str] | Unset = UNSET
|
|
36
|
+
if not isinstance(self.allowed_packs, Unset):
|
|
37
|
+
allowed_packs = self.allowed_packs
|
|
38
|
+
|
|
39
|
+
limit = self.limit
|
|
40
|
+
|
|
41
|
+
window_seconds = self.window_seconds
|
|
42
|
+
|
|
43
|
+
retry_after_seconds = self.retry_after_seconds
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({})
|
|
48
|
+
if allowed_packs is not UNSET:
|
|
49
|
+
field_dict["allowed_packs"] = allowed_packs
|
|
50
|
+
if limit is not UNSET:
|
|
51
|
+
field_dict["limit"] = limit
|
|
52
|
+
if window_seconds is not UNSET:
|
|
53
|
+
field_dict["window_seconds"] = window_seconds
|
|
54
|
+
if retry_after_seconds is not UNSET:
|
|
55
|
+
field_dict["retry_after_seconds"] = retry_after_seconds
|
|
56
|
+
|
|
57
|
+
return field_dict
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
61
|
+
d = dict(src_dict)
|
|
62
|
+
allowed_packs = cast(list[str], d.pop("allowed_packs", UNSET))
|
|
63
|
+
|
|
64
|
+
limit = d.pop("limit", UNSET)
|
|
65
|
+
|
|
66
|
+
window_seconds = d.pop("window_seconds", UNSET)
|
|
67
|
+
|
|
68
|
+
retry_after_seconds = d.pop("retry_after_seconds", UNSET)
|
|
69
|
+
|
|
70
|
+
error_details = cls(
|
|
71
|
+
allowed_packs=allowed_packs,
|
|
72
|
+
limit=limit,
|
|
73
|
+
window_seconds=window_seconds,
|
|
74
|
+
retry_after_seconds=retry_after_seconds,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
error_details.additional_properties = d
|
|
78
|
+
return error_details
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def additional_keys(self) -> list[str]:
|
|
82
|
+
return list(self.additional_properties.keys())
|
|
83
|
+
|
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
|
85
|
+
return self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
88
|
+
self.additional_properties[key] = value
|
|
89
|
+
|
|
90
|
+
def __delitem__(self, key: str) -> None:
|
|
91
|
+
del self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __contains__(self, key: str) -> bool:
|
|
94
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.presigned_part_url import PresignedPartUrl
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="GetUploadPartUrlsResponse200Type0")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class GetUploadPartUrlsResponse200Type0:
|
|
18
|
+
"""One page of presigned direct-to-R2 PUT URLs, or null when direct-to-R2 uploads are not available for this job and
|
|
19
|
+
parts must be sent to upload_part instead.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
part_size_bytes (int): The byte size of every part except the last.
|
|
23
|
+
total_parts (int): The total number of parts this upload is split into.
|
|
24
|
+
part_urls (list[PresignedPartUrl]): Presigned URLs for this page's parts, starting at the requested (or first)
|
|
25
|
+
part number.
|
|
26
|
+
next_part_number (int | None): The next part number not covered by this page, or null once every part has a URL.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
part_size_bytes: int
|
|
30
|
+
total_parts: int
|
|
31
|
+
part_urls: list[PresignedPartUrl]
|
|
32
|
+
next_part_number: int | None
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
part_size_bytes = self.part_size_bytes
|
|
37
|
+
|
|
38
|
+
total_parts = self.total_parts
|
|
39
|
+
|
|
40
|
+
part_urls = []
|
|
41
|
+
for part_urls_item_data in self.part_urls:
|
|
42
|
+
part_urls_item = part_urls_item_data.to_dict()
|
|
43
|
+
part_urls.append(part_urls_item)
|
|
44
|
+
|
|
45
|
+
next_part_number: int | None
|
|
46
|
+
next_part_number = self.next_part_number
|
|
47
|
+
|
|
48
|
+
field_dict: dict[str, Any] = {}
|
|
49
|
+
field_dict.update(self.additional_properties)
|
|
50
|
+
field_dict.update(
|
|
51
|
+
{
|
|
52
|
+
"part_size_bytes": part_size_bytes,
|
|
53
|
+
"total_parts": total_parts,
|
|
54
|
+
"part_urls": part_urls,
|
|
55
|
+
"next_part_number": next_part_number,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
return field_dict
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
63
|
+
from ..models.presigned_part_url import PresignedPartUrl # noqa: PLC0415
|
|
64
|
+
|
|
65
|
+
d = dict(src_dict)
|
|
66
|
+
part_size_bytes = d.pop("part_size_bytes")
|
|
67
|
+
|
|
68
|
+
total_parts = d.pop("total_parts")
|
|
69
|
+
|
|
70
|
+
part_urls = []
|
|
71
|
+
_part_urls = d.pop("part_urls")
|
|
72
|
+
for part_urls_item_data in _part_urls:
|
|
73
|
+
part_urls_item = PresignedPartUrl.from_dict(part_urls_item_data)
|
|
74
|
+
|
|
75
|
+
part_urls.append(part_urls_item)
|
|
76
|
+
|
|
77
|
+
def _parse_next_part_number(data: object) -> int | None:
|
|
78
|
+
if data is None:
|
|
79
|
+
return data
|
|
80
|
+
return cast(int | None, data)
|
|
81
|
+
|
|
82
|
+
next_part_number = _parse_next_part_number(d.pop("next_part_number"))
|
|
83
|
+
|
|
84
|
+
get_upload_part_urls_response_200_type_0 = cls(
|
|
85
|
+
part_size_bytes=part_size_bytes,
|
|
86
|
+
total_parts=total_parts,
|
|
87
|
+
part_urls=part_urls,
|
|
88
|
+
next_part_number=next_part_number,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
get_upload_part_urls_response_200_type_0.additional_properties = d
|
|
92
|
+
return get_upload_part_urls_response_200_type_0
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def additional_keys(self) -> list[str]:
|
|
96
|
+
return list(self.additional_properties.keys())
|
|
97
|
+
|
|
98
|
+
def __getitem__(self, key: str) -> Any:
|
|
99
|
+
return self.additional_properties[key]
|
|
100
|
+
|
|
101
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
102
|
+
self.additional_properties[key] = value
|
|
103
|
+
|
|
104
|
+
def __delitem__(self, key: str) -> None:
|
|
105
|
+
del self.additional_properties[key]
|
|
106
|
+
|
|
107
|
+
def __contains__(self, key: str) -> bool:
|
|
108
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="HeartbeatUploadResponse200")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class HeartbeatUploadResponse200:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
ok (bool):
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
ok: bool
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
ok = self.ok
|
|
24
|
+
|
|
25
|
+
field_dict: dict[str, Any] = {}
|
|
26
|
+
field_dict.update(self.additional_properties)
|
|
27
|
+
field_dict.update(
|
|
28
|
+
{
|
|
29
|
+
"ok": ok,
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
return field_dict
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
37
|
+
d = dict(src_dict)
|
|
38
|
+
ok = d.pop("ok")
|
|
39
|
+
|
|
40
|
+
heartbeat_upload_response_200 = cls(
|
|
41
|
+
ok=ok,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
heartbeat_upload_response_200.additional_properties = d
|
|
45
|
+
return heartbeat_upload_response_200
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def additional_keys(self) -> list[str]:
|
|
49
|
+
return list(self.additional_properties.keys())
|
|
50
|
+
|
|
51
|
+
def __getitem__(self, key: str) -> Any:
|
|
52
|
+
return self.additional_properties[key]
|
|
53
|
+
|
|
54
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
55
|
+
self.additional_properties[key] = value
|
|
56
|
+
|
|
57
|
+
def __delitem__(self, key: str) -> None:
|
|
58
|
+
del self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __contains__(self, key: str) -> bool:
|
|
61
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.active_hold import ActiveHold
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="HoldsResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class HoldsResponse:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
holds (list[ActiveHold]):
|
|
21
|
+
next_cursor (None | str): An opaque token for the next page's cursor parameter, or null on the last page. This
|
|
22
|
+
API refuses a cursor it did not mint.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
holds: list[ActiveHold]
|
|
26
|
+
next_cursor: None | str
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
holds = []
|
|
31
|
+
for holds_item_data in self.holds:
|
|
32
|
+
holds_item = holds_item_data.to_dict()
|
|
33
|
+
holds.append(holds_item)
|
|
34
|
+
|
|
35
|
+
next_cursor: None | str
|
|
36
|
+
next_cursor = self.next_cursor
|
|
37
|
+
|
|
38
|
+
field_dict: dict[str, Any] = {}
|
|
39
|
+
field_dict.update(self.additional_properties)
|
|
40
|
+
field_dict.update(
|
|
41
|
+
{
|
|
42
|
+
"holds": holds,
|
|
43
|
+
"next_cursor": next_cursor,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
from ..models.active_hold import ActiveHold # noqa: PLC0415
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
holds = []
|
|
55
|
+
_holds = d.pop("holds")
|
|
56
|
+
for holds_item_data in _holds:
|
|
57
|
+
holds_item = ActiveHold.from_dict(holds_item_data)
|
|
58
|
+
|
|
59
|
+
holds.append(holds_item)
|
|
60
|
+
|
|
61
|
+
def _parse_next_cursor(data: object) -> None | str:
|
|
62
|
+
if data is None:
|
|
63
|
+
return data
|
|
64
|
+
return cast(None | str, data)
|
|
65
|
+
|
|
66
|
+
next_cursor = _parse_next_cursor(d.pop("next_cursor"))
|
|
67
|
+
|
|
68
|
+
holds_response = cls(
|
|
69
|
+
holds=holds,
|
|
70
|
+
next_cursor=next_cursor,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
holds_response.additional_properties = d
|
|
74
|
+
return holds_response
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def additional_keys(self) -> list[str]:
|
|
78
|
+
return list(self.additional_properties.keys())
|
|
79
|
+
|
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
|
81
|
+
return self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
84
|
+
self.additional_properties[key] = value
|
|
85
|
+
|
|
86
|
+
def __delitem__(self, key: str) -> None:
|
|
87
|
+
del self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __contains__(self, key: str) -> bool:
|
|
90
|
+
return key in self.additional_properties
|