syllable-sdk 0.35.32__py3-none-any.whl → 0.35.34__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 +80 -211
- syllable_sdk/basesdk.py +5 -5
- syllable_sdk/batches.py +132 -329
- syllable_sdk/campaigns.py +74 -183
- syllable_sdk/channels.py +30 -73
- syllable_sdk/conversations.py +16 -37
- syllable_sdk/custom_messages.py +74 -183
- syllable_sdk/dashboards.py +64 -195
- syllable_sdk/data_sources.py +74 -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 +16 -37
- syllable_sdk/folders.py +116 -295
- syllable_sdk/full_summary.py +16 -37
- syllable_sdk/incidents.py +84 -215
- syllable_sdk/insights_sdk.py +16 -41
- syllable_sdk/insights_tools.py +96 -253
- syllable_sdk/language_groups.py +86 -215
- syllable_sdk/latency.py +16 -37
- syllable_sdk/models/__init__.py +0 -8
- syllable_sdk/numbers.py +44 -113
- syllable_sdk/organizations.py +52 -139
- syllable_sdk/permissions.py +12 -33
- syllable_sdk/prompts.py +94 -251
- syllable_sdk/roles.py +72 -181
- syllable_sdk/services.py +72 -185
- syllable_sdk/session_debug.py +44 -109
- syllable_sdk/session_labels.py +44 -109
- syllable_sdk/sessions.py +56 -141
- syllable_sdk/takeouts.py +36 -99
- syllable_sdk/targets.py +74 -187
- syllable_sdk/test.py +16 -37
- syllable_sdk/tools.py +72 -181
- syllable_sdk/transcript.py +18 -39
- syllable_sdk/twilio.py +44 -109
- syllable_sdk/users.py +94 -247
- syllable_sdk/utils/serializers.py +3 -2
- syllable_sdk/utils/unmarshal_json_response.py +24 -0
- syllable_sdk/v1.py +94 -247
- syllable_sdk/workflows.py +116 -291
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.34.dist-info}/METADATA +58 -45
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.34.dist-info}/RECORD +49 -44
- 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.34.dist-info}/WHEEL +0 -0
syllable_sdk/v1.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, List, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -107,31 +108,20 @@ class V1(BaseSDK):
|
|
|
107
108
|
|
|
108
109
|
response_data: Any = None
|
|
109
110
|
if utils.match_response(http_res, "200", "application/json"):
|
|
110
|
-
return
|
|
111
|
+
return unmarshal_json_response(models.ListResponseUserResponse, http_res)
|
|
111
112
|
if utils.match_response(http_res, "422", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
|
|
113
|
+
response_data = unmarshal_json_response(
|
|
114
|
+
errors.HTTPValidationErrorData, http_res
|
|
114
115
|
)
|
|
115
|
-
raise
|
|
116
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
116
117
|
if utils.match_response(http_res, "4XX", "*"):
|
|
117
118
|
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
-
raise
|
|
119
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
120
|
-
)
|
|
119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
121
120
|
if utils.match_response(http_res, "5XX", "*"):
|
|
122
121
|
http_res_text = utils.stream_to_text(http_res)
|
|
123
|
-
raise
|
|
124
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
125
|
-
)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
129
|
-
raise models.APIError(
|
|
130
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
131
|
-
http_res.status_code,
|
|
132
|
-
http_res_text,
|
|
133
|
-
http_res,
|
|
134
|
-
)
|
|
124
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
135
125
|
|
|
136
126
|
async def list_async(
|
|
137
127
|
self,
|
|
@@ -231,31 +221,20 @@ class V1(BaseSDK):
|
|
|
231
221
|
|
|
232
222
|
response_data: Any = None
|
|
233
223
|
if utils.match_response(http_res, "200", "application/json"):
|
|
234
|
-
return
|
|
224
|
+
return unmarshal_json_response(models.ListResponseUserResponse, http_res)
|
|
235
225
|
if utils.match_response(http_res, "422", "application/json"):
|
|
236
|
-
response_data =
|
|
237
|
-
|
|
226
|
+
response_data = unmarshal_json_response(
|
|
227
|
+
errors.HTTPValidationErrorData, http_res
|
|
238
228
|
)
|
|
239
|
-
raise
|
|
229
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
240
230
|
if utils.match_response(http_res, "4XX", "*"):
|
|
241
231
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
242
|
-
raise
|
|
243
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
244
|
-
)
|
|
232
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
245
233
|
if utils.match_response(http_res, "5XX", "*"):
|
|
246
234
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
247
|
-
raise
|
|
248
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
249
|
-
)
|
|
235
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
250
236
|
|
|
251
|
-
|
|
252
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
253
|
-
raise models.APIError(
|
|
254
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
255
|
-
http_res.status_code,
|
|
256
|
-
http_res_text,
|
|
257
|
-
http_res,
|
|
258
|
-
)
|
|
237
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
259
238
|
|
|
260
239
|
def create(
|
|
261
240
|
self,
|
|
@@ -334,31 +313,20 @@ class V1(BaseSDK):
|
|
|
334
313
|
|
|
335
314
|
response_data: Any = None
|
|
336
315
|
if utils.match_response(http_res, "200", "application/json"):
|
|
337
|
-
return
|
|
316
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
338
317
|
if utils.match_response(http_res, "422", "application/json"):
|
|
339
|
-
response_data =
|
|
340
|
-
|
|
318
|
+
response_data = unmarshal_json_response(
|
|
319
|
+
errors.HTTPValidationErrorData, http_res
|
|
341
320
|
)
|
|
342
|
-
raise
|
|
321
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
343
322
|
if utils.match_response(http_res, "4XX", "*"):
|
|
344
323
|
http_res_text = utils.stream_to_text(http_res)
|
|
345
|
-
raise
|
|
346
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
347
|
-
)
|
|
324
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
348
325
|
if utils.match_response(http_res, "5XX", "*"):
|
|
349
326
|
http_res_text = utils.stream_to_text(http_res)
|
|
350
|
-
raise
|
|
351
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
352
|
-
)
|
|
327
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
353
328
|
|
|
354
|
-
|
|
355
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
356
|
-
raise models.APIError(
|
|
357
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
358
|
-
http_res.status_code,
|
|
359
|
-
http_res_text,
|
|
360
|
-
http_res,
|
|
361
|
-
)
|
|
329
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
362
330
|
|
|
363
331
|
async def create_async(
|
|
364
332
|
self,
|
|
@@ -437,31 +405,20 @@ class V1(BaseSDK):
|
|
|
437
405
|
|
|
438
406
|
response_data: Any = None
|
|
439
407
|
if utils.match_response(http_res, "200", "application/json"):
|
|
440
|
-
return
|
|
408
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
441
409
|
if utils.match_response(http_res, "422", "application/json"):
|
|
442
|
-
response_data =
|
|
443
|
-
|
|
410
|
+
response_data = unmarshal_json_response(
|
|
411
|
+
errors.HTTPValidationErrorData, http_res
|
|
444
412
|
)
|
|
445
|
-
raise
|
|
413
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
446
414
|
if utils.match_response(http_res, "4XX", "*"):
|
|
447
415
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
448
|
-
raise
|
|
449
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
450
|
-
)
|
|
416
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
451
417
|
if utils.match_response(http_res, "5XX", "*"):
|
|
452
418
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
453
|
-
raise
|
|
454
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
455
|
-
)
|
|
419
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
456
420
|
|
|
457
|
-
|
|
458
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
459
|
-
raise models.APIError(
|
|
460
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
461
|
-
http_res.status_code,
|
|
462
|
-
http_res_text,
|
|
463
|
-
http_res,
|
|
464
|
-
)
|
|
421
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
465
422
|
|
|
466
423
|
def update(
|
|
467
424
|
self,
|
|
@@ -540,31 +497,20 @@ class V1(BaseSDK):
|
|
|
540
497
|
|
|
541
498
|
response_data: Any = None
|
|
542
499
|
if utils.match_response(http_res, "200", "application/json"):
|
|
543
|
-
return
|
|
500
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
544
501
|
if utils.match_response(http_res, "422", "application/json"):
|
|
545
|
-
response_data =
|
|
546
|
-
|
|
502
|
+
response_data = unmarshal_json_response(
|
|
503
|
+
errors.HTTPValidationErrorData, http_res
|
|
547
504
|
)
|
|
548
|
-
raise
|
|
505
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
549
506
|
if utils.match_response(http_res, "4XX", "*"):
|
|
550
507
|
http_res_text = utils.stream_to_text(http_res)
|
|
551
|
-
raise
|
|
552
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
553
|
-
)
|
|
508
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
554
509
|
if utils.match_response(http_res, "5XX", "*"):
|
|
555
510
|
http_res_text = utils.stream_to_text(http_res)
|
|
556
|
-
raise
|
|
557
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
558
|
-
)
|
|
511
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
559
512
|
|
|
560
|
-
|
|
561
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
562
|
-
raise models.APIError(
|
|
563
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
564
|
-
http_res.status_code,
|
|
565
|
-
http_res_text,
|
|
566
|
-
http_res,
|
|
567
|
-
)
|
|
513
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
568
514
|
|
|
569
515
|
async def update_async(
|
|
570
516
|
self,
|
|
@@ -643,31 +589,20 @@ class V1(BaseSDK):
|
|
|
643
589
|
|
|
644
590
|
response_data: Any = None
|
|
645
591
|
if utils.match_response(http_res, "200", "application/json"):
|
|
646
|
-
return
|
|
592
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
647
593
|
if utils.match_response(http_res, "422", "application/json"):
|
|
648
|
-
response_data =
|
|
649
|
-
|
|
594
|
+
response_data = unmarshal_json_response(
|
|
595
|
+
errors.HTTPValidationErrorData, http_res
|
|
650
596
|
)
|
|
651
|
-
raise
|
|
597
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
652
598
|
if utils.match_response(http_res, "4XX", "*"):
|
|
653
599
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
654
|
-
raise
|
|
655
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
656
|
-
)
|
|
600
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
657
601
|
if utils.match_response(http_res, "5XX", "*"):
|
|
658
602
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
659
|
-
raise
|
|
660
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
661
|
-
)
|
|
603
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
662
604
|
|
|
663
|
-
|
|
664
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
665
|
-
raise models.APIError(
|
|
666
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
667
|
-
http_res.status_code,
|
|
668
|
-
http_res_text,
|
|
669
|
-
http_res,
|
|
670
|
-
)
|
|
605
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
671
606
|
|
|
672
607
|
def delete(
|
|
673
608
|
self,
|
|
@@ -746,31 +681,20 @@ class V1(BaseSDK):
|
|
|
746
681
|
|
|
747
682
|
response_data: Any = None
|
|
748
683
|
if utils.match_response(http_res, "200", "application/json"):
|
|
749
|
-
return
|
|
684
|
+
return unmarshal_json_response(Any, http_res)
|
|
750
685
|
if utils.match_response(http_res, "422", "application/json"):
|
|
751
|
-
response_data =
|
|
752
|
-
|
|
686
|
+
response_data = unmarshal_json_response(
|
|
687
|
+
errors.HTTPValidationErrorData, http_res
|
|
753
688
|
)
|
|
754
|
-
raise
|
|
689
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
755
690
|
if utils.match_response(http_res, "4XX", "*"):
|
|
756
691
|
http_res_text = utils.stream_to_text(http_res)
|
|
757
|
-
raise
|
|
758
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
759
|
-
)
|
|
692
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
760
693
|
if utils.match_response(http_res, "5XX", "*"):
|
|
761
694
|
http_res_text = utils.stream_to_text(http_res)
|
|
762
|
-
raise
|
|
763
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
764
|
-
)
|
|
695
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
765
696
|
|
|
766
|
-
|
|
767
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
768
|
-
raise models.APIError(
|
|
769
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
770
|
-
http_res.status_code,
|
|
771
|
-
http_res_text,
|
|
772
|
-
http_res,
|
|
773
|
-
)
|
|
697
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
774
698
|
|
|
775
699
|
async def delete_async(
|
|
776
700
|
self,
|
|
@@ -849,31 +773,20 @@ class V1(BaseSDK):
|
|
|
849
773
|
|
|
850
774
|
response_data: Any = None
|
|
851
775
|
if utils.match_response(http_res, "200", "application/json"):
|
|
852
|
-
return
|
|
776
|
+
return unmarshal_json_response(Any, http_res)
|
|
853
777
|
if utils.match_response(http_res, "422", "application/json"):
|
|
854
|
-
response_data =
|
|
855
|
-
|
|
778
|
+
response_data = unmarshal_json_response(
|
|
779
|
+
errors.HTTPValidationErrorData, http_res
|
|
856
780
|
)
|
|
857
|
-
raise
|
|
781
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
858
782
|
if utils.match_response(http_res, "4XX", "*"):
|
|
859
783
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
860
|
-
raise
|
|
861
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
862
|
-
)
|
|
784
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
863
785
|
if utils.match_response(http_res, "5XX", "*"):
|
|
864
786
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
865
|
-
raise
|
|
866
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
867
|
-
)
|
|
787
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
868
788
|
|
|
869
|
-
|
|
870
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
871
|
-
raise models.APIError(
|
|
872
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
873
|
-
http_res.status_code,
|
|
874
|
-
http_res_text,
|
|
875
|
-
http_res,
|
|
876
|
-
)
|
|
789
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
877
790
|
|
|
878
791
|
def users_get_by_email(
|
|
879
792
|
self,
|
|
@@ -949,31 +862,20 @@ class V1(BaseSDK):
|
|
|
949
862
|
|
|
950
863
|
response_data: Any = None
|
|
951
864
|
if utils.match_response(http_res, "200", "application/json"):
|
|
952
|
-
return
|
|
865
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
953
866
|
if utils.match_response(http_res, "422", "application/json"):
|
|
954
|
-
response_data =
|
|
955
|
-
|
|
867
|
+
response_data = unmarshal_json_response(
|
|
868
|
+
errors.HTTPValidationErrorData, http_res
|
|
956
869
|
)
|
|
957
|
-
raise
|
|
870
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
958
871
|
if utils.match_response(http_res, "4XX", "*"):
|
|
959
872
|
http_res_text = utils.stream_to_text(http_res)
|
|
960
|
-
raise
|
|
961
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
962
|
-
)
|
|
873
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
963
874
|
if utils.match_response(http_res, "5XX", "*"):
|
|
964
875
|
http_res_text = utils.stream_to_text(http_res)
|
|
965
|
-
raise
|
|
966
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
967
|
-
)
|
|
876
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
968
877
|
|
|
969
|
-
|
|
970
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
971
|
-
raise models.APIError(
|
|
972
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
973
|
-
http_res.status_code,
|
|
974
|
-
http_res_text,
|
|
975
|
-
http_res,
|
|
976
|
-
)
|
|
878
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
977
879
|
|
|
978
880
|
async def users_get_by_email_async(
|
|
979
881
|
self,
|
|
@@ -1049,31 +951,20 @@ class V1(BaseSDK):
|
|
|
1049
951
|
|
|
1050
952
|
response_data: Any = None
|
|
1051
953
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1052
|
-
return
|
|
954
|
+
return unmarshal_json_response(models.UserResponse, http_res)
|
|
1053
955
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1054
|
-
response_data =
|
|
1055
|
-
|
|
956
|
+
response_data = unmarshal_json_response(
|
|
957
|
+
errors.HTTPValidationErrorData, http_res
|
|
1056
958
|
)
|
|
1057
|
-
raise
|
|
959
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1058
960
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1059
961
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1060
|
-
raise
|
|
1061
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1062
|
-
)
|
|
962
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1063
963
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1064
964
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1065
|
-
raise
|
|
1066
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1067
|
-
)
|
|
965
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1068
966
|
|
|
1069
|
-
|
|
1070
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1071
|
-
raise models.APIError(
|
|
1072
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1073
|
-
http_res.status_code,
|
|
1074
|
-
http_res_text,
|
|
1075
|
-
http_res,
|
|
1076
|
-
)
|
|
967
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1077
968
|
|
|
1078
969
|
def users_send_email(
|
|
1079
970
|
self,
|
|
@@ -1149,31 +1040,20 @@ class V1(BaseSDK):
|
|
|
1149
1040
|
|
|
1150
1041
|
response_data: Any = None
|
|
1151
1042
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1152
|
-
return
|
|
1043
|
+
return unmarshal_json_response(Any, http_res)
|
|
1153
1044
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1154
|
-
response_data =
|
|
1155
|
-
|
|
1045
|
+
response_data = unmarshal_json_response(
|
|
1046
|
+
errors.HTTPValidationErrorData, http_res
|
|
1156
1047
|
)
|
|
1157
|
-
raise
|
|
1048
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1158
1049
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1159
1050
|
http_res_text = utils.stream_to_text(http_res)
|
|
1160
|
-
raise
|
|
1161
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1162
|
-
)
|
|
1051
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1163
1052
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1164
1053
|
http_res_text = utils.stream_to_text(http_res)
|
|
1165
|
-
raise
|
|
1166
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1167
|
-
)
|
|
1054
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1168
1055
|
|
|
1169
|
-
|
|
1170
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1171
|
-
raise models.APIError(
|
|
1172
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1173
|
-
http_res.status_code,
|
|
1174
|
-
http_res_text,
|
|
1175
|
-
http_res,
|
|
1176
|
-
)
|
|
1056
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1177
1057
|
|
|
1178
1058
|
async def users_send_email_async(
|
|
1179
1059
|
self,
|
|
@@ -1249,31 +1129,20 @@ class V1(BaseSDK):
|
|
|
1249
1129
|
|
|
1250
1130
|
response_data: Any = None
|
|
1251
1131
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1252
|
-
return
|
|
1132
|
+
return unmarshal_json_response(Any, http_res)
|
|
1253
1133
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1254
|
-
response_data =
|
|
1255
|
-
|
|
1134
|
+
response_data = unmarshal_json_response(
|
|
1135
|
+
errors.HTTPValidationErrorData, http_res
|
|
1256
1136
|
)
|
|
1257
|
-
raise
|
|
1137
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1258
1138
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1259
1139
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1260
|
-
raise
|
|
1261
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1262
|
-
)
|
|
1140
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1263
1141
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1264
1142
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1265
|
-
raise
|
|
1266
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1267
|
-
)
|
|
1143
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1268
1144
|
|
|
1269
|
-
|
|
1270
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1271
|
-
raise models.APIError(
|
|
1272
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1273
|
-
http_res.status_code,
|
|
1274
|
-
http_res_text,
|
|
1275
|
-
http_res,
|
|
1276
|
-
)
|
|
1145
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1277
1146
|
|
|
1278
1147
|
def users_delete_account(
|
|
1279
1148
|
self,
|
|
@@ -1342,26 +1211,15 @@ class V1(BaseSDK):
|
|
|
1342
1211
|
)
|
|
1343
1212
|
|
|
1344
1213
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1345
|
-
return
|
|
1214
|
+
return unmarshal_json_response(Any, http_res)
|
|
1346
1215
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1347
1216
|
http_res_text = utils.stream_to_text(http_res)
|
|
1348
|
-
raise
|
|
1349
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1350
|
-
)
|
|
1217
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1351
1218
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1352
1219
|
http_res_text = utils.stream_to_text(http_res)
|
|
1353
|
-
raise
|
|
1354
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1355
|
-
)
|
|
1220
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1356
1221
|
|
|
1357
|
-
|
|
1358
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1359
|
-
raise models.APIError(
|
|
1360
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1361
|
-
http_res.status_code,
|
|
1362
|
-
http_res_text,
|
|
1363
|
-
http_res,
|
|
1364
|
-
)
|
|
1222
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1365
1223
|
|
|
1366
1224
|
async def users_delete_account_async(
|
|
1367
1225
|
self,
|
|
@@ -1430,23 +1288,12 @@ class V1(BaseSDK):
|
|
|
1430
1288
|
)
|
|
1431
1289
|
|
|
1432
1290
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1433
|
-
return
|
|
1291
|
+
return unmarshal_json_response(Any, http_res)
|
|
1434
1292
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1435
1293
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1436
|
-
raise
|
|
1437
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1438
|
-
)
|
|
1294
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1439
1295
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1440
1296
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1441
|
-
raise
|
|
1442
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1443
|
-
)
|
|
1297
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1444
1298
|
|
|
1445
|
-
|
|
1446
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1447
|
-
raise models.APIError(
|
|
1448
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1449
|
-
http_res.status_code,
|
|
1450
|
-
http_res_text,
|
|
1451
|
-
http_res,
|
|
1452
|
-
)
|
|
1299
|
+
raise errors.APIError("Unexpected response received", http_res)
|