athena-intelligence 0.1.124__py3-none-any.whl → 0.1.126__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.
- athena/__init__.py +3 -0
- athena/agents/client.py +88 -36
- athena/agents/drive/client.py +80 -32
- athena/agents/general/client.py +222 -91
- athena/agents/research/client.py +80 -32
- athena/agents/sql/client.py +80 -32
- athena/base_client.py +13 -11
- athena/client.py +191 -80
- athena/core/__init__.py +21 -4
- athena/core/client_wrapper.py +9 -10
- athena/core/file.py +37 -8
- athena/core/http_client.py +97 -41
- athena/core/jsonable_encoder.py +33 -31
- athena/core/pydantic_utilities.py +272 -4
- athena/core/query_encoder.py +38 -13
- athena/core/request_options.py +5 -2
- athena/core/serialization.py +272 -0
- athena/errors/internal_server_error.py +2 -3
- athena/errors/unauthorized_error.py +2 -3
- athena/errors/unprocessable_entity_error.py +2 -3
- athena/query/client.py +208 -58
- athena/tools/calendar/client.py +82 -30
- athena/tools/client.py +576 -184
- athena/tools/email/client.py +117 -43
- athena/tools/structured_data_extractor/client.py +118 -67
- athena/tools/tasks/client.py +41 -17
- athena/types/asset_node.py +14 -24
- athena/types/asset_not_found_error.py +11 -21
- athena/types/chunk.py +11 -21
- athena/types/chunk_content_item.py +21 -41
- athena/types/chunk_result.py +13 -23
- athena/types/custom_agent_response.py +12 -22
- athena/types/data_frame_request_out.py +11 -21
- athena/types/data_frame_unknown_format_error.py +11 -21
- athena/types/document_chunk.py +12 -22
- athena/types/drive_agent_response.py +12 -22
- athena/types/file_chunk_request_out.py +11 -21
- athena/types/file_too_large_error.py +11 -21
- athena/types/folder_response.py +11 -21
- athena/types/general_agent_config.py +11 -21
- athena/types/general_agent_config_enabled_tools_item.py +0 -1
- athena/types/general_agent_request.py +13 -23
- athena/types/general_agent_response.py +12 -22
- athena/types/image_url_content.py +11 -21
- athena/types/parent_folder_error.py +11 -21
- athena/types/prompt_message.py +12 -22
- athena/types/research_agent_response.py +12 -22
- athena/types/save_asset_request_out.py +11 -21
- athena/types/sql_agent_response.py +13 -23
- athena/types/structured_data_extractor_response.py +15 -25
- athena/types/text_content.py +11 -21
- athena/types/tool.py +1 -13
- athena/types/type.py +1 -21
- athena/version.py +0 -1
- {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/METADATA +12 -4
- athena_intelligence-0.1.126.dist-info/RECORD +87 -0
- {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/WHEEL +1 -1
- athena_intelligence-0.1.124.dist-info/RECORD +0 -86
athena/tools/client.py
CHANGED
@@ -1,33 +1,37 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
from
|
5
|
-
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from ..core.pydantic_utilities import pydantic_v1
|
4
|
+
from ..core.client_wrapper import SyncClientWrapper
|
5
|
+
from .calendar.client import CalendarClient
|
6
|
+
from .email.client import EmailClient
|
7
|
+
from .structured_data_extractor.client import StructuredDataExtractorClient
|
8
|
+
from .tasks.client import TasksClient
|
10
9
|
from ..core.request_options import RequestOptions
|
11
|
-
from ..
|
12
|
-
from ..
|
13
|
-
from ..errors.internal_server_error import InternalServerError
|
14
|
-
from ..errors.not_found_error import NotFoundError
|
10
|
+
from ..types.file_chunk_request_out import FileChunkRequestOut
|
11
|
+
from ..core.pydantic_utilities import parse_obj_as
|
15
12
|
from ..errors.unauthorized_error import UnauthorizedError
|
16
|
-
from ..errors.
|
17
|
-
from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
|
13
|
+
from ..errors.not_found_error import NotFoundError
|
18
14
|
from ..types.asset_not_found_error import AssetNotFoundError
|
19
|
-
from ..
|
20
|
-
from
|
21
|
-
from ..
|
22
|
-
from ..types.file_too_large_error import FileTooLargeError
|
15
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
16
|
+
from json.decoder import JSONDecodeError
|
17
|
+
from ..core.api_error import ApiError
|
23
18
|
from ..types.folder_response import FolderResponse
|
19
|
+
from ..errors.bad_request_error import BadRequestError
|
24
20
|
from ..types.parent_folder_error import ParentFolderError
|
25
|
-
from ..types.save_asset_request_out import SaveAssetRequestOut
|
26
|
-
from .calendar.client import AsyncCalendarClient, CalendarClient
|
27
|
-
from .email.client import AsyncEmailClient, EmailClient
|
28
|
-
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
|
29
|
-
from .tasks.client import AsyncTasksClient, TasksClient
|
30
21
|
from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
|
22
|
+
from ..types.data_frame_request_out import DataFrameRequestOut
|
23
|
+
from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
|
24
|
+
from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
|
25
|
+
from ..errors.internal_server_error import InternalServerError
|
26
|
+
from .. import core
|
27
|
+
from ..types.save_asset_request_out import SaveAssetRequestOut
|
28
|
+
from ..errors.content_too_large_error import ContentTooLargeError
|
29
|
+
from ..types.file_too_large_error import FileTooLargeError
|
30
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
31
|
+
from .calendar.client import AsyncCalendarClient
|
32
|
+
from .email.client import AsyncEmailClient
|
33
|
+
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient
|
34
|
+
from .tasks.client import AsyncTasksClient
|
31
35
|
|
32
36
|
# this is used as the default value for optional parameters
|
33
37
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -62,7 +66,7 @@ class ToolsClient:
|
|
62
66
|
|
63
67
|
Examples
|
64
68
|
--------
|
65
|
-
from athena
|
69
|
+
from athena import Athena
|
66
70
|
|
67
71
|
client = Athena(
|
68
72
|
api_key="YOUR_API_KEY",
|
@@ -77,19 +81,54 @@ class ToolsClient:
|
|
77
81
|
_response = self._client_wrapper.httpx_client.request(
|
78
82
|
"api/v0/tools/asset/chunks",
|
79
83
|
method="POST",
|
80
|
-
json={
|
84
|
+
json={
|
85
|
+
"asset_ids": asset_ids,
|
86
|
+
},
|
87
|
+
headers={
|
88
|
+
"content-type": "application/json",
|
89
|
+
},
|
81
90
|
request_options=request_options,
|
82
91
|
omit=OMIT,
|
83
92
|
)
|
84
|
-
if 200 <= _response.status_code < 300:
|
85
|
-
return pydantic_v1.parse_obj_as(FileChunkRequestOut, _response.json()) # type: ignore
|
86
|
-
if _response.status_code == 401:
|
87
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
88
|
-
if _response.status_code == 404:
|
89
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
90
|
-
if _response.status_code == 422:
|
91
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
92
93
|
try:
|
94
|
+
if 200 <= _response.status_code < 300:
|
95
|
+
return typing.cast(
|
96
|
+
FileChunkRequestOut,
|
97
|
+
parse_obj_as(
|
98
|
+
type_=FileChunkRequestOut, # type: ignore
|
99
|
+
object_=_response.json(),
|
100
|
+
),
|
101
|
+
)
|
102
|
+
if _response.status_code == 401:
|
103
|
+
raise UnauthorizedError(
|
104
|
+
typing.cast(
|
105
|
+
typing.Optional[typing.Any],
|
106
|
+
parse_obj_as(
|
107
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
108
|
+
object_=_response.json(),
|
109
|
+
),
|
110
|
+
)
|
111
|
+
)
|
112
|
+
if _response.status_code == 404:
|
113
|
+
raise NotFoundError(
|
114
|
+
typing.cast(
|
115
|
+
AssetNotFoundError,
|
116
|
+
parse_obj_as(
|
117
|
+
type_=AssetNotFoundError, # type: ignore
|
118
|
+
object_=_response.json(),
|
119
|
+
),
|
120
|
+
)
|
121
|
+
)
|
122
|
+
if _response.status_code == 422:
|
123
|
+
raise UnprocessableEntityError(
|
124
|
+
typing.cast(
|
125
|
+
typing.Optional[typing.Any],
|
126
|
+
parse_obj_as(
|
127
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
128
|
+
object_=_response.json(),
|
129
|
+
),
|
130
|
+
)
|
131
|
+
)
|
93
132
|
_response_json = _response.json()
|
94
133
|
except JSONDecodeError:
|
95
134
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -101,7 +140,7 @@ class ToolsClient:
|
|
101
140
|
folder_id: typing.Optional[str] = None,
|
102
141
|
include_asset_details: typing.Optional[bool] = None,
|
103
142
|
include_system_files: typing.Optional[bool] = None,
|
104
|
-
request_options: typing.Optional[RequestOptions] = None
|
143
|
+
request_options: typing.Optional[RequestOptions] = None,
|
105
144
|
) -> FolderResponse:
|
106
145
|
"""
|
107
146
|
List contents of a folder or entire workspace in a tree structure.
|
@@ -124,7 +163,7 @@ class ToolsClient:
|
|
124
163
|
|
125
164
|
Examples
|
126
165
|
--------
|
127
|
-
from athena
|
166
|
+
from athena import Athena
|
128
167
|
|
129
168
|
client = Athena(
|
130
169
|
api_key="YOUR_API_KEY",
|
@@ -141,17 +180,55 @@ class ToolsClient:
|
|
141
180
|
},
|
142
181
|
request_options=request_options,
|
143
182
|
)
|
144
|
-
if 200 <= _response.status_code < 300:
|
145
|
-
return pydantic_v1.parse_obj_as(FolderResponse, _response.json()) # type: ignore
|
146
|
-
if _response.status_code == 400:
|
147
|
-
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
148
|
-
if _response.status_code == 401:
|
149
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
150
|
-
if _response.status_code == 404:
|
151
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
152
|
-
if _response.status_code == 422:
|
153
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
154
183
|
try:
|
184
|
+
if 200 <= _response.status_code < 300:
|
185
|
+
return typing.cast(
|
186
|
+
FolderResponse,
|
187
|
+
parse_obj_as(
|
188
|
+
type_=FolderResponse, # type: ignore
|
189
|
+
object_=_response.json(),
|
190
|
+
),
|
191
|
+
)
|
192
|
+
if _response.status_code == 400:
|
193
|
+
raise BadRequestError(
|
194
|
+
typing.cast(
|
195
|
+
ParentFolderError,
|
196
|
+
parse_obj_as(
|
197
|
+
type_=ParentFolderError, # type: ignore
|
198
|
+
object_=_response.json(),
|
199
|
+
),
|
200
|
+
)
|
201
|
+
)
|
202
|
+
if _response.status_code == 401:
|
203
|
+
raise UnauthorizedError(
|
204
|
+
typing.cast(
|
205
|
+
typing.Optional[typing.Any],
|
206
|
+
parse_obj_as(
|
207
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
208
|
+
object_=_response.json(),
|
209
|
+
),
|
210
|
+
)
|
211
|
+
)
|
212
|
+
if _response.status_code == 404:
|
213
|
+
raise NotFoundError(
|
214
|
+
typing.cast(
|
215
|
+
AssetNotFoundError,
|
216
|
+
parse_obj_as(
|
217
|
+
type_=AssetNotFoundError, # type: ignore
|
218
|
+
object_=_response.json(),
|
219
|
+
),
|
220
|
+
)
|
221
|
+
)
|
222
|
+
if _response.status_code == 422:
|
223
|
+
raise UnprocessableEntityError(
|
224
|
+
typing.cast(
|
225
|
+
typing.Optional[typing.Any],
|
226
|
+
parse_obj_as(
|
227
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
228
|
+
object_=_response.json(),
|
229
|
+
),
|
230
|
+
)
|
231
|
+
)
|
155
232
|
_response_json = _response.json()
|
156
233
|
except JSONDecodeError:
|
157
234
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -168,7 +245,7 @@ class ToolsClient:
|
|
168
245
|
] = None,
|
169
246
|
sheet_name: typing.Optional[int] = None,
|
170
247
|
separator: typing.Optional[str] = None,
|
171
|
-
request_options: typing.Optional[RequestOptions] = None
|
248
|
+
request_options: typing.Optional[RequestOptions] = None,
|
172
249
|
) -> DataFrameRequestOut:
|
173
250
|
"""
|
174
251
|
Parameters
|
@@ -198,7 +275,7 @@ class ToolsClient:
|
|
198
275
|
|
199
276
|
Examples
|
200
277
|
--------
|
201
|
-
from athena
|
278
|
+
from athena import Athena
|
202
279
|
|
203
280
|
client = Athena(
|
204
281
|
api_key="YOUR_API_KEY",
|
@@ -220,21 +297,65 @@ class ToolsClient:
|
|
220
297
|
},
|
221
298
|
request_options=request_options,
|
222
299
|
)
|
223
|
-
if 200 <= _response.status_code < 300:
|
224
|
-
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
225
|
-
if _response.status_code == 401:
|
226
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
227
|
-
if _response.status_code == 404:
|
228
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
229
|
-
if _response.status_code == 415:
|
230
|
-
raise UnsupportedMediaTypeError(
|
231
|
-
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
232
|
-
)
|
233
|
-
if _response.status_code == 422:
|
234
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
235
|
-
if _response.status_code == 500:
|
236
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
237
300
|
try:
|
301
|
+
if 200 <= _response.status_code < 300:
|
302
|
+
return typing.cast(
|
303
|
+
DataFrameRequestOut,
|
304
|
+
parse_obj_as(
|
305
|
+
type_=DataFrameRequestOut, # type: ignore
|
306
|
+
object_=_response.json(),
|
307
|
+
),
|
308
|
+
)
|
309
|
+
if _response.status_code == 401:
|
310
|
+
raise UnauthorizedError(
|
311
|
+
typing.cast(
|
312
|
+
typing.Optional[typing.Any],
|
313
|
+
parse_obj_as(
|
314
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
315
|
+
object_=_response.json(),
|
316
|
+
),
|
317
|
+
)
|
318
|
+
)
|
319
|
+
if _response.status_code == 404:
|
320
|
+
raise NotFoundError(
|
321
|
+
typing.cast(
|
322
|
+
AssetNotFoundError,
|
323
|
+
parse_obj_as(
|
324
|
+
type_=AssetNotFoundError, # type: ignore
|
325
|
+
object_=_response.json(),
|
326
|
+
),
|
327
|
+
)
|
328
|
+
)
|
329
|
+
if _response.status_code == 415:
|
330
|
+
raise UnsupportedMediaTypeError(
|
331
|
+
typing.cast(
|
332
|
+
DataFrameUnknownFormatError,
|
333
|
+
parse_obj_as(
|
334
|
+
type_=DataFrameUnknownFormatError, # type: ignore
|
335
|
+
object_=_response.json(),
|
336
|
+
),
|
337
|
+
)
|
338
|
+
)
|
339
|
+
if _response.status_code == 422:
|
340
|
+
raise UnprocessableEntityError(
|
341
|
+
typing.cast(
|
342
|
+
typing.Optional[typing.Any],
|
343
|
+
parse_obj_as(
|
344
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
345
|
+
object_=_response.json(),
|
346
|
+
),
|
347
|
+
)
|
348
|
+
)
|
349
|
+
if _response.status_code == 500:
|
350
|
+
raise InternalServerError(
|
351
|
+
typing.cast(
|
352
|
+
typing.Optional[typing.Any],
|
353
|
+
parse_obj_as(
|
354
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
355
|
+
object_=_response.json(),
|
356
|
+
),
|
357
|
+
)
|
358
|
+
)
|
238
359
|
_response_json = _response.json()
|
239
360
|
except JSONDecodeError:
|
240
361
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -251,41 +372,68 @@ class ToolsClient:
|
|
251
372
|
asset_id : str
|
252
373
|
|
253
374
|
request_options : typing.Optional[RequestOptions]
|
254
|
-
Request-specific configuration.
|
375
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
255
376
|
|
256
377
|
Yields
|
257
378
|
------
|
258
379
|
typing.Iterator[bytes]
|
259
380
|
Stream the file in original format.
|
260
|
-
|
261
|
-
Examples
|
262
|
-
--------
|
263
|
-
from athena.client import Athena
|
264
|
-
|
265
|
-
client = Athena(
|
266
|
-
api_key="YOUR_API_KEY",
|
267
|
-
)
|
268
|
-
client.tools.raw_data(
|
269
|
-
asset_id="string",
|
270
|
-
)
|
271
381
|
"""
|
272
382
|
with self._client_wrapper.httpx_client.stream(
|
273
|
-
"api/v0/tools/file/raw-data",
|
383
|
+
"api/v0/tools/file/raw-data",
|
384
|
+
method="GET",
|
385
|
+
params={
|
386
|
+
"asset_id": asset_id,
|
387
|
+
},
|
388
|
+
request_options=request_options,
|
274
389
|
) as _response:
|
275
|
-
if 200 <= _response.status_code < 300:
|
276
|
-
for _chunk in _response.iter_bytes():
|
277
|
-
yield _chunk
|
278
|
-
return
|
279
|
-
_response.read()
|
280
|
-
if _response.status_code == 401:
|
281
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
282
|
-
if _response.status_code == 404:
|
283
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
284
|
-
if _response.status_code == 422:
|
285
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
286
|
-
if _response.status_code == 500:
|
287
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
288
390
|
try:
|
391
|
+
if 200 <= _response.status_code < 300:
|
392
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
393
|
+
for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
|
394
|
+
yield _chunk
|
395
|
+
return
|
396
|
+
_response.read()
|
397
|
+
if _response.status_code == 401:
|
398
|
+
raise UnauthorizedError(
|
399
|
+
typing.cast(
|
400
|
+
typing.Optional[typing.Any],
|
401
|
+
parse_obj_as(
|
402
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
403
|
+
object_=_response.json(),
|
404
|
+
),
|
405
|
+
)
|
406
|
+
)
|
407
|
+
if _response.status_code == 404:
|
408
|
+
raise NotFoundError(
|
409
|
+
typing.cast(
|
410
|
+
AssetNotFoundError,
|
411
|
+
parse_obj_as(
|
412
|
+
type_=AssetNotFoundError, # type: ignore
|
413
|
+
object_=_response.json(),
|
414
|
+
),
|
415
|
+
)
|
416
|
+
)
|
417
|
+
if _response.status_code == 422:
|
418
|
+
raise UnprocessableEntityError(
|
419
|
+
typing.cast(
|
420
|
+
typing.Optional[typing.Any],
|
421
|
+
parse_obj_as(
|
422
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
423
|
+
object_=_response.json(),
|
424
|
+
),
|
425
|
+
)
|
426
|
+
)
|
427
|
+
if _response.status_code == 500:
|
428
|
+
raise InternalServerError(
|
429
|
+
typing.cast(
|
430
|
+
typing.Optional[typing.Any],
|
431
|
+
parse_obj_as(
|
432
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
433
|
+
object_=_response.json(),
|
434
|
+
),
|
435
|
+
)
|
436
|
+
)
|
289
437
|
_response_json = _response.json()
|
290
438
|
except JSONDecodeError:
|
291
439
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -296,7 +444,7 @@ class ToolsClient:
|
|
296
444
|
*,
|
297
445
|
file: core.File,
|
298
446
|
parent_folder_id: typing.Optional[str] = None,
|
299
|
-
request_options: typing.Optional[RequestOptions] = None
|
447
|
+
request_options: typing.Optional[RequestOptions] = None,
|
300
448
|
) -> SaveAssetRequestOut:
|
301
449
|
"""
|
302
450
|
Parameters
|
@@ -317,7 +465,7 @@ class ToolsClient:
|
|
317
465
|
|
318
466
|
Examples
|
319
467
|
--------
|
320
|
-
from athena
|
468
|
+
from athena import Athena
|
321
469
|
|
322
470
|
client = Athena(
|
323
471
|
api_key="YOUR_API_KEY",
|
@@ -327,21 +475,55 @@ class ToolsClient:
|
|
327
475
|
_response = self._client_wrapper.httpx_client.request(
|
328
476
|
"api/v0/tools/file/save",
|
329
477
|
method="POST",
|
330
|
-
params={
|
478
|
+
params={
|
479
|
+
"parent_folder_id": parent_folder_id,
|
480
|
+
},
|
331
481
|
data={},
|
332
|
-
files={
|
482
|
+
files={
|
483
|
+
"file": file,
|
484
|
+
},
|
333
485
|
request_options=request_options,
|
334
486
|
omit=OMIT,
|
335
487
|
)
|
336
|
-
if 200 <= _response.status_code < 300:
|
337
|
-
return pydantic_v1.parse_obj_as(SaveAssetRequestOut, _response.json()) # type: ignore
|
338
|
-
if _response.status_code == 400:
|
339
|
-
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
340
|
-
if _response.status_code == 413:
|
341
|
-
raise ContentTooLargeError(pydantic_v1.parse_obj_as(FileTooLargeError, _response.json())) # type: ignore
|
342
|
-
if _response.status_code == 422:
|
343
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
344
488
|
try:
|
489
|
+
if 200 <= _response.status_code < 300:
|
490
|
+
return typing.cast(
|
491
|
+
SaveAssetRequestOut,
|
492
|
+
parse_obj_as(
|
493
|
+
type_=SaveAssetRequestOut, # type: ignore
|
494
|
+
object_=_response.json(),
|
495
|
+
),
|
496
|
+
)
|
497
|
+
if _response.status_code == 400:
|
498
|
+
raise BadRequestError(
|
499
|
+
typing.cast(
|
500
|
+
ParentFolderError,
|
501
|
+
parse_obj_as(
|
502
|
+
type_=ParentFolderError, # type: ignore
|
503
|
+
object_=_response.json(),
|
504
|
+
),
|
505
|
+
)
|
506
|
+
)
|
507
|
+
if _response.status_code == 413:
|
508
|
+
raise ContentTooLargeError(
|
509
|
+
typing.cast(
|
510
|
+
FileTooLargeError,
|
511
|
+
parse_obj_as(
|
512
|
+
type_=FileTooLargeError, # type: ignore
|
513
|
+
object_=_response.json(),
|
514
|
+
),
|
515
|
+
)
|
516
|
+
)
|
517
|
+
if _response.status_code == 422:
|
518
|
+
raise UnprocessableEntityError(
|
519
|
+
typing.cast(
|
520
|
+
typing.Optional[typing.Any],
|
521
|
+
parse_obj_as(
|
522
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
523
|
+
object_=_response.json(),
|
524
|
+
),
|
525
|
+
)
|
526
|
+
)
|
345
527
|
_response_json = _response.json()
|
346
528
|
except JSONDecodeError:
|
347
529
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -377,34 +559,77 @@ class AsyncToolsClient:
|
|
377
559
|
|
378
560
|
Examples
|
379
561
|
--------
|
380
|
-
|
562
|
+
import asyncio
|
563
|
+
|
564
|
+
from athena import AsyncAthena
|
381
565
|
|
382
566
|
client = AsyncAthena(
|
383
567
|
api_key="YOUR_API_KEY",
|
384
568
|
)
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
569
|
+
|
570
|
+
|
571
|
+
async def main() -> None:
|
572
|
+
await client.tools.get_asset_chunks(
|
573
|
+
asset_ids=[
|
574
|
+
"asset_9249292-d118-42d3-96b4-00eccfe0754f",
|
575
|
+
"asset_9249292-d118-42d3-95b4-01eccfe0754f",
|
576
|
+
],
|
577
|
+
)
|
578
|
+
|
579
|
+
|
580
|
+
asyncio.run(main())
|
391
581
|
"""
|
392
582
|
_response = await self._client_wrapper.httpx_client.request(
|
393
583
|
"api/v0/tools/asset/chunks",
|
394
584
|
method="POST",
|
395
|
-
json={
|
585
|
+
json={
|
586
|
+
"asset_ids": asset_ids,
|
587
|
+
},
|
588
|
+
headers={
|
589
|
+
"content-type": "application/json",
|
590
|
+
},
|
396
591
|
request_options=request_options,
|
397
592
|
omit=OMIT,
|
398
593
|
)
|
399
|
-
if 200 <= _response.status_code < 300:
|
400
|
-
return pydantic_v1.parse_obj_as(FileChunkRequestOut, _response.json()) # type: ignore
|
401
|
-
if _response.status_code == 401:
|
402
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
403
|
-
if _response.status_code == 404:
|
404
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
405
|
-
if _response.status_code == 422:
|
406
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
407
594
|
try:
|
595
|
+
if 200 <= _response.status_code < 300:
|
596
|
+
return typing.cast(
|
597
|
+
FileChunkRequestOut,
|
598
|
+
parse_obj_as(
|
599
|
+
type_=FileChunkRequestOut, # type: ignore
|
600
|
+
object_=_response.json(),
|
601
|
+
),
|
602
|
+
)
|
603
|
+
if _response.status_code == 401:
|
604
|
+
raise UnauthorizedError(
|
605
|
+
typing.cast(
|
606
|
+
typing.Optional[typing.Any],
|
607
|
+
parse_obj_as(
|
608
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
609
|
+
object_=_response.json(),
|
610
|
+
),
|
611
|
+
)
|
612
|
+
)
|
613
|
+
if _response.status_code == 404:
|
614
|
+
raise NotFoundError(
|
615
|
+
typing.cast(
|
616
|
+
AssetNotFoundError,
|
617
|
+
parse_obj_as(
|
618
|
+
type_=AssetNotFoundError, # type: ignore
|
619
|
+
object_=_response.json(),
|
620
|
+
),
|
621
|
+
)
|
622
|
+
)
|
623
|
+
if _response.status_code == 422:
|
624
|
+
raise UnprocessableEntityError(
|
625
|
+
typing.cast(
|
626
|
+
typing.Optional[typing.Any],
|
627
|
+
parse_obj_as(
|
628
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
629
|
+
object_=_response.json(),
|
630
|
+
),
|
631
|
+
)
|
632
|
+
)
|
408
633
|
_response_json = _response.json()
|
409
634
|
except JSONDecodeError:
|
410
635
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -416,7 +641,7 @@ class AsyncToolsClient:
|
|
416
641
|
folder_id: typing.Optional[str] = None,
|
417
642
|
include_asset_details: typing.Optional[bool] = None,
|
418
643
|
include_system_files: typing.Optional[bool] = None,
|
419
|
-
request_options: typing.Optional[RequestOptions] = None
|
644
|
+
request_options: typing.Optional[RequestOptions] = None,
|
420
645
|
) -> FolderResponse:
|
421
646
|
"""
|
422
647
|
List contents of a folder or entire workspace in a tree structure.
|
@@ -439,12 +664,20 @@ class AsyncToolsClient:
|
|
439
664
|
|
440
665
|
Examples
|
441
666
|
--------
|
442
|
-
|
667
|
+
import asyncio
|
668
|
+
|
669
|
+
from athena import AsyncAthena
|
443
670
|
|
444
671
|
client = AsyncAthena(
|
445
672
|
api_key="YOUR_API_KEY",
|
446
673
|
)
|
447
|
-
|
674
|
+
|
675
|
+
|
676
|
+
async def main() -> None:
|
677
|
+
await client.tools.list_contents()
|
678
|
+
|
679
|
+
|
680
|
+
asyncio.run(main())
|
448
681
|
"""
|
449
682
|
_response = await self._client_wrapper.httpx_client.request(
|
450
683
|
"api/v0/tools/contents",
|
@@ -456,17 +689,55 @@ class AsyncToolsClient:
|
|
456
689
|
},
|
457
690
|
request_options=request_options,
|
458
691
|
)
|
459
|
-
if 200 <= _response.status_code < 300:
|
460
|
-
return pydantic_v1.parse_obj_as(FolderResponse, _response.json()) # type: ignore
|
461
|
-
if _response.status_code == 400:
|
462
|
-
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
463
|
-
if _response.status_code == 401:
|
464
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
465
|
-
if _response.status_code == 404:
|
466
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
467
|
-
if _response.status_code == 422:
|
468
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
469
692
|
try:
|
693
|
+
if 200 <= _response.status_code < 300:
|
694
|
+
return typing.cast(
|
695
|
+
FolderResponse,
|
696
|
+
parse_obj_as(
|
697
|
+
type_=FolderResponse, # type: ignore
|
698
|
+
object_=_response.json(),
|
699
|
+
),
|
700
|
+
)
|
701
|
+
if _response.status_code == 400:
|
702
|
+
raise BadRequestError(
|
703
|
+
typing.cast(
|
704
|
+
ParentFolderError,
|
705
|
+
parse_obj_as(
|
706
|
+
type_=ParentFolderError, # type: ignore
|
707
|
+
object_=_response.json(),
|
708
|
+
),
|
709
|
+
)
|
710
|
+
)
|
711
|
+
if _response.status_code == 401:
|
712
|
+
raise UnauthorizedError(
|
713
|
+
typing.cast(
|
714
|
+
typing.Optional[typing.Any],
|
715
|
+
parse_obj_as(
|
716
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
717
|
+
object_=_response.json(),
|
718
|
+
),
|
719
|
+
)
|
720
|
+
)
|
721
|
+
if _response.status_code == 404:
|
722
|
+
raise NotFoundError(
|
723
|
+
typing.cast(
|
724
|
+
AssetNotFoundError,
|
725
|
+
parse_obj_as(
|
726
|
+
type_=AssetNotFoundError, # type: ignore
|
727
|
+
object_=_response.json(),
|
728
|
+
),
|
729
|
+
)
|
730
|
+
)
|
731
|
+
if _response.status_code == 422:
|
732
|
+
raise UnprocessableEntityError(
|
733
|
+
typing.cast(
|
734
|
+
typing.Optional[typing.Any],
|
735
|
+
parse_obj_as(
|
736
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
737
|
+
object_=_response.json(),
|
738
|
+
),
|
739
|
+
)
|
740
|
+
)
|
470
741
|
_response_json = _response.json()
|
471
742
|
except JSONDecodeError:
|
472
743
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -483,7 +754,7 @@ class AsyncToolsClient:
|
|
483
754
|
] = None,
|
484
755
|
sheet_name: typing.Optional[int] = None,
|
485
756
|
separator: typing.Optional[str] = None,
|
486
|
-
request_options: typing.Optional[RequestOptions] = None
|
757
|
+
request_options: typing.Optional[RequestOptions] = None,
|
487
758
|
) -> DataFrameRequestOut:
|
488
759
|
"""
|
489
760
|
Parameters
|
@@ -513,14 +784,22 @@ class AsyncToolsClient:
|
|
513
784
|
|
514
785
|
Examples
|
515
786
|
--------
|
516
|
-
|
787
|
+
import asyncio
|
788
|
+
|
789
|
+
from athena import AsyncAthena
|
517
790
|
|
518
791
|
client = AsyncAthena(
|
519
792
|
api_key="YOUR_API_KEY",
|
520
793
|
)
|
521
|
-
|
522
|
-
|
523
|
-
)
|
794
|
+
|
795
|
+
|
796
|
+
async def main() -> None:
|
797
|
+
await client.tools.data_frame(
|
798
|
+
asset_id="asset_id",
|
799
|
+
)
|
800
|
+
|
801
|
+
|
802
|
+
asyncio.run(main())
|
524
803
|
"""
|
525
804
|
_response = await self._client_wrapper.httpx_client.request(
|
526
805
|
"api/v0/tools/file/data-frame",
|
@@ -535,21 +814,65 @@ class AsyncToolsClient:
|
|
535
814
|
},
|
536
815
|
request_options=request_options,
|
537
816
|
)
|
538
|
-
if 200 <= _response.status_code < 300:
|
539
|
-
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
540
|
-
if _response.status_code == 401:
|
541
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
542
|
-
if _response.status_code == 404:
|
543
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
544
|
-
if _response.status_code == 415:
|
545
|
-
raise UnsupportedMediaTypeError(
|
546
|
-
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
547
|
-
)
|
548
|
-
if _response.status_code == 422:
|
549
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
550
|
-
if _response.status_code == 500:
|
551
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
552
817
|
try:
|
818
|
+
if 200 <= _response.status_code < 300:
|
819
|
+
return typing.cast(
|
820
|
+
DataFrameRequestOut,
|
821
|
+
parse_obj_as(
|
822
|
+
type_=DataFrameRequestOut, # type: ignore
|
823
|
+
object_=_response.json(),
|
824
|
+
),
|
825
|
+
)
|
826
|
+
if _response.status_code == 401:
|
827
|
+
raise UnauthorizedError(
|
828
|
+
typing.cast(
|
829
|
+
typing.Optional[typing.Any],
|
830
|
+
parse_obj_as(
|
831
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
832
|
+
object_=_response.json(),
|
833
|
+
),
|
834
|
+
)
|
835
|
+
)
|
836
|
+
if _response.status_code == 404:
|
837
|
+
raise NotFoundError(
|
838
|
+
typing.cast(
|
839
|
+
AssetNotFoundError,
|
840
|
+
parse_obj_as(
|
841
|
+
type_=AssetNotFoundError, # type: ignore
|
842
|
+
object_=_response.json(),
|
843
|
+
),
|
844
|
+
)
|
845
|
+
)
|
846
|
+
if _response.status_code == 415:
|
847
|
+
raise UnsupportedMediaTypeError(
|
848
|
+
typing.cast(
|
849
|
+
DataFrameUnknownFormatError,
|
850
|
+
parse_obj_as(
|
851
|
+
type_=DataFrameUnknownFormatError, # type: ignore
|
852
|
+
object_=_response.json(),
|
853
|
+
),
|
854
|
+
)
|
855
|
+
)
|
856
|
+
if _response.status_code == 422:
|
857
|
+
raise UnprocessableEntityError(
|
858
|
+
typing.cast(
|
859
|
+
typing.Optional[typing.Any],
|
860
|
+
parse_obj_as(
|
861
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
862
|
+
object_=_response.json(),
|
863
|
+
),
|
864
|
+
)
|
865
|
+
)
|
866
|
+
if _response.status_code == 500:
|
867
|
+
raise InternalServerError(
|
868
|
+
typing.cast(
|
869
|
+
typing.Optional[typing.Any],
|
870
|
+
parse_obj_as(
|
871
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
872
|
+
object_=_response.json(),
|
873
|
+
),
|
874
|
+
)
|
875
|
+
)
|
553
876
|
_response_json = _response.json()
|
554
877
|
except JSONDecodeError:
|
555
878
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -566,41 +889,68 @@ class AsyncToolsClient:
|
|
566
889
|
asset_id : str
|
567
890
|
|
568
891
|
request_options : typing.Optional[RequestOptions]
|
569
|
-
Request-specific configuration.
|
892
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
570
893
|
|
571
894
|
Yields
|
572
895
|
------
|
573
896
|
typing.AsyncIterator[bytes]
|
574
897
|
Stream the file in original format.
|
575
|
-
|
576
|
-
Examples
|
577
|
-
--------
|
578
|
-
from athena.client import AsyncAthena
|
579
|
-
|
580
|
-
client = AsyncAthena(
|
581
|
-
api_key="YOUR_API_KEY",
|
582
|
-
)
|
583
|
-
await client.tools.raw_data(
|
584
|
-
asset_id="string",
|
585
|
-
)
|
586
898
|
"""
|
587
899
|
async with self._client_wrapper.httpx_client.stream(
|
588
|
-
"api/v0/tools/file/raw-data",
|
900
|
+
"api/v0/tools/file/raw-data",
|
901
|
+
method="GET",
|
902
|
+
params={
|
903
|
+
"asset_id": asset_id,
|
904
|
+
},
|
905
|
+
request_options=request_options,
|
589
906
|
) as _response:
|
590
|
-
if 200 <= _response.status_code < 300:
|
591
|
-
async for _chunk in _response.aiter_bytes():
|
592
|
-
yield _chunk
|
593
|
-
return
|
594
|
-
await _response.aread()
|
595
|
-
if _response.status_code == 401:
|
596
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
597
|
-
if _response.status_code == 404:
|
598
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
599
|
-
if _response.status_code == 422:
|
600
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
601
|
-
if _response.status_code == 500:
|
602
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
603
907
|
try:
|
908
|
+
if 200 <= _response.status_code < 300:
|
909
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
910
|
+
async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
|
911
|
+
yield _chunk
|
912
|
+
return
|
913
|
+
await _response.aread()
|
914
|
+
if _response.status_code == 401:
|
915
|
+
raise UnauthorizedError(
|
916
|
+
typing.cast(
|
917
|
+
typing.Optional[typing.Any],
|
918
|
+
parse_obj_as(
|
919
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
920
|
+
object_=_response.json(),
|
921
|
+
),
|
922
|
+
)
|
923
|
+
)
|
924
|
+
if _response.status_code == 404:
|
925
|
+
raise NotFoundError(
|
926
|
+
typing.cast(
|
927
|
+
AssetNotFoundError,
|
928
|
+
parse_obj_as(
|
929
|
+
type_=AssetNotFoundError, # type: ignore
|
930
|
+
object_=_response.json(),
|
931
|
+
),
|
932
|
+
)
|
933
|
+
)
|
934
|
+
if _response.status_code == 422:
|
935
|
+
raise UnprocessableEntityError(
|
936
|
+
typing.cast(
|
937
|
+
typing.Optional[typing.Any],
|
938
|
+
parse_obj_as(
|
939
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
940
|
+
object_=_response.json(),
|
941
|
+
),
|
942
|
+
)
|
943
|
+
)
|
944
|
+
if _response.status_code == 500:
|
945
|
+
raise InternalServerError(
|
946
|
+
typing.cast(
|
947
|
+
typing.Optional[typing.Any],
|
948
|
+
parse_obj_as(
|
949
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
950
|
+
object_=_response.json(),
|
951
|
+
),
|
952
|
+
)
|
953
|
+
)
|
604
954
|
_response_json = _response.json()
|
605
955
|
except JSONDecodeError:
|
606
956
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -611,7 +961,7 @@ class AsyncToolsClient:
|
|
611
961
|
*,
|
612
962
|
file: core.File,
|
613
963
|
parent_folder_id: typing.Optional[str] = None,
|
614
|
-
request_options: typing.Optional[RequestOptions] = None
|
964
|
+
request_options: typing.Optional[RequestOptions] = None,
|
615
965
|
) -> SaveAssetRequestOut:
|
616
966
|
"""
|
617
967
|
Parameters
|
@@ -632,31 +982,73 @@ class AsyncToolsClient:
|
|
632
982
|
|
633
983
|
Examples
|
634
984
|
--------
|
635
|
-
|
985
|
+
import asyncio
|
986
|
+
|
987
|
+
from athena import AsyncAthena
|
636
988
|
|
637
989
|
client = AsyncAthena(
|
638
990
|
api_key="YOUR_API_KEY",
|
639
991
|
)
|
640
|
-
|
992
|
+
|
993
|
+
|
994
|
+
async def main() -> None:
|
995
|
+
await client.tools.save_asset()
|
996
|
+
|
997
|
+
|
998
|
+
asyncio.run(main())
|
641
999
|
"""
|
642
1000
|
_response = await self._client_wrapper.httpx_client.request(
|
643
1001
|
"api/v0/tools/file/save",
|
644
1002
|
method="POST",
|
645
|
-
params={
|
1003
|
+
params={
|
1004
|
+
"parent_folder_id": parent_folder_id,
|
1005
|
+
},
|
646
1006
|
data={},
|
647
|
-
files={
|
1007
|
+
files={
|
1008
|
+
"file": file,
|
1009
|
+
},
|
648
1010
|
request_options=request_options,
|
649
1011
|
omit=OMIT,
|
650
1012
|
)
|
651
|
-
if 200 <= _response.status_code < 300:
|
652
|
-
return pydantic_v1.parse_obj_as(SaveAssetRequestOut, _response.json()) # type: ignore
|
653
|
-
if _response.status_code == 400:
|
654
|
-
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
655
|
-
if _response.status_code == 413:
|
656
|
-
raise ContentTooLargeError(pydantic_v1.parse_obj_as(FileTooLargeError, _response.json())) # type: ignore
|
657
|
-
if _response.status_code == 422:
|
658
|
-
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
659
1013
|
try:
|
1014
|
+
if 200 <= _response.status_code < 300:
|
1015
|
+
return typing.cast(
|
1016
|
+
SaveAssetRequestOut,
|
1017
|
+
parse_obj_as(
|
1018
|
+
type_=SaveAssetRequestOut, # type: ignore
|
1019
|
+
object_=_response.json(),
|
1020
|
+
),
|
1021
|
+
)
|
1022
|
+
if _response.status_code == 400:
|
1023
|
+
raise BadRequestError(
|
1024
|
+
typing.cast(
|
1025
|
+
ParentFolderError,
|
1026
|
+
parse_obj_as(
|
1027
|
+
type_=ParentFolderError, # type: ignore
|
1028
|
+
object_=_response.json(),
|
1029
|
+
),
|
1030
|
+
)
|
1031
|
+
)
|
1032
|
+
if _response.status_code == 413:
|
1033
|
+
raise ContentTooLargeError(
|
1034
|
+
typing.cast(
|
1035
|
+
FileTooLargeError,
|
1036
|
+
parse_obj_as(
|
1037
|
+
type_=FileTooLargeError, # type: ignore
|
1038
|
+
object_=_response.json(),
|
1039
|
+
),
|
1040
|
+
)
|
1041
|
+
)
|
1042
|
+
if _response.status_code == 422:
|
1043
|
+
raise UnprocessableEntityError(
|
1044
|
+
typing.cast(
|
1045
|
+
typing.Optional[typing.Any],
|
1046
|
+
parse_obj_as(
|
1047
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1048
|
+
object_=_response.json(),
|
1049
|
+
),
|
1050
|
+
)
|
1051
|
+
)
|
660
1052
|
_response_json = _response.json()
|
661
1053
|
except JSONDecodeError:
|
662
1054
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|