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/conversations.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, List, Mapping, Optional
|
|
9
10
|
|
|
10
11
|
|
|
@@ -107,31 +108,20 @@ class Conversations(BaseSDK):
|
|
|
107
108
|
|
|
108
109
|
response_data: Any = None
|
|
109
110
|
if utils.match_response(http_res, "200", "application/json"):
|
|
110
|
-
return
|
|
111
|
+
return unmarshal_json_response(models.ListResponseConversation, http_res)
|
|
111
112
|
if utils.match_response(http_res, "422", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
|
|
113
|
+
response_data = unmarshal_json_response(
|
|
114
|
+
errors.HTTPValidationErrorData, http_res
|
|
114
115
|
)
|
|
115
|
-
raise
|
|
116
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
116
117
|
if utils.match_response(http_res, "4XX", "*"):
|
|
117
118
|
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
-
raise
|
|
119
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
120
|
-
)
|
|
119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
121
120
|
if utils.match_response(http_res, "5XX", "*"):
|
|
122
121
|
http_res_text = utils.stream_to_text(http_res)
|
|
123
|
-
raise
|
|
124
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
125
|
-
)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
129
|
-
raise models.APIError(
|
|
130
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
131
|
-
http_res.status_code,
|
|
132
|
-
http_res_text,
|
|
133
|
-
http_res,
|
|
134
|
-
)
|
|
124
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
135
125
|
|
|
136
126
|
async def list_async(
|
|
137
127
|
self,
|
|
@@ -229,28 +219,17 @@ class Conversations(BaseSDK):
|
|
|
229
219
|
|
|
230
220
|
response_data: Any = None
|
|
231
221
|
if utils.match_response(http_res, "200", "application/json"):
|
|
232
|
-
return
|
|
222
|
+
return unmarshal_json_response(models.ListResponseConversation, http_res)
|
|
233
223
|
if utils.match_response(http_res, "422", "application/json"):
|
|
234
|
-
response_data =
|
|
235
|
-
|
|
224
|
+
response_data = unmarshal_json_response(
|
|
225
|
+
errors.HTTPValidationErrorData, http_res
|
|
236
226
|
)
|
|
237
|
-
raise
|
|
227
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
238
228
|
if utils.match_response(http_res, "4XX", "*"):
|
|
239
229
|
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
|
-
)
|
|
230
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
243
231
|
if utils.match_response(http_res, "5XX", "*"):
|
|
244
232
|
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
|
-
)
|
|
233
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
248
234
|
|
|
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
|
-
)
|
|
235
|
+
raise errors.APIError("Unexpected response received", http_res)
|
syllable_sdk/custom_messages.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,22 @@ class CustomMessages(BaseSDK):
|
|
|
109
110
|
|
|
110
111
|
response_data: Any = None
|
|
111
112
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return
|
|
113
|
-
|
|
113
|
+
return unmarshal_json_response(
|
|
114
|
+
models.ListResponseCustomMessageResponse, http_res
|
|
114
115
|
)
|
|
115
116
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data =
|
|
117
|
-
|
|
117
|
+
response_data = unmarshal_json_response(
|
|
118
|
+
errors.HTTPValidationErrorData, http_res
|
|
118
119
|
)
|
|
119
|
-
raise
|
|
120
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
120
121
|
if utils.match_response(http_res, "4XX", "*"):
|
|
121
122
|
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
|
-
)
|
|
123
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
125
124
|
if utils.match_response(http_res, "5XX", "*"):
|
|
126
125
|
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
|
-
)
|
|
126
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
130
127
|
|
|
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
|
-
)
|
|
128
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
139
129
|
|
|
140
130
|
async def list_async(
|
|
141
131
|
self,
|
|
@@ -235,33 +225,22 @@ class CustomMessages(BaseSDK):
|
|
|
235
225
|
|
|
236
226
|
response_data: Any = None
|
|
237
227
|
if utils.match_response(http_res, "200", "application/json"):
|
|
238
|
-
return
|
|
239
|
-
|
|
228
|
+
return unmarshal_json_response(
|
|
229
|
+
models.ListResponseCustomMessageResponse, http_res
|
|
240
230
|
)
|
|
241
231
|
if utils.match_response(http_res, "422", "application/json"):
|
|
242
|
-
response_data =
|
|
243
|
-
|
|
232
|
+
response_data = unmarshal_json_response(
|
|
233
|
+
errors.HTTPValidationErrorData, http_res
|
|
244
234
|
)
|
|
245
|
-
raise
|
|
235
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
246
236
|
if utils.match_response(http_res, "4XX", "*"):
|
|
247
237
|
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
|
-
)
|
|
238
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
251
239
|
if utils.match_response(http_res, "5XX", "*"):
|
|
252
240
|
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
|
-
)
|
|
241
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
256
242
|
|
|
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
|
-
)
|
|
243
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
265
244
|
|
|
266
245
|
def create(
|
|
267
246
|
self,
|
|
@@ -343,31 +322,20 @@ class CustomMessages(BaseSDK):
|
|
|
343
322
|
|
|
344
323
|
response_data: Any = None
|
|
345
324
|
if utils.match_response(http_res, "200", "application/json"):
|
|
346
|
-
return
|
|
325
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
347
326
|
if utils.match_response(http_res, "422", "application/json"):
|
|
348
|
-
response_data =
|
|
349
|
-
|
|
327
|
+
response_data = unmarshal_json_response(
|
|
328
|
+
errors.HTTPValidationErrorData, http_res
|
|
350
329
|
)
|
|
351
|
-
raise
|
|
330
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
352
331
|
if utils.match_response(http_res, "4XX", "*"):
|
|
353
332
|
http_res_text = utils.stream_to_text(http_res)
|
|
354
|
-
raise
|
|
355
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
356
|
-
)
|
|
333
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
357
334
|
if utils.match_response(http_res, "5XX", "*"):
|
|
358
335
|
http_res_text = utils.stream_to_text(http_res)
|
|
359
|
-
raise
|
|
360
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
361
|
-
)
|
|
336
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
362
337
|
|
|
363
|
-
|
|
364
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
365
|
-
raise models.APIError(
|
|
366
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
367
|
-
http_res.status_code,
|
|
368
|
-
http_res_text,
|
|
369
|
-
http_res,
|
|
370
|
-
)
|
|
338
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
371
339
|
|
|
372
340
|
async def create_async(
|
|
373
341
|
self,
|
|
@@ -449,31 +417,20 @@ class CustomMessages(BaseSDK):
|
|
|
449
417
|
|
|
450
418
|
response_data: Any = None
|
|
451
419
|
if utils.match_response(http_res, "200", "application/json"):
|
|
452
|
-
return
|
|
420
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
453
421
|
if utils.match_response(http_res, "422", "application/json"):
|
|
454
|
-
response_data =
|
|
455
|
-
|
|
422
|
+
response_data = unmarshal_json_response(
|
|
423
|
+
errors.HTTPValidationErrorData, http_res
|
|
456
424
|
)
|
|
457
|
-
raise
|
|
425
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
458
426
|
if utils.match_response(http_res, "4XX", "*"):
|
|
459
427
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
460
|
-
raise
|
|
461
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
462
|
-
)
|
|
428
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
463
429
|
if utils.match_response(http_res, "5XX", "*"):
|
|
464
430
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
465
|
-
raise
|
|
466
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
467
|
-
)
|
|
431
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
468
432
|
|
|
469
|
-
|
|
470
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
471
|
-
raise models.APIError(
|
|
472
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
473
|
-
http_res.status_code,
|
|
474
|
-
http_res_text,
|
|
475
|
-
http_res,
|
|
476
|
-
)
|
|
433
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
477
434
|
|
|
478
435
|
def update(
|
|
479
436
|
self,
|
|
@@ -555,31 +512,20 @@ class CustomMessages(BaseSDK):
|
|
|
555
512
|
|
|
556
513
|
response_data: Any = None
|
|
557
514
|
if utils.match_response(http_res, "200", "application/json"):
|
|
558
|
-
return
|
|
515
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
559
516
|
if utils.match_response(http_res, "422", "application/json"):
|
|
560
|
-
response_data =
|
|
561
|
-
|
|
517
|
+
response_data = unmarshal_json_response(
|
|
518
|
+
errors.HTTPValidationErrorData, http_res
|
|
562
519
|
)
|
|
563
|
-
raise
|
|
520
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
564
521
|
if utils.match_response(http_res, "4XX", "*"):
|
|
565
522
|
http_res_text = utils.stream_to_text(http_res)
|
|
566
|
-
raise
|
|
567
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
568
|
-
)
|
|
523
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
569
524
|
if utils.match_response(http_res, "5XX", "*"):
|
|
570
525
|
http_res_text = utils.stream_to_text(http_res)
|
|
571
|
-
raise
|
|
572
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
573
|
-
)
|
|
526
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
574
527
|
|
|
575
|
-
|
|
576
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
577
|
-
raise models.APIError(
|
|
578
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
579
|
-
http_res.status_code,
|
|
580
|
-
http_res_text,
|
|
581
|
-
http_res,
|
|
582
|
-
)
|
|
528
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
583
529
|
|
|
584
530
|
async def update_async(
|
|
585
531
|
self,
|
|
@@ -661,31 +607,20 @@ class CustomMessages(BaseSDK):
|
|
|
661
607
|
|
|
662
608
|
response_data: Any = None
|
|
663
609
|
if utils.match_response(http_res, "200", "application/json"):
|
|
664
|
-
return
|
|
610
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
665
611
|
if utils.match_response(http_res, "422", "application/json"):
|
|
666
|
-
response_data =
|
|
667
|
-
|
|
612
|
+
response_data = unmarshal_json_response(
|
|
613
|
+
errors.HTTPValidationErrorData, http_res
|
|
668
614
|
)
|
|
669
|
-
raise
|
|
615
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
670
616
|
if utils.match_response(http_res, "4XX", "*"):
|
|
671
617
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
672
|
-
raise
|
|
673
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
674
|
-
)
|
|
618
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
675
619
|
if utils.match_response(http_res, "5XX", "*"):
|
|
676
620
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
677
|
-
raise
|
|
678
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
679
|
-
)
|
|
621
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
680
622
|
|
|
681
|
-
|
|
682
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
683
|
-
raise models.APIError(
|
|
684
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
685
|
-
http_res.status_code,
|
|
686
|
-
http_res_text,
|
|
687
|
-
http_res,
|
|
688
|
-
)
|
|
623
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
689
624
|
|
|
690
625
|
def get_by_id(
|
|
691
626
|
self,
|
|
@@ -761,31 +696,20 @@ class CustomMessages(BaseSDK):
|
|
|
761
696
|
|
|
762
697
|
response_data: Any = None
|
|
763
698
|
if utils.match_response(http_res, "200", "application/json"):
|
|
764
|
-
return
|
|
699
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
765
700
|
if utils.match_response(http_res, "422", "application/json"):
|
|
766
|
-
response_data =
|
|
767
|
-
|
|
701
|
+
response_data = unmarshal_json_response(
|
|
702
|
+
errors.HTTPValidationErrorData, http_res
|
|
768
703
|
)
|
|
769
|
-
raise
|
|
704
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
770
705
|
if utils.match_response(http_res, "4XX", "*"):
|
|
771
706
|
http_res_text = utils.stream_to_text(http_res)
|
|
772
|
-
raise
|
|
773
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
774
|
-
)
|
|
707
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
775
708
|
if utils.match_response(http_res, "5XX", "*"):
|
|
776
709
|
http_res_text = utils.stream_to_text(http_res)
|
|
777
|
-
raise
|
|
778
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
779
|
-
)
|
|
710
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
780
711
|
|
|
781
|
-
|
|
782
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
783
|
-
raise models.APIError(
|
|
784
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
785
|
-
http_res.status_code,
|
|
786
|
-
http_res_text,
|
|
787
|
-
http_res,
|
|
788
|
-
)
|
|
712
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
789
713
|
|
|
790
714
|
async def get_by_id_async(
|
|
791
715
|
self,
|
|
@@ -861,31 +785,20 @@ class CustomMessages(BaseSDK):
|
|
|
861
785
|
|
|
862
786
|
response_data: Any = None
|
|
863
787
|
if utils.match_response(http_res, "200", "application/json"):
|
|
864
|
-
return
|
|
788
|
+
return unmarshal_json_response(models.CustomMessageResponse, http_res)
|
|
865
789
|
if utils.match_response(http_res, "422", "application/json"):
|
|
866
|
-
response_data =
|
|
867
|
-
|
|
790
|
+
response_data = unmarshal_json_response(
|
|
791
|
+
errors.HTTPValidationErrorData, http_res
|
|
868
792
|
)
|
|
869
|
-
raise
|
|
793
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
870
794
|
if utils.match_response(http_res, "4XX", "*"):
|
|
871
795
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
872
|
-
raise
|
|
873
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
874
|
-
)
|
|
796
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
875
797
|
if utils.match_response(http_res, "5XX", "*"):
|
|
876
798
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
877
|
-
raise
|
|
878
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
879
|
-
)
|
|
799
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
880
800
|
|
|
881
|
-
|
|
882
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
883
|
-
raise models.APIError(
|
|
884
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
885
|
-
http_res.status_code,
|
|
886
|
-
http_res_text,
|
|
887
|
-
http_res,
|
|
888
|
-
)
|
|
801
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
889
802
|
|
|
890
803
|
def delete(
|
|
891
804
|
self,
|
|
@@ -964,31 +877,20 @@ class CustomMessages(BaseSDK):
|
|
|
964
877
|
|
|
965
878
|
response_data: Any = None
|
|
966
879
|
if utils.match_response(http_res, "200", "application/json"):
|
|
967
|
-
return
|
|
880
|
+
return unmarshal_json_response(Any, http_res)
|
|
968
881
|
if utils.match_response(http_res, "422", "application/json"):
|
|
969
|
-
response_data =
|
|
970
|
-
|
|
882
|
+
response_data = unmarshal_json_response(
|
|
883
|
+
errors.HTTPValidationErrorData, http_res
|
|
971
884
|
)
|
|
972
|
-
raise
|
|
885
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
973
886
|
if utils.match_response(http_res, "4XX", "*"):
|
|
974
887
|
http_res_text = utils.stream_to_text(http_res)
|
|
975
|
-
raise
|
|
976
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
977
|
-
)
|
|
888
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
978
889
|
if utils.match_response(http_res, "5XX", "*"):
|
|
979
890
|
http_res_text = utils.stream_to_text(http_res)
|
|
980
|
-
raise
|
|
981
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
982
|
-
)
|
|
891
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
983
892
|
|
|
984
|
-
|
|
985
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
986
|
-
raise models.APIError(
|
|
987
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
988
|
-
http_res.status_code,
|
|
989
|
-
http_res_text,
|
|
990
|
-
http_res,
|
|
991
|
-
)
|
|
893
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
992
894
|
|
|
993
895
|
async def delete_async(
|
|
994
896
|
self,
|
|
@@ -1067,28 +969,17 @@ class CustomMessages(BaseSDK):
|
|
|
1067
969
|
|
|
1068
970
|
response_data: Any = None
|
|
1069
971
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1070
|
-
return
|
|
972
|
+
return unmarshal_json_response(Any, http_res)
|
|
1071
973
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1072
|
-
response_data =
|
|
1073
|
-
|
|
974
|
+
response_data = unmarshal_json_response(
|
|
975
|
+
errors.HTTPValidationErrorData, http_res
|
|
1074
976
|
)
|
|
1075
|
-
raise
|
|
977
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1076
978
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1077
979
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1078
|
-
raise
|
|
1079
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1080
|
-
)
|
|
980
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1081
981
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1082
982
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1083
|
-
raise
|
|
1084
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1085
|
-
)
|
|
983
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1086
984
|
|
|
1087
|
-
|
|
1088
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1089
|
-
raise models.APIError(
|
|
1090
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1091
|
-
http_res.status_code,
|
|
1092
|
-
http_res_text,
|
|
1093
|
-
http_res,
|
|
1094
|
-
)
|
|
985
|
+
raise errors.APIError("Unexpected response received", http_res)
|