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,309 @@
|
|
|
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
|
+
from ..models.job_failure_kind_type_1 import (
|
|
10
|
+
JobFailureKindType1,
|
|
11
|
+
check_job_failure_kind_type_1,
|
|
12
|
+
)
|
|
13
|
+
from ..models.job_failure_kind_type_2_type_1 import (
|
|
14
|
+
JobFailureKindType2Type1,
|
|
15
|
+
check_job_failure_kind_type_2_type_1,
|
|
16
|
+
)
|
|
17
|
+
from ..models.job_failure_kind_type_3_type_1 import (
|
|
18
|
+
JobFailureKindType3Type1,
|
|
19
|
+
check_job_failure_kind_type_3_type_1,
|
|
20
|
+
)
|
|
21
|
+
from ..types import UNSET, Unset
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from ..models.options_summary import OptionsSummary
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
T = TypeVar("T", bound="Job")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@_attrs_define
|
|
31
|
+
class Job:
|
|
32
|
+
"""
|
|
33
|
+
Attributes:
|
|
34
|
+
id (str):
|
|
35
|
+
state (str): One of uploading, fetching, queued, processing, done or failed.
|
|
36
|
+
mode (str):
|
|
37
|
+
declared_seconds (int):
|
|
38
|
+
verified_seconds (int | None): The probed exact duration, once known.
|
|
39
|
+
actual_seconds (int | None):
|
|
40
|
+
billable_seconds (int):
|
|
41
|
+
error (None | str): A short failure reason when state is failed, otherwise null.
|
|
42
|
+
failure_kind (JobFailureKindType1 | JobFailureKindType2Type1 | JobFailureKindType3Type1 | None): Set when the
|
|
43
|
+
file itself could not be read: `media_unreadable` when the upload could not be probed as audio,
|
|
44
|
+
`media_undecodable` when the transcription provider could not decode it. Either way the file needs converting
|
|
45
|
+
(for example to MP3 or WAV) and uploading again; nothing was charged and the hold was released. Null for every
|
|
46
|
+
other job, including failures of any other kind and jobs that failed before this field existed.
|
|
47
|
+
retry_of (None | str): The id of an earlier failed job of yours that this job retries, set when the browser app
|
|
48
|
+
re-uploaded a converted copy of an unreadable file, otherwise null.
|
|
49
|
+
created_at (int):
|
|
50
|
+
transcript_id (None | str): The resulting transcript's id, once transcription has finished.
|
|
51
|
+
private_result_expires_at (int | None):
|
|
52
|
+
private_result_available (bool):
|
|
53
|
+
options (OptionsSummary): A content-free summary of the transcription options a job was submitted with: what was
|
|
54
|
+
requested, never the free-text content itself.
|
|
55
|
+
fetched_bytes (int | Unset): Bytes fetched so far for a from-url import. Present only while a fetch is in
|
|
56
|
+
progress.
|
|
57
|
+
fetch_total_bytes (int | Unset): The total byte size a from-url import is fetching toward. Present only while a
|
|
58
|
+
fetch is in progress.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
id: str
|
|
62
|
+
state: str
|
|
63
|
+
mode: str
|
|
64
|
+
declared_seconds: int
|
|
65
|
+
verified_seconds: int | None
|
|
66
|
+
actual_seconds: int | None
|
|
67
|
+
billable_seconds: int
|
|
68
|
+
error: None | str
|
|
69
|
+
failure_kind: (
|
|
70
|
+
JobFailureKindType1 | JobFailureKindType2Type1 | JobFailureKindType3Type1 | None
|
|
71
|
+
)
|
|
72
|
+
retry_of: None | str
|
|
73
|
+
created_at: int
|
|
74
|
+
transcript_id: None | str
|
|
75
|
+
private_result_expires_at: int | None
|
|
76
|
+
private_result_available: bool
|
|
77
|
+
options: OptionsSummary
|
|
78
|
+
fetched_bytes: int | Unset = UNSET
|
|
79
|
+
fetch_total_bytes: int | Unset = UNSET
|
|
80
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> dict[str, Any]:
|
|
83
|
+
id = self.id
|
|
84
|
+
|
|
85
|
+
state = self.state
|
|
86
|
+
|
|
87
|
+
mode = self.mode
|
|
88
|
+
|
|
89
|
+
declared_seconds = self.declared_seconds
|
|
90
|
+
|
|
91
|
+
verified_seconds: int | None
|
|
92
|
+
verified_seconds = self.verified_seconds
|
|
93
|
+
|
|
94
|
+
actual_seconds: int | None
|
|
95
|
+
actual_seconds = self.actual_seconds
|
|
96
|
+
|
|
97
|
+
billable_seconds = self.billable_seconds
|
|
98
|
+
|
|
99
|
+
error: None | str
|
|
100
|
+
error = self.error
|
|
101
|
+
|
|
102
|
+
failure_kind: None | str
|
|
103
|
+
if isinstance(self.failure_kind, str):
|
|
104
|
+
failure_kind = self.failure_kind
|
|
105
|
+
elif isinstance(self.failure_kind, str):
|
|
106
|
+
failure_kind = self.failure_kind
|
|
107
|
+
elif isinstance(self.failure_kind, str):
|
|
108
|
+
failure_kind = self.failure_kind
|
|
109
|
+
else:
|
|
110
|
+
failure_kind = self.failure_kind
|
|
111
|
+
|
|
112
|
+
retry_of: None | str
|
|
113
|
+
retry_of = self.retry_of
|
|
114
|
+
|
|
115
|
+
created_at = self.created_at
|
|
116
|
+
|
|
117
|
+
transcript_id: None | str
|
|
118
|
+
transcript_id = self.transcript_id
|
|
119
|
+
|
|
120
|
+
private_result_expires_at: int | None
|
|
121
|
+
private_result_expires_at = self.private_result_expires_at
|
|
122
|
+
|
|
123
|
+
private_result_available = self.private_result_available
|
|
124
|
+
|
|
125
|
+
options = self.options.to_dict()
|
|
126
|
+
|
|
127
|
+
fetched_bytes = self.fetched_bytes
|
|
128
|
+
|
|
129
|
+
fetch_total_bytes = self.fetch_total_bytes
|
|
130
|
+
|
|
131
|
+
field_dict: dict[str, Any] = {}
|
|
132
|
+
field_dict.update(self.additional_properties)
|
|
133
|
+
field_dict.update(
|
|
134
|
+
{
|
|
135
|
+
"id": id,
|
|
136
|
+
"state": state,
|
|
137
|
+
"mode": mode,
|
|
138
|
+
"declared_seconds": declared_seconds,
|
|
139
|
+
"verified_seconds": verified_seconds,
|
|
140
|
+
"actual_seconds": actual_seconds,
|
|
141
|
+
"billable_seconds": billable_seconds,
|
|
142
|
+
"error": error,
|
|
143
|
+
"failure_kind": failure_kind,
|
|
144
|
+
"retry_of": retry_of,
|
|
145
|
+
"created_at": created_at,
|
|
146
|
+
"transcript_id": transcript_id,
|
|
147
|
+
"private_result_expires_at": private_result_expires_at,
|
|
148
|
+
"private_result_available": private_result_available,
|
|
149
|
+
"options": options,
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
if fetched_bytes is not UNSET:
|
|
153
|
+
field_dict["fetched_bytes"] = fetched_bytes
|
|
154
|
+
if fetch_total_bytes is not UNSET:
|
|
155
|
+
field_dict["fetch_total_bytes"] = fetch_total_bytes
|
|
156
|
+
|
|
157
|
+
return field_dict
|
|
158
|
+
|
|
159
|
+
@classmethod
|
|
160
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
161
|
+
from ..models.options_summary import OptionsSummary # noqa: PLC0415
|
|
162
|
+
|
|
163
|
+
d = dict(src_dict)
|
|
164
|
+
id = d.pop("id")
|
|
165
|
+
|
|
166
|
+
state = d.pop("state")
|
|
167
|
+
|
|
168
|
+
mode = d.pop("mode")
|
|
169
|
+
|
|
170
|
+
declared_seconds = d.pop("declared_seconds")
|
|
171
|
+
|
|
172
|
+
def _parse_verified_seconds(data: object) -> int | None:
|
|
173
|
+
if data is None:
|
|
174
|
+
return data
|
|
175
|
+
return cast(int | None, data)
|
|
176
|
+
|
|
177
|
+
verified_seconds = _parse_verified_seconds(d.pop("verified_seconds"))
|
|
178
|
+
|
|
179
|
+
def _parse_actual_seconds(data: object) -> int | None:
|
|
180
|
+
if data is None:
|
|
181
|
+
return data
|
|
182
|
+
return cast(int | None, data)
|
|
183
|
+
|
|
184
|
+
actual_seconds = _parse_actual_seconds(d.pop("actual_seconds"))
|
|
185
|
+
|
|
186
|
+
billable_seconds = d.pop("billable_seconds")
|
|
187
|
+
|
|
188
|
+
def _parse_error(data: object) -> None | str:
|
|
189
|
+
if data is None:
|
|
190
|
+
return data
|
|
191
|
+
return cast(None | str, data)
|
|
192
|
+
|
|
193
|
+
error = _parse_error(d.pop("error"))
|
|
194
|
+
|
|
195
|
+
def _parse_failure_kind(
|
|
196
|
+
data: object,
|
|
197
|
+
) -> (
|
|
198
|
+
JobFailureKindType1
|
|
199
|
+
| JobFailureKindType2Type1
|
|
200
|
+
| JobFailureKindType3Type1
|
|
201
|
+
| None
|
|
202
|
+
):
|
|
203
|
+
if data is None:
|
|
204
|
+
return data
|
|
205
|
+
try:
|
|
206
|
+
if not isinstance(data, str):
|
|
207
|
+
raise TypeError()
|
|
208
|
+
failure_kind_type_1 = check_job_failure_kind_type_1(data)
|
|
209
|
+
|
|
210
|
+
return failure_kind_type_1
|
|
211
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
212
|
+
pass
|
|
213
|
+
try:
|
|
214
|
+
if not isinstance(data, str):
|
|
215
|
+
raise TypeError()
|
|
216
|
+
failure_kind_type_2_type_1 = check_job_failure_kind_type_2_type_1(data)
|
|
217
|
+
|
|
218
|
+
return failure_kind_type_2_type_1
|
|
219
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
220
|
+
pass
|
|
221
|
+
try:
|
|
222
|
+
if not isinstance(data, str):
|
|
223
|
+
raise TypeError()
|
|
224
|
+
failure_kind_type_3_type_1 = check_job_failure_kind_type_3_type_1(data)
|
|
225
|
+
|
|
226
|
+
return failure_kind_type_3_type_1
|
|
227
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
228
|
+
pass
|
|
229
|
+
return cast(
|
|
230
|
+
JobFailureKindType1
|
|
231
|
+
| JobFailureKindType2Type1
|
|
232
|
+
| JobFailureKindType3Type1
|
|
233
|
+
| None,
|
|
234
|
+
data,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
failure_kind = _parse_failure_kind(d.pop("failure_kind"))
|
|
238
|
+
|
|
239
|
+
def _parse_retry_of(data: object) -> None | str:
|
|
240
|
+
if data is None:
|
|
241
|
+
return data
|
|
242
|
+
return cast(None | str, data)
|
|
243
|
+
|
|
244
|
+
retry_of = _parse_retry_of(d.pop("retry_of"))
|
|
245
|
+
|
|
246
|
+
created_at = d.pop("created_at")
|
|
247
|
+
|
|
248
|
+
def _parse_transcript_id(data: object) -> None | str:
|
|
249
|
+
if data is None:
|
|
250
|
+
return data
|
|
251
|
+
return cast(None | str, data)
|
|
252
|
+
|
|
253
|
+
transcript_id = _parse_transcript_id(d.pop("transcript_id"))
|
|
254
|
+
|
|
255
|
+
def _parse_private_result_expires_at(data: object) -> int | None:
|
|
256
|
+
if data is None:
|
|
257
|
+
return data
|
|
258
|
+
return cast(int | None, data)
|
|
259
|
+
|
|
260
|
+
private_result_expires_at = _parse_private_result_expires_at(
|
|
261
|
+
d.pop("private_result_expires_at")
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
private_result_available = d.pop("private_result_available")
|
|
265
|
+
|
|
266
|
+
options = OptionsSummary.from_dict(d.pop("options"))
|
|
267
|
+
|
|
268
|
+
fetched_bytes = d.pop("fetched_bytes", UNSET)
|
|
269
|
+
|
|
270
|
+
fetch_total_bytes = d.pop("fetch_total_bytes", UNSET)
|
|
271
|
+
|
|
272
|
+
job = cls(
|
|
273
|
+
id=id,
|
|
274
|
+
state=state,
|
|
275
|
+
mode=mode,
|
|
276
|
+
declared_seconds=declared_seconds,
|
|
277
|
+
verified_seconds=verified_seconds,
|
|
278
|
+
actual_seconds=actual_seconds,
|
|
279
|
+
billable_seconds=billable_seconds,
|
|
280
|
+
error=error,
|
|
281
|
+
failure_kind=failure_kind,
|
|
282
|
+
retry_of=retry_of,
|
|
283
|
+
created_at=created_at,
|
|
284
|
+
transcript_id=transcript_id,
|
|
285
|
+
private_result_expires_at=private_result_expires_at,
|
|
286
|
+
private_result_available=private_result_available,
|
|
287
|
+
options=options,
|
|
288
|
+
fetched_bytes=fetched_bytes,
|
|
289
|
+
fetch_total_bytes=fetch_total_bytes,
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
job.additional_properties = d
|
|
293
|
+
return job
|
|
294
|
+
|
|
295
|
+
@property
|
|
296
|
+
def additional_keys(self) -> list[str]:
|
|
297
|
+
return list(self.additional_properties.keys())
|
|
298
|
+
|
|
299
|
+
def __getitem__(self, key: str) -> Any:
|
|
300
|
+
return self.additional_properties[key]
|
|
301
|
+
|
|
302
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
303
|
+
self.additional_properties[key] = value
|
|
304
|
+
|
|
305
|
+
def __delitem__(self, key: str) -> None:
|
|
306
|
+
del self.additional_properties[key]
|
|
307
|
+
|
|
308
|
+
def __contains__(self, key: str) -> bool:
|
|
309
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
JobFailureKindType1 = Literal["media_undecodable", "media_unreadable"]
|
|
4
|
+
|
|
5
|
+
JOB_FAILURE_KIND_TYPE_1_VALUES: set[JobFailureKindType1] = {
|
|
6
|
+
"media_undecodable",
|
|
7
|
+
"media_unreadable",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def check_job_failure_kind_type_1(value: str) -> JobFailureKindType1:
|
|
12
|
+
if value in JOB_FAILURE_KIND_TYPE_1_VALUES:
|
|
13
|
+
return value
|
|
14
|
+
raise TypeError(
|
|
15
|
+
f"Unexpected value {value!r}. Expected one of {JOB_FAILURE_KIND_TYPE_1_VALUES!r}"
|
|
16
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
JobFailureKindType2Type1 = Literal["media_undecodable", "media_unreadable"]
|
|
4
|
+
|
|
5
|
+
JOB_FAILURE_KIND_TYPE_2_TYPE_1_VALUES: set[JobFailureKindType2Type1] = {
|
|
6
|
+
"media_undecodable",
|
|
7
|
+
"media_unreadable",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def check_job_failure_kind_type_2_type_1(value: str) -> JobFailureKindType2Type1:
|
|
12
|
+
if value in JOB_FAILURE_KIND_TYPE_2_TYPE_1_VALUES:
|
|
13
|
+
return value
|
|
14
|
+
raise TypeError(
|
|
15
|
+
f"Unexpected value {value!r}. Expected one of {JOB_FAILURE_KIND_TYPE_2_TYPE_1_VALUES!r}"
|
|
16
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
JobFailureKindType3Type1 = Literal["media_undecodable", "media_unreadable"]
|
|
4
|
+
|
|
5
|
+
JOB_FAILURE_KIND_TYPE_3_TYPE_1_VALUES: set[JobFailureKindType3Type1] = {
|
|
6
|
+
"media_undecodable",
|
|
7
|
+
"media_unreadable",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def check_job_failure_kind_type_3_type_1(value: str) -> JobFailureKindType3Type1:
|
|
12
|
+
if value in JOB_FAILURE_KIND_TYPE_3_TYPE_1_VALUES:
|
|
13
|
+
return value
|
|
14
|
+
raise TypeError(
|
|
15
|
+
f"Unexpected value {value!r}. Expected one of {JOB_FAILURE_KIND_TYPE_3_TYPE_1_VALUES!r}"
|
|
16
|
+
)
|
|
@@ -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.job import Job
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="JobList")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class JobList:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
jobs (list[Job]):
|
|
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
|
+
jobs: list[Job]
|
|
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
|
+
jobs = []
|
|
31
|
+
for jobs_item_data in self.jobs:
|
|
32
|
+
jobs_item = jobs_item_data.to_dict()
|
|
33
|
+
jobs.append(jobs_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
|
+
"jobs": jobs,
|
|
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.job import Job # noqa: PLC0415
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
jobs = []
|
|
55
|
+
_jobs = d.pop("jobs")
|
|
56
|
+
for jobs_item_data in _jobs:
|
|
57
|
+
jobs_item = Job.from_dict(jobs_item_data)
|
|
58
|
+
|
|
59
|
+
jobs.append(jobs_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
|
+
job_list = cls(
|
|
69
|
+
jobs=jobs,
|
|
70
|
+
next_cursor=next_cursor,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
job_list.additional_properties = d
|
|
74
|
+
return job_list
|
|
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
|
|
@@ -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="LiftTranscriptHoldResponse200")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class LiftTranscriptHoldResponse200:
|
|
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
|
+
lift_transcript_hold_response_200 = cls(
|
|
41
|
+
ok=ok,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
lift_transcript_hold_response_200.additional_properties = d
|
|
45
|
+
return lift_transcript_hold_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,17 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
ListJobsActive = Literal["1", "true", "yes"]
|
|
4
|
+
|
|
5
|
+
LIST_JOBS_ACTIVE_VALUES: set[ListJobsActive] = {
|
|
6
|
+
"1",
|
|
7
|
+
"true",
|
|
8
|
+
"yes",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def check_list_jobs_active(value: str) -> ListJobsActive:
|
|
13
|
+
if value in LIST_JOBS_ACTIVE_VALUES:
|
|
14
|
+
return value
|
|
15
|
+
raise TypeError(
|
|
16
|
+
f"Unexpected value {value!r}. Expected one of {LIST_JOBS_ACTIVE_VALUES!r}"
|
|
17
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
ListOrgMattersStatus = Literal["closed", "open"]
|
|
4
|
+
|
|
5
|
+
LIST_ORG_MATTERS_STATUS_VALUES: set[ListOrgMattersStatus] = {
|
|
6
|
+
"closed",
|
|
7
|
+
"open",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def check_list_org_matters_status(value: str) -> ListOrgMattersStatus:
|
|
12
|
+
if value in LIST_ORG_MATTERS_STATUS_VALUES:
|
|
13
|
+
return value
|
|
14
|
+
raise TypeError(
|
|
15
|
+
f"Unexpected value {value!r}. Expected one of {LIST_ORG_MATTERS_STATUS_VALUES!r}"
|
|
16
|
+
)
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
T = TypeVar("T", bound="OptionsSummary")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class OptionsSummary:
|
|
14
|
+
"""A content-free summary of the transcription options a job was submitted with: what was requested, never the free-
|
|
15
|
+
text content itself.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
language_code (None | str): The manually forced language, or null if language auto-detection was used.
|
|
19
|
+
speaker_detection (bool):
|
|
20
|
+
medical_mode (bool):
|
|
21
|
+
multichannel (bool):
|
|
22
|
+
translation_targets (list[str]):
|
|
23
|
+
keyterms (bool): Whether a keyterms prompt was set. The terms themselves are not included.
|
|
24
|
+
prompt (bool): Whether a free-text context prompt was set. The prompt itself is not included.
|
|
25
|
+
auto_generate_insights (bool | None): This upload's override of automatic Insights generation, or null if it
|
|
26
|
+
used the account default.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
language_code: None | str
|
|
30
|
+
speaker_detection: bool
|
|
31
|
+
medical_mode: bool
|
|
32
|
+
multichannel: bool
|
|
33
|
+
translation_targets: list[str]
|
|
34
|
+
keyterms: bool
|
|
35
|
+
prompt: bool
|
|
36
|
+
auto_generate_insights: bool | None
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
def to_dict(self) -> dict[str, Any]:
|
|
40
|
+
language_code: None | str
|
|
41
|
+
language_code = self.language_code
|
|
42
|
+
|
|
43
|
+
speaker_detection = self.speaker_detection
|
|
44
|
+
|
|
45
|
+
medical_mode = self.medical_mode
|
|
46
|
+
|
|
47
|
+
multichannel = self.multichannel
|
|
48
|
+
|
|
49
|
+
translation_targets = self.translation_targets
|
|
50
|
+
|
|
51
|
+
keyterms = self.keyterms
|
|
52
|
+
|
|
53
|
+
prompt = self.prompt
|
|
54
|
+
|
|
55
|
+
auto_generate_insights: bool | None
|
|
56
|
+
auto_generate_insights = self.auto_generate_insights
|
|
57
|
+
|
|
58
|
+
field_dict: dict[str, Any] = {}
|
|
59
|
+
field_dict.update(self.additional_properties)
|
|
60
|
+
field_dict.update(
|
|
61
|
+
{
|
|
62
|
+
"language_code": language_code,
|
|
63
|
+
"speaker_detection": speaker_detection,
|
|
64
|
+
"medical_mode": medical_mode,
|
|
65
|
+
"multichannel": multichannel,
|
|
66
|
+
"translation_targets": translation_targets,
|
|
67
|
+
"keyterms": keyterms,
|
|
68
|
+
"prompt": prompt,
|
|
69
|
+
"auto_generate_insights": auto_generate_insights,
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
return field_dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
77
|
+
d = dict(src_dict)
|
|
78
|
+
|
|
79
|
+
def _parse_language_code(data: object) -> None | str:
|
|
80
|
+
if data is None:
|
|
81
|
+
return data
|
|
82
|
+
return cast(None | str, data)
|
|
83
|
+
|
|
84
|
+
language_code = _parse_language_code(d.pop("language_code"))
|
|
85
|
+
|
|
86
|
+
speaker_detection = d.pop("speaker_detection")
|
|
87
|
+
|
|
88
|
+
medical_mode = d.pop("medical_mode")
|
|
89
|
+
|
|
90
|
+
multichannel = d.pop("multichannel")
|
|
91
|
+
|
|
92
|
+
translation_targets = cast(list[str], d.pop("translation_targets"))
|
|
93
|
+
|
|
94
|
+
keyterms = d.pop("keyterms")
|
|
95
|
+
|
|
96
|
+
prompt = d.pop("prompt")
|
|
97
|
+
|
|
98
|
+
def _parse_auto_generate_insights(data: object) -> bool | None:
|
|
99
|
+
if data is None:
|
|
100
|
+
return data
|
|
101
|
+
return cast(bool | None, data)
|
|
102
|
+
|
|
103
|
+
auto_generate_insights = _parse_auto_generate_insights(
|
|
104
|
+
d.pop("auto_generate_insights")
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
options_summary = cls(
|
|
108
|
+
language_code=language_code,
|
|
109
|
+
speaker_detection=speaker_detection,
|
|
110
|
+
medical_mode=medical_mode,
|
|
111
|
+
multichannel=multichannel,
|
|
112
|
+
translation_targets=translation_targets,
|
|
113
|
+
keyterms=keyterms,
|
|
114
|
+
prompt=prompt,
|
|
115
|
+
auto_generate_insights=auto_generate_insights,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
options_summary.additional_properties = d
|
|
119
|
+
return options_summary
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def additional_keys(self) -> list[str]:
|
|
123
|
+
return list(self.additional_properties.keys())
|
|
124
|
+
|
|
125
|
+
def __getitem__(self, key: str) -> Any:
|
|
126
|
+
return self.additional_properties[key]
|
|
127
|
+
|
|
128
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
129
|
+
self.additional_properties[key] = value
|
|
130
|
+
|
|
131
|
+
def __delitem__(self, key: str) -> None:
|
|
132
|
+
del self.additional_properties[key]
|
|
133
|
+
|
|
134
|
+
def __contains__(self, key: str) -> bool:
|
|
135
|
+
return key in self.additional_properties
|