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,246 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.get_upload_part_urls_response_200_type_0 import (
|
|
11
|
+
GetUploadPartUrlsResponse200Type0,
|
|
12
|
+
)
|
|
13
|
+
from ...types import UNSET, Response, Unset
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
job: str,
|
|
18
|
+
*,
|
|
19
|
+
start: int | Unset = 1,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
params: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
params["start"] = start
|
|
25
|
+
|
|
26
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "get",
|
|
30
|
+
"url": "/v1/uploads/{job}/part-urls".format(
|
|
31
|
+
job=quote(str(job), safe=""),
|
|
32
|
+
),
|
|
33
|
+
"params": params,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return _kwargs
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
41
|
+
) -> Error | GetUploadPartUrlsResponse200Type0 | None | None:
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
|
|
44
|
+
def _parse_response_200(
|
|
45
|
+
data: object,
|
|
46
|
+
) -> GetUploadPartUrlsResponse200Type0 | None:
|
|
47
|
+
if data is None:
|
|
48
|
+
return data
|
|
49
|
+
try:
|
|
50
|
+
if not isinstance(data, dict):
|
|
51
|
+
raise TypeError()
|
|
52
|
+
response_200_type_0 = GetUploadPartUrlsResponse200Type0.from_dict(data)
|
|
53
|
+
|
|
54
|
+
return response_200_type_0
|
|
55
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
56
|
+
pass
|
|
57
|
+
return cast(GetUploadPartUrlsResponse200Type0 | None, data)
|
|
58
|
+
|
|
59
|
+
response_200 = _parse_response_200(response.json())
|
|
60
|
+
|
|
61
|
+
return response_200
|
|
62
|
+
|
|
63
|
+
if response.status_code == 400:
|
|
64
|
+
response_400 = Error.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_400
|
|
67
|
+
|
|
68
|
+
if response.status_code == 401:
|
|
69
|
+
response_401 = Error.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_401
|
|
72
|
+
|
|
73
|
+
if response.status_code == 403:
|
|
74
|
+
response_403 = Error.from_dict(response.json())
|
|
75
|
+
|
|
76
|
+
return response_403
|
|
77
|
+
|
|
78
|
+
if response.status_code == 404:
|
|
79
|
+
response_404 = Error.from_dict(response.json())
|
|
80
|
+
|
|
81
|
+
return response_404
|
|
82
|
+
|
|
83
|
+
if response.status_code == 409:
|
|
84
|
+
response_409 = Error.from_dict(response.json())
|
|
85
|
+
|
|
86
|
+
return response_409
|
|
87
|
+
|
|
88
|
+
if response.status_code == 429:
|
|
89
|
+
response_429 = Error.from_dict(response.json())
|
|
90
|
+
|
|
91
|
+
return response_429
|
|
92
|
+
|
|
93
|
+
if response.status_code == 500:
|
|
94
|
+
response_500 = Error.from_dict(response.json())
|
|
95
|
+
|
|
96
|
+
return response_500
|
|
97
|
+
|
|
98
|
+
if client.raise_on_unexpected_status:
|
|
99
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
100
|
+
else:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def _build_response(
|
|
105
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
106
|
+
) -> Response[Error | GetUploadPartUrlsResponse200Type0 | None]:
|
|
107
|
+
return Response(
|
|
108
|
+
status_code=HTTPStatus(response.status_code),
|
|
109
|
+
content=response.content,
|
|
110
|
+
headers=response.headers,
|
|
111
|
+
parsed=_parse_response(client=client, response=response),
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def sync_detailed(
|
|
116
|
+
job: str,
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
start: int | Unset = 1,
|
|
120
|
+
) -> Response[Error | GetUploadPartUrlsResponse200Type0 | None]:
|
|
121
|
+
"""Fetch a page of presigned direct-to-R2 part URLs
|
|
122
|
+
|
|
123
|
+
Returns a fresh page of presigned PUT URLs for the given job's direct-to-R2 upload, starting at the
|
|
124
|
+
requested part number. Presigned URLs expire, so a client resuming a stalled transfer should call
|
|
125
|
+
this again rather than reusing URLs from create_upload's response.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
job (str):
|
|
129
|
+
start (int | Unset): Default: 1.
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Response[Error | GetUploadPartUrlsResponse200Type0 | None]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = _get_kwargs(
|
|
140
|
+
job=job,
|
|
141
|
+
start=start,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
response = client.get_httpx_client().request(
|
|
145
|
+
**kwargs,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
return _build_response(client=client, response=response)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def sync(
|
|
152
|
+
job: str,
|
|
153
|
+
*,
|
|
154
|
+
client: AuthenticatedClient,
|
|
155
|
+
start: int | Unset = 1,
|
|
156
|
+
) -> Error | GetUploadPartUrlsResponse200Type0 | None | None:
|
|
157
|
+
"""Fetch a page of presigned direct-to-R2 part URLs
|
|
158
|
+
|
|
159
|
+
Returns a fresh page of presigned PUT URLs for the given job's direct-to-R2 upload, starting at the
|
|
160
|
+
requested part number. Presigned URLs expire, so a client resuming a stalled transfer should call
|
|
161
|
+
this again rather than reusing URLs from create_upload's response.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
job (str):
|
|
165
|
+
start (int | Unset): Default: 1.
|
|
166
|
+
|
|
167
|
+
Raises:
|
|
168
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
169
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
Error | GetUploadPartUrlsResponse200Type0 | None
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
return sync_detailed(
|
|
176
|
+
job=job,
|
|
177
|
+
client=client,
|
|
178
|
+
start=start,
|
|
179
|
+
).parsed
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
async def asyncio_detailed(
|
|
183
|
+
job: str,
|
|
184
|
+
*,
|
|
185
|
+
client: AuthenticatedClient,
|
|
186
|
+
start: int | Unset = 1,
|
|
187
|
+
) -> Response[Error | GetUploadPartUrlsResponse200Type0 | None]:
|
|
188
|
+
"""Fetch a page of presigned direct-to-R2 part URLs
|
|
189
|
+
|
|
190
|
+
Returns a fresh page of presigned PUT URLs for the given job's direct-to-R2 upload, starting at the
|
|
191
|
+
requested part number. Presigned URLs expire, so a client resuming a stalled transfer should call
|
|
192
|
+
this again rather than reusing URLs from create_upload's response.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
job (str):
|
|
196
|
+
start (int | Unset): Default: 1.
|
|
197
|
+
|
|
198
|
+
Raises:
|
|
199
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
200
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
201
|
+
|
|
202
|
+
Returns:
|
|
203
|
+
Response[Error | GetUploadPartUrlsResponse200Type0 | None]
|
|
204
|
+
"""
|
|
205
|
+
|
|
206
|
+
kwargs = _get_kwargs(
|
|
207
|
+
job=job,
|
|
208
|
+
start=start,
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
212
|
+
|
|
213
|
+
return _build_response(client=client, response=response)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
async def asyncio(
|
|
217
|
+
job: str,
|
|
218
|
+
*,
|
|
219
|
+
client: AuthenticatedClient,
|
|
220
|
+
start: int | Unset = 1,
|
|
221
|
+
) -> Error | GetUploadPartUrlsResponse200Type0 | None | None:
|
|
222
|
+
"""Fetch a page of presigned direct-to-R2 part URLs
|
|
223
|
+
|
|
224
|
+
Returns a fresh page of presigned PUT URLs for the given job's direct-to-R2 upload, starting at the
|
|
225
|
+
requested part number. Presigned URLs expire, so a client resuming a stalled transfer should call
|
|
226
|
+
this again rather than reusing URLs from create_upload's response.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
job (str):
|
|
230
|
+
start (int | Unset): Default: 1.
|
|
231
|
+
|
|
232
|
+
Raises:
|
|
233
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
234
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
Error | GetUploadPartUrlsResponse200Type0 | None
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
await asyncio_detailed(
|
|
242
|
+
job=job,
|
|
243
|
+
client=client,
|
|
244
|
+
start=start,
|
|
245
|
+
)
|
|
246
|
+
).parsed
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.heartbeat_upload_response_200 import HeartbeatUploadResponse200
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
job: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "post",
|
|
20
|
+
"url": "/v1/uploads/{job}/heartbeat".format(
|
|
21
|
+
job=quote(str(job), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> Error | HeartbeatUploadResponse200 | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = HeartbeatUploadResponse200.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 401:
|
|
37
|
+
response_401 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_401
|
|
40
|
+
|
|
41
|
+
if response.status_code == 403:
|
|
42
|
+
response_403 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_403
|
|
45
|
+
|
|
46
|
+
if response.status_code == 409:
|
|
47
|
+
response_409 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_409
|
|
50
|
+
|
|
51
|
+
if response.status_code == 429:
|
|
52
|
+
response_429 = Error.from_dict(response.json())
|
|
53
|
+
|
|
54
|
+
return response_429
|
|
55
|
+
|
|
56
|
+
if response.status_code == 500:
|
|
57
|
+
response_500 = Error.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_500
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(
|
|
68
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
69
|
+
) -> Response[Error | HeartbeatUploadResponse200]:
|
|
70
|
+
return Response(
|
|
71
|
+
status_code=HTTPStatus(response.status_code),
|
|
72
|
+
content=response.content,
|
|
73
|
+
headers=response.headers,
|
|
74
|
+
parsed=_parse_response(client=client, response=response),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def sync_detailed(
|
|
79
|
+
job: str,
|
|
80
|
+
*,
|
|
81
|
+
client: AuthenticatedClient,
|
|
82
|
+
) -> Response[Error | HeartbeatUploadResponse200]:
|
|
83
|
+
"""Keep a direct-to-R2 upload alive
|
|
84
|
+
|
|
85
|
+
Refreshes the job's activity clock for a direct-to-R2 transfer, whose bytes never pass through this
|
|
86
|
+
API and so never otherwise refresh it. Call this at an interval well under the 20 minute idle
|
|
87
|
+
timeout for the whole duration of a long transfer, or the job is reaped mid-flight.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
job (str):
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
94
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Response[Error | HeartbeatUploadResponse200]
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
kwargs = _get_kwargs(
|
|
101
|
+
job=job,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
response = client.get_httpx_client().request(
|
|
105
|
+
**kwargs,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return _build_response(client=client, response=response)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def sync(
|
|
112
|
+
job: str,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
) -> Error | HeartbeatUploadResponse200 | None:
|
|
116
|
+
"""Keep a direct-to-R2 upload alive
|
|
117
|
+
|
|
118
|
+
Refreshes the job's activity clock for a direct-to-R2 transfer, whose bytes never pass through this
|
|
119
|
+
API and so never otherwise refresh it. Call this at an interval well under the 20 minute idle
|
|
120
|
+
timeout for the whole duration of a long transfer, or the job is reaped mid-flight.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
job (str):
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Error | HeartbeatUploadResponse200
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return sync_detailed(
|
|
134
|
+
job=job,
|
|
135
|
+
client=client,
|
|
136
|
+
).parsed
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio_detailed(
|
|
140
|
+
job: str,
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient,
|
|
143
|
+
) -> Response[Error | HeartbeatUploadResponse200]:
|
|
144
|
+
"""Keep a direct-to-R2 upload alive
|
|
145
|
+
|
|
146
|
+
Refreshes the job's activity clock for a direct-to-R2 transfer, whose bytes never pass through this
|
|
147
|
+
API and so never otherwise refresh it. Call this at an interval well under the 20 minute idle
|
|
148
|
+
timeout for the whole duration of a long transfer, or the job is reaped mid-flight.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
job (str):
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
Response[Error | HeartbeatUploadResponse200]
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
kwargs = _get_kwargs(
|
|
162
|
+
job=job,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
166
|
+
|
|
167
|
+
return _build_response(client=client, response=response)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
async def asyncio(
|
|
171
|
+
job: str,
|
|
172
|
+
*,
|
|
173
|
+
client: AuthenticatedClient,
|
|
174
|
+
) -> Error | HeartbeatUploadResponse200 | None:
|
|
175
|
+
"""Keep a direct-to-R2 upload alive
|
|
176
|
+
|
|
177
|
+
Refreshes the job's activity clock for a direct-to-R2 transfer, whose bytes never pass through this
|
|
178
|
+
API and so never otherwise refresh it. Call this at an interval well under the 20 minute idle
|
|
179
|
+
timeout for the whole duration of a long transfer, or the job is reaped mid-flight.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
job (str):
|
|
183
|
+
|
|
184
|
+
Raises:
|
|
185
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
186
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
187
|
+
|
|
188
|
+
Returns:
|
|
189
|
+
Error | HeartbeatUploadResponse200
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
await asyncio_detailed(
|
|
194
|
+
job=job,
|
|
195
|
+
client=client,
|
|
196
|
+
)
|
|
197
|
+
).parsed
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.lift_transcript_hold_response_200 import LiftTranscriptHoldResponse200
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "delete",
|
|
20
|
+
"url": "/v1/org/transcripts/{id}/hold".format(
|
|
21
|
+
id=quote(str(id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> Error | LiftTranscriptHoldResponse200 | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = LiftTranscriptHoldResponse200.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 400:
|
|
37
|
+
response_400 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_400
|
|
40
|
+
|
|
41
|
+
if response.status_code == 401:
|
|
42
|
+
response_401 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_401
|
|
45
|
+
|
|
46
|
+
if response.status_code == 403:
|
|
47
|
+
response_403 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_403
|
|
50
|
+
|
|
51
|
+
if response.status_code == 404:
|
|
52
|
+
response_404 = Error.from_dict(response.json())
|
|
53
|
+
|
|
54
|
+
return response_404
|
|
55
|
+
|
|
56
|
+
if response.status_code == 429:
|
|
57
|
+
response_429 = Error.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_429
|
|
60
|
+
|
|
61
|
+
if response.status_code == 500:
|
|
62
|
+
response_500 = Error.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
return response_500
|
|
65
|
+
|
|
66
|
+
if client.raise_on_unexpected_status:
|
|
67
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
68
|
+
else:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _build_response(
|
|
73
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
74
|
+
) -> Response[Error | LiftTranscriptHoldResponse200]:
|
|
75
|
+
return Response(
|
|
76
|
+
status_code=HTTPStatus(response.status_code),
|
|
77
|
+
content=response.content,
|
|
78
|
+
headers=response.headers,
|
|
79
|
+
parsed=_parse_response(client=client, response=response),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def sync_detailed(
|
|
84
|
+
id: str,
|
|
85
|
+
*,
|
|
86
|
+
client: AuthenticatedClient,
|
|
87
|
+
) -> Response[Error | LiftTranscriptHoldResponse200]:
|
|
88
|
+
"""Lift a legal hold on a transcript
|
|
89
|
+
|
|
90
|
+
Reviewer only. Lifts a legal hold on one transcript in the caller's firm-custody workspace. A held
|
|
91
|
+
transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion,
|
|
92
|
+
and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409
|
|
93
|
+
transcript_legal_hold), until the hold is lifted.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
id (str):
|
|
97
|
+
|
|
98
|
+
Raises:
|
|
99
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
100
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
Response[Error | LiftTranscriptHoldResponse200]
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
kwargs = _get_kwargs(
|
|
107
|
+
id=id,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = client.get_httpx_client().request(
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def sync(
|
|
118
|
+
id: str,
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient,
|
|
121
|
+
) -> Error | LiftTranscriptHoldResponse200 | None:
|
|
122
|
+
"""Lift a legal hold on a transcript
|
|
123
|
+
|
|
124
|
+
Reviewer only. Lifts a legal hold on one transcript in the caller's firm-custody workspace. A held
|
|
125
|
+
transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion,
|
|
126
|
+
and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409
|
|
127
|
+
transcript_legal_hold), until the hold is lifted.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
id (str):
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Error | LiftTranscriptHoldResponse200
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
return sync_detailed(
|
|
141
|
+
id=id,
|
|
142
|
+
client=client,
|
|
143
|
+
).parsed
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio_detailed(
|
|
147
|
+
id: str,
|
|
148
|
+
*,
|
|
149
|
+
client: AuthenticatedClient,
|
|
150
|
+
) -> Response[Error | LiftTranscriptHoldResponse200]:
|
|
151
|
+
"""Lift a legal hold on a transcript
|
|
152
|
+
|
|
153
|
+
Reviewer only. Lifts a legal hold on one transcript in the caller's firm-custody workspace. A held
|
|
154
|
+
transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion,
|
|
155
|
+
and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409
|
|
156
|
+
transcript_legal_hold), until the hold is lifted.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
id (str):
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
Response[Error | LiftTranscriptHoldResponse200]
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
kwargs = _get_kwargs(
|
|
170
|
+
id=id,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
174
|
+
|
|
175
|
+
return _build_response(client=client, response=response)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
async def asyncio(
|
|
179
|
+
id: str,
|
|
180
|
+
*,
|
|
181
|
+
client: AuthenticatedClient,
|
|
182
|
+
) -> Error | LiftTranscriptHoldResponse200 | None:
|
|
183
|
+
"""Lift a legal hold on a transcript
|
|
184
|
+
|
|
185
|
+
Reviewer only. Lifts a legal hold on one transcript in the caller's firm-custody workspace. A held
|
|
186
|
+
transcript is exempt from the retention sweep, the retention re-clamp sweep and ordinary deletion,
|
|
187
|
+
and its body, translations, cleaned text and AI outputs cannot be edited or regenerated (409
|
|
188
|
+
transcript_legal_hold), until the hold is lifted.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
id (str):
|
|
192
|
+
|
|
193
|
+
Raises:
|
|
194
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
195
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
Error | LiftTranscriptHoldResponse200
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
await asyncio_detailed(
|
|
203
|
+
id=id,
|
|
204
|
+
client=client,
|
|
205
|
+
)
|
|
206
|
+
).parsed
|