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/twilio.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.numbers import Numbers
|
|
8
8
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
@@ -96,31 +96,20 @@ class Twilio(BaseSDK):
|
|
|
96
96
|
|
|
97
97
|
response_data: Any = None
|
|
98
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return utils.
|
|
99
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
100
100
|
if utils.match_response(http_res, "422", "application/json"):
|
|
101
|
-
response_data = utils.
|
|
102
|
-
|
|
101
|
+
response_data = utils.unmarshal_json_response(
|
|
102
|
+
errors.HTTPValidationErrorData, http_res
|
|
103
103
|
)
|
|
104
|
-
raise
|
|
104
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
105
105
|
if utils.match_response(http_res, "4XX", "*"):
|
|
106
106
|
http_res_text = utils.stream_to_text(http_res)
|
|
107
|
-
raise
|
|
108
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
109
|
-
)
|
|
107
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
110
108
|
if utils.match_response(http_res, "5XX", "*"):
|
|
111
109
|
http_res_text = utils.stream_to_text(http_res)
|
|
112
|
-
raise
|
|
113
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
114
|
-
)
|
|
110
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
115
111
|
|
|
116
|
-
|
|
117
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
-
raise models.APIError(
|
|
119
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
120
|
-
http_res.status_code,
|
|
121
|
-
http_res_text,
|
|
122
|
-
http_res,
|
|
123
|
-
)
|
|
112
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
124
113
|
|
|
125
114
|
async def get_by_id_async(
|
|
126
115
|
self,
|
|
@@ -194,31 +183,20 @@ class Twilio(BaseSDK):
|
|
|
194
183
|
|
|
195
184
|
response_data: Any = None
|
|
196
185
|
if utils.match_response(http_res, "200", "application/json"):
|
|
197
|
-
return utils.
|
|
186
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
198
187
|
if utils.match_response(http_res, "422", "application/json"):
|
|
199
|
-
response_data = utils.
|
|
200
|
-
|
|
188
|
+
response_data = utils.unmarshal_json_response(
|
|
189
|
+
errors.HTTPValidationErrorData, http_res
|
|
201
190
|
)
|
|
202
|
-
raise
|
|
191
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
203
192
|
if utils.match_response(http_res, "4XX", "*"):
|
|
204
193
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
205
|
-
raise
|
|
206
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
207
|
-
)
|
|
194
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
208
195
|
if utils.match_response(http_res, "5XX", "*"):
|
|
209
196
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
210
|
-
raise
|
|
211
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
212
|
-
)
|
|
197
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
213
198
|
|
|
214
|
-
|
|
215
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
216
|
-
raise models.APIError(
|
|
217
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
218
|
-
http_res.status_code,
|
|
219
|
-
http_res_text,
|
|
220
|
-
http_res,
|
|
221
|
-
)
|
|
199
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
222
200
|
|
|
223
201
|
def update(
|
|
224
202
|
self,
|
|
@@ -298,31 +276,20 @@ class Twilio(BaseSDK):
|
|
|
298
276
|
|
|
299
277
|
response_data: Any = None
|
|
300
278
|
if utils.match_response(http_res, "200", "application/json"):
|
|
301
|
-
return utils.
|
|
279
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
302
280
|
if utils.match_response(http_res, "422", "application/json"):
|
|
303
|
-
response_data = utils.
|
|
304
|
-
|
|
281
|
+
response_data = utils.unmarshal_json_response(
|
|
282
|
+
errors.HTTPValidationErrorData, http_res
|
|
305
283
|
)
|
|
306
|
-
raise
|
|
284
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
307
285
|
if utils.match_response(http_res, "4XX", "*"):
|
|
308
286
|
http_res_text = utils.stream_to_text(http_res)
|
|
309
|
-
raise
|
|
310
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
311
|
-
)
|
|
287
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
312
288
|
if utils.match_response(http_res, "5XX", "*"):
|
|
313
289
|
http_res_text = utils.stream_to_text(http_res)
|
|
314
|
-
raise
|
|
315
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
316
|
-
)
|
|
290
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
317
291
|
|
|
318
|
-
|
|
319
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
320
|
-
raise models.APIError(
|
|
321
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
322
|
-
http_res.status_code,
|
|
323
|
-
http_res_text,
|
|
324
|
-
http_res,
|
|
325
|
-
)
|
|
292
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
326
293
|
|
|
327
294
|
async def update_async(
|
|
328
295
|
self,
|
|
@@ -402,31 +369,20 @@ class Twilio(BaseSDK):
|
|
|
402
369
|
|
|
403
370
|
response_data: Any = None
|
|
404
371
|
if utils.match_response(http_res, "200", "application/json"):
|
|
405
|
-
return utils.
|
|
372
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
406
373
|
if utils.match_response(http_res, "422", "application/json"):
|
|
407
|
-
response_data = utils.
|
|
408
|
-
|
|
374
|
+
response_data = utils.unmarshal_json_response(
|
|
375
|
+
errors.HTTPValidationErrorData, http_res
|
|
409
376
|
)
|
|
410
|
-
raise
|
|
377
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
411
378
|
if utils.match_response(http_res, "4XX", "*"):
|
|
412
379
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
413
|
-
raise
|
|
414
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
415
|
-
)
|
|
380
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
416
381
|
if utils.match_response(http_res, "5XX", "*"):
|
|
417
382
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
418
|
-
raise
|
|
419
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
420
|
-
)
|
|
383
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
421
384
|
|
|
422
|
-
|
|
423
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
424
|
-
raise models.APIError(
|
|
425
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
426
|
-
http_res.status_code,
|
|
427
|
-
http_res_text,
|
|
428
|
-
http_res,
|
|
429
|
-
)
|
|
385
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
430
386
|
|
|
431
387
|
def create(
|
|
432
388
|
self,
|
|
@@ -506,31 +462,20 @@ class Twilio(BaseSDK):
|
|
|
506
462
|
|
|
507
463
|
response_data: Any = None
|
|
508
464
|
if utils.match_response(http_res, "200", "application/json"):
|
|
509
|
-
return utils.
|
|
465
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
510
466
|
if utils.match_response(http_res, "422", "application/json"):
|
|
511
|
-
response_data = utils.
|
|
512
|
-
|
|
467
|
+
response_data = utils.unmarshal_json_response(
|
|
468
|
+
errors.HTTPValidationErrorData, http_res
|
|
513
469
|
)
|
|
514
|
-
raise
|
|
470
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
515
471
|
if utils.match_response(http_res, "4XX", "*"):
|
|
516
472
|
http_res_text = utils.stream_to_text(http_res)
|
|
517
|
-
raise
|
|
518
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
519
|
-
)
|
|
473
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
520
474
|
if utils.match_response(http_res, "5XX", "*"):
|
|
521
475
|
http_res_text = utils.stream_to_text(http_res)
|
|
522
|
-
raise
|
|
523
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
524
|
-
)
|
|
476
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
525
477
|
|
|
526
|
-
|
|
527
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
528
|
-
raise models.APIError(
|
|
529
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
530
|
-
http_res.status_code,
|
|
531
|
-
http_res_text,
|
|
532
|
-
http_res,
|
|
533
|
-
)
|
|
478
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
534
479
|
|
|
535
480
|
async def create_async(
|
|
536
481
|
self,
|
|
@@ -610,28 +555,17 @@ class Twilio(BaseSDK):
|
|
|
610
555
|
|
|
611
556
|
response_data: Any = None
|
|
612
557
|
if utils.match_response(http_res, "200", "application/json"):
|
|
613
|
-
return utils.
|
|
558
|
+
return utils.unmarshal_json_response(models.Channel, http_res)
|
|
614
559
|
if utils.match_response(http_res, "422", "application/json"):
|
|
615
|
-
response_data = utils.
|
|
616
|
-
|
|
560
|
+
response_data = utils.unmarshal_json_response(
|
|
561
|
+
errors.HTTPValidationErrorData, http_res
|
|
617
562
|
)
|
|
618
|
-
raise
|
|
563
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
619
564
|
if utils.match_response(http_res, "4XX", "*"):
|
|
620
565
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
621
|
-
raise
|
|
622
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
623
|
-
)
|
|
566
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
624
567
|
if utils.match_response(http_res, "5XX", "*"):
|
|
625
568
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
626
|
-
raise
|
|
627
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
628
|
-
)
|
|
569
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
629
570
|
|
|
630
|
-
|
|
631
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
632
|
-
raise models.APIError(
|
|
633
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
634
|
-
http_res.status_code,
|
|
635
|
-
http_res_text,
|
|
636
|
-
http_res,
|
|
637
|
-
)
|
|
571
|
+
raise errors.APIError("Unexpected response received", http_res)
|