syllable-sdk 0.35.32__py3-none-any.whl → 0.35.33__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.
- syllable_sdk/__init__.py +0 -1
- syllable_sdk/_version.py +3 -3
- syllable_sdk/agents.py +83 -211
- syllable_sdk/basesdk.py +5 -5
- syllable_sdk/batches.py +131 -329
- syllable_sdk/campaigns.py +73 -183
- syllable_sdk/channels.py +29 -73
- syllable_sdk/conversations.py +19 -37
- syllable_sdk/custom_messages.py +73 -183
- syllable_sdk/dashboards.py +67 -195
- syllable_sdk/data_sources.py +85 -183
- syllable_sdk/errors/__init__.py +55 -0
- syllable_sdk/errors/apierror.py +38 -0
- syllable_sdk/errors/httpvalidationerror.py +26 -0
- syllable_sdk/errors/no_response_error.py +13 -0
- syllable_sdk/errors/responsevalidationerror.py +25 -0
- syllable_sdk/errors/syllablesdkerror.py +26 -0
- syllable_sdk/events.py +15 -37
- syllable_sdk/folders.py +121 -293
- syllable_sdk/full_summary.py +19 -37
- syllable_sdk/incidents.py +83 -215
- syllable_sdk/insights_sdk.py +17 -39
- syllable_sdk/insights_tools.py +97 -251
- syllable_sdk/language_groups.py +85 -215
- syllable_sdk/latency.py +19 -37
- syllable_sdk/models/__init__.py +0 -8
- syllable_sdk/numbers.py +53 -111
- syllable_sdk/organizations.py +51 -139
- syllable_sdk/permissions.py +11 -33
- syllable_sdk/prompts.py +95 -249
- syllable_sdk/roles.py +75 -181
- syllable_sdk/services.py +73 -183
- syllable_sdk/session_debug.py +43 -109
- syllable_sdk/session_labels.py +47 -109
- syllable_sdk/sessions.py +59 -141
- syllable_sdk/takeouts.py +35 -99
- syllable_sdk/targets.py +75 -185
- syllable_sdk/test.py +15 -37
- syllable_sdk/tools.py +75 -181
- syllable_sdk/transcript.py +17 -39
- syllable_sdk/twilio.py +43 -109
- syllable_sdk/users.py +97 -247
- syllable_sdk/utils/__init__.py +3 -0
- syllable_sdk/utils/serializers.py +21 -3
- syllable_sdk/v1.py +97 -247
- syllable_sdk/workflows.py +115 -291
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.33.dist-info}/METADATA +58 -45
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.33.dist-info}/RECORD +49 -45
- syllable_sdk/models/apierror.py +0 -22
- syllable_sdk/models/httpvalidationerror.py +0 -21
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.33.dist-info}/WHEEL +0 -0
syllable_sdk/workflows.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from syllable_sdk import models, utils
|
|
4
|
+
from syllable_sdk import errors, models, utils
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
@@ -109,33 +109,22 @@ class Workflows(BaseSDK):
|
|
|
109
109
|
|
|
110
110
|
response_data: Any = None
|
|
111
111
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return utils.
|
|
113
|
-
|
|
112
|
+
return utils.unmarshal_json_response(
|
|
113
|
+
models.ListResponseInsightWorkflowOutput, http_res
|
|
114
114
|
)
|
|
115
115
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data = utils.
|
|
117
|
-
|
|
116
|
+
response_data = utils.unmarshal_json_response(
|
|
117
|
+
errors.HTTPValidationErrorData, http_res
|
|
118
118
|
)
|
|
119
|
-
raise
|
|
119
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
120
120
|
if utils.match_response(http_res, "4XX", "*"):
|
|
121
121
|
http_res_text = utils.stream_to_text(http_res)
|
|
122
|
-
raise
|
|
123
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
124
|
-
)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
125
123
|
if utils.match_response(http_res, "5XX", "*"):
|
|
126
124
|
http_res_text = utils.stream_to_text(http_res)
|
|
127
|
-
raise
|
|
128
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
129
|
-
)
|
|
125
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
130
126
|
|
|
131
|
-
|
|
132
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
133
|
-
raise models.APIError(
|
|
134
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
135
|
-
http_res.status_code,
|
|
136
|
-
http_res_text,
|
|
137
|
-
http_res,
|
|
138
|
-
)
|
|
127
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
139
128
|
|
|
140
129
|
async def list_async(
|
|
141
130
|
self,
|
|
@@ -235,33 +224,22 @@ class Workflows(BaseSDK):
|
|
|
235
224
|
|
|
236
225
|
response_data: Any = None
|
|
237
226
|
if utils.match_response(http_res, "200", "application/json"):
|
|
238
|
-
return utils.
|
|
239
|
-
|
|
227
|
+
return utils.unmarshal_json_response(
|
|
228
|
+
models.ListResponseInsightWorkflowOutput, http_res
|
|
240
229
|
)
|
|
241
230
|
if utils.match_response(http_res, "422", "application/json"):
|
|
242
|
-
response_data = utils.
|
|
243
|
-
|
|
231
|
+
response_data = utils.unmarshal_json_response(
|
|
232
|
+
errors.HTTPValidationErrorData, http_res
|
|
244
233
|
)
|
|
245
|
-
raise
|
|
234
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
246
235
|
if utils.match_response(http_res, "4XX", "*"):
|
|
247
236
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
248
|
-
raise
|
|
249
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
250
|
-
)
|
|
237
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
251
238
|
if utils.match_response(http_res, "5XX", "*"):
|
|
252
239
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
253
|
-
raise
|
|
254
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
255
|
-
)
|
|
240
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
256
241
|
|
|
257
|
-
|
|
258
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
259
|
-
raise models.APIError(
|
|
260
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
261
|
-
http_res.status_code,
|
|
262
|
-
http_res_text,
|
|
263
|
-
http_res,
|
|
264
|
-
)
|
|
242
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
265
243
|
|
|
266
244
|
def create(
|
|
267
245
|
self,
|
|
@@ -342,31 +320,20 @@ class Workflows(BaseSDK):
|
|
|
342
320
|
|
|
343
321
|
response_data: Any = None
|
|
344
322
|
if utils.match_response(http_res, "200", "application/json"):
|
|
345
|
-
return utils.
|
|
323
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
346
324
|
if utils.match_response(http_res, "422", "application/json"):
|
|
347
|
-
response_data = utils.
|
|
348
|
-
|
|
325
|
+
response_data = utils.unmarshal_json_response(
|
|
326
|
+
errors.HTTPValidationErrorData, http_res
|
|
349
327
|
)
|
|
350
|
-
raise
|
|
328
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
351
329
|
if utils.match_response(http_res, "4XX", "*"):
|
|
352
330
|
http_res_text = utils.stream_to_text(http_res)
|
|
353
|
-
raise
|
|
354
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
355
|
-
)
|
|
331
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
356
332
|
if utils.match_response(http_res, "5XX", "*"):
|
|
357
333
|
http_res_text = utils.stream_to_text(http_res)
|
|
358
|
-
raise
|
|
359
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
360
|
-
)
|
|
334
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
361
335
|
|
|
362
|
-
|
|
363
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
364
|
-
raise models.APIError(
|
|
365
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
366
|
-
http_res.status_code,
|
|
367
|
-
http_res_text,
|
|
368
|
-
http_res,
|
|
369
|
-
)
|
|
336
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
370
337
|
|
|
371
338
|
async def create_async(
|
|
372
339
|
self,
|
|
@@ -447,31 +414,20 @@ class Workflows(BaseSDK):
|
|
|
447
414
|
|
|
448
415
|
response_data: Any = None
|
|
449
416
|
if utils.match_response(http_res, "200", "application/json"):
|
|
450
|
-
return utils.
|
|
417
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
451
418
|
if utils.match_response(http_res, "422", "application/json"):
|
|
452
|
-
response_data = utils.
|
|
453
|
-
|
|
419
|
+
response_data = utils.unmarshal_json_response(
|
|
420
|
+
errors.HTTPValidationErrorData, http_res
|
|
454
421
|
)
|
|
455
|
-
raise
|
|
422
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
456
423
|
if utils.match_response(http_res, "4XX", "*"):
|
|
457
424
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
458
|
-
raise
|
|
459
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
460
|
-
)
|
|
425
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
461
426
|
if utils.match_response(http_res, "5XX", "*"):
|
|
462
427
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
463
|
-
raise
|
|
464
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
465
|
-
)
|
|
428
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
466
429
|
|
|
467
|
-
|
|
468
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
469
|
-
raise models.APIError(
|
|
470
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
471
|
-
http_res.status_code,
|
|
472
|
-
http_res_text,
|
|
473
|
-
http_res,
|
|
474
|
-
)
|
|
430
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
475
431
|
|
|
476
432
|
def get_by_id(
|
|
477
433
|
self,
|
|
@@ -547,31 +503,20 @@ class Workflows(BaseSDK):
|
|
|
547
503
|
|
|
548
504
|
response_data: Any = None
|
|
549
505
|
if utils.match_response(http_res, "200", "application/json"):
|
|
550
|
-
return utils.
|
|
506
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
551
507
|
if utils.match_response(http_res, "422", "application/json"):
|
|
552
|
-
response_data = utils.
|
|
553
|
-
|
|
508
|
+
response_data = utils.unmarshal_json_response(
|
|
509
|
+
errors.HTTPValidationErrorData, http_res
|
|
554
510
|
)
|
|
555
|
-
raise
|
|
511
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
556
512
|
if utils.match_response(http_res, "4XX", "*"):
|
|
557
513
|
http_res_text = utils.stream_to_text(http_res)
|
|
558
|
-
raise
|
|
559
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
560
|
-
)
|
|
514
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
561
515
|
if utils.match_response(http_res, "5XX", "*"):
|
|
562
516
|
http_res_text = utils.stream_to_text(http_res)
|
|
563
|
-
raise
|
|
564
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
565
|
-
)
|
|
517
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
566
518
|
|
|
567
|
-
|
|
568
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
569
|
-
raise models.APIError(
|
|
570
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
571
|
-
http_res.status_code,
|
|
572
|
-
http_res_text,
|
|
573
|
-
http_res,
|
|
574
|
-
)
|
|
519
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
575
520
|
|
|
576
521
|
async def get_by_id_async(
|
|
577
522
|
self,
|
|
@@ -647,31 +592,20 @@ class Workflows(BaseSDK):
|
|
|
647
592
|
|
|
648
593
|
response_data: Any = None
|
|
649
594
|
if utils.match_response(http_res, "200", "application/json"):
|
|
650
|
-
return utils.
|
|
595
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
651
596
|
if utils.match_response(http_res, "422", "application/json"):
|
|
652
|
-
response_data = utils.
|
|
653
|
-
|
|
597
|
+
response_data = utils.unmarshal_json_response(
|
|
598
|
+
errors.HTTPValidationErrorData, http_res
|
|
654
599
|
)
|
|
655
|
-
raise
|
|
600
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
656
601
|
if utils.match_response(http_res, "4XX", "*"):
|
|
657
602
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
658
|
-
raise
|
|
659
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
660
|
-
)
|
|
603
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
661
604
|
if utils.match_response(http_res, "5XX", "*"):
|
|
662
605
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
663
|
-
raise
|
|
664
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
665
|
-
)
|
|
606
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
666
607
|
|
|
667
|
-
|
|
668
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
669
|
-
raise models.APIError(
|
|
670
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
671
|
-
http_res.status_code,
|
|
672
|
-
http_res_text,
|
|
673
|
-
http_res,
|
|
674
|
-
)
|
|
608
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
675
609
|
|
|
676
610
|
def update(
|
|
677
611
|
self,
|
|
@@ -761,31 +695,20 @@ class Workflows(BaseSDK):
|
|
|
761
695
|
|
|
762
696
|
response_data: Any = None
|
|
763
697
|
if utils.match_response(http_res, "200", "application/json"):
|
|
764
|
-
return utils.
|
|
698
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
765
699
|
if utils.match_response(http_res, "422", "application/json"):
|
|
766
|
-
response_data = utils.
|
|
767
|
-
|
|
700
|
+
response_data = utils.unmarshal_json_response(
|
|
701
|
+
errors.HTTPValidationErrorData, http_res
|
|
768
702
|
)
|
|
769
|
-
raise
|
|
703
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
770
704
|
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
771
705
|
http_res_text = utils.stream_to_text(http_res)
|
|
772
|
-
raise
|
|
773
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
774
|
-
)
|
|
706
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
775
707
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
776
708
|
http_res_text = utils.stream_to_text(http_res)
|
|
777
|
-
raise
|
|
778
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
779
|
-
)
|
|
709
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
780
710
|
|
|
781
|
-
|
|
782
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
783
|
-
raise models.APIError(
|
|
784
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
785
|
-
http_res.status_code,
|
|
786
|
-
http_res_text,
|
|
787
|
-
http_res,
|
|
788
|
-
)
|
|
711
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
789
712
|
|
|
790
713
|
async def update_async(
|
|
791
714
|
self,
|
|
@@ -875,31 +798,20 @@ class Workflows(BaseSDK):
|
|
|
875
798
|
|
|
876
799
|
response_data: Any = None
|
|
877
800
|
if utils.match_response(http_res, "200", "application/json"):
|
|
878
|
-
return utils.
|
|
801
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
879
802
|
if utils.match_response(http_res, "422", "application/json"):
|
|
880
|
-
response_data = utils.
|
|
881
|
-
|
|
803
|
+
response_data = utils.unmarshal_json_response(
|
|
804
|
+
errors.HTTPValidationErrorData, http_res
|
|
882
805
|
)
|
|
883
|
-
raise
|
|
806
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
884
807
|
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
885
808
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
886
|
-
raise
|
|
887
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
888
|
-
)
|
|
809
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
889
810
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
890
811
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
891
|
-
raise
|
|
892
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
893
|
-
)
|
|
812
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
894
813
|
|
|
895
|
-
|
|
896
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
897
|
-
raise models.APIError(
|
|
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
|
-
)
|
|
814
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
903
815
|
|
|
904
816
|
def delete(
|
|
905
817
|
self,
|
|
@@ -975,31 +887,20 @@ class Workflows(BaseSDK):
|
|
|
975
887
|
|
|
976
888
|
response_data: Any = None
|
|
977
889
|
if utils.match_response(http_res, "200", "application/json"):
|
|
978
|
-
return utils.
|
|
890
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
979
891
|
if utils.match_response(http_res, "422", "application/json"):
|
|
980
|
-
response_data = utils.
|
|
981
|
-
|
|
892
|
+
response_data = utils.unmarshal_json_response(
|
|
893
|
+
errors.HTTPValidationErrorData, http_res
|
|
982
894
|
)
|
|
983
|
-
raise
|
|
895
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
984
896
|
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
985
897
|
http_res_text = utils.stream_to_text(http_res)
|
|
986
|
-
raise
|
|
987
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
988
|
-
)
|
|
898
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
989
899
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
990
900
|
http_res_text = utils.stream_to_text(http_res)
|
|
991
|
-
raise
|
|
992
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
993
|
-
)
|
|
901
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
994
902
|
|
|
995
|
-
|
|
996
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
997
|
-
raise models.APIError(
|
|
998
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
999
|
-
http_res.status_code,
|
|
1000
|
-
http_res_text,
|
|
1001
|
-
http_res,
|
|
1002
|
-
)
|
|
903
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1003
904
|
|
|
1004
905
|
async def delete_async(
|
|
1005
906
|
self,
|
|
@@ -1075,31 +976,20 @@ class Workflows(BaseSDK):
|
|
|
1075
976
|
|
|
1076
977
|
response_data: Any = None
|
|
1077
978
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1078
|
-
return utils.
|
|
979
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
1079
980
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1080
|
-
response_data = utils.
|
|
1081
|
-
|
|
981
|
+
response_data = utils.unmarshal_json_response(
|
|
982
|
+
errors.HTTPValidationErrorData, http_res
|
|
1082
983
|
)
|
|
1083
|
-
raise
|
|
984
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1084
985
|
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
1085
986
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1086
|
-
raise
|
|
1087
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1088
|
-
)
|
|
987
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1089
988
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1090
989
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1091
|
-
raise
|
|
1092
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1093
|
-
)
|
|
990
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1094
991
|
|
|
1095
|
-
|
|
1096
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1097
|
-
raise models.APIError(
|
|
1098
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1099
|
-
http_res.status_code,
|
|
1100
|
-
http_res_text,
|
|
1101
|
-
http_res,
|
|
1102
|
-
)
|
|
992
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1103
993
|
|
|
1104
994
|
def inactivate(
|
|
1105
995
|
self,
|
|
@@ -1175,31 +1065,20 @@ class Workflows(BaseSDK):
|
|
|
1175
1065
|
|
|
1176
1066
|
response_data: Any = None
|
|
1177
1067
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1178
|
-
return utils.
|
|
1068
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
1179
1069
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1180
|
-
response_data = utils.
|
|
1181
|
-
|
|
1070
|
+
response_data = utils.unmarshal_json_response(
|
|
1071
|
+
errors.HTTPValidationErrorData, http_res
|
|
1182
1072
|
)
|
|
1183
|
-
raise
|
|
1073
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1184
1074
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1185
1075
|
http_res_text = utils.stream_to_text(http_res)
|
|
1186
|
-
raise
|
|
1187
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1188
|
-
)
|
|
1076
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1189
1077
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1190
1078
|
http_res_text = utils.stream_to_text(http_res)
|
|
1191
|
-
raise
|
|
1192
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1193
|
-
)
|
|
1079
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1194
1080
|
|
|
1195
|
-
|
|
1196
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1197
|
-
raise models.APIError(
|
|
1198
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1199
|
-
http_res.status_code,
|
|
1200
|
-
http_res_text,
|
|
1201
|
-
http_res,
|
|
1202
|
-
)
|
|
1081
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1203
1082
|
|
|
1204
1083
|
async def inactivate_async(
|
|
1205
1084
|
self,
|
|
@@ -1275,31 +1154,20 @@ class Workflows(BaseSDK):
|
|
|
1275
1154
|
|
|
1276
1155
|
response_data: Any = None
|
|
1277
1156
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1278
|
-
return utils.
|
|
1157
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
1279
1158
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1280
|
-
response_data = utils.
|
|
1281
|
-
|
|
1159
|
+
response_data = utils.unmarshal_json_response(
|
|
1160
|
+
errors.HTTPValidationErrorData, http_res
|
|
1282
1161
|
)
|
|
1283
|
-
raise
|
|
1162
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1284
1163
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1285
1164
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1286
|
-
raise
|
|
1287
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1288
|
-
)
|
|
1165
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1289
1166
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1290
1167
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1291
|
-
raise
|
|
1292
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1293
|
-
)
|
|
1168
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1294
1169
|
|
|
1295
|
-
|
|
1296
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1297
|
-
raise models.APIError(
|
|
1298
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1299
|
-
http_res.status_code,
|
|
1300
|
-
http_res_text,
|
|
1301
|
-
http_res,
|
|
1302
|
-
)
|
|
1170
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1303
1171
|
|
|
1304
1172
|
def activate(
|
|
1305
1173
|
self,
|
|
@@ -1389,31 +1257,20 @@ class Workflows(BaseSDK):
|
|
|
1389
1257
|
|
|
1390
1258
|
response_data: Any = None
|
|
1391
1259
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1392
|
-
return utils.
|
|
1260
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
1393
1261
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1394
|
-
response_data = utils.
|
|
1395
|
-
|
|
1262
|
+
response_data = utils.unmarshal_json_response(
|
|
1263
|
+
errors.HTTPValidationErrorData, http_res
|
|
1396
1264
|
)
|
|
1397
|
-
raise
|
|
1265
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1398
1266
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1399
1267
|
http_res_text = utils.stream_to_text(http_res)
|
|
1400
|
-
raise
|
|
1401
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1402
|
-
)
|
|
1268
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1403
1269
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1404
1270
|
http_res_text = utils.stream_to_text(http_res)
|
|
1405
|
-
raise
|
|
1406
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1407
|
-
)
|
|
1271
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1408
1272
|
|
|
1409
|
-
|
|
1410
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1411
|
-
raise models.APIError(
|
|
1412
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1413
|
-
http_res.status_code,
|
|
1414
|
-
http_res_text,
|
|
1415
|
-
http_res,
|
|
1416
|
-
)
|
|
1273
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1417
1274
|
|
|
1418
1275
|
async def activate_async(
|
|
1419
1276
|
self,
|
|
@@ -1503,31 +1360,20 @@ class Workflows(BaseSDK):
|
|
|
1503
1360
|
|
|
1504
1361
|
response_data: Any = None
|
|
1505
1362
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1506
|
-
return utils.
|
|
1363
|
+
return utils.unmarshal_json_response(models.InsightWorkflowOutput, http_res)
|
|
1507
1364
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1508
|
-
response_data = utils.
|
|
1509
|
-
|
|
1365
|
+
response_data = utils.unmarshal_json_response(
|
|
1366
|
+
errors.HTTPValidationErrorData, http_res
|
|
1510
1367
|
)
|
|
1511
|
-
raise
|
|
1368
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1512
1369
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1513
1370
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1514
|
-
raise
|
|
1515
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1516
|
-
)
|
|
1371
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1517
1372
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1518
1373
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1519
|
-
raise
|
|
1520
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1521
|
-
)
|
|
1374
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1522
1375
|
|
|
1523
|
-
|
|
1524
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1525
|
-
raise models.APIError(
|
|
1526
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1527
|
-
http_res.status_code,
|
|
1528
|
-
http_res_text,
|
|
1529
|
-
http_res,
|
|
1530
|
-
)
|
|
1376
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1531
1377
|
|
|
1532
1378
|
def queue_work(
|
|
1533
1379
|
self,
|
|
@@ -1609,31 +1455,20 @@ class Workflows(BaseSDK):
|
|
|
1609
1455
|
|
|
1610
1456
|
response_data: Any = None
|
|
1611
1457
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1612
|
-
return utils.
|
|
1458
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
1613
1459
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1614
|
-
response_data = utils.
|
|
1615
|
-
|
|
1460
|
+
response_data = utils.unmarshal_json_response(
|
|
1461
|
+
errors.HTTPValidationErrorData, http_res
|
|
1616
1462
|
)
|
|
1617
|
-
raise
|
|
1463
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1618
1464
|
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
1619
1465
|
http_res_text = utils.stream_to_text(http_res)
|
|
1620
|
-
raise
|
|
1621
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1622
|
-
)
|
|
1466
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1623
1467
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1624
1468
|
http_res_text = utils.stream_to_text(http_res)
|
|
1625
|
-
raise
|
|
1626
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1627
|
-
)
|
|
1469
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1628
1470
|
|
|
1629
|
-
|
|
1630
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1631
|
-
raise models.APIError(
|
|
1632
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1633
|
-
http_res.status_code,
|
|
1634
|
-
http_res_text,
|
|
1635
|
-
http_res,
|
|
1636
|
-
)
|
|
1471
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1637
1472
|
|
|
1638
1473
|
async def queue_work_async(
|
|
1639
1474
|
self,
|
|
@@ -1715,28 +1550,17 @@ class Workflows(BaseSDK):
|
|
|
1715
1550
|
|
|
1716
1551
|
response_data: Any = None
|
|
1717
1552
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1718
|
-
return utils.
|
|
1553
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
1719
1554
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1720
|
-
response_data = utils.
|
|
1721
|
-
|
|
1555
|
+
response_data = utils.unmarshal_json_response(
|
|
1556
|
+
errors.HTTPValidationErrorData, http_res
|
|
1722
1557
|
)
|
|
1723
|
-
raise
|
|
1558
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1724
1559
|
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
1725
1560
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1726
|
-
raise
|
|
1727
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1728
|
-
)
|
|
1561
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1729
1562
|
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1730
1563
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1731
|
-
raise
|
|
1732
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1733
|
-
)
|
|
1564
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1734
1565
|
|
|
1735
|
-
|
|
1736
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1737
|
-
raise models.APIError(
|
|
1738
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1739
|
-
http_res.status_code,
|
|
1740
|
-
http_res_text,
|
|
1741
|
-
http_res,
|
|
1742
|
-
)
|
|
1566
|
+
raise errors.APIError("Unexpected response received", http_res)
|