syllable-sdk 0.35.27__py3-none-any.whl → 0.35.31__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/_version.py +3 -3
- syllable_sdk/agents.py +210 -82
- syllable_sdk/basesdk.py +4 -4
- syllable_sdk/batches.py +328 -130
- syllable_sdk/campaigns.py +182 -72
- syllable_sdk/channels.py +72 -28
- syllable_sdk/conversations.py +36 -18
- syllable_sdk/custom_messages.py +182 -72
- syllable_sdk/dashboards.py +194 -66
- syllable_sdk/data_sources.py +182 -84
- syllable_sdk/events.py +36 -14
- syllable_sdk/folders.py +292 -120
- syllable_sdk/full_summary.py +36 -18
- syllable_sdk/incidents.py +214 -82
- syllable_sdk/insights_sdk.py +38 -16
- syllable_sdk/insights_tools.py +250 -96
- syllable_sdk/language_groups.py +214 -84
- syllable_sdk/latency.py +36 -18
- syllable_sdk/models/__init__.py +6 -19
- syllable_sdk/models/apierror.py +14 -30
- syllable_sdk/models/dialogtoolcall.py +37 -1
- syllable_sdk/models/httpvalidationerror.py +6 -11
- syllable_sdk/models/testmessageresponse.py +38 -15
- syllable_sdk/models/tooldefinition.py +10 -2
- syllable_sdk/models/tooloptions.py +20 -0
- syllable_sdk/numbers.py +110 -52
- syllable_sdk/organizations.py +138 -50
- syllable_sdk/permissions.py +32 -10
- syllable_sdk/prompts.py +248 -94
- syllable_sdk/roles.py +180 -74
- syllable_sdk/services.py +182 -72
- syllable_sdk/session_debug.py +108 -42
- syllable_sdk/session_labels.py +108 -46
- syllable_sdk/sessions.py +140 -58
- syllable_sdk/takeouts.py +98 -34
- syllable_sdk/targets.py +184 -74
- syllable_sdk/test.py +36 -14
- syllable_sdk/tools.py +180 -74
- syllable_sdk/transcript.py +38 -16
- syllable_sdk/twilio.py +108 -42
- syllable_sdk/users.py +246 -96
- syllable_sdk/utils/__init__.py +0 -3
- syllable_sdk/utils/serializers.py +3 -21
- syllable_sdk/v1.py +246 -96
- syllable_sdk/workflows.py +290 -114
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/METADATA +24 -44
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/RECORD +48 -50
- syllable_sdk/models/no_response_error.py +0 -13
- syllable_sdk/models/responsevalidationerror.py +0 -25
- syllable_sdk/models/syllablesdkerror.py +0 -26
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/WHEEL +0 -0
syllable_sdk/data_sources.py
CHANGED
|
@@ -109,22 +109,33 @@ class DataSources(BaseSDK):
|
|
|
109
109
|
|
|
110
110
|
response_data: Any = None
|
|
111
111
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return utils.
|
|
113
|
-
models.ListResponseDataSourceMetadataResponse
|
|
112
|
+
return utils.unmarshal_json(
|
|
113
|
+
http_res.text, models.ListResponseDataSourceMetadataResponse
|
|
114
114
|
)
|
|
115
115
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data = utils.
|
|
117
|
-
models.HTTPValidationErrorData
|
|
116
|
+
response_data = utils.unmarshal_json(
|
|
117
|
+
http_res.text, models.HTTPValidationErrorData
|
|
118
118
|
)
|
|
119
|
-
raise models.HTTPValidationError(response_data
|
|
119
|
+
raise models.HTTPValidationError(data=response_data)
|
|
120
120
|
if utils.match_response(http_res, "4XX", "*"):
|
|
121
121
|
http_res_text = utils.stream_to_text(http_res)
|
|
122
|
-
raise models.APIError(
|
|
122
|
+
raise models.APIError(
|
|
123
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
124
|
+
)
|
|
123
125
|
if utils.match_response(http_res, "5XX", "*"):
|
|
124
126
|
http_res_text = utils.stream_to_text(http_res)
|
|
125
|
-
raise models.APIError(
|
|
127
|
+
raise models.APIError(
|
|
128
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
129
|
+
)
|
|
126
130
|
|
|
127
|
-
|
|
131
|
+
content_type = http_res.headers.get("Content-Type")
|
|
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
|
+
)
|
|
128
139
|
|
|
129
140
|
async def list_async(
|
|
130
141
|
self,
|
|
@@ -224,22 +235,33 @@ class DataSources(BaseSDK):
|
|
|
224
235
|
|
|
225
236
|
response_data: Any = None
|
|
226
237
|
if utils.match_response(http_res, "200", "application/json"):
|
|
227
|
-
return utils.
|
|
228
|
-
models.ListResponseDataSourceMetadataResponse
|
|
238
|
+
return utils.unmarshal_json(
|
|
239
|
+
http_res.text, models.ListResponseDataSourceMetadataResponse
|
|
229
240
|
)
|
|
230
241
|
if utils.match_response(http_res, "422", "application/json"):
|
|
231
|
-
response_data = utils.
|
|
232
|
-
models.HTTPValidationErrorData
|
|
242
|
+
response_data = utils.unmarshal_json(
|
|
243
|
+
http_res.text, models.HTTPValidationErrorData
|
|
233
244
|
)
|
|
234
|
-
raise models.HTTPValidationError(response_data
|
|
245
|
+
raise models.HTTPValidationError(data=response_data)
|
|
235
246
|
if utils.match_response(http_res, "4XX", "*"):
|
|
236
247
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
237
|
-
raise models.APIError(
|
|
248
|
+
raise models.APIError(
|
|
249
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
250
|
+
)
|
|
238
251
|
if utils.match_response(http_res, "5XX", "*"):
|
|
239
252
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
240
|
-
raise models.APIError(
|
|
253
|
+
raise models.APIError(
|
|
254
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
255
|
+
)
|
|
241
256
|
|
|
242
|
-
|
|
257
|
+
content_type = http_res.headers.get("Content-Type")
|
|
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
|
+
)
|
|
243
265
|
|
|
244
266
|
def create(
|
|
245
267
|
self,
|
|
@@ -320,22 +342,31 @@ class DataSources(BaseSDK):
|
|
|
320
342
|
|
|
321
343
|
response_data: Any = None
|
|
322
344
|
if utils.match_response(http_res, "200", "application/json"):
|
|
323
|
-
return utils.
|
|
324
|
-
models.DataSourceDetailResponse, http_res
|
|
325
|
-
)
|
|
345
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
326
346
|
if utils.match_response(http_res, "422", "application/json"):
|
|
327
|
-
response_data = utils.
|
|
328
|
-
models.HTTPValidationErrorData
|
|
347
|
+
response_data = utils.unmarshal_json(
|
|
348
|
+
http_res.text, models.HTTPValidationErrorData
|
|
329
349
|
)
|
|
330
|
-
raise models.HTTPValidationError(response_data
|
|
350
|
+
raise models.HTTPValidationError(data=response_data)
|
|
331
351
|
if utils.match_response(http_res, "4XX", "*"):
|
|
332
352
|
http_res_text = utils.stream_to_text(http_res)
|
|
333
|
-
raise models.APIError(
|
|
353
|
+
raise models.APIError(
|
|
354
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
355
|
+
)
|
|
334
356
|
if utils.match_response(http_res, "5XX", "*"):
|
|
335
357
|
http_res_text = utils.stream_to_text(http_res)
|
|
336
|
-
raise models.APIError(
|
|
358
|
+
raise models.APIError(
|
|
359
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
360
|
+
)
|
|
337
361
|
|
|
338
|
-
|
|
362
|
+
content_type = http_res.headers.get("Content-Type")
|
|
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
|
+
)
|
|
339
370
|
|
|
340
371
|
async def create_async(
|
|
341
372
|
self,
|
|
@@ -416,22 +447,31 @@ class DataSources(BaseSDK):
|
|
|
416
447
|
|
|
417
448
|
response_data: Any = None
|
|
418
449
|
if utils.match_response(http_res, "200", "application/json"):
|
|
419
|
-
return utils.
|
|
420
|
-
models.DataSourceDetailResponse, http_res
|
|
421
|
-
)
|
|
450
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
422
451
|
if utils.match_response(http_res, "422", "application/json"):
|
|
423
|
-
response_data = utils.
|
|
424
|
-
models.HTTPValidationErrorData
|
|
452
|
+
response_data = utils.unmarshal_json(
|
|
453
|
+
http_res.text, models.HTTPValidationErrorData
|
|
425
454
|
)
|
|
426
|
-
raise models.HTTPValidationError(response_data
|
|
455
|
+
raise models.HTTPValidationError(data=response_data)
|
|
427
456
|
if utils.match_response(http_res, "4XX", "*"):
|
|
428
457
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
429
|
-
raise models.APIError(
|
|
458
|
+
raise models.APIError(
|
|
459
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
460
|
+
)
|
|
430
461
|
if utils.match_response(http_res, "5XX", "*"):
|
|
431
462
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
432
|
-
raise models.APIError(
|
|
463
|
+
raise models.APIError(
|
|
464
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
465
|
+
)
|
|
433
466
|
|
|
434
|
-
|
|
467
|
+
content_type = http_res.headers.get("Content-Type")
|
|
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
|
+
)
|
|
435
475
|
|
|
436
476
|
def update(
|
|
437
477
|
self,
|
|
@@ -512,22 +552,31 @@ class DataSources(BaseSDK):
|
|
|
512
552
|
|
|
513
553
|
response_data: Any = None
|
|
514
554
|
if utils.match_response(http_res, "200", "application/json"):
|
|
515
|
-
return utils.
|
|
516
|
-
models.DataSourceDetailResponse, http_res
|
|
517
|
-
)
|
|
555
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
518
556
|
if utils.match_response(http_res, "422", "application/json"):
|
|
519
|
-
response_data = utils.
|
|
520
|
-
models.HTTPValidationErrorData
|
|
557
|
+
response_data = utils.unmarshal_json(
|
|
558
|
+
http_res.text, models.HTTPValidationErrorData
|
|
521
559
|
)
|
|
522
|
-
raise models.HTTPValidationError(response_data
|
|
560
|
+
raise models.HTTPValidationError(data=response_data)
|
|
523
561
|
if utils.match_response(http_res, "4XX", "*"):
|
|
524
562
|
http_res_text = utils.stream_to_text(http_res)
|
|
525
|
-
raise models.APIError(
|
|
563
|
+
raise models.APIError(
|
|
564
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
565
|
+
)
|
|
526
566
|
if utils.match_response(http_res, "5XX", "*"):
|
|
527
567
|
http_res_text = utils.stream_to_text(http_res)
|
|
528
|
-
raise models.APIError(
|
|
568
|
+
raise models.APIError(
|
|
569
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
570
|
+
)
|
|
529
571
|
|
|
530
|
-
|
|
572
|
+
content_type = http_res.headers.get("Content-Type")
|
|
573
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
574
|
+
raise models.APIError(
|
|
575
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
576
|
+
http_res.status_code,
|
|
577
|
+
http_res_text,
|
|
578
|
+
http_res,
|
|
579
|
+
)
|
|
531
580
|
|
|
532
581
|
async def update_async(
|
|
533
582
|
self,
|
|
@@ -608,22 +657,31 @@ class DataSources(BaseSDK):
|
|
|
608
657
|
|
|
609
658
|
response_data: Any = None
|
|
610
659
|
if utils.match_response(http_res, "200", "application/json"):
|
|
611
|
-
return utils.
|
|
612
|
-
models.DataSourceDetailResponse, http_res
|
|
613
|
-
)
|
|
660
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
614
661
|
if utils.match_response(http_res, "422", "application/json"):
|
|
615
|
-
response_data = utils.
|
|
616
|
-
models.HTTPValidationErrorData
|
|
662
|
+
response_data = utils.unmarshal_json(
|
|
663
|
+
http_res.text, models.HTTPValidationErrorData
|
|
617
664
|
)
|
|
618
|
-
raise models.HTTPValidationError(response_data
|
|
665
|
+
raise models.HTTPValidationError(data=response_data)
|
|
619
666
|
if utils.match_response(http_res, "4XX", "*"):
|
|
620
667
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
621
|
-
raise models.APIError(
|
|
668
|
+
raise models.APIError(
|
|
669
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
670
|
+
)
|
|
622
671
|
if utils.match_response(http_res, "5XX", "*"):
|
|
623
672
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
624
|
-
raise models.APIError(
|
|
673
|
+
raise models.APIError(
|
|
674
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
675
|
+
)
|
|
625
676
|
|
|
626
|
-
|
|
677
|
+
content_type = http_res.headers.get("Content-Type")
|
|
678
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
679
|
+
raise models.APIError(
|
|
680
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
681
|
+
http_res.status_code,
|
|
682
|
+
http_res_text,
|
|
683
|
+
http_res,
|
|
684
|
+
)
|
|
627
685
|
|
|
628
686
|
def get_by_id(
|
|
629
687
|
self,
|
|
@@ -699,22 +757,31 @@ class DataSources(BaseSDK):
|
|
|
699
757
|
|
|
700
758
|
response_data: Any = None
|
|
701
759
|
if utils.match_response(http_res, "200", "application/json"):
|
|
702
|
-
return utils.
|
|
703
|
-
models.DataSourceDetailResponse, http_res
|
|
704
|
-
)
|
|
760
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
705
761
|
if utils.match_response(http_res, "422", "application/json"):
|
|
706
|
-
response_data = utils.
|
|
707
|
-
models.HTTPValidationErrorData
|
|
762
|
+
response_data = utils.unmarshal_json(
|
|
763
|
+
http_res.text, models.HTTPValidationErrorData
|
|
708
764
|
)
|
|
709
|
-
raise models.HTTPValidationError(response_data
|
|
765
|
+
raise models.HTTPValidationError(data=response_data)
|
|
710
766
|
if utils.match_response(http_res, "4XX", "*"):
|
|
711
767
|
http_res_text = utils.stream_to_text(http_res)
|
|
712
|
-
raise models.APIError(
|
|
768
|
+
raise models.APIError(
|
|
769
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
770
|
+
)
|
|
713
771
|
if utils.match_response(http_res, "5XX", "*"):
|
|
714
772
|
http_res_text = utils.stream_to_text(http_res)
|
|
715
|
-
raise models.APIError(
|
|
773
|
+
raise models.APIError(
|
|
774
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
775
|
+
)
|
|
716
776
|
|
|
717
|
-
|
|
777
|
+
content_type = http_res.headers.get("Content-Type")
|
|
778
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
779
|
+
raise models.APIError(
|
|
780
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
781
|
+
http_res.status_code,
|
|
782
|
+
http_res_text,
|
|
783
|
+
http_res,
|
|
784
|
+
)
|
|
718
785
|
|
|
719
786
|
async def get_by_id_async(
|
|
720
787
|
self,
|
|
@@ -790,22 +857,31 @@ class DataSources(BaseSDK):
|
|
|
790
857
|
|
|
791
858
|
response_data: Any = None
|
|
792
859
|
if utils.match_response(http_res, "200", "application/json"):
|
|
793
|
-
return utils.
|
|
794
|
-
models.DataSourceDetailResponse, http_res
|
|
795
|
-
)
|
|
860
|
+
return utils.unmarshal_json(http_res.text, models.DataSourceDetailResponse)
|
|
796
861
|
if utils.match_response(http_res, "422", "application/json"):
|
|
797
|
-
response_data = utils.
|
|
798
|
-
models.HTTPValidationErrorData
|
|
862
|
+
response_data = utils.unmarshal_json(
|
|
863
|
+
http_res.text, models.HTTPValidationErrorData
|
|
799
864
|
)
|
|
800
|
-
raise models.HTTPValidationError(response_data
|
|
865
|
+
raise models.HTTPValidationError(data=response_data)
|
|
801
866
|
if utils.match_response(http_res, "4XX", "*"):
|
|
802
867
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
803
|
-
raise models.APIError(
|
|
868
|
+
raise models.APIError(
|
|
869
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
870
|
+
)
|
|
804
871
|
if utils.match_response(http_res, "5XX", "*"):
|
|
805
872
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
806
|
-
raise models.APIError(
|
|
873
|
+
raise models.APIError(
|
|
874
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
875
|
+
)
|
|
807
876
|
|
|
808
|
-
|
|
877
|
+
content_type = http_res.headers.get("Content-Type")
|
|
878
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
879
|
+
raise models.APIError(
|
|
880
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
881
|
+
http_res.status_code,
|
|
882
|
+
http_res_text,
|
|
883
|
+
http_res,
|
|
884
|
+
)
|
|
809
885
|
|
|
810
886
|
def delete(
|
|
811
887
|
self,
|
|
@@ -884,20 +960,31 @@ class DataSources(BaseSDK):
|
|
|
884
960
|
|
|
885
961
|
response_data: Any = None
|
|
886
962
|
if utils.match_response(http_res, "200", "application/json"):
|
|
887
|
-
return utils.
|
|
963
|
+
return utils.unmarshal_json(http_res.text, Any)
|
|
888
964
|
if utils.match_response(http_res, "422", "application/json"):
|
|
889
|
-
response_data = utils.
|
|
890
|
-
models.HTTPValidationErrorData
|
|
965
|
+
response_data = utils.unmarshal_json(
|
|
966
|
+
http_res.text, models.HTTPValidationErrorData
|
|
891
967
|
)
|
|
892
|
-
raise models.HTTPValidationError(response_data
|
|
968
|
+
raise models.HTTPValidationError(data=response_data)
|
|
893
969
|
if utils.match_response(http_res, "4XX", "*"):
|
|
894
970
|
http_res_text = utils.stream_to_text(http_res)
|
|
895
|
-
raise models.APIError(
|
|
971
|
+
raise models.APIError(
|
|
972
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
973
|
+
)
|
|
896
974
|
if utils.match_response(http_res, "5XX", "*"):
|
|
897
975
|
http_res_text = utils.stream_to_text(http_res)
|
|
898
|
-
raise models.APIError(
|
|
976
|
+
raise models.APIError(
|
|
977
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
978
|
+
)
|
|
899
979
|
|
|
900
|
-
|
|
980
|
+
content_type = http_res.headers.get("Content-Type")
|
|
981
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
982
|
+
raise models.APIError(
|
|
983
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
984
|
+
http_res.status_code,
|
|
985
|
+
http_res_text,
|
|
986
|
+
http_res,
|
|
987
|
+
)
|
|
901
988
|
|
|
902
989
|
async def delete_async(
|
|
903
990
|
self,
|
|
@@ -976,17 +1063,28 @@ class DataSources(BaseSDK):
|
|
|
976
1063
|
|
|
977
1064
|
response_data: Any = None
|
|
978
1065
|
if utils.match_response(http_res, "200", "application/json"):
|
|
979
|
-
return utils.
|
|
1066
|
+
return utils.unmarshal_json(http_res.text, Any)
|
|
980
1067
|
if utils.match_response(http_res, "422", "application/json"):
|
|
981
|
-
response_data = utils.
|
|
982
|
-
models.HTTPValidationErrorData
|
|
1068
|
+
response_data = utils.unmarshal_json(
|
|
1069
|
+
http_res.text, models.HTTPValidationErrorData
|
|
983
1070
|
)
|
|
984
|
-
raise models.HTTPValidationError(response_data
|
|
1071
|
+
raise models.HTTPValidationError(data=response_data)
|
|
985
1072
|
if utils.match_response(http_res, "4XX", "*"):
|
|
986
1073
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
987
|
-
raise models.APIError(
|
|
1074
|
+
raise models.APIError(
|
|
1075
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1076
|
+
)
|
|
988
1077
|
if utils.match_response(http_res, "5XX", "*"):
|
|
989
1078
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
990
|
-
raise models.APIError(
|
|
1079
|
+
raise models.APIError(
|
|
1080
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1081
|
+
)
|
|
991
1082
|
|
|
992
|
-
|
|
1083
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1084
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1085
|
+
raise models.APIError(
|
|
1086
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1087
|
+
http_res.status_code,
|
|
1088
|
+
http_res_text,
|
|
1089
|
+
http_res,
|
|
1090
|
+
)
|
syllable_sdk/events.py
CHANGED
|
@@ -107,20 +107,31 @@ class Events(BaseSDK):
|
|
|
107
107
|
|
|
108
108
|
response_data: Any = None
|
|
109
109
|
if utils.match_response(http_res, "200", "application/json"):
|
|
110
|
-
return utils.
|
|
110
|
+
return utils.unmarshal_json(http_res.text, models.ListResponseEvent)
|
|
111
111
|
if utils.match_response(http_res, "422", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
models.HTTPValidationErrorData
|
|
112
|
+
response_data = utils.unmarshal_json(
|
|
113
|
+
http_res.text, models.HTTPValidationErrorData
|
|
114
114
|
)
|
|
115
|
-
raise models.HTTPValidationError(response_data
|
|
115
|
+
raise models.HTTPValidationError(data=response_data)
|
|
116
116
|
if utils.match_response(http_res, "4XX", "*"):
|
|
117
117
|
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
-
raise models.APIError(
|
|
118
|
+
raise models.APIError(
|
|
119
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
120
|
+
)
|
|
119
121
|
if utils.match_response(http_res, "5XX", "*"):
|
|
120
122
|
http_res_text = utils.stream_to_text(http_res)
|
|
121
|
-
raise models.APIError(
|
|
123
|
+
raise models.APIError(
|
|
124
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
125
|
+
)
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
content_type = http_res.headers.get("Content-Type")
|
|
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
135
|
|
|
125
136
|
async def list_async(
|
|
126
137
|
self,
|
|
@@ -218,17 +229,28 @@ class Events(BaseSDK):
|
|
|
218
229
|
|
|
219
230
|
response_data: Any = None
|
|
220
231
|
if utils.match_response(http_res, "200", "application/json"):
|
|
221
|
-
return utils.
|
|
232
|
+
return utils.unmarshal_json(http_res.text, models.ListResponseEvent)
|
|
222
233
|
if utils.match_response(http_res, "422", "application/json"):
|
|
223
|
-
response_data = utils.
|
|
224
|
-
models.HTTPValidationErrorData
|
|
234
|
+
response_data = utils.unmarshal_json(
|
|
235
|
+
http_res.text, models.HTTPValidationErrorData
|
|
225
236
|
)
|
|
226
|
-
raise models.HTTPValidationError(response_data
|
|
237
|
+
raise models.HTTPValidationError(data=response_data)
|
|
227
238
|
if utils.match_response(http_res, "4XX", "*"):
|
|
228
239
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
229
|
-
raise models.APIError(
|
|
240
|
+
raise models.APIError(
|
|
241
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
242
|
+
)
|
|
230
243
|
if utils.match_response(http_res, "5XX", "*"):
|
|
231
244
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
232
|
-
raise models.APIError(
|
|
245
|
+
raise models.APIError(
|
|
246
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
247
|
+
)
|
|
233
248
|
|
|
234
|
-
|
|
249
|
+
content_type = http_res.headers.get("Content-Type")
|
|
250
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
251
|
+
raise models.APIError(
|
|
252
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
253
|
+
http_res.status_code,
|
|
254
|
+
http_res_text,
|
|
255
|
+
http_res,
|
|
256
|
+
)
|