syllable-sdk 0.35.27__py3-none-any.whl → 0.35.31__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.
Files changed (51) hide show
  1. syllable_sdk/_version.py +3 -3
  2. syllable_sdk/agents.py +210 -82
  3. syllable_sdk/basesdk.py +4 -4
  4. syllable_sdk/batches.py +328 -130
  5. syllable_sdk/campaigns.py +182 -72
  6. syllable_sdk/channels.py +72 -28
  7. syllable_sdk/conversations.py +36 -18
  8. syllable_sdk/custom_messages.py +182 -72
  9. syllable_sdk/dashboards.py +194 -66
  10. syllable_sdk/data_sources.py +182 -84
  11. syllable_sdk/events.py +36 -14
  12. syllable_sdk/folders.py +292 -120
  13. syllable_sdk/full_summary.py +36 -18
  14. syllable_sdk/incidents.py +214 -82
  15. syllable_sdk/insights_sdk.py +38 -16
  16. syllable_sdk/insights_tools.py +250 -96
  17. syllable_sdk/language_groups.py +214 -84
  18. syllable_sdk/latency.py +36 -18
  19. syllable_sdk/models/__init__.py +6 -19
  20. syllable_sdk/models/apierror.py +14 -30
  21. syllable_sdk/models/dialogtoolcall.py +37 -1
  22. syllable_sdk/models/httpvalidationerror.py +6 -11
  23. syllable_sdk/models/testmessageresponse.py +38 -15
  24. syllable_sdk/models/tooldefinition.py +10 -2
  25. syllable_sdk/models/tooloptions.py +20 -0
  26. syllable_sdk/numbers.py +110 -52
  27. syllable_sdk/organizations.py +138 -50
  28. syllable_sdk/permissions.py +32 -10
  29. syllable_sdk/prompts.py +248 -94
  30. syllable_sdk/roles.py +180 -74
  31. syllable_sdk/services.py +182 -72
  32. syllable_sdk/session_debug.py +108 -42
  33. syllable_sdk/session_labels.py +108 -46
  34. syllable_sdk/sessions.py +140 -58
  35. syllable_sdk/takeouts.py +98 -34
  36. syllable_sdk/targets.py +184 -74
  37. syllable_sdk/test.py +36 -14
  38. syllable_sdk/tools.py +180 -74
  39. syllable_sdk/transcript.py +38 -16
  40. syllable_sdk/twilio.py +108 -42
  41. syllable_sdk/users.py +246 -96
  42. syllable_sdk/utils/__init__.py +0 -3
  43. syllable_sdk/utils/serializers.py +3 -21
  44. syllable_sdk/v1.py +246 -96
  45. syllable_sdk/workflows.py +290 -114
  46. {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/METADATA +24 -44
  47. {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/RECORD +48 -50
  48. syllable_sdk/models/no_response_error.py +0 -13
  49. syllable_sdk/models/responsevalidationerror.py +0 -25
  50. syllable_sdk/models/syllablesdkerror.py +0 -26
  51. {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/WHEEL +0 -0
@@ -113,22 +113,33 @@ class Dashboards(BaseSDK):
113
113
 
114
114
  response_data: Any = None
115
115
  if utils.match_response(http_res, "200", "application/json"):
116
- return utils.unmarshal_json_response(
117
- models.ListResponseDashboardResponse, http_res
116
+ return utils.unmarshal_json(
117
+ http_res.text, models.ListResponseDashboardResponse
118
118
  )
119
119
  if utils.match_response(http_res, "422", "application/json"):
120
- response_data = utils.unmarshal_json_response(
121
- models.HTTPValidationErrorData, http_res
120
+ response_data = utils.unmarshal_json(
121
+ http_res.text, models.HTTPValidationErrorData
122
122
  )
123
- raise models.HTTPValidationError(response_data, http_res)
123
+ raise models.HTTPValidationError(data=response_data)
124
124
  if utils.match_response(http_res, "4XX", "*"):
125
125
  http_res_text = utils.stream_to_text(http_res)
126
- raise models.APIError("API error occurred", http_res, http_res_text)
126
+ raise models.APIError(
127
+ "API error occurred", http_res.status_code, http_res_text, http_res
128
+ )
127
129
  if utils.match_response(http_res, "5XX", "*"):
128
130
  http_res_text = utils.stream_to_text(http_res)
129
- raise models.APIError("API error occurred", http_res, http_res_text)
131
+ raise models.APIError(
132
+ "API error occurred", http_res.status_code, http_res_text, http_res
133
+ )
130
134
 
131
- raise models.APIError("Unexpected response received", http_res)
135
+ content_type = http_res.headers.get("Content-Type")
136
+ http_res_text = utils.stream_to_text(http_res)
137
+ raise models.APIError(
138
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
139
+ http_res.status_code,
140
+ http_res_text,
141
+ http_res,
142
+ )
132
143
 
133
144
  async def post_list_dashboard_async(
134
145
  self,
@@ -231,22 +242,33 @@ class Dashboards(BaseSDK):
231
242
 
232
243
  response_data: Any = None
233
244
  if utils.match_response(http_res, "200", "application/json"):
234
- return utils.unmarshal_json_response(
235
- models.ListResponseDashboardResponse, http_res
245
+ return utils.unmarshal_json(
246
+ http_res.text, models.ListResponseDashboardResponse
236
247
  )
237
248
  if utils.match_response(http_res, "422", "application/json"):
238
- response_data = utils.unmarshal_json_response(
239
- models.HTTPValidationErrorData, http_res
249
+ response_data = utils.unmarshal_json(
250
+ http_res.text, models.HTTPValidationErrorData
240
251
  )
241
- raise models.HTTPValidationError(response_data, http_res)
252
+ raise models.HTTPValidationError(data=response_data)
242
253
  if utils.match_response(http_res, "4XX", "*"):
243
254
  http_res_text = await utils.stream_to_text_async(http_res)
244
- raise models.APIError("API error occurred", http_res, http_res_text)
255
+ raise models.APIError(
256
+ "API error occurred", http_res.status_code, http_res_text, http_res
257
+ )
245
258
  if utils.match_response(http_res, "5XX", "*"):
246
259
  http_res_text = await utils.stream_to_text_async(http_res)
247
- raise models.APIError("API error occurred", http_res, http_res_text)
260
+ raise models.APIError(
261
+ "API error occurred", http_res.status_code, http_res_text, http_res
262
+ )
248
263
 
249
- raise models.APIError("Unexpected response received", http_res)
264
+ content_type = http_res.headers.get("Content-Type")
265
+ http_res_text = await utils.stream_to_text_async(http_res)
266
+ raise models.APIError(
267
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
268
+ http_res.status_code,
269
+ http_res_text,
270
+ http_res,
271
+ )
250
272
 
251
273
  def post_get_dashboard(
252
274
  self,
@@ -325,22 +347,31 @@ class Dashboards(BaseSDK):
325
347
 
326
348
  response_data: Any = None
327
349
  if utils.match_response(http_res, "200", "application/json"):
328
- return utils.unmarshal_json_response(
329
- models.DashboardTokenResponse, http_res
330
- )
350
+ return utils.unmarshal_json(http_res.text, models.DashboardTokenResponse)
331
351
  if utils.match_response(http_res, "422", "application/json"):
332
- response_data = utils.unmarshal_json_response(
333
- models.HTTPValidationErrorData, http_res
352
+ response_data = utils.unmarshal_json(
353
+ http_res.text, models.HTTPValidationErrorData
334
354
  )
335
- raise models.HTTPValidationError(response_data, http_res)
355
+ raise models.HTTPValidationError(data=response_data)
336
356
  if utils.match_response(http_res, "4XX", "*"):
337
357
  http_res_text = utils.stream_to_text(http_res)
338
- raise models.APIError("API error occurred", http_res, http_res_text)
358
+ raise models.APIError(
359
+ "API error occurred", http_res.status_code, http_res_text, http_res
360
+ )
339
361
  if utils.match_response(http_res, "5XX", "*"):
340
362
  http_res_text = utils.stream_to_text(http_res)
341
- raise models.APIError("API error occurred", http_res, http_res_text)
363
+ raise models.APIError(
364
+ "API error occurred", http_res.status_code, http_res_text, http_res
365
+ )
342
366
 
343
- raise models.APIError("Unexpected response received", http_res)
367
+ content_type = http_res.headers.get("Content-Type")
368
+ http_res_text = utils.stream_to_text(http_res)
369
+ raise models.APIError(
370
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
371
+ http_res.status_code,
372
+ http_res_text,
373
+ http_res,
374
+ )
344
375
 
345
376
  async def post_get_dashboard_async(
346
377
  self,
@@ -419,22 +450,31 @@ class Dashboards(BaseSDK):
419
450
 
420
451
  response_data: Any = None
421
452
  if utils.match_response(http_res, "200", "application/json"):
422
- return utils.unmarshal_json_response(
423
- models.DashboardTokenResponse, http_res
424
- )
453
+ return utils.unmarshal_json(http_res.text, models.DashboardTokenResponse)
425
454
  if utils.match_response(http_res, "422", "application/json"):
426
- response_data = utils.unmarshal_json_response(
427
- models.HTTPValidationErrorData, http_res
455
+ response_data = utils.unmarshal_json(
456
+ http_res.text, models.HTTPValidationErrorData
428
457
  )
429
- raise models.HTTPValidationError(response_data, http_res)
458
+ raise models.HTTPValidationError(data=response_data)
430
459
  if utils.match_response(http_res, "4XX", "*"):
431
460
  http_res_text = await utils.stream_to_text_async(http_res)
432
- raise models.APIError("API error occurred", http_res, http_res_text)
461
+ raise models.APIError(
462
+ "API error occurred", http_res.status_code, http_res_text, http_res
463
+ )
433
464
  if utils.match_response(http_res, "5XX", "*"):
434
465
  http_res_text = await utils.stream_to_text_async(http_res)
435
- raise models.APIError("API error occurred", http_res, http_res_text)
466
+ raise models.APIError(
467
+ "API error occurred", http_res.status_code, http_res_text, http_res
468
+ )
436
469
 
437
- raise models.APIError("Unexpected response received", http_res)
470
+ content_type = http_res.headers.get("Content-Type")
471
+ http_res_text = await utils.stream_to_text_async(http_res)
472
+ raise models.APIError(
473
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
474
+ http_res.status_code,
475
+ http_res_text,
476
+ http_res,
477
+ )
438
478
 
439
479
  @deprecated(
440
480
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -509,15 +549,26 @@ class Dashboards(BaseSDK):
509
549
  )
510
550
 
511
551
  if utils.match_response(http_res, "200", "application/json"):
512
- return utils.unmarshal_json_response(models.Dashboard, http_res)
552
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
513
553
  if utils.match_response(http_res, "4XX", "*"):
514
554
  http_res_text = utils.stream_to_text(http_res)
515
- raise models.APIError("API error occurred", http_res, http_res_text)
555
+ raise models.APIError(
556
+ "API error occurred", http_res.status_code, http_res_text, http_res
557
+ )
516
558
  if utils.match_response(http_res, "5XX", "*"):
517
559
  http_res_text = utils.stream_to_text(http_res)
518
- raise models.APIError("API error occurred", http_res, http_res_text)
560
+ raise models.APIError(
561
+ "API error occurred", http_res.status_code, http_res_text, http_res
562
+ )
519
563
 
520
- raise models.APIError("Unexpected response received", http_res)
564
+ content_type = http_res.headers.get("Content-Type")
565
+ http_res_text = utils.stream_to_text(http_res)
566
+ raise models.APIError(
567
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
568
+ http_res.status_code,
569
+ http_res_text,
570
+ http_res,
571
+ )
521
572
 
522
573
  @deprecated(
523
574
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -592,15 +643,26 @@ class Dashboards(BaseSDK):
592
643
  )
593
644
 
594
645
  if utils.match_response(http_res, "200", "application/json"):
595
- return utils.unmarshal_json_response(models.Dashboard, http_res)
646
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
596
647
  if utils.match_response(http_res, "4XX", "*"):
597
648
  http_res_text = await utils.stream_to_text_async(http_res)
598
- raise models.APIError("API error occurred", http_res, http_res_text)
649
+ raise models.APIError(
650
+ "API error occurred", http_res.status_code, http_res_text, http_res
651
+ )
599
652
  if utils.match_response(http_res, "5XX", "*"):
600
653
  http_res_text = await utils.stream_to_text_async(http_res)
601
- raise models.APIError("API error occurred", http_res, http_res_text)
654
+ raise models.APIError(
655
+ "API error occurred", http_res.status_code, http_res_text, http_res
656
+ )
602
657
 
603
- raise models.APIError("Unexpected response received", http_res)
658
+ content_type = http_res.headers.get("Content-Type")
659
+ http_res_text = await utils.stream_to_text_async(http_res)
660
+ raise models.APIError(
661
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
662
+ http_res.status_code,
663
+ http_res_text,
664
+ http_res,
665
+ )
604
666
 
605
667
  @deprecated(
606
668
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -675,15 +737,26 @@ class Dashboards(BaseSDK):
675
737
  )
676
738
 
677
739
  if utils.match_response(http_res, "200", "application/json"):
678
- return utils.unmarshal_json_response(models.Dashboard, http_res)
740
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
679
741
  if utils.match_response(http_res, "4XX", "*"):
680
742
  http_res_text = utils.stream_to_text(http_res)
681
- raise models.APIError("API error occurred", http_res, http_res_text)
743
+ raise models.APIError(
744
+ "API error occurred", http_res.status_code, http_res_text, http_res
745
+ )
682
746
  if utils.match_response(http_res, "5XX", "*"):
683
747
  http_res_text = utils.stream_to_text(http_res)
684
- raise models.APIError("API error occurred", http_res, http_res_text)
748
+ raise models.APIError(
749
+ "API error occurred", http_res.status_code, http_res_text, http_res
750
+ )
685
751
 
686
- raise models.APIError("Unexpected response received", http_res)
752
+ content_type = http_res.headers.get("Content-Type")
753
+ http_res_text = utils.stream_to_text(http_res)
754
+ raise models.APIError(
755
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
756
+ http_res.status_code,
757
+ http_res_text,
758
+ http_res,
759
+ )
687
760
 
688
761
  @deprecated(
689
762
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -758,15 +831,26 @@ class Dashboards(BaseSDK):
758
831
  )
759
832
 
760
833
  if utils.match_response(http_res, "200", "application/json"):
761
- return utils.unmarshal_json_response(models.Dashboard, http_res)
834
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
762
835
  if utils.match_response(http_res, "4XX", "*"):
763
836
  http_res_text = await utils.stream_to_text_async(http_res)
764
- raise models.APIError("API error occurred", http_res, http_res_text)
837
+ raise models.APIError(
838
+ "API error occurred", http_res.status_code, http_res_text, http_res
839
+ )
765
840
  if utils.match_response(http_res, "5XX", "*"):
766
841
  http_res_text = await utils.stream_to_text_async(http_res)
767
- raise models.APIError("API error occurred", http_res, http_res_text)
842
+ raise models.APIError(
843
+ "API error occurred", http_res.status_code, http_res_text, http_res
844
+ )
768
845
 
769
- raise models.APIError("Unexpected response received", http_res)
846
+ content_type = http_res.headers.get("Content-Type")
847
+ http_res_text = await utils.stream_to_text_async(http_res)
848
+ raise models.APIError(
849
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
850
+ http_res.status_code,
851
+ http_res_text,
852
+ http_res,
853
+ )
770
854
 
771
855
  @deprecated(
772
856
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -841,15 +925,26 @@ class Dashboards(BaseSDK):
841
925
  )
842
926
 
843
927
  if utils.match_response(http_res, "200", "application/json"):
844
- return utils.unmarshal_json_response(models.Dashboard, http_res)
928
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
845
929
  if utils.match_response(http_res, "4XX", "*"):
846
930
  http_res_text = utils.stream_to_text(http_res)
847
- raise models.APIError("API error occurred", http_res, http_res_text)
931
+ raise models.APIError(
932
+ "API error occurred", http_res.status_code, http_res_text, http_res
933
+ )
848
934
  if utils.match_response(http_res, "5XX", "*"):
849
935
  http_res_text = utils.stream_to_text(http_res)
850
- raise models.APIError("API error occurred", http_res, http_res_text)
936
+ raise models.APIError(
937
+ "API error occurred", http_res.status_code, http_res_text, http_res
938
+ )
851
939
 
852
- raise models.APIError("Unexpected response received", http_res)
940
+ content_type = http_res.headers.get("Content-Type")
941
+ http_res_text = utils.stream_to_text(http_res)
942
+ raise models.APIError(
943
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
944
+ http_res.status_code,
945
+ http_res_text,
946
+ http_res,
947
+ )
853
948
 
854
949
  @deprecated(
855
950
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -924,15 +1019,26 @@ class Dashboards(BaseSDK):
924
1019
  )
925
1020
 
926
1021
  if utils.match_response(http_res, "200", "application/json"):
927
- return utils.unmarshal_json_response(models.Dashboard, http_res)
1022
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
928
1023
  if utils.match_response(http_res, "4XX", "*"):
929
1024
  http_res_text = await utils.stream_to_text_async(http_res)
930
- raise models.APIError("API error occurred", http_res, http_res_text)
1025
+ raise models.APIError(
1026
+ "API error occurred", http_res.status_code, http_res_text, http_res
1027
+ )
931
1028
  if utils.match_response(http_res, "5XX", "*"):
932
1029
  http_res_text = await utils.stream_to_text_async(http_res)
933
- raise models.APIError("API error occurred", http_res, http_res_text)
1030
+ raise models.APIError(
1031
+ "API error occurred", http_res.status_code, http_res_text, http_res
1032
+ )
934
1033
 
935
- raise models.APIError("Unexpected response received", http_res)
1034
+ content_type = http_res.headers.get("Content-Type")
1035
+ http_res_text = await utils.stream_to_text_async(http_res)
1036
+ raise models.APIError(
1037
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1038
+ http_res.status_code,
1039
+ http_res_text,
1040
+ http_res,
1041
+ )
936
1042
 
937
1043
  @deprecated(
938
1044
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -1007,15 +1113,26 @@ class Dashboards(BaseSDK):
1007
1113
  )
1008
1114
 
1009
1115
  if utils.match_response(http_res, "200", "application/json"):
1010
- return utils.unmarshal_json_response(models.Dashboard, http_res)
1116
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
1011
1117
  if utils.match_response(http_res, "4XX", "*"):
1012
1118
  http_res_text = utils.stream_to_text(http_res)
1013
- raise models.APIError("API error occurred", http_res, http_res_text)
1119
+ raise models.APIError(
1120
+ "API error occurred", http_res.status_code, http_res_text, http_res
1121
+ )
1014
1122
  if utils.match_response(http_res, "5XX", "*"):
1015
1123
  http_res_text = utils.stream_to_text(http_res)
1016
- raise models.APIError("API error occurred", http_res, http_res_text)
1124
+ raise models.APIError(
1125
+ "API error occurred", http_res.status_code, http_res_text, http_res
1126
+ )
1017
1127
 
1018
- raise models.APIError("Unexpected response received", http_res)
1128
+ content_type = http_res.headers.get("Content-Type")
1129
+ http_res_text = utils.stream_to_text(http_res)
1130
+ raise models.APIError(
1131
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1132
+ http_res.status_code,
1133
+ http_res_text,
1134
+ http_res,
1135
+ )
1019
1136
 
1020
1137
  @deprecated(
1021
1138
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -1090,12 +1207,23 @@ class Dashboards(BaseSDK):
1090
1207
  )
1091
1208
 
1092
1209
  if utils.match_response(http_res, "200", "application/json"):
1093
- return utils.unmarshal_json_response(models.Dashboard, http_res)
1210
+ return utils.unmarshal_json(http_res.text, models.Dashboard)
1094
1211
  if utils.match_response(http_res, "4XX", "*"):
1095
1212
  http_res_text = await utils.stream_to_text_async(http_res)
1096
- raise models.APIError("API error occurred", http_res, http_res_text)
1213
+ raise models.APIError(
1214
+ "API error occurred", http_res.status_code, http_res_text, http_res
1215
+ )
1097
1216
  if utils.match_response(http_res, "5XX", "*"):
1098
1217
  http_res_text = await utils.stream_to_text_async(http_res)
1099
- raise models.APIError("API error occurred", http_res, http_res_text)
1218
+ raise models.APIError(
1219
+ "API error occurred", http_res.status_code, http_res_text, http_res
1220
+ )
1100
1221
 
1101
- raise models.APIError("Unexpected response received", http_res)
1222
+ content_type = http_res.headers.get("Content-Type")
1223
+ http_res_text = await utils.stream_to_text_async(http_res)
1224
+ raise models.APIError(
1225
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1226
+ http_res.status_code,
1227
+ http_res_text,
1228
+ http_res,
1229
+ )