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/campaigns.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
|
|
@@ -107,33 +107,22 @@ class Campaigns(BaseSDK):
|
|
|
107
107
|
|
|
108
108
|
response_data: Any = None
|
|
109
109
|
if utils.match_response(http_res, "200", "application/json"):
|
|
110
|
-
return utils.
|
|
111
|
-
|
|
110
|
+
return utils.unmarshal_json_response(
|
|
111
|
+
models.ListResponseOutboundCampaign, http_res
|
|
112
112
|
)
|
|
113
113
|
if utils.match_response(http_res, "422", "application/json"):
|
|
114
|
-
response_data = utils.
|
|
115
|
-
|
|
114
|
+
response_data = utils.unmarshal_json_response(
|
|
115
|
+
errors.HTTPValidationErrorData, http_res
|
|
116
116
|
)
|
|
117
|
-
raise
|
|
117
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
118
118
|
if utils.match_response(http_res, "4XX", "*"):
|
|
119
119
|
http_res_text = utils.stream_to_text(http_res)
|
|
120
|
-
raise
|
|
121
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
122
|
-
)
|
|
120
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
123
121
|
if utils.match_response(http_res, "5XX", "*"):
|
|
124
122
|
http_res_text = utils.stream_to_text(http_res)
|
|
125
|
-
raise
|
|
126
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
127
|
-
)
|
|
123
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
128
124
|
|
|
129
|
-
|
|
130
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
131
|
-
raise models.APIError(
|
|
132
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
133
|
-
http_res.status_code,
|
|
134
|
-
http_res_text,
|
|
135
|
-
http_res,
|
|
136
|
-
)
|
|
125
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
137
126
|
|
|
138
127
|
async def list_async(
|
|
139
128
|
self,
|
|
@@ -231,33 +220,22 @@ class Campaigns(BaseSDK):
|
|
|
231
220
|
|
|
232
221
|
response_data: Any = None
|
|
233
222
|
if utils.match_response(http_res, "200", "application/json"):
|
|
234
|
-
return utils.
|
|
235
|
-
|
|
223
|
+
return utils.unmarshal_json_response(
|
|
224
|
+
models.ListResponseOutboundCampaign, http_res
|
|
236
225
|
)
|
|
237
226
|
if utils.match_response(http_res, "422", "application/json"):
|
|
238
|
-
response_data = utils.
|
|
239
|
-
|
|
227
|
+
response_data = utils.unmarshal_json_response(
|
|
228
|
+
errors.HTTPValidationErrorData, http_res
|
|
240
229
|
)
|
|
241
|
-
raise
|
|
230
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
242
231
|
if utils.match_response(http_res, "4XX", "*"):
|
|
243
232
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
244
|
-
raise
|
|
245
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
246
|
-
)
|
|
233
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
247
234
|
if utils.match_response(http_res, "5XX", "*"):
|
|
248
235
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
249
|
-
raise
|
|
250
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
251
|
-
)
|
|
236
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
252
237
|
|
|
253
|
-
|
|
254
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
255
|
-
raise models.APIError(
|
|
256
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
257
|
-
http_res.status_code,
|
|
258
|
-
http_res_text,
|
|
259
|
-
http_res,
|
|
260
|
-
)
|
|
238
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
261
239
|
|
|
262
240
|
def create(
|
|
263
241
|
self,
|
|
@@ -336,31 +314,20 @@ class Campaigns(BaseSDK):
|
|
|
336
314
|
|
|
337
315
|
response_data: Any = None
|
|
338
316
|
if utils.match_response(http_res, "200", "application/json"):
|
|
339
|
-
return utils.
|
|
317
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
340
318
|
if utils.match_response(http_res, "422", "application/json"):
|
|
341
|
-
response_data = utils.
|
|
342
|
-
|
|
319
|
+
response_data = utils.unmarshal_json_response(
|
|
320
|
+
errors.HTTPValidationErrorData, http_res
|
|
343
321
|
)
|
|
344
|
-
raise
|
|
322
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
345
323
|
if utils.match_response(http_res, "4XX", "*"):
|
|
346
324
|
http_res_text = utils.stream_to_text(http_res)
|
|
347
|
-
raise
|
|
348
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
349
|
-
)
|
|
325
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
350
326
|
if utils.match_response(http_res, "5XX", "*"):
|
|
351
327
|
http_res_text = utils.stream_to_text(http_res)
|
|
352
|
-
raise
|
|
353
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
354
|
-
)
|
|
328
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
355
329
|
|
|
356
|
-
|
|
357
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
358
|
-
raise models.APIError(
|
|
359
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
360
|
-
http_res.status_code,
|
|
361
|
-
http_res_text,
|
|
362
|
-
http_res,
|
|
363
|
-
)
|
|
330
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
364
331
|
|
|
365
332
|
async def create_async(
|
|
366
333
|
self,
|
|
@@ -439,31 +406,20 @@ class Campaigns(BaseSDK):
|
|
|
439
406
|
|
|
440
407
|
response_data: Any = None
|
|
441
408
|
if utils.match_response(http_res, "200", "application/json"):
|
|
442
|
-
return utils.
|
|
409
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
443
410
|
if utils.match_response(http_res, "422", "application/json"):
|
|
444
|
-
response_data = utils.
|
|
445
|
-
|
|
411
|
+
response_data = utils.unmarshal_json_response(
|
|
412
|
+
errors.HTTPValidationErrorData, http_res
|
|
446
413
|
)
|
|
447
|
-
raise
|
|
414
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
448
415
|
if utils.match_response(http_res, "4XX", "*"):
|
|
449
416
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
450
|
-
raise
|
|
451
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
452
|
-
)
|
|
417
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
453
418
|
if utils.match_response(http_res, "5XX", "*"):
|
|
454
419
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
455
|
-
raise
|
|
456
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
457
|
-
)
|
|
420
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
458
421
|
|
|
459
|
-
|
|
460
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
461
|
-
raise models.APIError(
|
|
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
|
-
)
|
|
422
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
467
423
|
|
|
468
424
|
def get_by_id(
|
|
469
425
|
self,
|
|
@@ -537,31 +493,20 @@ class Campaigns(BaseSDK):
|
|
|
537
493
|
|
|
538
494
|
response_data: Any = None
|
|
539
495
|
if utils.match_response(http_res, "200", "application/json"):
|
|
540
|
-
return utils.
|
|
496
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
541
497
|
if utils.match_response(http_res, "422", "application/json"):
|
|
542
|
-
response_data = utils.
|
|
543
|
-
|
|
498
|
+
response_data = utils.unmarshal_json_response(
|
|
499
|
+
errors.HTTPValidationErrorData, http_res
|
|
544
500
|
)
|
|
545
|
-
raise
|
|
501
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
546
502
|
if utils.match_response(http_res, "4XX", "*"):
|
|
547
503
|
http_res_text = utils.stream_to_text(http_res)
|
|
548
|
-
raise
|
|
549
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
550
|
-
)
|
|
504
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
551
505
|
if utils.match_response(http_res, "5XX", "*"):
|
|
552
506
|
http_res_text = utils.stream_to_text(http_res)
|
|
553
|
-
raise
|
|
554
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
555
|
-
)
|
|
507
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
556
508
|
|
|
557
|
-
|
|
558
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
559
|
-
raise models.APIError(
|
|
560
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
561
|
-
http_res.status_code,
|
|
562
|
-
http_res_text,
|
|
563
|
-
http_res,
|
|
564
|
-
)
|
|
509
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
565
510
|
|
|
566
511
|
async def get_by_id_async(
|
|
567
512
|
self,
|
|
@@ -635,31 +580,20 @@ class Campaigns(BaseSDK):
|
|
|
635
580
|
|
|
636
581
|
response_data: Any = None
|
|
637
582
|
if utils.match_response(http_res, "200", "application/json"):
|
|
638
|
-
return utils.
|
|
583
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
639
584
|
if utils.match_response(http_res, "422", "application/json"):
|
|
640
|
-
response_data = utils.
|
|
641
|
-
|
|
585
|
+
response_data = utils.unmarshal_json_response(
|
|
586
|
+
errors.HTTPValidationErrorData, http_res
|
|
642
587
|
)
|
|
643
|
-
raise
|
|
588
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
644
589
|
if utils.match_response(http_res, "4XX", "*"):
|
|
645
590
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
646
|
-
raise
|
|
647
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
648
|
-
)
|
|
591
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
649
592
|
if utils.match_response(http_res, "5XX", "*"):
|
|
650
593
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
651
|
-
raise
|
|
652
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
653
|
-
)
|
|
594
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
654
595
|
|
|
655
|
-
|
|
656
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
657
|
-
raise models.APIError(
|
|
658
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
659
|
-
http_res.status_code,
|
|
660
|
-
http_res_text,
|
|
661
|
-
http_res,
|
|
662
|
-
)
|
|
596
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
663
597
|
|
|
664
598
|
def update(
|
|
665
599
|
self,
|
|
@@ -747,31 +681,20 @@ class Campaigns(BaseSDK):
|
|
|
747
681
|
|
|
748
682
|
response_data: Any = None
|
|
749
683
|
if utils.match_response(http_res, "200", "application/json"):
|
|
750
|
-
return utils.
|
|
684
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
751
685
|
if utils.match_response(http_res, "422", "application/json"):
|
|
752
|
-
response_data = utils.
|
|
753
|
-
|
|
686
|
+
response_data = utils.unmarshal_json_response(
|
|
687
|
+
errors.HTTPValidationErrorData, http_res
|
|
754
688
|
)
|
|
755
|
-
raise
|
|
689
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
756
690
|
if utils.match_response(http_res, "4XX", "*"):
|
|
757
691
|
http_res_text = utils.stream_to_text(http_res)
|
|
758
|
-
raise
|
|
759
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
760
|
-
)
|
|
692
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
761
693
|
if utils.match_response(http_res, "5XX", "*"):
|
|
762
694
|
http_res_text = utils.stream_to_text(http_res)
|
|
763
|
-
raise
|
|
764
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
765
|
-
)
|
|
695
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
766
696
|
|
|
767
|
-
|
|
768
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
769
|
-
raise models.APIError(
|
|
770
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
771
|
-
http_res.status_code,
|
|
772
|
-
http_res_text,
|
|
773
|
-
http_res,
|
|
774
|
-
)
|
|
697
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
775
698
|
|
|
776
699
|
async def update_async(
|
|
777
700
|
self,
|
|
@@ -859,31 +782,20 @@ class Campaigns(BaseSDK):
|
|
|
859
782
|
|
|
860
783
|
response_data: Any = None
|
|
861
784
|
if utils.match_response(http_res, "200", "application/json"):
|
|
862
|
-
return utils.
|
|
785
|
+
return utils.unmarshal_json_response(models.OutboundCampaign, http_res)
|
|
863
786
|
if utils.match_response(http_res, "422", "application/json"):
|
|
864
|
-
response_data = utils.
|
|
865
|
-
|
|
787
|
+
response_data = utils.unmarshal_json_response(
|
|
788
|
+
errors.HTTPValidationErrorData, http_res
|
|
866
789
|
)
|
|
867
|
-
raise
|
|
790
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
868
791
|
if utils.match_response(http_res, "4XX", "*"):
|
|
869
792
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
870
|
-
raise
|
|
871
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
872
|
-
)
|
|
793
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
873
794
|
if utils.match_response(http_res, "5XX", "*"):
|
|
874
795
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
875
|
-
raise
|
|
876
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
877
|
-
)
|
|
796
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
878
797
|
|
|
879
|
-
|
|
880
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
881
|
-
raise models.APIError(
|
|
882
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
883
|
-
http_res.status_code,
|
|
884
|
-
http_res_text,
|
|
885
|
-
http_res,
|
|
886
|
-
)
|
|
798
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
887
799
|
|
|
888
800
|
def delete(
|
|
889
801
|
self,
|
|
@@ -957,31 +869,20 @@ class Campaigns(BaseSDK):
|
|
|
957
869
|
|
|
958
870
|
response_data: Any = None
|
|
959
871
|
if utils.match_response(http_res, "200", "application/json"):
|
|
960
|
-
return utils.
|
|
872
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
961
873
|
if utils.match_response(http_res, "422", "application/json"):
|
|
962
|
-
response_data = utils.
|
|
963
|
-
|
|
874
|
+
response_data = utils.unmarshal_json_response(
|
|
875
|
+
errors.HTTPValidationErrorData, http_res
|
|
964
876
|
)
|
|
965
|
-
raise
|
|
877
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
966
878
|
if utils.match_response(http_res, "4XX", "*"):
|
|
967
879
|
http_res_text = utils.stream_to_text(http_res)
|
|
968
|
-
raise
|
|
969
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
970
|
-
)
|
|
880
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
971
881
|
if utils.match_response(http_res, "5XX", "*"):
|
|
972
882
|
http_res_text = utils.stream_to_text(http_res)
|
|
973
|
-
raise
|
|
974
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
975
|
-
)
|
|
883
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
976
884
|
|
|
977
|
-
|
|
978
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
979
|
-
raise models.APIError(
|
|
980
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
981
|
-
http_res.status_code,
|
|
982
|
-
http_res_text,
|
|
983
|
-
http_res,
|
|
984
|
-
)
|
|
885
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
985
886
|
|
|
986
887
|
async def delete_async(
|
|
987
888
|
self,
|
|
@@ -1055,28 +956,17 @@ class Campaigns(BaseSDK):
|
|
|
1055
956
|
|
|
1056
957
|
response_data: Any = None
|
|
1057
958
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1058
|
-
return utils.
|
|
959
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
1059
960
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1060
|
-
response_data = utils.
|
|
1061
|
-
|
|
961
|
+
response_data = utils.unmarshal_json_response(
|
|
962
|
+
errors.HTTPValidationErrorData, http_res
|
|
1062
963
|
)
|
|
1063
|
-
raise
|
|
964
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1064
965
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1065
966
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1066
|
-
raise
|
|
1067
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1068
|
-
)
|
|
967
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1069
968
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1070
969
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1071
|
-
raise
|
|
1072
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1073
|
-
)
|
|
970
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1074
971
|
|
|
1075
|
-
|
|
1076
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1077
|
-
raise models.APIError(
|
|
1078
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1079
|
-
http_res.status_code,
|
|
1080
|
-
http_res_text,
|
|
1081
|
-
http_res,
|
|
1082
|
-
)
|
|
972
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/channels.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
4
|
from .sdkconfiguration import SDKConfiguration
|
|
5
|
-
from syllable_sdk import models, utils
|
|
5
|
+
from syllable_sdk import errors, models, utils
|
|
6
6
|
from syllable_sdk._hooks import HookContext
|
|
7
7
|
from syllable_sdk.targets import Targets
|
|
8
8
|
from syllable_sdk.twilio import Twilio
|
|
@@ -124,31 +124,20 @@ class Channels(BaseSDK):
|
|
|
124
124
|
|
|
125
125
|
response_data: Any = None
|
|
126
126
|
if utils.match_response(http_res, "200", "application/json"):
|
|
127
|
-
return utils.
|
|
127
|
+
return utils.unmarshal_json_response(models.ListResponseChannel, http_res)
|
|
128
128
|
if utils.match_response(http_res, "422", "application/json"):
|
|
129
|
-
response_data = utils.
|
|
130
|
-
|
|
129
|
+
response_data = utils.unmarshal_json_response(
|
|
130
|
+
errors.HTTPValidationErrorData, http_res
|
|
131
131
|
)
|
|
132
|
-
raise
|
|
132
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
133
133
|
if utils.match_response(http_res, "4XX", "*"):
|
|
134
134
|
http_res_text = utils.stream_to_text(http_res)
|
|
135
|
-
raise
|
|
136
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
137
|
-
)
|
|
135
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
138
136
|
if utils.match_response(http_res, "5XX", "*"):
|
|
139
137
|
http_res_text = utils.stream_to_text(http_res)
|
|
140
|
-
raise
|
|
141
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
142
|
-
)
|
|
138
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
143
139
|
|
|
144
|
-
|
|
145
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
146
|
-
raise models.APIError(
|
|
147
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
148
|
-
http_res.status_code,
|
|
149
|
-
http_res_text,
|
|
150
|
-
http_res,
|
|
151
|
-
)
|
|
140
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
152
141
|
|
|
153
142
|
async def list_async(
|
|
154
143
|
self,
|
|
@@ -246,31 +235,20 @@ class Channels(BaseSDK):
|
|
|
246
235
|
|
|
247
236
|
response_data: Any = None
|
|
248
237
|
if utils.match_response(http_res, "200", "application/json"):
|
|
249
|
-
return utils.
|
|
238
|
+
return utils.unmarshal_json_response(models.ListResponseChannel, http_res)
|
|
250
239
|
if utils.match_response(http_res, "422", "application/json"):
|
|
251
|
-
response_data = utils.
|
|
252
|
-
|
|
240
|
+
response_data = utils.unmarshal_json_response(
|
|
241
|
+
errors.HTTPValidationErrorData, http_res
|
|
253
242
|
)
|
|
254
|
-
raise
|
|
243
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
255
244
|
if utils.match_response(http_res, "4XX", "*"):
|
|
256
245
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
257
|
-
raise
|
|
258
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
259
|
-
)
|
|
246
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
260
247
|
if utils.match_response(http_res, "5XX", "*"):
|
|
261
248
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
262
|
-
raise
|
|
263
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
264
|
-
)
|
|
249
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
265
250
|
|
|
266
|
-
|
|
267
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
268
|
-
raise models.APIError(
|
|
269
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
270
|
-
http_res.status_code,
|
|
271
|
-
http_res_text,
|
|
272
|
-
http_res,
|
|
273
|
-
)
|
|
251
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
274
252
|
|
|
275
253
|
def delete(
|
|
276
254
|
self,
|
|
@@ -349,31 +327,20 @@ class Channels(BaseSDK):
|
|
|
349
327
|
|
|
350
328
|
response_data: Any = None
|
|
351
329
|
if utils.match_response(http_res, "200", "application/json"):
|
|
352
|
-
return utils.
|
|
330
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
353
331
|
if utils.match_response(http_res, "422", "application/json"):
|
|
354
|
-
response_data = utils.
|
|
355
|
-
|
|
332
|
+
response_data = utils.unmarshal_json_response(
|
|
333
|
+
errors.HTTPValidationErrorData, http_res
|
|
356
334
|
)
|
|
357
|
-
raise
|
|
335
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
358
336
|
if utils.match_response(http_res, "4XX", "*"):
|
|
359
337
|
http_res_text = utils.stream_to_text(http_res)
|
|
360
|
-
raise
|
|
361
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
362
|
-
)
|
|
338
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
363
339
|
if utils.match_response(http_res, "5XX", "*"):
|
|
364
340
|
http_res_text = utils.stream_to_text(http_res)
|
|
365
|
-
raise
|
|
366
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
367
|
-
)
|
|
341
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
368
342
|
|
|
369
|
-
|
|
370
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
371
|
-
raise models.APIError(
|
|
372
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
373
|
-
http_res.status_code,
|
|
374
|
-
http_res_text,
|
|
375
|
-
http_res,
|
|
376
|
-
)
|
|
343
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
377
344
|
|
|
378
345
|
async def delete_async(
|
|
379
346
|
self,
|
|
@@ -452,28 +419,17 @@ class Channels(BaseSDK):
|
|
|
452
419
|
|
|
453
420
|
response_data: Any = None
|
|
454
421
|
if utils.match_response(http_res, "200", "application/json"):
|
|
455
|
-
return utils.
|
|
422
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
456
423
|
if utils.match_response(http_res, "422", "application/json"):
|
|
457
|
-
response_data = utils.
|
|
458
|
-
|
|
424
|
+
response_data = utils.unmarshal_json_response(
|
|
425
|
+
errors.HTTPValidationErrorData, http_res
|
|
459
426
|
)
|
|
460
|
-
raise
|
|
427
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
461
428
|
if utils.match_response(http_res, "4XX", "*"):
|
|
462
429
|
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
|
-
)
|
|
430
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
466
431
|
if utils.match_response(http_res, "5XX", "*"):
|
|
467
432
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
468
|
-
raise
|
|
469
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
470
|
-
)
|
|
433
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
471
434
|
|
|
472
|
-
|
|
473
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
474
|
-
raise models.APIError(
|
|
475
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
476
|
-
http_res.status_code,
|
|
477
|
-
http_res_text,
|
|
478
|
-
http_res,
|
|
479
|
-
)
|
|
435
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/conversations.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 OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
@@ -107,31 +107,22 @@ class Conversations(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_response(
|
|
111
|
+
models.ListResponseConversation, http_res
|
|
112
|
+
)
|
|
111
113
|
if utils.match_response(http_res, "422", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
|
|
114
|
+
response_data = utils.unmarshal_json_response(
|
|
115
|
+
errors.HTTPValidationErrorData, http_res
|
|
114
116
|
)
|
|
115
|
-
raise
|
|
117
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
116
118
|
if utils.match_response(http_res, "4XX", "*"):
|
|
117
119
|
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
|
-
)
|
|
120
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
121
121
|
if utils.match_response(http_res, "5XX", "*"):
|
|
122
122
|
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
|
-
)
|
|
123
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
126
124
|
|
|
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
|
-
)
|
|
125
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
135
126
|
|
|
136
127
|
async def list_async(
|
|
137
128
|
self,
|
|
@@ -229,28 +220,19 @@ class Conversations(BaseSDK):
|
|
|
229
220
|
|
|
230
221
|
response_data: Any = None
|
|
231
222
|
if utils.match_response(http_res, "200", "application/json"):
|
|
232
|
-
return utils.
|
|
223
|
+
return utils.unmarshal_json_response(
|
|
224
|
+
models.ListResponseConversation, http_res
|
|
225
|
+
)
|
|
233
226
|
if utils.match_response(http_res, "422", "application/json"):
|
|
234
|
-
response_data = utils.
|
|
235
|
-
|
|
227
|
+
response_data = utils.unmarshal_json_response(
|
|
228
|
+
errors.HTTPValidationErrorData, http_res
|
|
236
229
|
)
|
|
237
|
-
raise
|
|
230
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
238
231
|
if utils.match_response(http_res, "4XX", "*"):
|
|
239
232
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
240
|
-
raise
|
|
241
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
242
|
-
)
|
|
233
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
243
234
|
if utils.match_response(http_res, "5XX", "*"):
|
|
244
235
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
245
|
-
raise
|
|
246
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
247
|
-
)
|
|
236
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
248
237
|
|
|
249
|
-
|
|
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
|
-
)
|
|
238
|
+
raise errors.APIError("Unexpected response received", http_res)
|