mistralai 1.9.10__py3-none-any.whl → 1.10.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.
- mistralai/_hooks/registration.py +5 -0
- mistralai/_hooks/tracing.py +50 -0
- mistralai/_version.py +3 -3
- mistralai/accesses.py +51 -116
- mistralai/agents.py +58 -85
- mistralai/audio.py +8 -3
- mistralai/basesdk.py +15 -5
- mistralai/batch.py +6 -3
- mistralai/beta.py +10 -5
- mistralai/chat.py +70 -97
- mistralai/classifiers.py +57 -144
- mistralai/conversations.py +435 -412
- mistralai/documents.py +156 -359
- mistralai/embeddings.py +21 -42
- mistralai/extra/observability/__init__.py +15 -0
- mistralai/extra/observability/otel.py +393 -0
- mistralai/extra/run/tools.py +28 -16
- mistralai/files.py +53 -176
- mistralai/fim.py +46 -73
- mistralai/fine_tuning.py +6 -3
- mistralai/jobs.py +49 -158
- mistralai/libraries.py +71 -178
- mistralai/mistral_agents.py +298 -179
- mistralai/mistral_jobs.py +51 -138
- mistralai/models/__init__.py +94 -5
- mistralai/models/agent.py +15 -2
- mistralai/models/agentconversation.py +11 -3
- mistralai/models/agentcreationrequest.py +6 -2
- mistralai/models/agents_api_v1_agents_deleteop.py +16 -0
- mistralai/models/agents_api_v1_agents_getop.py +40 -3
- mistralai/models/agents_api_v1_agents_listop.py +72 -2
- mistralai/models/agents_api_v1_conversations_deleteop.py +18 -0
- mistralai/models/agents_api_v1_conversations_listop.py +39 -2
- mistralai/models/agentscompletionrequest.py +21 -6
- mistralai/models/agentscompletionstreamrequest.py +21 -6
- mistralai/models/agentupdaterequest.py +18 -2
- mistralai/models/audiotranscriptionrequest.py +2 -0
- mistralai/models/batchjobin.py +10 -0
- mistralai/models/chatcompletionrequest.py +22 -5
- mistralai/models/chatcompletionstreamrequest.py +22 -5
- mistralai/models/conversationrequest.py +15 -4
- mistralai/models/conversationrestartrequest.py +50 -2
- mistralai/models/conversationrestartstreamrequest.py +50 -2
- mistralai/models/conversationstreamrequest.py +15 -4
- mistralai/models/documentout.py +26 -10
- mistralai/models/documentupdatein.py +24 -3
- mistralai/models/embeddingrequest.py +8 -8
- mistralai/models/files_api_routes_list_filesop.py +7 -0
- mistralai/models/fimcompletionrequest.py +8 -9
- mistralai/models/fimcompletionstreamrequest.py +8 -9
- mistralai/models/httpvalidationerror.py +11 -6
- mistralai/models/libraries_documents_list_v1op.py +15 -2
- mistralai/models/libraryout.py +10 -7
- mistralai/models/listfilesout.py +35 -4
- mistralai/models/mistralerror.py +26 -0
- mistralai/models/modelcapabilities.py +13 -4
- mistralai/models/modelconversation.py +8 -2
- mistralai/models/no_response_error.py +13 -0
- mistralai/models/ocrpageobject.py +26 -5
- mistralai/models/ocrrequest.py +17 -1
- mistralai/models/ocrtableobject.py +31 -0
- mistralai/models/prediction.py +4 -0
- mistralai/models/requestsource.py +7 -0
- mistralai/models/responseformat.py +4 -2
- mistralai/models/responseformats.py +0 -1
- mistralai/models/responsevalidationerror.py +25 -0
- mistralai/models/sdkerror.py +30 -14
- mistralai/models/sharingdelete.py +36 -5
- mistralai/models/sharingin.py +36 -5
- mistralai/models/sharingout.py +3 -3
- mistralai/models/toolexecutiondeltaevent.py +13 -4
- mistralai/models/toolexecutiondoneevent.py +13 -4
- mistralai/models/toolexecutionentry.py +9 -4
- mistralai/models/toolexecutionstartedevent.py +13 -4
- mistralai/models_.py +67 -212
- mistralai/ocr.py +33 -36
- mistralai/sdk.py +15 -2
- mistralai/transcriptions.py +21 -60
- mistralai/utils/__init__.py +18 -5
- mistralai/utils/eventstreaming.py +10 -0
- mistralai/utils/serializers.py +3 -2
- mistralai/utils/unmarshal_json_response.py +24 -0
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/METADATA +89 -40
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/RECORD +86 -75
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/WHEEL +1 -1
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info/licenses}/LICENSE +0 -0
mistralai/documents.py
CHANGED
|
@@ -5,7 +5,8 @@ from mistralai import models, utils
|
|
|
5
5
|
from mistralai._hooks import HookContext
|
|
6
6
|
from mistralai.types import OptionalNullable, UNSET
|
|
7
7
|
from mistralai.utils import get_security_from_env
|
|
8
|
-
from
|
|
8
|
+
from mistralai.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, Dict, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Documents(BaseSDK):
|
|
@@ -18,6 +19,7 @@ class Documents(BaseSDK):
|
|
|
18
19
|
search: OptionalNullable[str] = UNSET,
|
|
19
20
|
page_size: Optional[int] = 100,
|
|
20
21
|
page: Optional[int] = 0,
|
|
22
|
+
filters_attributes: OptionalNullable[str] = UNSET,
|
|
21
23
|
sort_by: Optional[str] = "created_at",
|
|
22
24
|
sort_order: Optional[str] = "desc",
|
|
23
25
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -25,7 +27,7 @@ class Documents(BaseSDK):
|
|
|
25
27
|
timeout_ms: Optional[int] = None,
|
|
26
28
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
27
29
|
) -> models.ListDocumentOut:
|
|
28
|
-
r"""List
|
|
30
|
+
r"""List documents in a given library.
|
|
29
31
|
|
|
30
32
|
Given a library, lists the document that have been uploaded to that library.
|
|
31
33
|
|
|
@@ -33,6 +35,7 @@ class Documents(BaseSDK):
|
|
|
33
35
|
:param search:
|
|
34
36
|
:param page_size:
|
|
35
37
|
:param page:
|
|
38
|
+
:param filters_attributes:
|
|
36
39
|
:param sort_by:
|
|
37
40
|
:param sort_order:
|
|
38
41
|
:param retries: Override the default retry configuration for this method
|
|
@@ -55,6 +58,7 @@ class Documents(BaseSDK):
|
|
|
55
58
|
search=search,
|
|
56
59
|
page_size=page_size,
|
|
57
60
|
page=page,
|
|
61
|
+
filters_attributes=filters_attributes,
|
|
58
62
|
sort_by=sort_by,
|
|
59
63
|
sort_order=sort_order,
|
|
60
64
|
)
|
|
@@ -100,31 +104,20 @@ class Documents(BaseSDK):
|
|
|
100
104
|
|
|
101
105
|
response_data: Any = None
|
|
102
106
|
if utils.match_response(http_res, "200", "application/json"):
|
|
103
|
-
return
|
|
107
|
+
return unmarshal_json_response(models.ListDocumentOut, http_res)
|
|
104
108
|
if utils.match_response(http_res, "422", "application/json"):
|
|
105
|
-
response_data =
|
|
106
|
-
|
|
109
|
+
response_data = unmarshal_json_response(
|
|
110
|
+
models.HTTPValidationErrorData, http_res
|
|
107
111
|
)
|
|
108
|
-
raise models.HTTPValidationError(
|
|
112
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
109
113
|
if utils.match_response(http_res, "4XX", "*"):
|
|
110
114
|
http_res_text = utils.stream_to_text(http_res)
|
|
111
|
-
raise models.SDKError(
|
|
112
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
113
|
-
)
|
|
115
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
114
116
|
if utils.match_response(http_res, "5XX", "*"):
|
|
115
117
|
http_res_text = utils.stream_to_text(http_res)
|
|
116
|
-
raise models.SDKError(
|
|
117
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
118
|
-
)
|
|
118
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
122
|
-
raise models.SDKError(
|
|
123
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
124
|
-
http_res.status_code,
|
|
125
|
-
http_res_text,
|
|
126
|
-
http_res,
|
|
127
|
-
)
|
|
120
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
128
121
|
|
|
129
122
|
async def list_async(
|
|
130
123
|
self,
|
|
@@ -133,6 +126,7 @@ class Documents(BaseSDK):
|
|
|
133
126
|
search: OptionalNullable[str] = UNSET,
|
|
134
127
|
page_size: Optional[int] = 100,
|
|
135
128
|
page: Optional[int] = 0,
|
|
129
|
+
filters_attributes: OptionalNullable[str] = UNSET,
|
|
136
130
|
sort_by: Optional[str] = "created_at",
|
|
137
131
|
sort_order: Optional[str] = "desc",
|
|
138
132
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -140,7 +134,7 @@ class Documents(BaseSDK):
|
|
|
140
134
|
timeout_ms: Optional[int] = None,
|
|
141
135
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
142
136
|
) -> models.ListDocumentOut:
|
|
143
|
-
r"""List
|
|
137
|
+
r"""List documents in a given library.
|
|
144
138
|
|
|
145
139
|
Given a library, lists the document that have been uploaded to that library.
|
|
146
140
|
|
|
@@ -148,6 +142,7 @@ class Documents(BaseSDK):
|
|
|
148
142
|
:param search:
|
|
149
143
|
:param page_size:
|
|
150
144
|
:param page:
|
|
145
|
+
:param filters_attributes:
|
|
151
146
|
:param sort_by:
|
|
152
147
|
:param sort_order:
|
|
153
148
|
:param retries: Override the default retry configuration for this method
|
|
@@ -170,6 +165,7 @@ class Documents(BaseSDK):
|
|
|
170
165
|
search=search,
|
|
171
166
|
page_size=page_size,
|
|
172
167
|
page=page,
|
|
168
|
+
filters_attributes=filters_attributes,
|
|
173
169
|
sort_by=sort_by,
|
|
174
170
|
sort_order=sort_order,
|
|
175
171
|
)
|
|
@@ -215,31 +211,20 @@ class Documents(BaseSDK):
|
|
|
215
211
|
|
|
216
212
|
response_data: Any = None
|
|
217
213
|
if utils.match_response(http_res, "200", "application/json"):
|
|
218
|
-
return
|
|
214
|
+
return unmarshal_json_response(models.ListDocumentOut, http_res)
|
|
219
215
|
if utils.match_response(http_res, "422", "application/json"):
|
|
220
|
-
response_data =
|
|
221
|
-
|
|
216
|
+
response_data = unmarshal_json_response(
|
|
217
|
+
models.HTTPValidationErrorData, http_res
|
|
222
218
|
)
|
|
223
|
-
raise models.HTTPValidationError(
|
|
219
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
224
220
|
if utils.match_response(http_res, "4XX", "*"):
|
|
225
221
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
226
|
-
raise models.SDKError(
|
|
227
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
228
|
-
)
|
|
222
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
229
223
|
if utils.match_response(http_res, "5XX", "*"):
|
|
230
224
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
231
|
-
raise models.SDKError(
|
|
232
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
233
|
-
)
|
|
225
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
234
226
|
|
|
235
|
-
|
|
236
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
237
|
-
raise models.SDKError(
|
|
238
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
239
|
-
http_res.status_code,
|
|
240
|
-
http_res_text,
|
|
241
|
-
http_res,
|
|
242
|
-
)
|
|
227
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
243
228
|
|
|
244
229
|
def upload(
|
|
245
230
|
self,
|
|
@@ -327,31 +312,20 @@ class Documents(BaseSDK):
|
|
|
327
312
|
|
|
328
313
|
response_data: Any = None
|
|
329
314
|
if utils.match_response(http_res, ["200", "201"], "application/json"):
|
|
330
|
-
return
|
|
315
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
331
316
|
if utils.match_response(http_res, "422", "application/json"):
|
|
332
|
-
response_data =
|
|
333
|
-
|
|
317
|
+
response_data = unmarshal_json_response(
|
|
318
|
+
models.HTTPValidationErrorData, http_res
|
|
334
319
|
)
|
|
335
|
-
raise models.HTTPValidationError(
|
|
320
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
336
321
|
if utils.match_response(http_res, "4XX", "*"):
|
|
337
322
|
http_res_text = utils.stream_to_text(http_res)
|
|
338
|
-
raise models.SDKError(
|
|
339
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
340
|
-
)
|
|
323
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
341
324
|
if utils.match_response(http_res, "5XX", "*"):
|
|
342
325
|
http_res_text = utils.stream_to_text(http_res)
|
|
343
|
-
raise models.SDKError(
|
|
344
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
345
|
-
)
|
|
326
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
346
327
|
|
|
347
|
-
|
|
348
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
349
|
-
raise models.SDKError(
|
|
350
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
351
|
-
http_res.status_code,
|
|
352
|
-
http_res_text,
|
|
353
|
-
http_res,
|
|
354
|
-
)
|
|
328
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
355
329
|
|
|
356
330
|
async def upload_async(
|
|
357
331
|
self,
|
|
@@ -439,31 +413,20 @@ class Documents(BaseSDK):
|
|
|
439
413
|
|
|
440
414
|
response_data: Any = None
|
|
441
415
|
if utils.match_response(http_res, ["200", "201"], "application/json"):
|
|
442
|
-
return
|
|
416
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
443
417
|
if utils.match_response(http_res, "422", "application/json"):
|
|
444
|
-
response_data =
|
|
445
|
-
|
|
418
|
+
response_data = unmarshal_json_response(
|
|
419
|
+
models.HTTPValidationErrorData, http_res
|
|
446
420
|
)
|
|
447
|
-
raise models.HTTPValidationError(
|
|
421
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
448
422
|
if utils.match_response(http_res, "4XX", "*"):
|
|
449
423
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
450
|
-
raise models.SDKError(
|
|
451
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
452
|
-
)
|
|
424
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
453
425
|
if utils.match_response(http_res, "5XX", "*"):
|
|
454
426
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
455
|
-
raise models.SDKError(
|
|
456
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
457
|
-
)
|
|
427
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
458
428
|
|
|
459
|
-
|
|
460
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
461
|
-
raise models.SDKError(
|
|
462
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
463
|
-
http_res.status_code,
|
|
464
|
-
http_res_text,
|
|
465
|
-
http_res,
|
|
466
|
-
)
|
|
429
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
467
430
|
|
|
468
431
|
def get(
|
|
469
432
|
self,
|
|
@@ -542,31 +505,20 @@ class Documents(BaseSDK):
|
|
|
542
505
|
|
|
543
506
|
response_data: Any = None
|
|
544
507
|
if utils.match_response(http_res, "200", "application/json"):
|
|
545
|
-
return
|
|
508
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
546
509
|
if utils.match_response(http_res, "422", "application/json"):
|
|
547
|
-
response_data =
|
|
548
|
-
|
|
510
|
+
response_data = unmarshal_json_response(
|
|
511
|
+
models.HTTPValidationErrorData, http_res
|
|
549
512
|
)
|
|
550
|
-
raise models.HTTPValidationError(
|
|
513
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
551
514
|
if utils.match_response(http_res, "4XX", "*"):
|
|
552
515
|
http_res_text = utils.stream_to_text(http_res)
|
|
553
|
-
raise models.SDKError(
|
|
554
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
555
|
-
)
|
|
516
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
556
517
|
if utils.match_response(http_res, "5XX", "*"):
|
|
557
518
|
http_res_text = utils.stream_to_text(http_res)
|
|
558
|
-
raise models.SDKError(
|
|
559
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
560
|
-
)
|
|
519
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
561
520
|
|
|
562
|
-
|
|
563
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
564
|
-
raise models.SDKError(
|
|
565
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
566
|
-
http_res.status_code,
|
|
567
|
-
http_res_text,
|
|
568
|
-
http_res,
|
|
569
|
-
)
|
|
521
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
570
522
|
|
|
571
523
|
async def get_async(
|
|
572
524
|
self,
|
|
@@ -645,31 +597,20 @@ class Documents(BaseSDK):
|
|
|
645
597
|
|
|
646
598
|
response_data: Any = None
|
|
647
599
|
if utils.match_response(http_res, "200", "application/json"):
|
|
648
|
-
return
|
|
600
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
649
601
|
if utils.match_response(http_res, "422", "application/json"):
|
|
650
|
-
response_data =
|
|
651
|
-
|
|
602
|
+
response_data = unmarshal_json_response(
|
|
603
|
+
models.HTTPValidationErrorData, http_res
|
|
652
604
|
)
|
|
653
|
-
raise models.HTTPValidationError(
|
|
605
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
654
606
|
if utils.match_response(http_res, "4XX", "*"):
|
|
655
607
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
656
|
-
raise models.SDKError(
|
|
657
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
658
|
-
)
|
|
608
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
659
609
|
if utils.match_response(http_res, "5XX", "*"):
|
|
660
610
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
661
|
-
raise models.SDKError(
|
|
662
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
663
|
-
)
|
|
611
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
664
612
|
|
|
665
|
-
|
|
666
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
667
|
-
raise models.SDKError(
|
|
668
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
669
|
-
http_res.status_code,
|
|
670
|
-
http_res_text,
|
|
671
|
-
http_res,
|
|
672
|
-
)
|
|
613
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
673
614
|
|
|
674
615
|
def update(
|
|
675
616
|
self,
|
|
@@ -677,6 +618,9 @@ class Documents(BaseSDK):
|
|
|
677
618
|
library_id: str,
|
|
678
619
|
document_id: str,
|
|
679
620
|
name: OptionalNullable[str] = UNSET,
|
|
621
|
+
attributes: OptionalNullable[
|
|
622
|
+
Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]]
|
|
623
|
+
] = UNSET,
|
|
680
624
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
681
625
|
server_url: Optional[str] = None,
|
|
682
626
|
timeout_ms: Optional[int] = None,
|
|
@@ -689,6 +633,7 @@ class Documents(BaseSDK):
|
|
|
689
633
|
:param library_id:
|
|
690
634
|
:param document_id:
|
|
691
635
|
:param name:
|
|
636
|
+
:param attributes:
|
|
692
637
|
:param retries: Override the default retry configuration for this method
|
|
693
638
|
:param server_url: Override the default server URL for this method
|
|
694
639
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -709,6 +654,7 @@ class Documents(BaseSDK):
|
|
|
709
654
|
document_id=document_id,
|
|
710
655
|
document_update_in=models.DocumentUpdateIn(
|
|
711
656
|
name=name,
|
|
657
|
+
attributes=attributes,
|
|
712
658
|
),
|
|
713
659
|
)
|
|
714
660
|
|
|
@@ -760,31 +706,20 @@ class Documents(BaseSDK):
|
|
|
760
706
|
|
|
761
707
|
response_data: Any = None
|
|
762
708
|
if utils.match_response(http_res, "200", "application/json"):
|
|
763
|
-
return
|
|
709
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
764
710
|
if utils.match_response(http_res, "422", "application/json"):
|
|
765
|
-
response_data =
|
|
766
|
-
|
|
711
|
+
response_data = unmarshal_json_response(
|
|
712
|
+
models.HTTPValidationErrorData, http_res
|
|
767
713
|
)
|
|
768
|
-
raise models.HTTPValidationError(
|
|
714
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
769
715
|
if utils.match_response(http_res, "4XX", "*"):
|
|
770
716
|
http_res_text = utils.stream_to_text(http_res)
|
|
771
|
-
raise models.SDKError(
|
|
772
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
773
|
-
)
|
|
717
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
774
718
|
if utils.match_response(http_res, "5XX", "*"):
|
|
775
719
|
http_res_text = utils.stream_to_text(http_res)
|
|
776
|
-
raise models.SDKError(
|
|
777
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
778
|
-
)
|
|
720
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
779
721
|
|
|
780
|
-
|
|
781
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
782
|
-
raise models.SDKError(
|
|
783
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
784
|
-
http_res.status_code,
|
|
785
|
-
http_res_text,
|
|
786
|
-
http_res,
|
|
787
|
-
)
|
|
722
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
788
723
|
|
|
789
724
|
async def update_async(
|
|
790
725
|
self,
|
|
@@ -792,6 +727,9 @@ class Documents(BaseSDK):
|
|
|
792
727
|
library_id: str,
|
|
793
728
|
document_id: str,
|
|
794
729
|
name: OptionalNullable[str] = UNSET,
|
|
730
|
+
attributes: OptionalNullable[
|
|
731
|
+
Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]]
|
|
732
|
+
] = UNSET,
|
|
795
733
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
796
734
|
server_url: Optional[str] = None,
|
|
797
735
|
timeout_ms: Optional[int] = None,
|
|
@@ -804,6 +742,7 @@ class Documents(BaseSDK):
|
|
|
804
742
|
:param library_id:
|
|
805
743
|
:param document_id:
|
|
806
744
|
:param name:
|
|
745
|
+
:param attributes:
|
|
807
746
|
:param retries: Override the default retry configuration for this method
|
|
808
747
|
:param server_url: Override the default server URL for this method
|
|
809
748
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -824,6 +763,7 @@ class Documents(BaseSDK):
|
|
|
824
763
|
document_id=document_id,
|
|
825
764
|
document_update_in=models.DocumentUpdateIn(
|
|
826
765
|
name=name,
|
|
766
|
+
attributes=attributes,
|
|
827
767
|
),
|
|
828
768
|
)
|
|
829
769
|
|
|
@@ -875,31 +815,20 @@ class Documents(BaseSDK):
|
|
|
875
815
|
|
|
876
816
|
response_data: Any = None
|
|
877
817
|
if utils.match_response(http_res, "200", "application/json"):
|
|
878
|
-
return
|
|
818
|
+
return unmarshal_json_response(models.DocumentOut, http_res)
|
|
879
819
|
if utils.match_response(http_res, "422", "application/json"):
|
|
880
|
-
response_data =
|
|
881
|
-
|
|
820
|
+
response_data = unmarshal_json_response(
|
|
821
|
+
models.HTTPValidationErrorData, http_res
|
|
882
822
|
)
|
|
883
|
-
raise models.HTTPValidationError(
|
|
823
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
884
824
|
if utils.match_response(http_res, "4XX", "*"):
|
|
885
825
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
886
|
-
raise models.SDKError(
|
|
887
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
888
|
-
)
|
|
826
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
889
827
|
if utils.match_response(http_res, "5XX", "*"):
|
|
890
828
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
891
|
-
raise models.SDKError(
|
|
892
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
893
|
-
)
|
|
829
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
894
830
|
|
|
895
|
-
|
|
896
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
897
|
-
raise models.SDKError(
|
|
898
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
899
|
-
http_res.status_code,
|
|
900
|
-
http_res_text,
|
|
901
|
-
http_res,
|
|
902
|
-
)
|
|
831
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
903
832
|
|
|
904
833
|
def delete(
|
|
905
834
|
self,
|
|
@@ -980,29 +909,18 @@ class Documents(BaseSDK):
|
|
|
980
909
|
if utils.match_response(http_res, "204", "*"):
|
|
981
910
|
return
|
|
982
911
|
if utils.match_response(http_res, "422", "application/json"):
|
|
983
|
-
response_data =
|
|
984
|
-
|
|
912
|
+
response_data = unmarshal_json_response(
|
|
913
|
+
models.HTTPValidationErrorData, http_res
|
|
985
914
|
)
|
|
986
|
-
raise models.HTTPValidationError(
|
|
915
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
987
916
|
if utils.match_response(http_res, "4XX", "*"):
|
|
988
917
|
http_res_text = utils.stream_to_text(http_res)
|
|
989
|
-
raise models.SDKError(
|
|
990
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
991
|
-
)
|
|
918
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
992
919
|
if utils.match_response(http_res, "5XX", "*"):
|
|
993
920
|
http_res_text = utils.stream_to_text(http_res)
|
|
994
|
-
raise models.SDKError(
|
|
995
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
996
|
-
)
|
|
921
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
997
922
|
|
|
998
|
-
|
|
999
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1000
|
-
raise models.SDKError(
|
|
1001
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1002
|
-
http_res.status_code,
|
|
1003
|
-
http_res_text,
|
|
1004
|
-
http_res,
|
|
1005
|
-
)
|
|
923
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1006
924
|
|
|
1007
925
|
async def delete_async(
|
|
1008
926
|
self,
|
|
@@ -1083,29 +1001,18 @@ class Documents(BaseSDK):
|
|
|
1083
1001
|
if utils.match_response(http_res, "204", "*"):
|
|
1084
1002
|
return
|
|
1085
1003
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1086
|
-
response_data =
|
|
1087
|
-
|
|
1004
|
+
response_data = unmarshal_json_response(
|
|
1005
|
+
models.HTTPValidationErrorData, http_res
|
|
1088
1006
|
)
|
|
1089
|
-
raise models.HTTPValidationError(
|
|
1007
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1090
1008
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1091
1009
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1092
|
-
raise models.SDKError(
|
|
1093
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1094
|
-
)
|
|
1010
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1095
1011
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1096
1012
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1097
|
-
raise models.SDKError(
|
|
1098
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1099
|
-
)
|
|
1013
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1100
1014
|
|
|
1101
|
-
|
|
1102
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1103
|
-
raise models.SDKError(
|
|
1104
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1105
|
-
http_res.status_code,
|
|
1106
|
-
http_res_text,
|
|
1107
|
-
http_res,
|
|
1108
|
-
)
|
|
1015
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1109
1016
|
|
|
1110
1017
|
def text_content(
|
|
1111
1018
|
self,
|
|
@@ -1184,31 +1091,20 @@ class Documents(BaseSDK):
|
|
|
1184
1091
|
|
|
1185
1092
|
response_data: Any = None
|
|
1186
1093
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1187
|
-
return
|
|
1094
|
+
return unmarshal_json_response(models.DocumentTextContent, http_res)
|
|
1188
1095
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1189
|
-
response_data =
|
|
1190
|
-
|
|
1096
|
+
response_data = unmarshal_json_response(
|
|
1097
|
+
models.HTTPValidationErrorData, http_res
|
|
1191
1098
|
)
|
|
1192
|
-
raise models.HTTPValidationError(
|
|
1099
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1193
1100
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1194
1101
|
http_res_text = utils.stream_to_text(http_res)
|
|
1195
|
-
raise models.SDKError(
|
|
1196
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1197
|
-
)
|
|
1102
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1198
1103
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1199
1104
|
http_res_text = utils.stream_to_text(http_res)
|
|
1200
|
-
raise models.SDKError(
|
|
1201
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1202
|
-
)
|
|
1105
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1203
1106
|
|
|
1204
|
-
|
|
1205
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1206
|
-
raise models.SDKError(
|
|
1207
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1208
|
-
http_res.status_code,
|
|
1209
|
-
http_res_text,
|
|
1210
|
-
http_res,
|
|
1211
|
-
)
|
|
1107
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1212
1108
|
|
|
1213
1109
|
async def text_content_async(
|
|
1214
1110
|
self,
|
|
@@ -1287,31 +1183,20 @@ class Documents(BaseSDK):
|
|
|
1287
1183
|
|
|
1288
1184
|
response_data: Any = None
|
|
1289
1185
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1290
|
-
return
|
|
1186
|
+
return unmarshal_json_response(models.DocumentTextContent, http_res)
|
|
1291
1187
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1292
|
-
response_data =
|
|
1293
|
-
|
|
1188
|
+
response_data = unmarshal_json_response(
|
|
1189
|
+
models.HTTPValidationErrorData, http_res
|
|
1294
1190
|
)
|
|
1295
|
-
raise models.HTTPValidationError(
|
|
1191
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1296
1192
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1297
1193
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1298
|
-
raise models.SDKError(
|
|
1299
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1300
|
-
)
|
|
1194
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1301
1195
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1302
1196
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1303
|
-
raise models.SDKError(
|
|
1304
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1305
|
-
)
|
|
1197
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1306
1198
|
|
|
1307
|
-
|
|
1308
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1309
|
-
raise models.SDKError(
|
|
1310
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1311
|
-
http_res.status_code,
|
|
1312
|
-
http_res_text,
|
|
1313
|
-
http_res,
|
|
1314
|
-
)
|
|
1199
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1315
1200
|
|
|
1316
1201
|
def status(
|
|
1317
1202
|
self,
|
|
@@ -1390,31 +1275,20 @@ class Documents(BaseSDK):
|
|
|
1390
1275
|
|
|
1391
1276
|
response_data: Any = None
|
|
1392
1277
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1393
|
-
return
|
|
1278
|
+
return unmarshal_json_response(models.ProcessingStatusOut, http_res)
|
|
1394
1279
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1395
|
-
response_data =
|
|
1396
|
-
|
|
1280
|
+
response_data = unmarshal_json_response(
|
|
1281
|
+
models.HTTPValidationErrorData, http_res
|
|
1397
1282
|
)
|
|
1398
|
-
raise models.HTTPValidationError(
|
|
1283
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1399
1284
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1400
1285
|
http_res_text = utils.stream_to_text(http_res)
|
|
1401
|
-
raise models.SDKError(
|
|
1402
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1403
|
-
)
|
|
1286
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1404
1287
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1405
1288
|
http_res_text = utils.stream_to_text(http_res)
|
|
1406
|
-
raise models.SDKError(
|
|
1407
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1408
|
-
)
|
|
1289
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1409
1290
|
|
|
1410
|
-
|
|
1411
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1412
|
-
raise models.SDKError(
|
|
1413
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1414
|
-
http_res.status_code,
|
|
1415
|
-
http_res_text,
|
|
1416
|
-
http_res,
|
|
1417
|
-
)
|
|
1291
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1418
1292
|
|
|
1419
1293
|
async def status_async(
|
|
1420
1294
|
self,
|
|
@@ -1493,31 +1367,20 @@ class Documents(BaseSDK):
|
|
|
1493
1367
|
|
|
1494
1368
|
response_data: Any = None
|
|
1495
1369
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1496
|
-
return
|
|
1370
|
+
return unmarshal_json_response(models.ProcessingStatusOut, http_res)
|
|
1497
1371
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1498
|
-
response_data =
|
|
1499
|
-
|
|
1372
|
+
response_data = unmarshal_json_response(
|
|
1373
|
+
models.HTTPValidationErrorData, http_res
|
|
1500
1374
|
)
|
|
1501
|
-
raise models.HTTPValidationError(
|
|
1375
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1502
1376
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1503
1377
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1504
|
-
raise models.SDKError(
|
|
1505
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1506
|
-
)
|
|
1378
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1507
1379
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1508
1380
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1509
|
-
raise models.SDKError(
|
|
1510
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1511
|
-
)
|
|
1381
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1512
1382
|
|
|
1513
|
-
|
|
1514
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1515
|
-
raise models.SDKError(
|
|
1516
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1517
|
-
http_res.status_code,
|
|
1518
|
-
http_res_text,
|
|
1519
|
-
http_res,
|
|
1520
|
-
)
|
|
1383
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1521
1384
|
|
|
1522
1385
|
def get_signed_url(
|
|
1523
1386
|
self,
|
|
@@ -1596,31 +1459,20 @@ class Documents(BaseSDK):
|
|
|
1596
1459
|
|
|
1597
1460
|
response_data: Any = None
|
|
1598
1461
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1599
|
-
return
|
|
1462
|
+
return unmarshal_json_response(str, http_res)
|
|
1600
1463
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1601
|
-
response_data =
|
|
1602
|
-
|
|
1464
|
+
response_data = unmarshal_json_response(
|
|
1465
|
+
models.HTTPValidationErrorData, http_res
|
|
1603
1466
|
)
|
|
1604
|
-
raise models.HTTPValidationError(
|
|
1467
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1605
1468
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1606
1469
|
http_res_text = utils.stream_to_text(http_res)
|
|
1607
|
-
raise models.SDKError(
|
|
1608
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1609
|
-
)
|
|
1470
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1610
1471
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1611
1472
|
http_res_text = utils.stream_to_text(http_res)
|
|
1612
|
-
raise models.SDKError(
|
|
1613
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1614
|
-
)
|
|
1473
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1615
1474
|
|
|
1616
|
-
|
|
1617
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1618
|
-
raise models.SDKError(
|
|
1619
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1620
|
-
http_res.status_code,
|
|
1621
|
-
http_res_text,
|
|
1622
|
-
http_res,
|
|
1623
|
-
)
|
|
1475
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1624
1476
|
|
|
1625
1477
|
async def get_signed_url_async(
|
|
1626
1478
|
self,
|
|
@@ -1699,31 +1551,20 @@ class Documents(BaseSDK):
|
|
|
1699
1551
|
|
|
1700
1552
|
response_data: Any = None
|
|
1701
1553
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1702
|
-
return
|
|
1554
|
+
return unmarshal_json_response(str, http_res)
|
|
1703
1555
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1704
|
-
response_data =
|
|
1705
|
-
|
|
1556
|
+
response_data = unmarshal_json_response(
|
|
1557
|
+
models.HTTPValidationErrorData, http_res
|
|
1706
1558
|
)
|
|
1707
|
-
raise models.HTTPValidationError(
|
|
1559
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1708
1560
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1709
1561
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1710
|
-
raise models.SDKError(
|
|
1711
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1712
|
-
)
|
|
1562
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1713
1563
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1714
1564
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1715
|
-
raise models.SDKError(
|
|
1716
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1717
|
-
)
|
|
1565
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1718
1566
|
|
|
1719
|
-
|
|
1720
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1721
|
-
raise models.SDKError(
|
|
1722
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1723
|
-
http_res.status_code,
|
|
1724
|
-
http_res_text,
|
|
1725
|
-
http_res,
|
|
1726
|
-
)
|
|
1567
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1727
1568
|
|
|
1728
1569
|
def extracted_text_signed_url(
|
|
1729
1570
|
self,
|
|
@@ -1802,31 +1643,20 @@ class Documents(BaseSDK):
|
|
|
1802
1643
|
|
|
1803
1644
|
response_data: Any = None
|
|
1804
1645
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1805
|
-
return
|
|
1646
|
+
return unmarshal_json_response(str, http_res)
|
|
1806
1647
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1807
|
-
response_data =
|
|
1808
|
-
|
|
1648
|
+
response_data = unmarshal_json_response(
|
|
1649
|
+
models.HTTPValidationErrorData, http_res
|
|
1809
1650
|
)
|
|
1810
|
-
raise models.HTTPValidationError(
|
|
1651
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1811
1652
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1812
1653
|
http_res_text = utils.stream_to_text(http_res)
|
|
1813
|
-
raise models.SDKError(
|
|
1814
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1815
|
-
)
|
|
1654
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1816
1655
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1817
1656
|
http_res_text = utils.stream_to_text(http_res)
|
|
1818
|
-
raise models.SDKError(
|
|
1819
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1820
|
-
)
|
|
1657
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1821
1658
|
|
|
1822
|
-
|
|
1823
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1824
|
-
raise models.SDKError(
|
|
1825
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1826
|
-
http_res.status_code,
|
|
1827
|
-
http_res_text,
|
|
1828
|
-
http_res,
|
|
1829
|
-
)
|
|
1659
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1830
1660
|
|
|
1831
1661
|
async def extracted_text_signed_url_async(
|
|
1832
1662
|
self,
|
|
@@ -1905,31 +1735,20 @@ class Documents(BaseSDK):
|
|
|
1905
1735
|
|
|
1906
1736
|
response_data: Any = None
|
|
1907
1737
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1908
|
-
return
|
|
1738
|
+
return unmarshal_json_response(str, http_res)
|
|
1909
1739
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1910
|
-
response_data =
|
|
1911
|
-
|
|
1740
|
+
response_data = unmarshal_json_response(
|
|
1741
|
+
models.HTTPValidationErrorData, http_res
|
|
1912
1742
|
)
|
|
1913
|
-
raise models.HTTPValidationError(
|
|
1743
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1914
1744
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1915
1745
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1916
|
-
raise models.SDKError(
|
|
1917
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1918
|
-
)
|
|
1746
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1919
1747
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1920
1748
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1921
|
-
raise models.SDKError(
|
|
1922
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1923
|
-
)
|
|
1749
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1924
1750
|
|
|
1925
|
-
|
|
1926
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1927
|
-
raise models.SDKError(
|
|
1928
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1929
|
-
http_res.status_code,
|
|
1930
|
-
http_res_text,
|
|
1931
|
-
http_res,
|
|
1932
|
-
)
|
|
1751
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1933
1752
|
|
|
1934
1753
|
def reprocess(
|
|
1935
1754
|
self,
|
|
@@ -2010,29 +1829,18 @@ class Documents(BaseSDK):
|
|
|
2010
1829
|
if utils.match_response(http_res, "204", "*"):
|
|
2011
1830
|
return
|
|
2012
1831
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2013
|
-
response_data =
|
|
2014
|
-
|
|
1832
|
+
response_data = unmarshal_json_response(
|
|
1833
|
+
models.HTTPValidationErrorData, http_res
|
|
2015
1834
|
)
|
|
2016
|
-
raise models.HTTPValidationError(
|
|
1835
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
2017
1836
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2018
1837
|
http_res_text = utils.stream_to_text(http_res)
|
|
2019
|
-
raise models.SDKError(
|
|
2020
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2021
|
-
)
|
|
1838
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2022
1839
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2023
1840
|
http_res_text = utils.stream_to_text(http_res)
|
|
2024
|
-
raise models.SDKError(
|
|
2025
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2026
|
-
)
|
|
1841
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2027
1842
|
|
|
2028
|
-
|
|
2029
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2030
|
-
raise models.SDKError(
|
|
2031
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2032
|
-
http_res.status_code,
|
|
2033
|
-
http_res_text,
|
|
2034
|
-
http_res,
|
|
2035
|
-
)
|
|
1843
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
2036
1844
|
|
|
2037
1845
|
async def reprocess_async(
|
|
2038
1846
|
self,
|
|
@@ -2113,26 +1921,15 @@ class Documents(BaseSDK):
|
|
|
2113
1921
|
if utils.match_response(http_res, "204", "*"):
|
|
2114
1922
|
return
|
|
2115
1923
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2116
|
-
response_data =
|
|
2117
|
-
|
|
1924
|
+
response_data = unmarshal_json_response(
|
|
1925
|
+
models.HTTPValidationErrorData, http_res
|
|
2118
1926
|
)
|
|
2119
|
-
raise models.HTTPValidationError(
|
|
1927
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
2120
1928
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2121
1929
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2122
|
-
raise models.SDKError(
|
|
2123
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2124
|
-
)
|
|
1930
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2125
1931
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2126
1932
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2127
|
-
raise models.SDKError(
|
|
2128
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2129
|
-
)
|
|
1933
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2130
1934
|
|
|
2131
|
-
|
|
2132
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2133
|
-
raise models.SDKError(
|
|
2134
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2135
|
-
http_res.status_code,
|
|
2136
|
-
http_res_text,
|
|
2137
|
-
http_res,
|
|
2138
|
-
)
|
|
1935
|
+
raise models.SDKError("Unexpected response received", http_res)
|