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/test.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
|
|
@@ -88,31 +88,20 @@ class Test(BaseSDK):
|
|
|
88
88
|
|
|
89
89
|
response_data: Any = None
|
|
90
90
|
if utils.match_response(http_res, "200", "application/json"):
|
|
91
|
-
return utils.
|
|
91
|
+
return utils.unmarshal_json_response(models.TestMessageResponse, http_res)
|
|
92
92
|
if utils.match_response(http_res, "422", "application/json"):
|
|
93
|
-
response_data = utils.
|
|
94
|
-
|
|
93
|
+
response_data = utils.unmarshal_json_response(
|
|
94
|
+
errors.HTTPValidationErrorData, http_res
|
|
95
95
|
)
|
|
96
|
-
raise
|
|
96
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
97
97
|
if utils.match_response(http_res, "4XX", "*"):
|
|
98
98
|
http_res_text = utils.stream_to_text(http_res)
|
|
99
|
-
raise
|
|
100
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
101
|
-
)
|
|
99
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
100
|
if utils.match_response(http_res, "5XX", "*"):
|
|
103
101
|
http_res_text = utils.stream_to_text(http_res)
|
|
104
|
-
raise
|
|
105
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
106
|
-
)
|
|
102
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
107
103
|
|
|
108
|
-
|
|
109
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
110
|
-
raise models.APIError(
|
|
111
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
112
|
-
http_res.status_code,
|
|
113
|
-
http_res_text,
|
|
114
|
-
http_res,
|
|
115
|
-
)
|
|
104
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
116
105
|
|
|
117
106
|
async def send_test_message_async(
|
|
118
107
|
self,
|
|
@@ -191,28 +180,17 @@ class Test(BaseSDK):
|
|
|
191
180
|
|
|
192
181
|
response_data: Any = None
|
|
193
182
|
if utils.match_response(http_res, "200", "application/json"):
|
|
194
|
-
return utils.
|
|
183
|
+
return utils.unmarshal_json_response(models.TestMessageResponse, http_res)
|
|
195
184
|
if utils.match_response(http_res, "422", "application/json"):
|
|
196
|
-
response_data = utils.
|
|
197
|
-
|
|
185
|
+
response_data = utils.unmarshal_json_response(
|
|
186
|
+
errors.HTTPValidationErrorData, http_res
|
|
198
187
|
)
|
|
199
|
-
raise
|
|
188
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
200
189
|
if utils.match_response(http_res, "4XX", "*"):
|
|
201
190
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
202
|
-
raise
|
|
203
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
204
|
-
)
|
|
191
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
205
192
|
if utils.match_response(http_res, "5XX", "*"):
|
|
206
193
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
207
|
-
raise
|
|
208
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
209
|
-
)
|
|
194
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
210
195
|
|
|
211
|
-
|
|
212
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
213
|
-
raise models.APIError(
|
|
214
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
215
|
-
http_res.status_code,
|
|
216
|
-
http_res_text,
|
|
217
|
-
http_res,
|
|
218
|
-
)
|
|
196
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/tools.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from syllable_sdk import models, utils
|
|
4
|
+
from syllable_sdk import errors, models, utils
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
@@ -109,31 +109,22 @@ class Tools(BaseSDK):
|
|
|
109
109
|
|
|
110
110
|
response_data: Any = None
|
|
111
111
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return utils.
|
|
112
|
+
return utils.unmarshal_json_response(
|
|
113
|
+
models.ListResponseToolResponse, http_res
|
|
114
|
+
)
|
|
113
115
|
if utils.match_response(http_res, "422", "application/json"):
|
|
114
|
-
response_data = utils.
|
|
115
|
-
|
|
116
|
+
response_data = utils.unmarshal_json_response(
|
|
117
|
+
errors.HTTPValidationErrorData, http_res
|
|
116
118
|
)
|
|
117
|
-
raise
|
|
119
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
118
120
|
if utils.match_response(http_res, "4XX", "*"):
|
|
119
121
|
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
|
-
)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
123
123
|
if utils.match_response(http_res, "5XX", "*"):
|
|
124
124
|
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
|
-
)
|
|
125
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
128
126
|
|
|
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
|
-
)
|
|
127
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
137
128
|
|
|
138
129
|
async def list_async(
|
|
139
130
|
self,
|
|
@@ -233,31 +224,22 @@ class Tools(BaseSDK):
|
|
|
233
224
|
|
|
234
225
|
response_data: Any = None
|
|
235
226
|
if utils.match_response(http_res, "200", "application/json"):
|
|
236
|
-
return utils.
|
|
227
|
+
return utils.unmarshal_json_response(
|
|
228
|
+
models.ListResponseToolResponse, http_res
|
|
229
|
+
)
|
|
237
230
|
if utils.match_response(http_res, "422", "application/json"):
|
|
238
|
-
response_data = utils.
|
|
239
|
-
|
|
231
|
+
response_data = utils.unmarshal_json_response(
|
|
232
|
+
errors.HTTPValidationErrorData, http_res
|
|
240
233
|
)
|
|
241
|
-
raise
|
|
234
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
242
235
|
if utils.match_response(http_res, "4XX", "*"):
|
|
243
236
|
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
|
-
)
|
|
237
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
247
238
|
if utils.match_response(http_res, "5XX", "*"):
|
|
248
239
|
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
|
-
)
|
|
240
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
252
241
|
|
|
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
|
-
)
|
|
242
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
261
243
|
|
|
262
244
|
def create(
|
|
263
245
|
self,
|
|
@@ -336,31 +318,20 @@ class Tools(BaseSDK):
|
|
|
336
318
|
|
|
337
319
|
response_data: Any = None
|
|
338
320
|
if utils.match_response(http_res, "200", "application/json"):
|
|
339
|
-
return utils.
|
|
321
|
+
return utils.unmarshal_json_response(models.ToolResponse, http_res)
|
|
340
322
|
if utils.match_response(http_res, "422", "application/json"):
|
|
341
|
-
response_data = utils.
|
|
342
|
-
|
|
323
|
+
response_data = utils.unmarshal_json_response(
|
|
324
|
+
errors.HTTPValidationErrorData, http_res
|
|
343
325
|
)
|
|
344
|
-
raise
|
|
326
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
345
327
|
if utils.match_response(http_res, "4XX", "*"):
|
|
346
328
|
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
|
-
)
|
|
329
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
350
330
|
if utils.match_response(http_res, "5XX", "*"):
|
|
351
331
|
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
|
-
)
|
|
332
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
355
333
|
|
|
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
|
-
)
|
|
334
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
364
335
|
|
|
365
336
|
async def create_async(
|
|
366
337
|
self,
|
|
@@ -439,31 +410,20 @@ class Tools(BaseSDK):
|
|
|
439
410
|
|
|
440
411
|
response_data: Any = None
|
|
441
412
|
if utils.match_response(http_res, "200", "application/json"):
|
|
442
|
-
return utils.
|
|
413
|
+
return utils.unmarshal_json_response(models.ToolResponse, http_res)
|
|
443
414
|
if utils.match_response(http_res, "422", "application/json"):
|
|
444
|
-
response_data = utils.
|
|
445
|
-
|
|
415
|
+
response_data = utils.unmarshal_json_response(
|
|
416
|
+
errors.HTTPValidationErrorData, http_res
|
|
446
417
|
)
|
|
447
|
-
raise
|
|
418
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
448
419
|
if utils.match_response(http_res, "4XX", "*"):
|
|
449
420
|
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
|
-
)
|
|
421
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
453
422
|
if utils.match_response(http_res, "5XX", "*"):
|
|
454
423
|
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
|
-
)
|
|
424
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
458
425
|
|
|
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
|
-
)
|
|
426
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
467
427
|
|
|
468
428
|
def update(
|
|
469
429
|
self,
|
|
@@ -542,31 +502,20 @@ class Tools(BaseSDK):
|
|
|
542
502
|
|
|
543
503
|
response_data: Any = None
|
|
544
504
|
if utils.match_response(http_res, "200", "application/json"):
|
|
545
|
-
return utils.
|
|
505
|
+
return utils.unmarshal_json_response(models.ToolResponse, http_res)
|
|
546
506
|
if utils.match_response(http_res, "422", "application/json"):
|
|
547
|
-
response_data = utils.
|
|
548
|
-
|
|
507
|
+
response_data = utils.unmarshal_json_response(
|
|
508
|
+
errors.HTTPValidationErrorData, http_res
|
|
549
509
|
)
|
|
550
|
-
raise
|
|
510
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
551
511
|
if utils.match_response(http_res, "4XX", "*"):
|
|
552
512
|
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
|
-
)
|
|
513
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
556
514
|
if utils.match_response(http_res, "5XX", "*"):
|
|
557
515
|
http_res_text = utils.stream_to_text(http_res)
|
|
558
|
-
raise
|
|
559
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
560
|
-
)
|
|
516
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
561
517
|
|
|
562
|
-
|
|
563
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
564
|
-
raise models.APIError(
|
|
565
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
566
|
-
http_res.status_code,
|
|
567
|
-
http_res_text,
|
|
568
|
-
http_res,
|
|
569
|
-
)
|
|
518
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
570
519
|
|
|
571
520
|
async def update_async(
|
|
572
521
|
self,
|
|
@@ -645,31 +594,20 @@ class Tools(BaseSDK):
|
|
|
645
594
|
|
|
646
595
|
response_data: Any = None
|
|
647
596
|
if utils.match_response(http_res, "200", "application/json"):
|
|
648
|
-
return utils.
|
|
597
|
+
return utils.unmarshal_json_response(models.ToolResponse, http_res)
|
|
649
598
|
if utils.match_response(http_res, "422", "application/json"):
|
|
650
|
-
response_data = utils.
|
|
651
|
-
|
|
599
|
+
response_data = utils.unmarshal_json_response(
|
|
600
|
+
errors.HTTPValidationErrorData, http_res
|
|
652
601
|
)
|
|
653
|
-
raise
|
|
602
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
654
603
|
if utils.match_response(http_res, "4XX", "*"):
|
|
655
604
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
656
|
-
raise
|
|
657
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
658
|
-
)
|
|
605
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
659
606
|
if utils.match_response(http_res, "5XX", "*"):
|
|
660
607
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
661
|
-
raise
|
|
662
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
663
|
-
)
|
|
608
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
664
609
|
|
|
665
|
-
|
|
666
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
667
|
-
raise models.APIError(
|
|
668
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
669
|
-
http_res.status_code,
|
|
670
|
-
http_res_text,
|
|
671
|
-
http_res,
|
|
672
|
-
)
|
|
610
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
673
611
|
|
|
674
612
|
def get_by_name(
|
|
675
613
|
self,
|
|
@@ -745,31 +683,20 @@ class Tools(BaseSDK):
|
|
|
745
683
|
|
|
746
684
|
response_data: Any = None
|
|
747
685
|
if utils.match_response(http_res, "200", "application/json"):
|
|
748
|
-
return utils.
|
|
686
|
+
return utils.unmarshal_json_response(models.ToolDetailResponse, http_res)
|
|
749
687
|
if utils.match_response(http_res, "422", "application/json"):
|
|
750
|
-
response_data = utils.
|
|
751
|
-
|
|
688
|
+
response_data = utils.unmarshal_json_response(
|
|
689
|
+
errors.HTTPValidationErrorData, http_res
|
|
752
690
|
)
|
|
753
|
-
raise
|
|
691
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
754
692
|
if utils.match_response(http_res, "4XX", "*"):
|
|
755
693
|
http_res_text = utils.stream_to_text(http_res)
|
|
756
|
-
raise
|
|
757
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
758
|
-
)
|
|
694
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
759
695
|
if utils.match_response(http_res, "5XX", "*"):
|
|
760
696
|
http_res_text = utils.stream_to_text(http_res)
|
|
761
|
-
raise
|
|
762
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
763
|
-
)
|
|
697
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
764
698
|
|
|
765
|
-
|
|
766
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
767
|
-
raise models.APIError(
|
|
768
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
769
|
-
http_res.status_code,
|
|
770
|
-
http_res_text,
|
|
771
|
-
http_res,
|
|
772
|
-
)
|
|
699
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
773
700
|
|
|
774
701
|
async def get_by_name_async(
|
|
775
702
|
self,
|
|
@@ -845,31 +772,20 @@ class Tools(BaseSDK):
|
|
|
845
772
|
|
|
846
773
|
response_data: Any = None
|
|
847
774
|
if utils.match_response(http_res, "200", "application/json"):
|
|
848
|
-
return utils.
|
|
775
|
+
return utils.unmarshal_json_response(models.ToolDetailResponse, http_res)
|
|
849
776
|
if utils.match_response(http_res, "422", "application/json"):
|
|
850
|
-
response_data = utils.
|
|
851
|
-
|
|
777
|
+
response_data = utils.unmarshal_json_response(
|
|
778
|
+
errors.HTTPValidationErrorData, http_res
|
|
852
779
|
)
|
|
853
|
-
raise
|
|
780
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
854
781
|
if utils.match_response(http_res, "4XX", "*"):
|
|
855
782
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
856
|
-
raise
|
|
857
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
858
|
-
)
|
|
783
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
859
784
|
if utils.match_response(http_res, "5XX", "*"):
|
|
860
785
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
861
|
-
raise
|
|
862
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
863
|
-
)
|
|
786
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
864
787
|
|
|
865
|
-
|
|
866
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
867
|
-
raise models.APIError(
|
|
868
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
869
|
-
http_res.status_code,
|
|
870
|
-
http_res_text,
|
|
871
|
-
http_res,
|
|
872
|
-
)
|
|
788
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
873
789
|
|
|
874
790
|
def delete(
|
|
875
791
|
self,
|
|
@@ -948,31 +864,20 @@ class Tools(BaseSDK):
|
|
|
948
864
|
|
|
949
865
|
response_data: Any = None
|
|
950
866
|
if utils.match_response(http_res, "200", "application/json"):
|
|
951
|
-
return utils.
|
|
867
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
952
868
|
if utils.match_response(http_res, "422", "application/json"):
|
|
953
|
-
response_data = utils.
|
|
954
|
-
|
|
869
|
+
response_data = utils.unmarshal_json_response(
|
|
870
|
+
errors.HTTPValidationErrorData, http_res
|
|
955
871
|
)
|
|
956
|
-
raise
|
|
872
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
957
873
|
if utils.match_response(http_res, "4XX", "*"):
|
|
958
874
|
http_res_text = utils.stream_to_text(http_res)
|
|
959
|
-
raise
|
|
960
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
961
|
-
)
|
|
875
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
962
876
|
if utils.match_response(http_res, "5XX", "*"):
|
|
963
877
|
http_res_text = utils.stream_to_text(http_res)
|
|
964
|
-
raise
|
|
965
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
966
|
-
)
|
|
878
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
967
879
|
|
|
968
|
-
|
|
969
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
970
|
-
raise models.APIError(
|
|
971
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
972
|
-
http_res.status_code,
|
|
973
|
-
http_res_text,
|
|
974
|
-
http_res,
|
|
975
|
-
)
|
|
880
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
976
881
|
|
|
977
882
|
async def delete_async(
|
|
978
883
|
self,
|
|
@@ -1051,28 +956,17 @@ class Tools(BaseSDK):
|
|
|
1051
956
|
|
|
1052
957
|
response_data: Any = None
|
|
1053
958
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1054
|
-
return utils.
|
|
959
|
+
return utils.unmarshal_json_response(Any, http_res)
|
|
1055
960
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1056
|
-
response_data = utils.
|
|
1057
|
-
|
|
961
|
+
response_data = utils.unmarshal_json_response(
|
|
962
|
+
errors.HTTPValidationErrorData, http_res
|
|
1058
963
|
)
|
|
1059
|
-
raise
|
|
964
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1060
965
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1061
966
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1062
|
-
raise
|
|
1063
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1064
|
-
)
|
|
967
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1065
968
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1066
969
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1067
|
-
raise
|
|
1068
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1069
|
-
)
|
|
970
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1070
971
|
|
|
1071
|
-
|
|
1072
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1073
|
-
raise models.APIError(
|
|
1074
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1075
|
-
http_res.status_code,
|
|
1076
|
-
http_res_text,
|
|
1077
|
-
http_res,
|
|
1078
|
-
)
|
|
972
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/transcript.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
|
|
@@ -81,33 +81,22 @@ class Transcript(BaseSDK):
|
|
|
81
81
|
|
|
82
82
|
response_data: Any = None
|
|
83
83
|
if utils.match_response(http_res, "200", "application/json"):
|
|
84
|
-
return utils.
|
|
85
|
-
|
|
84
|
+
return utils.unmarshal_json_response(
|
|
85
|
+
models.SessionTranscriptionResponse, http_res
|
|
86
86
|
)
|
|
87
87
|
if utils.match_response(http_res, "422", "application/json"):
|
|
88
|
-
response_data = utils.
|
|
89
|
-
|
|
88
|
+
response_data = utils.unmarshal_json_response(
|
|
89
|
+
errors.HTTPValidationErrorData, http_res
|
|
90
90
|
)
|
|
91
|
-
raise
|
|
91
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
92
92
|
if utils.match_response(http_res, "4XX", "*"):
|
|
93
93
|
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
-
raise
|
|
95
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
96
|
-
)
|
|
94
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
97
95
|
if utils.match_response(http_res, "5XX", "*"):
|
|
98
96
|
http_res_text = utils.stream_to_text(http_res)
|
|
99
|
-
raise
|
|
100
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
101
|
-
)
|
|
97
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
98
|
|
|
103
|
-
|
|
104
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
105
|
-
raise models.APIError(
|
|
106
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
107
|
-
http_res.status_code,
|
|
108
|
-
http_res_text,
|
|
109
|
-
http_res,
|
|
110
|
-
)
|
|
99
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
111
100
|
|
|
112
101
|
async def get_by_id_async(
|
|
113
102
|
self,
|
|
@@ -181,30 +170,19 @@ class Transcript(BaseSDK):
|
|
|
181
170
|
|
|
182
171
|
response_data: Any = None
|
|
183
172
|
if utils.match_response(http_res, "200", "application/json"):
|
|
184
|
-
return utils.
|
|
185
|
-
|
|
173
|
+
return utils.unmarshal_json_response(
|
|
174
|
+
models.SessionTranscriptionResponse, http_res
|
|
186
175
|
)
|
|
187
176
|
if utils.match_response(http_res, "422", "application/json"):
|
|
188
|
-
response_data = utils.
|
|
189
|
-
|
|
177
|
+
response_data = utils.unmarshal_json_response(
|
|
178
|
+
errors.HTTPValidationErrorData, http_res
|
|
190
179
|
)
|
|
191
|
-
raise
|
|
180
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
192
181
|
if utils.match_response(http_res, "4XX", "*"):
|
|
193
182
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
194
|
-
raise
|
|
195
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
196
|
-
)
|
|
183
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
197
184
|
if utils.match_response(http_res, "5XX", "*"):
|
|
198
185
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
199
|
-
raise
|
|
200
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
201
|
-
)
|
|
186
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
202
187
|
|
|
203
|
-
|
|
204
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
205
|
-
raise models.APIError(
|
|
206
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
207
|
-
http_res.status_code,
|
|
208
|
-
http_res_text,
|
|
209
|
-
http_res,
|
|
210
|
-
)
|
|
188
|
+
raise errors.APIError("Unexpected response received", http_res)
|