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.
- syllable_sdk/_version.py +3 -3
- syllable_sdk/agents.py +210 -82
- syllable_sdk/basesdk.py +4 -4
- syllable_sdk/batches.py +328 -130
- syllable_sdk/campaigns.py +182 -72
- syllable_sdk/channels.py +72 -28
- syllable_sdk/conversations.py +36 -18
- syllable_sdk/custom_messages.py +182 -72
- syllable_sdk/dashboards.py +194 -66
- syllable_sdk/data_sources.py +182 -84
- syllable_sdk/events.py +36 -14
- syllable_sdk/folders.py +292 -120
- syllable_sdk/full_summary.py +36 -18
- syllable_sdk/incidents.py +214 -82
- syllable_sdk/insights_sdk.py +38 -16
- syllable_sdk/insights_tools.py +250 -96
- syllable_sdk/language_groups.py +214 -84
- syllable_sdk/latency.py +36 -18
- syllable_sdk/models/__init__.py +6 -19
- syllable_sdk/models/apierror.py +14 -30
- syllable_sdk/models/dialogtoolcall.py +37 -1
- syllable_sdk/models/httpvalidationerror.py +6 -11
- syllable_sdk/models/testmessageresponse.py +38 -15
- syllable_sdk/models/tooldefinition.py +10 -2
- syllable_sdk/models/tooloptions.py +20 -0
- syllable_sdk/numbers.py +110 -52
- syllable_sdk/organizations.py +138 -50
- syllable_sdk/permissions.py +32 -10
- syllable_sdk/prompts.py +248 -94
- syllable_sdk/roles.py +180 -74
- syllable_sdk/services.py +182 -72
- syllable_sdk/session_debug.py +108 -42
- syllable_sdk/session_labels.py +108 -46
- syllable_sdk/sessions.py +140 -58
- syllable_sdk/takeouts.py +98 -34
- syllable_sdk/targets.py +184 -74
- syllable_sdk/test.py +36 -14
- syllable_sdk/tools.py +180 -74
- syllable_sdk/transcript.py +38 -16
- syllable_sdk/twilio.py +108 -42
- syllable_sdk/users.py +246 -96
- syllable_sdk/utils/__init__.py +0 -3
- syllable_sdk/utils/serializers.py +3 -21
- syllable_sdk/v1.py +246 -96
- syllable_sdk/workflows.py +290 -114
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/METADATA +24 -44
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/RECORD +48 -50
- syllable_sdk/models/no_response_error.py +0 -13
- syllable_sdk/models/responsevalidationerror.py +0 -25
- syllable_sdk/models/syllablesdkerror.py +0 -26
- {syllable_sdk-0.35.27.dist-info → syllable_sdk-0.35.31.dist-info}/WHEEL +0 -0
syllable_sdk/dashboards.py
CHANGED
|
@@ -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.
|
|
117
|
-
models.ListResponseDashboardResponse
|
|
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.
|
|
121
|
-
models.HTTPValidationErrorData
|
|
120
|
+
response_data = utils.unmarshal_json(
|
|
121
|
+
http_res.text, models.HTTPValidationErrorData
|
|
122
122
|
)
|
|
123
|
-
raise models.HTTPValidationError(response_data
|
|
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(
|
|
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(
|
|
131
|
+
raise models.APIError(
|
|
132
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
133
|
+
)
|
|
130
134
|
|
|
131
|
-
|
|
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.
|
|
235
|
-
models.ListResponseDashboardResponse
|
|
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.
|
|
239
|
-
models.HTTPValidationErrorData
|
|
249
|
+
response_data = utils.unmarshal_json(
|
|
250
|
+
http_res.text, models.HTTPValidationErrorData
|
|
240
251
|
)
|
|
241
|
-
raise models.HTTPValidationError(response_data
|
|
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(
|
|
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(
|
|
260
|
+
raise models.APIError(
|
|
261
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
262
|
+
)
|
|
248
263
|
|
|
249
|
-
|
|
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.
|
|
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.
|
|
333
|
-
models.HTTPValidationErrorData
|
|
352
|
+
response_data = utils.unmarshal_json(
|
|
353
|
+
http_res.text, models.HTTPValidationErrorData
|
|
334
354
|
)
|
|
335
|
-
raise models.HTTPValidationError(response_data
|
|
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(
|
|
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(
|
|
363
|
+
raise models.APIError(
|
|
364
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
365
|
+
)
|
|
342
366
|
|
|
343
|
-
|
|
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.
|
|
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.
|
|
427
|
-
models.HTTPValidationErrorData
|
|
455
|
+
response_data = utils.unmarshal_json(
|
|
456
|
+
http_res.text, models.HTTPValidationErrorData
|
|
428
457
|
)
|
|
429
|
-
raise models.HTTPValidationError(response_data
|
|
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(
|
|
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(
|
|
466
|
+
raise models.APIError(
|
|
467
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
468
|
+
)
|
|
436
469
|
|
|
437
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
560
|
+
raise models.APIError(
|
|
561
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
562
|
+
)
|
|
519
563
|
|
|
520
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
654
|
+
raise models.APIError(
|
|
655
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
656
|
+
)
|
|
602
657
|
|
|
603
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
748
|
+
raise models.APIError(
|
|
749
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
750
|
+
)
|
|
685
751
|
|
|
686
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
842
|
+
raise models.APIError(
|
|
843
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
844
|
+
)
|
|
768
845
|
|
|
769
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
936
|
+
raise models.APIError(
|
|
937
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
938
|
+
)
|
|
851
939
|
|
|
852
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
1030
|
+
raise models.APIError(
|
|
1031
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1032
|
+
)
|
|
934
1033
|
|
|
935
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
1124
|
+
raise models.APIError(
|
|
1125
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1126
|
+
)
|
|
1017
1127
|
|
|
1018
|
-
|
|
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.
|
|
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(
|
|
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(
|
|
1218
|
+
raise models.APIError(
|
|
1219
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1220
|
+
)
|
|
1100
1221
|
|
|
1101
|
-
|
|
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
|
+
)
|