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/services.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
|
|
|
@@ -109,33 +110,20 @@ class Services(BaseSDK):
|
|
|
109
110
|
|
|
110
111
|
response_data: Any = None
|
|
111
112
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return
|
|
113
|
-
http_res.text, models.ListResponseServiceResponse
|
|
114
|
-
)
|
|
113
|
+
return unmarshal_json_response(models.ListResponseServiceResponse, http_res)
|
|
115
114
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data =
|
|
117
|
-
|
|
115
|
+
response_data = unmarshal_json_response(
|
|
116
|
+
errors.HTTPValidationErrorData, http_res
|
|
118
117
|
)
|
|
119
|
-
raise
|
|
118
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
120
119
|
if utils.match_response(http_res, "4XX", "*"):
|
|
121
120
|
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
|
-
)
|
|
121
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
125
122
|
if utils.match_response(http_res, "5XX", "*"):
|
|
126
123
|
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
|
-
)
|
|
124
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
130
125
|
|
|
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
|
-
)
|
|
126
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
139
127
|
|
|
140
128
|
async def list_async(
|
|
141
129
|
self,
|
|
@@ -235,33 +223,20 @@ class Services(BaseSDK):
|
|
|
235
223
|
|
|
236
224
|
response_data: Any = None
|
|
237
225
|
if utils.match_response(http_res, "200", "application/json"):
|
|
238
|
-
return
|
|
239
|
-
http_res.text, models.ListResponseServiceResponse
|
|
240
|
-
)
|
|
226
|
+
return unmarshal_json_response(models.ListResponseServiceResponse, http_res)
|
|
241
227
|
if utils.match_response(http_res, "422", "application/json"):
|
|
242
|
-
response_data =
|
|
243
|
-
|
|
228
|
+
response_data = unmarshal_json_response(
|
|
229
|
+
errors.HTTPValidationErrorData, http_res
|
|
244
230
|
)
|
|
245
|
-
raise
|
|
231
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
246
232
|
if utils.match_response(http_res, "4XX", "*"):
|
|
247
233
|
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
|
-
)
|
|
234
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
251
235
|
if utils.match_response(http_res, "5XX", "*"):
|
|
252
236
|
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
|
-
)
|
|
237
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
256
238
|
|
|
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
|
-
)
|
|
239
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
265
240
|
|
|
266
241
|
def create(
|
|
267
242
|
self,
|
|
@@ -342,31 +317,20 @@ class Services(BaseSDK):
|
|
|
342
317
|
|
|
343
318
|
response_data: Any = None
|
|
344
319
|
if utils.match_response(http_res, "200", "application/json"):
|
|
345
|
-
return
|
|
320
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
346
321
|
if utils.match_response(http_res, "422", "application/json"):
|
|
347
|
-
response_data =
|
|
348
|
-
|
|
322
|
+
response_data = unmarshal_json_response(
|
|
323
|
+
errors.HTTPValidationErrorData, http_res
|
|
349
324
|
)
|
|
350
|
-
raise
|
|
325
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
351
326
|
if utils.match_response(http_res, "4XX", "*"):
|
|
352
327
|
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
|
-
)
|
|
328
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
356
329
|
if utils.match_response(http_res, "5XX", "*"):
|
|
357
330
|
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
|
-
)
|
|
331
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
361
332
|
|
|
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
|
-
)
|
|
333
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
370
334
|
|
|
371
335
|
async def create_async(
|
|
372
336
|
self,
|
|
@@ -447,31 +411,20 @@ class Services(BaseSDK):
|
|
|
447
411
|
|
|
448
412
|
response_data: Any = None
|
|
449
413
|
if utils.match_response(http_res, "200", "application/json"):
|
|
450
|
-
return
|
|
414
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
451
415
|
if utils.match_response(http_res, "422", "application/json"):
|
|
452
|
-
response_data =
|
|
453
|
-
|
|
416
|
+
response_data = unmarshal_json_response(
|
|
417
|
+
errors.HTTPValidationErrorData, http_res
|
|
454
418
|
)
|
|
455
|
-
raise
|
|
419
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
456
420
|
if utils.match_response(http_res, "4XX", "*"):
|
|
457
421
|
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
|
-
)
|
|
422
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
461
423
|
if utils.match_response(http_res, "5XX", "*"):
|
|
462
424
|
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
|
-
)
|
|
425
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
466
426
|
|
|
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
|
-
)
|
|
427
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
475
428
|
|
|
476
429
|
def update(
|
|
477
430
|
self,
|
|
@@ -552,31 +505,20 @@ class Services(BaseSDK):
|
|
|
552
505
|
|
|
553
506
|
response_data: Any = None
|
|
554
507
|
if utils.match_response(http_res, "200", "application/json"):
|
|
555
|
-
return
|
|
508
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
556
509
|
if utils.match_response(http_res, "422", "application/json"):
|
|
557
|
-
response_data =
|
|
558
|
-
|
|
510
|
+
response_data = unmarshal_json_response(
|
|
511
|
+
errors.HTTPValidationErrorData, http_res
|
|
559
512
|
)
|
|
560
|
-
raise
|
|
513
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
561
514
|
if utils.match_response(http_res, "4XX", "*"):
|
|
562
515
|
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
|
-
)
|
|
516
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
566
517
|
if utils.match_response(http_res, "5XX", "*"):
|
|
567
518
|
http_res_text = utils.stream_to_text(http_res)
|
|
568
|
-
raise
|
|
569
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
570
|
-
)
|
|
519
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
571
520
|
|
|
572
|
-
|
|
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
|
-
)
|
|
521
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
580
522
|
|
|
581
523
|
async def update_async(
|
|
582
524
|
self,
|
|
@@ -657,31 +599,20 @@ class Services(BaseSDK):
|
|
|
657
599
|
|
|
658
600
|
response_data: Any = None
|
|
659
601
|
if utils.match_response(http_res, "200", "application/json"):
|
|
660
|
-
return
|
|
602
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
661
603
|
if utils.match_response(http_res, "422", "application/json"):
|
|
662
|
-
response_data =
|
|
663
|
-
|
|
604
|
+
response_data = unmarshal_json_response(
|
|
605
|
+
errors.HTTPValidationErrorData, http_res
|
|
664
606
|
)
|
|
665
|
-
raise
|
|
607
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
666
608
|
if utils.match_response(http_res, "4XX", "*"):
|
|
667
609
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
668
|
-
raise
|
|
669
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
670
|
-
)
|
|
610
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
671
611
|
if utils.match_response(http_res, "5XX", "*"):
|
|
672
612
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
673
|
-
raise
|
|
674
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
675
|
-
)
|
|
613
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
676
614
|
|
|
677
|
-
|
|
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
|
-
)
|
|
615
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
685
616
|
|
|
686
617
|
def get_by_id(
|
|
687
618
|
self,
|
|
@@ -757,31 +688,20 @@ class Services(BaseSDK):
|
|
|
757
688
|
|
|
758
689
|
response_data: Any = None
|
|
759
690
|
if utils.match_response(http_res, "200", "application/json"):
|
|
760
|
-
return
|
|
691
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
761
692
|
if utils.match_response(http_res, "422", "application/json"):
|
|
762
|
-
response_data =
|
|
763
|
-
|
|
693
|
+
response_data = unmarshal_json_response(
|
|
694
|
+
errors.HTTPValidationErrorData, http_res
|
|
764
695
|
)
|
|
765
|
-
raise
|
|
696
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
766
697
|
if utils.match_response(http_res, "4XX", "*"):
|
|
767
698
|
http_res_text = utils.stream_to_text(http_res)
|
|
768
|
-
raise
|
|
769
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
770
|
-
)
|
|
699
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
771
700
|
if utils.match_response(http_res, "5XX", "*"):
|
|
772
701
|
http_res_text = utils.stream_to_text(http_res)
|
|
773
|
-
raise
|
|
774
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
775
|
-
)
|
|
702
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
776
703
|
|
|
777
|
-
|
|
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
|
-
)
|
|
704
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
785
705
|
|
|
786
706
|
async def get_by_id_async(
|
|
787
707
|
self,
|
|
@@ -857,31 +777,20 @@ class Services(BaseSDK):
|
|
|
857
777
|
|
|
858
778
|
response_data: Any = None
|
|
859
779
|
if utils.match_response(http_res, "200", "application/json"):
|
|
860
|
-
return
|
|
780
|
+
return unmarshal_json_response(models.ServiceResponse, http_res)
|
|
861
781
|
if utils.match_response(http_res, "422", "application/json"):
|
|
862
|
-
response_data =
|
|
863
|
-
|
|
782
|
+
response_data = unmarshal_json_response(
|
|
783
|
+
errors.HTTPValidationErrorData, http_res
|
|
864
784
|
)
|
|
865
|
-
raise
|
|
785
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
866
786
|
if utils.match_response(http_res, "4XX", "*"):
|
|
867
787
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
868
|
-
raise
|
|
869
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
870
|
-
)
|
|
788
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
871
789
|
if utils.match_response(http_res, "5XX", "*"):
|
|
872
790
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
873
|
-
raise
|
|
874
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
875
|
-
)
|
|
791
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
876
792
|
|
|
877
|
-
|
|
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
|
-
)
|
|
793
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
885
794
|
|
|
886
795
|
def delete(
|
|
887
796
|
self,
|
|
@@ -960,31 +869,20 @@ class Services(BaseSDK):
|
|
|
960
869
|
|
|
961
870
|
response_data: Any = None
|
|
962
871
|
if utils.match_response(http_res, "200", "application/json"):
|
|
963
|
-
return
|
|
872
|
+
return unmarshal_json_response(Any, http_res)
|
|
964
873
|
if utils.match_response(http_res, "422", "application/json"):
|
|
965
|
-
response_data =
|
|
966
|
-
|
|
874
|
+
response_data = unmarshal_json_response(
|
|
875
|
+
errors.HTTPValidationErrorData, http_res
|
|
967
876
|
)
|
|
968
|
-
raise
|
|
877
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
969
878
|
if utils.match_response(http_res, "4XX", "*"):
|
|
970
879
|
http_res_text = utils.stream_to_text(http_res)
|
|
971
|
-
raise
|
|
972
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
973
|
-
)
|
|
880
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
974
881
|
if utils.match_response(http_res, "5XX", "*"):
|
|
975
882
|
http_res_text = utils.stream_to_text(http_res)
|
|
976
|
-
raise
|
|
977
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
978
|
-
)
|
|
883
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
979
884
|
|
|
980
|
-
|
|
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
|
-
)
|
|
885
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
988
886
|
|
|
989
887
|
async def delete_async(
|
|
990
888
|
self,
|
|
@@ -1063,28 +961,17 @@ class Services(BaseSDK):
|
|
|
1063
961
|
|
|
1064
962
|
response_data: Any = None
|
|
1065
963
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1066
|
-
return
|
|
964
|
+
return unmarshal_json_response(Any, http_res)
|
|
1067
965
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1068
|
-
response_data =
|
|
1069
|
-
|
|
966
|
+
response_data = unmarshal_json_response(
|
|
967
|
+
errors.HTTPValidationErrorData, http_res
|
|
1070
968
|
)
|
|
1071
|
-
raise
|
|
969
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1072
970
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1073
971
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1074
|
-
raise
|
|
1075
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1076
|
-
)
|
|
972
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1077
973
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1078
974
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1079
|
-
raise
|
|
1080
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1081
|
-
)
|
|
975
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1082
976
|
|
|
1083
|
-
|
|
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
|
-
)
|
|
977
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/session_debug.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 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, Mapping, Optional
|
|
9
10
|
|
|
10
11
|
|
|
@@ -84,31 +85,20 @@ class SessionDebug(BaseSDK):
|
|
|
84
85
|
|
|
85
86
|
response_data: Any = None
|
|
86
87
|
if utils.match_response(http_res, "200", "application/json"):
|
|
87
|
-
return
|
|
88
|
+
return unmarshal_json_response(models.SessionData, http_res)
|
|
88
89
|
if utils.match_response(http_res, "422", "application/json"):
|
|
89
|
-
response_data =
|
|
90
|
-
|
|
90
|
+
response_data = unmarshal_json_response(
|
|
91
|
+
errors.HTTPValidationErrorData, http_res
|
|
91
92
|
)
|
|
92
|
-
raise
|
|
93
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
93
94
|
if utils.match_response(http_res, "4XX", "*"):
|
|
94
95
|
http_res_text = utils.stream_to_text(http_res)
|
|
95
|
-
raise
|
|
96
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
97
|
-
)
|
|
96
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
98
97
|
if utils.match_response(http_res, "5XX", "*"):
|
|
99
98
|
http_res_text = utils.stream_to_text(http_res)
|
|
100
|
-
raise
|
|
101
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
102
|
-
)
|
|
99
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
103
100
|
|
|
104
|
-
|
|
105
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
106
|
-
raise models.APIError(
|
|
107
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
108
|
-
http_res.status_code,
|
|
109
|
-
http_res_text,
|
|
110
|
-
http_res,
|
|
111
|
-
)
|
|
101
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
112
102
|
|
|
113
103
|
async def get_session_data_by_sid_async(
|
|
114
104
|
self,
|
|
@@ -185,31 +175,20 @@ class SessionDebug(BaseSDK):
|
|
|
185
175
|
|
|
186
176
|
response_data: Any = None
|
|
187
177
|
if utils.match_response(http_res, "200", "application/json"):
|
|
188
|
-
return
|
|
178
|
+
return unmarshal_json_response(models.SessionData, http_res)
|
|
189
179
|
if utils.match_response(http_res, "422", "application/json"):
|
|
190
|
-
response_data =
|
|
191
|
-
|
|
180
|
+
response_data = unmarshal_json_response(
|
|
181
|
+
errors.HTTPValidationErrorData, http_res
|
|
192
182
|
)
|
|
193
|
-
raise
|
|
183
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
194
184
|
if utils.match_response(http_res, "4XX", "*"):
|
|
195
185
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
196
|
-
raise
|
|
197
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
198
|
-
)
|
|
186
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
199
187
|
if utils.match_response(http_res, "5XX", "*"):
|
|
200
188
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
201
|
-
raise
|
|
202
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
203
|
-
)
|
|
189
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
204
190
|
|
|
205
|
-
|
|
206
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
207
|
-
raise models.APIError(
|
|
208
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
209
|
-
http_res.status_code,
|
|
210
|
-
http_res_text,
|
|
211
|
-
http_res,
|
|
212
|
-
)
|
|
191
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
213
192
|
|
|
214
193
|
def get_session_data_by_session_id(
|
|
215
194
|
self,
|
|
@@ -283,31 +262,20 @@ class SessionDebug(BaseSDK):
|
|
|
283
262
|
|
|
284
263
|
response_data: Any = None
|
|
285
264
|
if utils.match_response(http_res, "200", "application/json"):
|
|
286
|
-
return
|
|
265
|
+
return unmarshal_json_response(models.SessionData, http_res)
|
|
287
266
|
if utils.match_response(http_res, "422", "application/json"):
|
|
288
|
-
response_data =
|
|
289
|
-
|
|
267
|
+
response_data = unmarshal_json_response(
|
|
268
|
+
errors.HTTPValidationErrorData, http_res
|
|
290
269
|
)
|
|
291
|
-
raise
|
|
270
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
292
271
|
if utils.match_response(http_res, "4XX", "*"):
|
|
293
272
|
http_res_text = utils.stream_to_text(http_res)
|
|
294
|
-
raise
|
|
295
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
296
|
-
)
|
|
273
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
297
274
|
if utils.match_response(http_res, "5XX", "*"):
|
|
298
275
|
http_res_text = utils.stream_to_text(http_res)
|
|
299
|
-
raise
|
|
300
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
301
|
-
)
|
|
276
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
302
277
|
|
|
303
|
-
|
|
304
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
305
|
-
raise models.APIError(
|
|
306
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
307
|
-
http_res.status_code,
|
|
308
|
-
http_res_text,
|
|
309
|
-
http_res,
|
|
310
|
-
)
|
|
278
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
311
279
|
|
|
312
280
|
async def get_session_data_by_session_id_async(
|
|
313
281
|
self,
|
|
@@ -381,31 +349,20 @@ class SessionDebug(BaseSDK):
|
|
|
381
349
|
|
|
382
350
|
response_data: Any = None
|
|
383
351
|
if utils.match_response(http_res, "200", "application/json"):
|
|
384
|
-
return
|
|
352
|
+
return unmarshal_json_response(models.SessionData, http_res)
|
|
385
353
|
if utils.match_response(http_res, "422", "application/json"):
|
|
386
|
-
response_data =
|
|
387
|
-
|
|
354
|
+
response_data = unmarshal_json_response(
|
|
355
|
+
errors.HTTPValidationErrorData, http_res
|
|
388
356
|
)
|
|
389
|
-
raise
|
|
357
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
390
358
|
if utils.match_response(http_res, "4XX", "*"):
|
|
391
359
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
392
|
-
raise
|
|
393
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
394
|
-
)
|
|
360
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
395
361
|
if utils.match_response(http_res, "5XX", "*"):
|
|
396
362
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
397
|
-
raise
|
|
398
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
399
|
-
)
|
|
363
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
400
364
|
|
|
401
|
-
|
|
402
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
403
|
-
raise models.APIError(
|
|
404
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
405
|
-
http_res.status_code,
|
|
406
|
-
http_res_text,
|
|
407
|
-
http_res,
|
|
408
|
-
)
|
|
365
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
409
366
|
|
|
410
367
|
def get_session_tool_call_result_by_id(
|
|
411
368
|
self,
|
|
@@ -482,31 +439,20 @@ class SessionDebug(BaseSDK):
|
|
|
482
439
|
|
|
483
440
|
response_data: Any = None
|
|
484
441
|
if utils.match_response(http_res, "200", "application/json"):
|
|
485
|
-
return
|
|
442
|
+
return unmarshal_json_response(models.ToolResultData, http_res)
|
|
486
443
|
if utils.match_response(http_res, "422", "application/json"):
|
|
487
|
-
response_data =
|
|
488
|
-
|
|
444
|
+
response_data = unmarshal_json_response(
|
|
445
|
+
errors.HTTPValidationErrorData, http_res
|
|
489
446
|
)
|
|
490
|
-
raise
|
|
447
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
491
448
|
if utils.match_response(http_res, "4XX", "*"):
|
|
492
449
|
http_res_text = utils.stream_to_text(http_res)
|
|
493
|
-
raise
|
|
494
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
495
|
-
)
|
|
450
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
496
451
|
if utils.match_response(http_res, "5XX", "*"):
|
|
497
452
|
http_res_text = utils.stream_to_text(http_res)
|
|
498
|
-
raise
|
|
499
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
500
|
-
)
|
|
453
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
501
454
|
|
|
502
|
-
|
|
503
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
504
|
-
raise models.APIError(
|
|
505
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
506
|
-
http_res.status_code,
|
|
507
|
-
http_res_text,
|
|
508
|
-
http_res,
|
|
509
|
-
)
|
|
455
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
510
456
|
|
|
511
457
|
async def get_session_tool_call_result_by_id_async(
|
|
512
458
|
self,
|
|
@@ -583,28 +529,17 @@ class SessionDebug(BaseSDK):
|
|
|
583
529
|
|
|
584
530
|
response_data: Any = None
|
|
585
531
|
if utils.match_response(http_res, "200", "application/json"):
|
|
586
|
-
return
|
|
532
|
+
return unmarshal_json_response(models.ToolResultData, http_res)
|
|
587
533
|
if utils.match_response(http_res, "422", "application/json"):
|
|
588
|
-
response_data =
|
|
589
|
-
|
|
534
|
+
response_data = unmarshal_json_response(
|
|
535
|
+
errors.HTTPValidationErrorData, http_res
|
|
590
536
|
)
|
|
591
|
-
raise
|
|
537
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
592
538
|
if utils.match_response(http_res, "4XX", "*"):
|
|
593
539
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
594
|
-
raise
|
|
595
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
596
|
-
)
|
|
540
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
597
541
|
if utils.match_response(http_res, "5XX", "*"):
|
|
598
542
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
599
|
-
raise
|
|
600
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
601
|
-
)
|
|
543
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
602
544
|
|
|
603
|
-
|
|
604
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
605
|
-
raise models.APIError(
|
|
606
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
607
|
-
http_res.status_code,
|
|
608
|
-
http_res_text,
|
|
609
|
-
http_res,
|
|
610
|
-
)
|
|
545
|
+
raise errors.APIError("Unexpected response received", http_res)
|