athena-intelligence 0.1.227__py3-none-any.whl → 0.1.357__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.
Potentially problematic release.
This version of athena-intelligence might be problematic. Click here for more details.
- athena/__init__.py +223 -69
- athena/agents/__init__.py +33 -1
- athena/agents/client.py +81 -18
- athena/aop/client.py +2 -2
- athena/aop/raw_client.py +2 -2
- athena/assets/client.py +359 -2
- athena/assets/raw_client.py +562 -0
- athena/base_client.py +118 -18
- athena/client.py +23 -21
- athena/core/__init__.py +73 -20
- athena/core/client_wrapper.py +2 -2
- athena/core/force_multipart.py +4 -2
- athena/core/http_response.py +1 -1
- athena/core/pydantic_utilities.py +5 -2
- athena/environment.py +0 -2
- athena/errors/__init__.py +42 -7
- athena/query/__init__.py +28 -1
- athena/query/types/__init__.py +30 -1
- athena/tools/__init__.py +39 -4
- athena/tools/client.py +161 -31
- athena/tools/raw_client.py +12 -9
- athena/tools/sheets/__init__.py +29 -2
- athena/tools/sheets/client.py +66 -101
- athena/tools/sheets/raw_client.py +66 -93
- athena/tools/sheets/types/__init__.py +31 -2
- athena/tools/sheets/types/{insert_table_row_request_row_data_item_value.py → update_sheet_range_request_values_item_item.py} +1 -1
- athena/tools/types/__init__.py +28 -1
- athena/types/__init__.py +187 -52
- athena/types/aop_execute_response_out.py +2 -1
- athena/types/border_model.py +32 -0
- athena/types/border_style.py +7 -0
- athena/types/borders_model.py +58 -0
- athena/types/cell_format.py +60 -0
- athena/types/cell_format_horizontal_alignment.py +5 -0
- athena/types/cell_format_vertical_alignment.py +5 -0
- athena/types/conversation_asset_info.py +8 -2
- athena/types/conversation_message.py +42 -0
- athena/types/conversation_result.py +67 -0
- athena/types/creatable_asset_type.py +5 -0
- athena/types/create_asset_response_out.py +46 -0
- athena/types/create_project_response_out.py +51 -0
- athena/types/dimension_properties.py +49 -0
- athena/types/grid_range.py +39 -0
- athena/types/{file_chunk_request_out.py → number_format_model.py} +8 -4
- athena/types/number_format_type.py +21 -0
- athena/types/sheet.py +83 -0
- athena/types/table_row_data.py +5 -0
- athena/types/text_format_model.py +37 -0
- athena/types/textrotation.py +5 -0
- athena/types/{document_chunk.py → theme_color.py} +3 -7
- athena/types/thread_status_response_out.py +5 -0
- athena/types/wrap_strategy.py +5 -0
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/RECORD +55 -36
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/WHEEL +0 -0
athena/assets/raw_client.py
CHANGED
|
@@ -6,10 +6,22 @@ from json.decoder import JSONDecodeError
|
|
|
6
6
|
from ..core.api_error import ApiError
|
|
7
7
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
8
|
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
9
10
|
from ..core.pydantic_utilities import parse_obj_as
|
|
10
11
|
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..errors.bad_request_error import BadRequestError
|
|
13
|
+
from ..errors.internal_server_error import InternalServerError
|
|
14
|
+
from ..errors.not_found_error import NotFoundError
|
|
15
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
11
16
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
17
|
+
from ..types.creatable_asset_type import CreatableAssetType
|
|
18
|
+
from ..types.create_asset_response_out import CreateAssetResponseOut
|
|
19
|
+
from ..types.create_project_response_out import CreateProjectResponseOut
|
|
12
20
|
from ..types.paginated_assets_out import PaginatedAssetsOut
|
|
21
|
+
from ..types.public_asset_out import PublicAssetOut
|
|
22
|
+
|
|
23
|
+
# this is used as the default value for optional parameters
|
|
24
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
13
25
|
|
|
14
26
|
|
|
15
27
|
class RawAssetsClient:
|
|
@@ -87,6 +99,281 @@ class RawAssetsClient:
|
|
|
87
99
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
88
100
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
89
101
|
|
|
102
|
+
def create(
|
|
103
|
+
self,
|
|
104
|
+
*,
|
|
105
|
+
asset_type: CreatableAssetType,
|
|
106
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
107
|
+
title: typing.Optional[str] = OMIT,
|
|
108
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
109
|
+
) -> HttpResponse[CreateAssetResponseOut]:
|
|
110
|
+
"""
|
|
111
|
+
Create a new asset such as a spreadsheet, document, or folder in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration.
|
|
112
|
+
|
|
113
|
+
Parameters
|
|
114
|
+
----------
|
|
115
|
+
asset_type : CreatableAssetType
|
|
116
|
+
Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder'
|
|
117
|
+
|
|
118
|
+
parent_folder_id : typing.Optional[str]
|
|
119
|
+
ID of the parent folder to create the asset in
|
|
120
|
+
|
|
121
|
+
title : typing.Optional[str]
|
|
122
|
+
Title for the new asset
|
|
123
|
+
|
|
124
|
+
request_options : typing.Optional[RequestOptions]
|
|
125
|
+
Request-specific configuration.
|
|
126
|
+
|
|
127
|
+
Returns
|
|
128
|
+
-------
|
|
129
|
+
HttpResponse[CreateAssetResponseOut]
|
|
130
|
+
Asset created successfully
|
|
131
|
+
"""
|
|
132
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
133
|
+
"api/v0/assets/create",
|
|
134
|
+
method="POST",
|
|
135
|
+
json={
|
|
136
|
+
"asset_type": asset_type,
|
|
137
|
+
"parent_folder_id": parent_folder_id,
|
|
138
|
+
"title": title,
|
|
139
|
+
},
|
|
140
|
+
headers={
|
|
141
|
+
"content-type": "application/json",
|
|
142
|
+
},
|
|
143
|
+
request_options=request_options,
|
|
144
|
+
omit=OMIT,
|
|
145
|
+
)
|
|
146
|
+
try:
|
|
147
|
+
if 200 <= _response.status_code < 300:
|
|
148
|
+
_data = typing.cast(
|
|
149
|
+
CreateAssetResponseOut,
|
|
150
|
+
parse_obj_as(
|
|
151
|
+
type_=CreateAssetResponseOut, # type: ignore
|
|
152
|
+
object_=_response.json(),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
return HttpResponse(response=_response, data=_data)
|
|
156
|
+
if _response.status_code == 400:
|
|
157
|
+
raise BadRequestError(
|
|
158
|
+
headers=dict(_response.headers),
|
|
159
|
+
body=typing.cast(
|
|
160
|
+
typing.Optional[typing.Any],
|
|
161
|
+
parse_obj_as(
|
|
162
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
163
|
+
object_=_response.json(),
|
|
164
|
+
),
|
|
165
|
+
),
|
|
166
|
+
)
|
|
167
|
+
if _response.status_code == 422:
|
|
168
|
+
raise UnprocessableEntityError(
|
|
169
|
+
headers=dict(_response.headers),
|
|
170
|
+
body=typing.cast(
|
|
171
|
+
typing.Optional[typing.Any],
|
|
172
|
+
parse_obj_as(
|
|
173
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
174
|
+
object_=_response.json(),
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
)
|
|
178
|
+
if _response.status_code == 500:
|
|
179
|
+
raise InternalServerError(
|
|
180
|
+
headers=dict(_response.headers),
|
|
181
|
+
body=typing.cast(
|
|
182
|
+
typing.Optional[typing.Any],
|
|
183
|
+
parse_obj_as(
|
|
184
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
185
|
+
object_=_response.json(),
|
|
186
|
+
),
|
|
187
|
+
),
|
|
188
|
+
)
|
|
189
|
+
_response_json = _response.json()
|
|
190
|
+
except JSONDecodeError:
|
|
191
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
192
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
193
|
+
|
|
194
|
+
def create_project(
|
|
195
|
+
self,
|
|
196
|
+
*,
|
|
197
|
+
title: str,
|
|
198
|
+
custom_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
199
|
+
description: typing.Optional[str] = OMIT,
|
|
200
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
201
|
+
project_type: typing.Optional[str] = OMIT,
|
|
202
|
+
share_with_emails: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
203
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
204
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
205
|
+
) -> HttpResponse[CreateProjectResponseOut]:
|
|
206
|
+
"""
|
|
207
|
+
Create a new project with custom metadata. Projects can be typed (e.g., 'candidate', 'user', 'company') and include flexible custom metadata for storing additional information.
|
|
208
|
+
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
title : str
|
|
212
|
+
The project title
|
|
213
|
+
|
|
214
|
+
custom_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
215
|
+
A flexible dictionary for storing custom metadata
|
|
216
|
+
|
|
217
|
+
description : typing.Optional[str]
|
|
218
|
+
Optional project description
|
|
219
|
+
|
|
220
|
+
parent_folder_id : typing.Optional[str]
|
|
221
|
+
Optional parent folder ID
|
|
222
|
+
|
|
223
|
+
project_type : typing.Optional[str]
|
|
224
|
+
User-defined project type (e.g., 'candidate', 'user', 'company')
|
|
225
|
+
|
|
226
|
+
share_with_emails : typing.Optional[typing.Sequence[str]]
|
|
227
|
+
Optional list of email addresses to share the project with (VIEW permission)
|
|
228
|
+
|
|
229
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
230
|
+
Optional list of tags for categorizing the project
|
|
231
|
+
|
|
232
|
+
request_options : typing.Optional[RequestOptions]
|
|
233
|
+
Request-specific configuration.
|
|
234
|
+
|
|
235
|
+
Returns
|
|
236
|
+
-------
|
|
237
|
+
HttpResponse[CreateProjectResponseOut]
|
|
238
|
+
Project created successfully
|
|
239
|
+
"""
|
|
240
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
241
|
+
"api/v0/assets/create_project",
|
|
242
|
+
method="POST",
|
|
243
|
+
json={
|
|
244
|
+
"custom_metadata": custom_metadata,
|
|
245
|
+
"description": description,
|
|
246
|
+
"parent_folder_id": parent_folder_id,
|
|
247
|
+
"project_type": project_type,
|
|
248
|
+
"share_with_emails": share_with_emails,
|
|
249
|
+
"tags": tags,
|
|
250
|
+
"title": title,
|
|
251
|
+
},
|
|
252
|
+
headers={
|
|
253
|
+
"content-type": "application/json",
|
|
254
|
+
},
|
|
255
|
+
request_options=request_options,
|
|
256
|
+
omit=OMIT,
|
|
257
|
+
)
|
|
258
|
+
try:
|
|
259
|
+
if 200 <= _response.status_code < 300:
|
|
260
|
+
_data = typing.cast(
|
|
261
|
+
CreateProjectResponseOut,
|
|
262
|
+
parse_obj_as(
|
|
263
|
+
type_=CreateProjectResponseOut, # type: ignore
|
|
264
|
+
object_=_response.json(),
|
|
265
|
+
),
|
|
266
|
+
)
|
|
267
|
+
return HttpResponse(response=_response, data=_data)
|
|
268
|
+
if _response.status_code == 400:
|
|
269
|
+
raise BadRequestError(
|
|
270
|
+
headers=dict(_response.headers),
|
|
271
|
+
body=typing.cast(
|
|
272
|
+
typing.Optional[typing.Any],
|
|
273
|
+
parse_obj_as(
|
|
274
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
275
|
+
object_=_response.json(),
|
|
276
|
+
),
|
|
277
|
+
),
|
|
278
|
+
)
|
|
279
|
+
if _response.status_code == 422:
|
|
280
|
+
raise UnprocessableEntityError(
|
|
281
|
+
headers=dict(_response.headers),
|
|
282
|
+
body=typing.cast(
|
|
283
|
+
typing.Optional[typing.Any],
|
|
284
|
+
parse_obj_as(
|
|
285
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
286
|
+
object_=_response.json(),
|
|
287
|
+
),
|
|
288
|
+
),
|
|
289
|
+
)
|
|
290
|
+
if _response.status_code == 500:
|
|
291
|
+
raise InternalServerError(
|
|
292
|
+
headers=dict(_response.headers),
|
|
293
|
+
body=typing.cast(
|
|
294
|
+
typing.Optional[typing.Any],
|
|
295
|
+
parse_obj_as(
|
|
296
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
297
|
+
object_=_response.json(),
|
|
298
|
+
),
|
|
299
|
+
),
|
|
300
|
+
)
|
|
301
|
+
_response_json = _response.json()
|
|
302
|
+
except JSONDecodeError:
|
|
303
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
304
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
305
|
+
|
|
306
|
+
def get(
|
|
307
|
+
self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
308
|
+
) -> HttpResponse[PublicAssetOut]:
|
|
309
|
+
"""
|
|
310
|
+
Retrieve a single asset by its ID. Returns comprehensive metadata including creation info, tags, timestamps, media type, and AI-generated summary.
|
|
311
|
+
|
|
312
|
+
Parameters
|
|
313
|
+
----------
|
|
314
|
+
asset_id : str
|
|
315
|
+
|
|
316
|
+
request_options : typing.Optional[RequestOptions]
|
|
317
|
+
Request-specific configuration.
|
|
318
|
+
|
|
319
|
+
Returns
|
|
320
|
+
-------
|
|
321
|
+
HttpResponse[PublicAssetOut]
|
|
322
|
+
Successfully retrieved asset
|
|
323
|
+
"""
|
|
324
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
325
|
+
f"api/v0/assets/{jsonable_encoder(asset_id)}",
|
|
326
|
+
method="GET",
|
|
327
|
+
request_options=request_options,
|
|
328
|
+
)
|
|
329
|
+
try:
|
|
330
|
+
if 200 <= _response.status_code < 300:
|
|
331
|
+
_data = typing.cast(
|
|
332
|
+
PublicAssetOut,
|
|
333
|
+
parse_obj_as(
|
|
334
|
+
type_=PublicAssetOut, # type: ignore
|
|
335
|
+
object_=_response.json(),
|
|
336
|
+
),
|
|
337
|
+
)
|
|
338
|
+
return HttpResponse(response=_response, data=_data)
|
|
339
|
+
if _response.status_code == 401:
|
|
340
|
+
raise UnauthorizedError(
|
|
341
|
+
headers=dict(_response.headers),
|
|
342
|
+
body=typing.cast(
|
|
343
|
+
typing.Optional[typing.Any],
|
|
344
|
+
parse_obj_as(
|
|
345
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
346
|
+
object_=_response.json(),
|
|
347
|
+
),
|
|
348
|
+
),
|
|
349
|
+
)
|
|
350
|
+
if _response.status_code == 404:
|
|
351
|
+
raise NotFoundError(
|
|
352
|
+
headers=dict(_response.headers),
|
|
353
|
+
body=typing.cast(
|
|
354
|
+
typing.Optional[typing.Any],
|
|
355
|
+
parse_obj_as(
|
|
356
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
357
|
+
object_=_response.json(),
|
|
358
|
+
),
|
|
359
|
+
),
|
|
360
|
+
)
|
|
361
|
+
if _response.status_code == 422:
|
|
362
|
+
raise UnprocessableEntityError(
|
|
363
|
+
headers=dict(_response.headers),
|
|
364
|
+
body=typing.cast(
|
|
365
|
+
typing.Optional[typing.Any],
|
|
366
|
+
parse_obj_as(
|
|
367
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
368
|
+
object_=_response.json(),
|
|
369
|
+
),
|
|
370
|
+
),
|
|
371
|
+
)
|
|
372
|
+
_response_json = _response.json()
|
|
373
|
+
except JSONDecodeError:
|
|
374
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
375
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
376
|
+
|
|
90
377
|
|
|
91
378
|
class AsyncRawAssetsClient:
|
|
92
379
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -162,3 +449,278 @@ class AsyncRawAssetsClient:
|
|
|
162
449
|
except JSONDecodeError:
|
|
163
450
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
164
451
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
452
|
+
|
|
453
|
+
async def create(
|
|
454
|
+
self,
|
|
455
|
+
*,
|
|
456
|
+
asset_type: CreatableAssetType,
|
|
457
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
458
|
+
title: typing.Optional[str] = OMIT,
|
|
459
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
460
|
+
) -> AsyncHttpResponse[CreateAssetResponseOut]:
|
|
461
|
+
"""
|
|
462
|
+
Create a new asset such as a spreadsheet, document, or folder in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration.
|
|
463
|
+
|
|
464
|
+
Parameters
|
|
465
|
+
----------
|
|
466
|
+
asset_type : CreatableAssetType
|
|
467
|
+
Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder'
|
|
468
|
+
|
|
469
|
+
parent_folder_id : typing.Optional[str]
|
|
470
|
+
ID of the parent folder to create the asset in
|
|
471
|
+
|
|
472
|
+
title : typing.Optional[str]
|
|
473
|
+
Title for the new asset
|
|
474
|
+
|
|
475
|
+
request_options : typing.Optional[RequestOptions]
|
|
476
|
+
Request-specific configuration.
|
|
477
|
+
|
|
478
|
+
Returns
|
|
479
|
+
-------
|
|
480
|
+
AsyncHttpResponse[CreateAssetResponseOut]
|
|
481
|
+
Asset created successfully
|
|
482
|
+
"""
|
|
483
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
484
|
+
"api/v0/assets/create",
|
|
485
|
+
method="POST",
|
|
486
|
+
json={
|
|
487
|
+
"asset_type": asset_type,
|
|
488
|
+
"parent_folder_id": parent_folder_id,
|
|
489
|
+
"title": title,
|
|
490
|
+
},
|
|
491
|
+
headers={
|
|
492
|
+
"content-type": "application/json",
|
|
493
|
+
},
|
|
494
|
+
request_options=request_options,
|
|
495
|
+
omit=OMIT,
|
|
496
|
+
)
|
|
497
|
+
try:
|
|
498
|
+
if 200 <= _response.status_code < 300:
|
|
499
|
+
_data = typing.cast(
|
|
500
|
+
CreateAssetResponseOut,
|
|
501
|
+
parse_obj_as(
|
|
502
|
+
type_=CreateAssetResponseOut, # type: ignore
|
|
503
|
+
object_=_response.json(),
|
|
504
|
+
),
|
|
505
|
+
)
|
|
506
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
507
|
+
if _response.status_code == 400:
|
|
508
|
+
raise BadRequestError(
|
|
509
|
+
headers=dict(_response.headers),
|
|
510
|
+
body=typing.cast(
|
|
511
|
+
typing.Optional[typing.Any],
|
|
512
|
+
parse_obj_as(
|
|
513
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
514
|
+
object_=_response.json(),
|
|
515
|
+
),
|
|
516
|
+
),
|
|
517
|
+
)
|
|
518
|
+
if _response.status_code == 422:
|
|
519
|
+
raise UnprocessableEntityError(
|
|
520
|
+
headers=dict(_response.headers),
|
|
521
|
+
body=typing.cast(
|
|
522
|
+
typing.Optional[typing.Any],
|
|
523
|
+
parse_obj_as(
|
|
524
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
525
|
+
object_=_response.json(),
|
|
526
|
+
),
|
|
527
|
+
),
|
|
528
|
+
)
|
|
529
|
+
if _response.status_code == 500:
|
|
530
|
+
raise InternalServerError(
|
|
531
|
+
headers=dict(_response.headers),
|
|
532
|
+
body=typing.cast(
|
|
533
|
+
typing.Optional[typing.Any],
|
|
534
|
+
parse_obj_as(
|
|
535
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
536
|
+
object_=_response.json(),
|
|
537
|
+
),
|
|
538
|
+
),
|
|
539
|
+
)
|
|
540
|
+
_response_json = _response.json()
|
|
541
|
+
except JSONDecodeError:
|
|
542
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
543
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
544
|
+
|
|
545
|
+
async def create_project(
|
|
546
|
+
self,
|
|
547
|
+
*,
|
|
548
|
+
title: str,
|
|
549
|
+
custom_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
550
|
+
description: typing.Optional[str] = OMIT,
|
|
551
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
552
|
+
project_type: typing.Optional[str] = OMIT,
|
|
553
|
+
share_with_emails: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
554
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
555
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
556
|
+
) -> AsyncHttpResponse[CreateProjectResponseOut]:
|
|
557
|
+
"""
|
|
558
|
+
Create a new project with custom metadata. Projects can be typed (e.g., 'candidate', 'user', 'company') and include flexible custom metadata for storing additional information.
|
|
559
|
+
|
|
560
|
+
Parameters
|
|
561
|
+
----------
|
|
562
|
+
title : str
|
|
563
|
+
The project title
|
|
564
|
+
|
|
565
|
+
custom_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
566
|
+
A flexible dictionary for storing custom metadata
|
|
567
|
+
|
|
568
|
+
description : typing.Optional[str]
|
|
569
|
+
Optional project description
|
|
570
|
+
|
|
571
|
+
parent_folder_id : typing.Optional[str]
|
|
572
|
+
Optional parent folder ID
|
|
573
|
+
|
|
574
|
+
project_type : typing.Optional[str]
|
|
575
|
+
User-defined project type (e.g., 'candidate', 'user', 'company')
|
|
576
|
+
|
|
577
|
+
share_with_emails : typing.Optional[typing.Sequence[str]]
|
|
578
|
+
Optional list of email addresses to share the project with (VIEW permission)
|
|
579
|
+
|
|
580
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
581
|
+
Optional list of tags for categorizing the project
|
|
582
|
+
|
|
583
|
+
request_options : typing.Optional[RequestOptions]
|
|
584
|
+
Request-specific configuration.
|
|
585
|
+
|
|
586
|
+
Returns
|
|
587
|
+
-------
|
|
588
|
+
AsyncHttpResponse[CreateProjectResponseOut]
|
|
589
|
+
Project created successfully
|
|
590
|
+
"""
|
|
591
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
592
|
+
"api/v0/assets/create_project",
|
|
593
|
+
method="POST",
|
|
594
|
+
json={
|
|
595
|
+
"custom_metadata": custom_metadata,
|
|
596
|
+
"description": description,
|
|
597
|
+
"parent_folder_id": parent_folder_id,
|
|
598
|
+
"project_type": project_type,
|
|
599
|
+
"share_with_emails": share_with_emails,
|
|
600
|
+
"tags": tags,
|
|
601
|
+
"title": title,
|
|
602
|
+
},
|
|
603
|
+
headers={
|
|
604
|
+
"content-type": "application/json",
|
|
605
|
+
},
|
|
606
|
+
request_options=request_options,
|
|
607
|
+
omit=OMIT,
|
|
608
|
+
)
|
|
609
|
+
try:
|
|
610
|
+
if 200 <= _response.status_code < 300:
|
|
611
|
+
_data = typing.cast(
|
|
612
|
+
CreateProjectResponseOut,
|
|
613
|
+
parse_obj_as(
|
|
614
|
+
type_=CreateProjectResponseOut, # type: ignore
|
|
615
|
+
object_=_response.json(),
|
|
616
|
+
),
|
|
617
|
+
)
|
|
618
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
619
|
+
if _response.status_code == 400:
|
|
620
|
+
raise BadRequestError(
|
|
621
|
+
headers=dict(_response.headers),
|
|
622
|
+
body=typing.cast(
|
|
623
|
+
typing.Optional[typing.Any],
|
|
624
|
+
parse_obj_as(
|
|
625
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
626
|
+
object_=_response.json(),
|
|
627
|
+
),
|
|
628
|
+
),
|
|
629
|
+
)
|
|
630
|
+
if _response.status_code == 422:
|
|
631
|
+
raise UnprocessableEntityError(
|
|
632
|
+
headers=dict(_response.headers),
|
|
633
|
+
body=typing.cast(
|
|
634
|
+
typing.Optional[typing.Any],
|
|
635
|
+
parse_obj_as(
|
|
636
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
637
|
+
object_=_response.json(),
|
|
638
|
+
),
|
|
639
|
+
),
|
|
640
|
+
)
|
|
641
|
+
if _response.status_code == 500:
|
|
642
|
+
raise InternalServerError(
|
|
643
|
+
headers=dict(_response.headers),
|
|
644
|
+
body=typing.cast(
|
|
645
|
+
typing.Optional[typing.Any],
|
|
646
|
+
parse_obj_as(
|
|
647
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
648
|
+
object_=_response.json(),
|
|
649
|
+
),
|
|
650
|
+
),
|
|
651
|
+
)
|
|
652
|
+
_response_json = _response.json()
|
|
653
|
+
except JSONDecodeError:
|
|
654
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
655
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
656
|
+
|
|
657
|
+
async def get(
|
|
658
|
+
self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
659
|
+
) -> AsyncHttpResponse[PublicAssetOut]:
|
|
660
|
+
"""
|
|
661
|
+
Retrieve a single asset by its ID. Returns comprehensive metadata including creation info, tags, timestamps, media type, and AI-generated summary.
|
|
662
|
+
|
|
663
|
+
Parameters
|
|
664
|
+
----------
|
|
665
|
+
asset_id : str
|
|
666
|
+
|
|
667
|
+
request_options : typing.Optional[RequestOptions]
|
|
668
|
+
Request-specific configuration.
|
|
669
|
+
|
|
670
|
+
Returns
|
|
671
|
+
-------
|
|
672
|
+
AsyncHttpResponse[PublicAssetOut]
|
|
673
|
+
Successfully retrieved asset
|
|
674
|
+
"""
|
|
675
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
676
|
+
f"api/v0/assets/{jsonable_encoder(asset_id)}",
|
|
677
|
+
method="GET",
|
|
678
|
+
request_options=request_options,
|
|
679
|
+
)
|
|
680
|
+
try:
|
|
681
|
+
if 200 <= _response.status_code < 300:
|
|
682
|
+
_data = typing.cast(
|
|
683
|
+
PublicAssetOut,
|
|
684
|
+
parse_obj_as(
|
|
685
|
+
type_=PublicAssetOut, # type: ignore
|
|
686
|
+
object_=_response.json(),
|
|
687
|
+
),
|
|
688
|
+
)
|
|
689
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
690
|
+
if _response.status_code == 401:
|
|
691
|
+
raise UnauthorizedError(
|
|
692
|
+
headers=dict(_response.headers),
|
|
693
|
+
body=typing.cast(
|
|
694
|
+
typing.Optional[typing.Any],
|
|
695
|
+
parse_obj_as(
|
|
696
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
697
|
+
object_=_response.json(),
|
|
698
|
+
),
|
|
699
|
+
),
|
|
700
|
+
)
|
|
701
|
+
if _response.status_code == 404:
|
|
702
|
+
raise NotFoundError(
|
|
703
|
+
headers=dict(_response.headers),
|
|
704
|
+
body=typing.cast(
|
|
705
|
+
typing.Optional[typing.Any],
|
|
706
|
+
parse_obj_as(
|
|
707
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
708
|
+
object_=_response.json(),
|
|
709
|
+
),
|
|
710
|
+
),
|
|
711
|
+
)
|
|
712
|
+
if _response.status_code == 422:
|
|
713
|
+
raise UnprocessableEntityError(
|
|
714
|
+
headers=dict(_response.headers),
|
|
715
|
+
body=typing.cast(
|
|
716
|
+
typing.Optional[typing.Any],
|
|
717
|
+
parse_obj_as(
|
|
718
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
719
|
+
object_=_response.json(),
|
|
720
|
+
),
|
|
721
|
+
),
|
|
722
|
+
)
|
|
723
|
+
_response_json = _response.json()
|
|
724
|
+
except JSONDecodeError:
|
|
725
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
726
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|