vellum-ai 1.1.0__py3-none-any.whl → 1.1.1__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.
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -873
- vellum/client/core/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/http_response.py +47 -0
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +20 -693
- vellum/client/resources/ad_hoc/client.py +55 -161
- vellum/client/resources/ad_hoc/raw_client.py +278 -0
- vellum/client/resources/container_images/client.py +62 -172
- vellum/client/resources/container_images/raw_client.py +400 -0
- vellum/client/resources/deployments/client.py +112 -437
- vellum/client/resources/deployments/raw_client.py +995 -0
- vellum/client/resources/document_indexes/client.py +108 -317
- vellum/client/resources/document_indexes/raw_client.py +847 -0
- vellum/client/resources/documents/client.py +88 -285
- vellum/client/resources/documents/raw_client.py +655 -0
- vellum/client/resources/folder_entities/client.py +54 -92
- vellum/client/resources/folder_entities/raw_client.py +277 -0
- vellum/client/resources/metric_definitions/client.py +48 -95
- vellum/client/resources/metric_definitions/raw_client.py +225 -0
- vellum/client/resources/ml_models/client.py +36 -40
- vellum/client/resources/ml_models/raw_client.py +103 -0
- vellum/client/resources/organizations/client.py +34 -39
- vellum/client/resources/organizations/raw_client.py +96 -0
- vellum/client/resources/prompts/client.py +50 -193
- vellum/client/resources/prompts/raw_client.py +346 -0
- vellum/client/resources/sandboxes/client.py +68 -141
- vellum/client/resources/sandboxes/raw_client.py +393 -0
- vellum/client/resources/test_suite_runs/client.py +58 -141
- vellum/client/resources/test_suite_runs/raw_client.py +355 -0
- vellum/client/resources/test_suites/client.py +73 -141
- vellum/client/resources/test_suites/raw_client.py +379 -0
- vellum/client/resources/workflow_deployments/client.py +118 -362
- vellum/client/resources/workflow_deployments/raw_client.py +931 -0
- vellum/client/resources/workflow_executions/client.py +36 -40
- vellum/client/resources/workflow_executions/raw_client.py +97 -0
- vellum/client/resources/workflow_sandboxes/client.py +60 -108
- vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
- vellum/client/resources/workflows/client.py +68 -133
- vellum/client/resources/workflows/raw_client.py +307 -0
- vellum/client/resources/workspace_secrets/client.py +46 -90
- vellum/client/resources/workspace_secrets/raw_client.py +220 -0
- vellum/client/resources/workspaces/client.py +34 -39
- vellum/client/resources/workspaces/raw_client.py +96 -0
- vellum/core/http_response.py +3 -0
- vellum/raw_client.py +3 -0
- vellum/resources/ad_hoc/raw_client.py +3 -0
- vellum/resources/container_images/raw_client.py +3 -0
- vellum/resources/deployments/raw_client.py +3 -0
- vellum/resources/document_indexes/raw_client.py +3 -0
- vellum/resources/documents/raw_client.py +3 -0
- vellum/resources/folder_entities/raw_client.py +3 -0
- vellum/resources/metric_definitions/raw_client.py +3 -0
- vellum/resources/ml_models/raw_client.py +3 -0
- vellum/resources/organizations/raw_client.py +3 -0
- vellum/resources/prompts/raw_client.py +3 -0
- vellum/resources/sandboxes/raw_client.py +3 -0
- vellum/resources/test_suite_runs/raw_client.py +3 -0
- vellum/resources/test_suites/raw_client.py +3 -0
- vellum/resources/workflow_deployments/raw_client.py +3 -0
- vellum/resources/workflow_executions/raw_client.py +3 -0
- vellum/resources/workflow_sandboxes/raw_client.py +3 -0
- vellum/resources/workflows/raw_client.py +3 -0
- vellum/resources/workspace_secrets/raw_client.py +3 -0
- vellum/resources/workspaces/raw_client.py +3 -0
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.1.dist-info}/RECORD +75 -32
- vellum_ee/workflows/display/exceptions.py +7 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
- vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.1.dist-info}/entry_points.txt +0 -0
@@ -2,18 +2,15 @@
|
|
2
2
|
|
3
3
|
import typing
|
4
4
|
from ...core.client_wrapper import SyncClientWrapper
|
5
|
+
from .raw_client import RawDocumentIndexesClient
|
5
6
|
from .types.document_indexes_list_request_status import DocumentIndexesListRequestStatus
|
6
7
|
from ...core.request_options import RequestOptions
|
7
8
|
from ...types.paginated_document_index_read_list import PaginatedDocumentIndexReadList
|
8
|
-
from ...core.pydantic_utilities import parse_obj_as
|
9
|
-
from json.decoder import JSONDecodeError
|
10
|
-
from ...core.api_error import ApiError
|
11
9
|
from ...types.document_index_indexing_config_request import DocumentIndexIndexingConfigRequest
|
12
10
|
from ...types.entity_status import EntityStatus
|
13
11
|
from ...types.document_index_read import DocumentIndexRead
|
14
|
-
from ...core.serialization import convert_and_respect_annotation_metadata
|
15
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
16
12
|
from ...core.client_wrapper import AsyncClientWrapper
|
13
|
+
from .raw_client import AsyncRawDocumentIndexesClient
|
17
14
|
|
18
15
|
# this is used as the default value for optional parameters
|
19
16
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -21,9 +18,24 @@ OMIT = typing.cast(typing.Any, ...)
|
|
21
18
|
|
22
19
|
class DocumentIndexesClient:
|
23
20
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
24
|
-
self.
|
21
|
+
self._raw_client = RawDocumentIndexesClient(client_wrapper=client_wrapper)
|
25
22
|
|
26
|
-
|
23
|
+
@property
|
24
|
+
def _client_wrapper(self) -> SyncClientWrapper:
|
25
|
+
return self._raw_client._client_wrapper
|
26
|
+
|
27
|
+
@property
|
28
|
+
def with_raw_response(self) -> RawDocumentIndexesClient:
|
29
|
+
"""
|
30
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
31
|
+
|
32
|
+
Returns
|
33
|
+
-------
|
34
|
+
RawDocumentIndexesClient
|
35
|
+
"""
|
36
|
+
return self._raw_client
|
37
|
+
|
38
|
+
def list_(
|
27
39
|
self,
|
28
40
|
*,
|
29
41
|
limit: typing.Optional[int] = None,
|
@@ -74,32 +86,15 @@ class DocumentIndexesClient:
|
|
74
86
|
)
|
75
87
|
client.document_indexes.list()
|
76
88
|
"""
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
"offset": offset,
|
84
|
-
"ordering": ordering,
|
85
|
-
"search": search,
|
86
|
-
"status": status,
|
87
|
-
},
|
89
|
+
response = self._raw_client.list(
|
90
|
+
limit=limit,
|
91
|
+
offset=offset,
|
92
|
+
ordering=ordering,
|
93
|
+
search=search,
|
94
|
+
status=status,
|
88
95
|
request_options=request_options,
|
89
96
|
)
|
90
|
-
|
91
|
-
if 200 <= _response.status_code < 300:
|
92
|
-
return typing.cast(
|
93
|
-
PaginatedDocumentIndexReadList,
|
94
|
-
parse_obj_as(
|
95
|
-
type_=PaginatedDocumentIndexReadList, # type: ignore
|
96
|
-
object_=_response.json(),
|
97
|
-
),
|
98
|
-
)
|
99
|
-
_response_json = _response.json()
|
100
|
-
except JSONDecodeError:
|
101
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
102
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
97
|
+
return response.data
|
103
98
|
|
104
99
|
def create(
|
105
100
|
self,
|
@@ -164,38 +159,15 @@ class DocumentIndexesClient:
|
|
164
159
|
),
|
165
160
|
)
|
166
161
|
"""
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
"name": name,
|
174
|
-
"status": status,
|
175
|
-
"indexing_config": convert_and_respect_annotation_metadata(
|
176
|
-
object_=indexing_config, annotation=DocumentIndexIndexingConfigRequest, direction="write"
|
177
|
-
),
|
178
|
-
"copy_documents_from_index_id": copy_documents_from_index_id,
|
179
|
-
},
|
180
|
-
headers={
|
181
|
-
"content-type": "application/json",
|
182
|
-
},
|
162
|
+
response = self._raw_client.create(
|
163
|
+
label=label,
|
164
|
+
name=name,
|
165
|
+
indexing_config=indexing_config,
|
166
|
+
status=status,
|
167
|
+
copy_documents_from_index_id=copy_documents_from_index_id,
|
183
168
|
request_options=request_options,
|
184
|
-
omit=OMIT,
|
185
169
|
)
|
186
|
-
|
187
|
-
if 200 <= _response.status_code < 300:
|
188
|
-
return typing.cast(
|
189
|
-
DocumentIndexRead,
|
190
|
-
parse_obj_as(
|
191
|
-
type_=DocumentIndexRead, # type: ignore
|
192
|
-
object_=_response.json(),
|
193
|
-
),
|
194
|
-
)
|
195
|
-
_response_json = _response.json()
|
196
|
-
except JSONDecodeError:
|
197
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
198
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
170
|
+
return response.data
|
199
171
|
|
200
172
|
def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentIndexRead:
|
201
173
|
"""
|
@@ -226,25 +198,11 @@ class DocumentIndexesClient:
|
|
226
198
|
id="id",
|
227
199
|
)
|
228
200
|
"""
|
229
|
-
|
230
|
-
|
231
|
-
base_url=self._client_wrapper.get_environment().default,
|
232
|
-
method="GET",
|
201
|
+
response = self._raw_client.retrieve(
|
202
|
+
id,
|
233
203
|
request_options=request_options,
|
234
204
|
)
|
235
|
-
|
236
|
-
if 200 <= _response.status_code < 300:
|
237
|
-
return typing.cast(
|
238
|
-
DocumentIndexRead,
|
239
|
-
parse_obj_as(
|
240
|
-
type_=DocumentIndexRead, # type: ignore
|
241
|
-
object_=_response.json(),
|
242
|
-
),
|
243
|
-
)
|
244
|
-
_response_json = _response.json()
|
245
|
-
except JSONDecodeError:
|
246
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
247
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
205
|
+
return response.data
|
248
206
|
|
249
207
|
def update(
|
250
208
|
self,
|
@@ -292,33 +250,13 @@ class DocumentIndexesClient:
|
|
292
250
|
label="x",
|
293
251
|
)
|
294
252
|
"""
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
json={
|
300
|
-
"label": label,
|
301
|
-
"status": status,
|
302
|
-
},
|
303
|
-
headers={
|
304
|
-
"content-type": "application/json",
|
305
|
-
},
|
253
|
+
response = self._raw_client.update(
|
254
|
+
id,
|
255
|
+
label=label,
|
256
|
+
status=status,
|
306
257
|
request_options=request_options,
|
307
|
-
omit=OMIT,
|
308
258
|
)
|
309
|
-
|
310
|
-
if 200 <= _response.status_code < 300:
|
311
|
-
return typing.cast(
|
312
|
-
DocumentIndexRead,
|
313
|
-
parse_obj_as(
|
314
|
-
type_=DocumentIndexRead, # type: ignore
|
315
|
-
object_=_response.json(),
|
316
|
-
),
|
317
|
-
)
|
318
|
-
_response_json = _response.json()
|
319
|
-
except JSONDecodeError:
|
320
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
321
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
259
|
+
return response.data
|
322
260
|
|
323
261
|
def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
324
262
|
"""
|
@@ -348,19 +286,11 @@ class DocumentIndexesClient:
|
|
348
286
|
id="id",
|
349
287
|
)
|
350
288
|
"""
|
351
|
-
|
352
|
-
|
353
|
-
base_url=self._client_wrapper.get_environment().documents,
|
354
|
-
method="DELETE",
|
289
|
+
response = self._raw_client.destroy(
|
290
|
+
id,
|
355
291
|
request_options=request_options,
|
356
292
|
)
|
357
|
-
|
358
|
-
if 200 <= _response.status_code < 300:
|
359
|
-
return
|
360
|
-
_response_json = _response.json()
|
361
|
-
except JSONDecodeError:
|
362
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
363
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
293
|
+
return response.data
|
364
294
|
|
365
295
|
def partial_update(
|
366
296
|
self,
|
@@ -407,33 +337,13 @@ class DocumentIndexesClient:
|
|
407
337
|
id="id",
|
408
338
|
)
|
409
339
|
"""
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
json={
|
415
|
-
"label": label,
|
416
|
-
"status": status,
|
417
|
-
},
|
418
|
-
headers={
|
419
|
-
"content-type": "application/json",
|
420
|
-
},
|
340
|
+
response = self._raw_client.partial_update(
|
341
|
+
id,
|
342
|
+
label=label,
|
343
|
+
status=status,
|
421
344
|
request_options=request_options,
|
422
|
-
omit=OMIT,
|
423
345
|
)
|
424
|
-
|
425
|
-
if 200 <= _response.status_code < 300:
|
426
|
-
return typing.cast(
|
427
|
-
DocumentIndexRead,
|
428
|
-
parse_obj_as(
|
429
|
-
type_=DocumentIndexRead, # type: ignore
|
430
|
-
object_=_response.json(),
|
431
|
-
),
|
432
|
-
)
|
433
|
-
_response_json = _response.json()
|
434
|
-
except JSONDecodeError:
|
435
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
436
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
346
|
+
return response.data
|
437
347
|
|
438
348
|
def add_document(
|
439
349
|
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
@@ -469,19 +379,12 @@ class DocumentIndexesClient:
|
|
469
379
|
id="id",
|
470
380
|
)
|
471
381
|
"""
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
method="POST",
|
382
|
+
response = self._raw_client.add_document(
|
383
|
+
document_id,
|
384
|
+
id,
|
476
385
|
request_options=request_options,
|
477
386
|
)
|
478
|
-
|
479
|
-
if 200 <= _response.status_code < 300:
|
480
|
-
return
|
481
|
-
_response_json = _response.json()
|
482
|
-
except JSONDecodeError:
|
483
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
484
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
387
|
+
return response.data
|
485
388
|
|
486
389
|
def remove_document(
|
487
390
|
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
@@ -517,26 +420,30 @@ class DocumentIndexesClient:
|
|
517
420
|
id="id",
|
518
421
|
)
|
519
422
|
"""
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
method="DELETE",
|
423
|
+
response = self._raw_client.remove_document(
|
424
|
+
document_id,
|
425
|
+
id,
|
524
426
|
request_options=request_options,
|
525
427
|
)
|
526
|
-
|
527
|
-
if 200 <= _response.status_code < 300:
|
528
|
-
return
|
529
|
-
_response_json = _response.json()
|
530
|
-
except JSONDecodeError:
|
531
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
532
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
428
|
+
return response.data
|
533
429
|
|
534
430
|
|
535
431
|
class AsyncDocumentIndexesClient:
|
536
432
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
537
|
-
self.
|
433
|
+
self._raw_client = AsyncRawDocumentIndexesClient(client_wrapper=client_wrapper)
|
538
434
|
|
539
|
-
|
435
|
+
@property
|
436
|
+
def with_raw_response(self) -> AsyncRawDocumentIndexesClient:
|
437
|
+
"""
|
438
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
439
|
+
|
440
|
+
Returns
|
441
|
+
-------
|
442
|
+
AsyncRawDocumentIndexesClient
|
443
|
+
"""
|
444
|
+
return self._raw_client
|
445
|
+
|
446
|
+
async def list_(
|
540
447
|
self,
|
541
448
|
*,
|
542
449
|
limit: typing.Optional[int] = None,
|
@@ -595,32 +502,15 @@ class AsyncDocumentIndexesClient:
|
|
595
502
|
|
596
503
|
asyncio.run(main())
|
597
504
|
"""
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
"offset": offset,
|
605
|
-
"ordering": ordering,
|
606
|
-
"search": search,
|
607
|
-
"status": status,
|
608
|
-
},
|
505
|
+
response = await self._raw_client.list(
|
506
|
+
limit=limit,
|
507
|
+
offset=offset,
|
508
|
+
ordering=ordering,
|
509
|
+
search=search,
|
510
|
+
status=status,
|
609
511
|
request_options=request_options,
|
610
512
|
)
|
611
|
-
|
612
|
-
if 200 <= _response.status_code < 300:
|
613
|
-
return typing.cast(
|
614
|
-
PaginatedDocumentIndexReadList,
|
615
|
-
parse_obj_as(
|
616
|
-
type_=PaginatedDocumentIndexReadList, # type: ignore
|
617
|
-
object_=_response.json(),
|
618
|
-
),
|
619
|
-
)
|
620
|
-
_response_json = _response.json()
|
621
|
-
except JSONDecodeError:
|
622
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
623
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
513
|
+
return response.data
|
624
514
|
|
625
515
|
async def create(
|
626
516
|
self,
|
@@ -693,38 +583,15 @@ class AsyncDocumentIndexesClient:
|
|
693
583
|
|
694
584
|
asyncio.run(main())
|
695
585
|
"""
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
"name": name,
|
703
|
-
"status": status,
|
704
|
-
"indexing_config": convert_and_respect_annotation_metadata(
|
705
|
-
object_=indexing_config, annotation=DocumentIndexIndexingConfigRequest, direction="write"
|
706
|
-
),
|
707
|
-
"copy_documents_from_index_id": copy_documents_from_index_id,
|
708
|
-
},
|
709
|
-
headers={
|
710
|
-
"content-type": "application/json",
|
711
|
-
},
|
586
|
+
response = await self._raw_client.create(
|
587
|
+
label=label,
|
588
|
+
name=name,
|
589
|
+
indexing_config=indexing_config,
|
590
|
+
status=status,
|
591
|
+
copy_documents_from_index_id=copy_documents_from_index_id,
|
712
592
|
request_options=request_options,
|
713
|
-
omit=OMIT,
|
714
593
|
)
|
715
|
-
|
716
|
-
if 200 <= _response.status_code < 300:
|
717
|
-
return typing.cast(
|
718
|
-
DocumentIndexRead,
|
719
|
-
parse_obj_as(
|
720
|
-
type_=DocumentIndexRead, # type: ignore
|
721
|
-
object_=_response.json(),
|
722
|
-
),
|
723
|
-
)
|
724
|
-
_response_json = _response.json()
|
725
|
-
except JSONDecodeError:
|
726
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
727
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
594
|
+
return response.data
|
728
595
|
|
729
596
|
async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentIndexRead:
|
730
597
|
"""
|
@@ -763,25 +630,11 @@ class AsyncDocumentIndexesClient:
|
|
763
630
|
|
764
631
|
asyncio.run(main())
|
765
632
|
"""
|
766
|
-
|
767
|
-
|
768
|
-
base_url=self._client_wrapper.get_environment().default,
|
769
|
-
method="GET",
|
633
|
+
response = await self._raw_client.retrieve(
|
634
|
+
id,
|
770
635
|
request_options=request_options,
|
771
636
|
)
|
772
|
-
|
773
|
-
if 200 <= _response.status_code < 300:
|
774
|
-
return typing.cast(
|
775
|
-
DocumentIndexRead,
|
776
|
-
parse_obj_as(
|
777
|
-
type_=DocumentIndexRead, # type: ignore
|
778
|
-
object_=_response.json(),
|
779
|
-
),
|
780
|
-
)
|
781
|
-
_response_json = _response.json()
|
782
|
-
except JSONDecodeError:
|
783
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
784
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
637
|
+
return response.data
|
785
638
|
|
786
639
|
async def update(
|
787
640
|
self,
|
@@ -837,33 +690,13 @@ class AsyncDocumentIndexesClient:
|
|
837
690
|
|
838
691
|
asyncio.run(main())
|
839
692
|
"""
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
json={
|
845
|
-
"label": label,
|
846
|
-
"status": status,
|
847
|
-
},
|
848
|
-
headers={
|
849
|
-
"content-type": "application/json",
|
850
|
-
},
|
693
|
+
response = await self._raw_client.update(
|
694
|
+
id,
|
695
|
+
label=label,
|
696
|
+
status=status,
|
851
697
|
request_options=request_options,
|
852
|
-
omit=OMIT,
|
853
698
|
)
|
854
|
-
|
855
|
-
if 200 <= _response.status_code < 300:
|
856
|
-
return typing.cast(
|
857
|
-
DocumentIndexRead,
|
858
|
-
parse_obj_as(
|
859
|
-
type_=DocumentIndexRead, # type: ignore
|
860
|
-
object_=_response.json(),
|
861
|
-
),
|
862
|
-
)
|
863
|
-
_response_json = _response.json()
|
864
|
-
except JSONDecodeError:
|
865
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
866
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
699
|
+
return response.data
|
867
700
|
|
868
701
|
async def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
869
702
|
"""
|
@@ -901,19 +734,11 @@ class AsyncDocumentIndexesClient:
|
|
901
734
|
|
902
735
|
asyncio.run(main())
|
903
736
|
"""
|
904
|
-
|
905
|
-
|
906
|
-
base_url=self._client_wrapper.get_environment().documents,
|
907
|
-
method="DELETE",
|
737
|
+
response = await self._raw_client.destroy(
|
738
|
+
id,
|
908
739
|
request_options=request_options,
|
909
740
|
)
|
910
|
-
|
911
|
-
if 200 <= _response.status_code < 300:
|
912
|
-
return
|
913
|
-
_response_json = _response.json()
|
914
|
-
except JSONDecodeError:
|
915
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
916
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
741
|
+
return response.data
|
917
742
|
|
918
743
|
async def partial_update(
|
919
744
|
self,
|
@@ -968,33 +793,13 @@ class AsyncDocumentIndexesClient:
|
|
968
793
|
|
969
794
|
asyncio.run(main())
|
970
795
|
"""
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
json={
|
976
|
-
"label": label,
|
977
|
-
"status": status,
|
978
|
-
},
|
979
|
-
headers={
|
980
|
-
"content-type": "application/json",
|
981
|
-
},
|
796
|
+
response = await self._raw_client.partial_update(
|
797
|
+
id,
|
798
|
+
label=label,
|
799
|
+
status=status,
|
982
800
|
request_options=request_options,
|
983
|
-
omit=OMIT,
|
984
801
|
)
|
985
|
-
|
986
|
-
if 200 <= _response.status_code < 300:
|
987
|
-
return typing.cast(
|
988
|
-
DocumentIndexRead,
|
989
|
-
parse_obj_as(
|
990
|
-
type_=DocumentIndexRead, # type: ignore
|
991
|
-
object_=_response.json(),
|
992
|
-
),
|
993
|
-
)
|
994
|
-
_response_json = _response.json()
|
995
|
-
except JSONDecodeError:
|
996
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
997
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
802
|
+
return response.data
|
998
803
|
|
999
804
|
async def add_document(
|
1000
805
|
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
@@ -1038,19 +843,12 @@ class AsyncDocumentIndexesClient:
|
|
1038
843
|
|
1039
844
|
asyncio.run(main())
|
1040
845
|
"""
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
method="POST",
|
846
|
+
response = await self._raw_client.add_document(
|
847
|
+
document_id,
|
848
|
+
id,
|
1045
849
|
request_options=request_options,
|
1046
850
|
)
|
1047
|
-
|
1048
|
-
if 200 <= _response.status_code < 300:
|
1049
|
-
return
|
1050
|
-
_response_json = _response.json()
|
1051
|
-
except JSONDecodeError:
|
1052
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1053
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
851
|
+
return response.data
|
1054
852
|
|
1055
853
|
async def remove_document(
|
1056
854
|
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
@@ -1094,16 +892,9 @@ class AsyncDocumentIndexesClient:
|
|
1094
892
|
|
1095
893
|
asyncio.run(main())
|
1096
894
|
"""
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
method="DELETE",
|
895
|
+
response = await self._raw_client.remove_document(
|
896
|
+
document_id,
|
897
|
+
id,
|
1101
898
|
request_options=request_options,
|
1102
899
|
)
|
1103
|
-
|
1104
|
-
if 200 <= _response.status_code < 300:
|
1105
|
-
return
|
1106
|
-
_response_json = _response.json()
|
1107
|
-
except JSONDecodeError:
|
1108
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1109
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
900
|
+
return response.data
|