syllable-sdk 0.35.33__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.
Files changed (41) hide show
  1. syllable_sdk/_version.py +3 -3
  2. syllable_sdk/agents.py +23 -26
  3. syllable_sdk/batches.py +37 -36
  4. syllable_sdk/campaigns.py +21 -20
  5. syllable_sdk/channels.py +9 -8
  6. syllable_sdk/conversations.py +5 -8
  7. syllable_sdk/custom_messages.py +21 -20
  8. syllable_sdk/dashboards.py +17 -20
  9. syllable_sdk/data_sources.py +21 -32
  10. syllable_sdk/events.py +5 -4
  11. syllable_sdk/folders.py +33 -40
  12. syllable_sdk/full_summary.py +5 -8
  13. syllable_sdk/incidents.py +23 -22
  14. syllable_sdk/insights_sdk.py +5 -8
  15. syllable_sdk/insights_tools.py +27 -30
  16. syllable_sdk/language_groups.py +23 -22
  17. syllable_sdk/latency.py +5 -8
  18. syllable_sdk/numbers.py +13 -24
  19. syllable_sdk/organizations.py +15 -14
  20. syllable_sdk/permissions.py +3 -2
  21. syllable_sdk/prompts.py +27 -30
  22. syllable_sdk/roles.py +21 -24
  23. syllable_sdk/services.py +21 -24
  24. syllable_sdk/session_debug.py +13 -12
  25. syllable_sdk/session_labels.py +13 -16
  26. syllable_sdk/sessions.py +15 -18
  27. syllable_sdk/takeouts.py +9 -8
  28. syllable_sdk/targets.py +21 -24
  29. syllable_sdk/test.py +5 -4
  30. syllable_sdk/tools.py +21 -24
  31. syllable_sdk/transcript.py +5 -4
  32. syllable_sdk/twilio.py +13 -12
  33. syllable_sdk/users.py +27 -30
  34. syllable_sdk/utils/__init__.py +0 -3
  35. syllable_sdk/utils/serializers.py +1 -18
  36. syllable_sdk/utils/unmarshal_json_response.py +24 -0
  37. syllable_sdk/v1.py +27 -30
  38. syllable_sdk/workflows.py +33 -32
  39. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.34.dist-info}/METADATA +1 -1
  40. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.34.dist-info}/RECORD +41 -40
  41. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.34.dist-info}/WHEEL +0 -0
syllable_sdk/numbers.py CHANGED
@@ -5,6 +5,7 @@ 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, Mapping, Optional, Union
9
10
 
10
11
 
@@ -99,11 +100,9 @@ class Numbers(BaseSDK):
99
100
 
100
101
  response_data: Any = None
101
102
  if utils.match_response(http_res, "200", "application/json"):
102
- return utils.unmarshal_json_response(
103
- models.TwilioNumberAddResponse, http_res
104
- )
103
+ return unmarshal_json_response(models.TwilioNumberAddResponse, http_res)
105
104
  if utils.match_response(http_res, "422", "application/json"):
106
- response_data = utils.unmarshal_json_response(
105
+ response_data = unmarshal_json_response(
107
106
  errors.HTTPValidationErrorData, http_res
108
107
  )
109
108
  raise errors.HTTPValidationError(response_data, http_res)
@@ -204,11 +203,9 @@ class Numbers(BaseSDK):
204
203
 
205
204
  response_data: Any = None
206
205
  if utils.match_response(http_res, "200", "application/json"):
207
- return utils.unmarshal_json_response(
208
- models.TwilioNumberAddResponse, http_res
209
- )
206
+ return unmarshal_json_response(models.TwilioNumberAddResponse, http_res)
210
207
  if utils.match_response(http_res, "422", "application/json"):
211
- response_data = utils.unmarshal_json_response(
208
+ response_data = unmarshal_json_response(
212
209
  errors.HTTPValidationErrorData, http_res
213
210
  )
214
211
  raise errors.HTTPValidationError(response_data, http_res)
@@ -309,11 +306,9 @@ class Numbers(BaseSDK):
309
306
 
310
307
  response_data: Any = None
311
308
  if utils.match_response(http_res, "200", "application/json"):
312
- return utils.unmarshal_json_response(
313
- models.TwilioNumberUpdateResponse, http_res
314
- )
309
+ return unmarshal_json_response(models.TwilioNumberUpdateResponse, http_res)
315
310
  if utils.match_response(http_res, "422", "application/json"):
316
- response_data = utils.unmarshal_json_response(
311
+ response_data = unmarshal_json_response(
317
312
  errors.HTTPValidationErrorData, http_res
318
313
  )
319
314
  raise errors.HTTPValidationError(response_data, http_res)
@@ -414,11 +409,9 @@ class Numbers(BaseSDK):
414
409
 
415
410
  response_data: Any = None
416
411
  if utils.match_response(http_res, "200", "application/json"):
417
- return utils.unmarshal_json_response(
418
- models.TwilioNumberUpdateResponse, http_res
419
- )
412
+ return unmarshal_json_response(models.TwilioNumberUpdateResponse, http_res)
420
413
  if utils.match_response(http_res, "422", "application/json"):
421
- response_data = utils.unmarshal_json_response(
414
+ response_data = unmarshal_json_response(
422
415
  errors.HTTPValidationErrorData, http_res
423
416
  )
424
417
  raise errors.HTTPValidationError(response_data, http_res)
@@ -505,11 +498,9 @@ class Numbers(BaseSDK):
505
498
 
506
499
  response_data: Any = None
507
500
  if utils.match_response(http_res, "200", "application/json"):
508
- return utils.unmarshal_json_response(
509
- models.TwilioListNumbersResponse, http_res
510
- )
501
+ return unmarshal_json_response(models.TwilioListNumbersResponse, http_res)
511
502
  if utils.match_response(http_res, "422", "application/json"):
512
- response_data = utils.unmarshal_json_response(
503
+ response_data = unmarshal_json_response(
513
504
  errors.HTTPValidationErrorData, http_res
514
505
  )
515
506
  raise errors.HTTPValidationError(response_data, http_res)
@@ -596,11 +587,9 @@ class Numbers(BaseSDK):
596
587
 
597
588
  response_data: Any = None
598
589
  if utils.match_response(http_res, "200", "application/json"):
599
- return utils.unmarshal_json_response(
600
- models.TwilioListNumbersResponse, http_res
601
- )
590
+ return unmarshal_json_response(models.TwilioListNumbersResponse, http_res)
602
591
  if utils.match_response(http_res, "422", "application/json"):
603
- response_data = utils.unmarshal_json_response(
592
+ response_data = unmarshal_json_response(
604
593
  errors.HTTPValidationErrorData, http_res
605
594
  )
606
595
  raise errors.HTTPValidationError(response_data, http_res)
@@ -5,6 +5,7 @@ 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, Mapping, Optional, Union, cast
9
10
 
10
11
 
@@ -77,7 +78,7 @@ class Organizations(BaseSDK):
77
78
  )
78
79
 
79
80
  if utils.match_response(http_res, "200", "application/json"):
80
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
81
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
81
82
  if utils.match_response(http_res, "4XX", "*"):
82
83
  http_res_text = utils.stream_to_text(http_res)
83
84
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -153,7 +154,7 @@ class Organizations(BaseSDK):
153
154
  )
154
155
 
155
156
  if utils.match_response(http_res, "200", "application/json"):
156
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
157
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
157
158
  if utils.match_response(http_res, "4XX", "*"):
158
159
  http_res_text = await utils.stream_to_text_async(http_res)
159
160
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -242,9 +243,9 @@ class Organizations(BaseSDK):
242
243
 
243
244
  response_data: Any = None
244
245
  if utils.match_response(http_res, "200", "application/json"):
245
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
246
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
246
247
  if utils.match_response(http_res, "422", "application/json"):
247
- response_data = utils.unmarshal_json_response(
248
+ response_data = unmarshal_json_response(
248
249
  errors.HTTPValidationErrorData, http_res
249
250
  )
250
251
  raise errors.HTTPValidationError(response_data, http_res)
@@ -336,9 +337,9 @@ class Organizations(BaseSDK):
336
337
 
337
338
  response_data: Any = None
338
339
  if utils.match_response(http_res, "200", "application/json"):
339
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
340
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
340
341
  if utils.match_response(http_res, "422", "application/json"):
341
- response_data = utils.unmarshal_json_response(
342
+ response_data = unmarshal_json_response(
342
343
  errors.HTTPValidationErrorData, http_res
343
344
  )
344
345
  raise errors.HTTPValidationError(response_data, http_res)
@@ -430,9 +431,9 @@ class Organizations(BaseSDK):
430
431
 
431
432
  response_data: Any = None
432
433
  if utils.match_response(http_res, "200", "application/json"):
433
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
434
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
434
435
  if utils.match_response(http_res, "422", "application/json"):
435
- response_data = utils.unmarshal_json_response(
436
+ response_data = unmarshal_json_response(
436
437
  errors.HTTPValidationErrorData, http_res
437
438
  )
438
439
  raise errors.HTTPValidationError(response_data, http_res)
@@ -524,9 +525,9 @@ class Organizations(BaseSDK):
524
525
 
525
526
  response_data: Any = None
526
527
  if utils.match_response(http_res, "200", "application/json"):
527
- return utils.unmarshal_json_response(models.OrganizationResponse, http_res)
528
+ return unmarshal_json_response(models.OrganizationResponse, http_res)
528
529
  if utils.match_response(http_res, "422", "application/json"):
529
- response_data = utils.unmarshal_json_response(
530
+ response_data = unmarshal_json_response(
530
531
  errors.HTTPValidationErrorData, http_res
531
532
  )
532
533
  raise errors.HTTPValidationError(response_data, http_res)
@@ -620,9 +621,9 @@ class Organizations(BaseSDK):
620
621
 
621
622
  response_data: Any = None
622
623
  if utils.match_response(http_res, "200", "application/json"):
623
- return utils.unmarshal_json_response(Any, http_res)
624
+ return unmarshal_json_response(Any, http_res)
624
625
  if utils.match_response(http_res, "422", "application/json"):
625
- response_data = utils.unmarshal_json_response(
626
+ response_data = unmarshal_json_response(
626
627
  errors.HTTPValidationErrorData, http_res
627
628
  )
628
629
  raise errors.HTTPValidationError(response_data, http_res)
@@ -716,9 +717,9 @@ class Organizations(BaseSDK):
716
717
 
717
718
  response_data: Any = None
718
719
  if utils.match_response(http_res, "200", "application/json"):
719
- return utils.unmarshal_json_response(Any, http_res)
720
+ return unmarshal_json_response(Any, http_res)
720
721
  if utils.match_response(http_res, "422", "application/json"):
721
- response_data = utils.unmarshal_json_response(
722
+ response_data = unmarshal_json_response(
722
723
  errors.HTTPValidationErrorData, http_res
723
724
  )
724
725
  raise errors.HTTPValidationError(response_data, http_res)
@@ -5,6 +5,7 @@ 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 List, Mapping, Optional
9
10
 
10
11
 
@@ -77,7 +78,7 @@ class Permissions(BaseSDK):
77
78
  )
78
79
 
79
80
  if utils.match_response(http_res, "200", "application/json"):
80
- return utils.unmarshal_json_response(
81
+ return unmarshal_json_response(
81
82
  List[models.PermissionGroupResponse], http_res
82
83
  )
83
84
  if utils.match_response(http_res, "4XX", "*"):
@@ -155,7 +156,7 @@ class Permissions(BaseSDK):
155
156
  )
156
157
 
157
158
  if utils.match_response(http_res, "200", "application/json"):
158
- return utils.unmarshal_json_response(
159
+ return unmarshal_json_response(
159
160
  List[models.PermissionGroupResponse], http_res
160
161
  )
161
162
  if utils.match_response(http_res, "4XX", "*"):
syllable_sdk/prompts.py CHANGED
@@ -5,6 +5,7 @@ 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,11 +110,9 @@ class Prompts(BaseSDK):
109
110
 
110
111
  response_data: Any = None
111
112
  if utils.match_response(http_res, "200", "application/json"):
112
- return utils.unmarshal_json_response(
113
- models.ListResponsePromptResponse, http_res
114
- )
113
+ return unmarshal_json_response(models.ListResponsePromptResponse, http_res)
115
114
  if utils.match_response(http_res, "422", "application/json"):
116
- response_data = utils.unmarshal_json_response(
115
+ response_data = unmarshal_json_response(
117
116
  errors.HTTPValidationErrorData, http_res
118
117
  )
119
118
  raise errors.HTTPValidationError(response_data, http_res)
@@ -224,11 +223,9 @@ class Prompts(BaseSDK):
224
223
 
225
224
  response_data: Any = None
226
225
  if utils.match_response(http_res, "200", "application/json"):
227
- return utils.unmarshal_json_response(
228
- models.ListResponsePromptResponse, http_res
229
- )
226
+ return unmarshal_json_response(models.ListResponsePromptResponse, http_res)
230
227
  if utils.match_response(http_res, "422", "application/json"):
231
- response_data = utils.unmarshal_json_response(
228
+ response_data = unmarshal_json_response(
232
229
  errors.HTTPValidationErrorData, http_res
233
230
  )
234
231
  raise errors.HTTPValidationError(response_data, http_res)
@@ -318,9 +315,9 @@ class Prompts(BaseSDK):
318
315
 
319
316
  response_data: Any = None
320
317
  if utils.match_response(http_res, "200", "application/json"):
321
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
318
+ return unmarshal_json_response(models.PromptResponse, http_res)
322
319
  if utils.match_response(http_res, "422", "application/json"):
323
- response_data = utils.unmarshal_json_response(
320
+ response_data = unmarshal_json_response(
324
321
  errors.HTTPValidationErrorData, http_res
325
322
  )
326
323
  raise errors.HTTPValidationError(response_data, http_res)
@@ -410,9 +407,9 @@ class Prompts(BaseSDK):
410
407
 
411
408
  response_data: Any = None
412
409
  if utils.match_response(http_res, "200", "application/json"):
413
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
410
+ return unmarshal_json_response(models.PromptResponse, http_res)
414
411
  if utils.match_response(http_res, "422", "application/json"):
415
- response_data = utils.unmarshal_json_response(
412
+ response_data = unmarshal_json_response(
416
413
  errors.HTTPValidationErrorData, http_res
417
414
  )
418
415
  raise errors.HTTPValidationError(response_data, http_res)
@@ -502,9 +499,9 @@ class Prompts(BaseSDK):
502
499
 
503
500
  response_data: Any = None
504
501
  if utils.match_response(http_res, "200", "application/json"):
505
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
502
+ return unmarshal_json_response(models.PromptResponse, http_res)
506
503
  if utils.match_response(http_res, "422", "application/json"):
507
- response_data = utils.unmarshal_json_response(
504
+ response_data = unmarshal_json_response(
508
505
  errors.HTTPValidationErrorData, http_res
509
506
  )
510
507
  raise errors.HTTPValidationError(response_data, http_res)
@@ -594,9 +591,9 @@ class Prompts(BaseSDK):
594
591
 
595
592
  response_data: Any = None
596
593
  if utils.match_response(http_res, "200", "application/json"):
597
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
594
+ return unmarshal_json_response(models.PromptResponse, http_res)
598
595
  if utils.match_response(http_res, "422", "application/json"):
599
- response_data = utils.unmarshal_json_response(
596
+ response_data = unmarshal_json_response(
600
597
  errors.HTTPValidationErrorData, http_res
601
598
  )
602
599
  raise errors.HTTPValidationError(response_data, http_res)
@@ -683,9 +680,9 @@ class Prompts(BaseSDK):
683
680
 
684
681
  response_data: Any = None
685
682
  if utils.match_response(http_res, "200", "application/json"):
686
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
683
+ return unmarshal_json_response(models.PromptResponse, http_res)
687
684
  if utils.match_response(http_res, "422", "application/json"):
688
- response_data = utils.unmarshal_json_response(
685
+ response_data = unmarshal_json_response(
689
686
  errors.HTTPValidationErrorData, http_res
690
687
  )
691
688
  raise errors.HTTPValidationError(response_data, http_res)
@@ -772,9 +769,9 @@ class Prompts(BaseSDK):
772
769
 
773
770
  response_data: Any = None
774
771
  if utils.match_response(http_res, "200", "application/json"):
775
- return utils.unmarshal_json_response(models.PromptResponse, http_res)
772
+ return unmarshal_json_response(models.PromptResponse, http_res)
776
773
  if utils.match_response(http_res, "422", "application/json"):
777
- response_data = utils.unmarshal_json_response(
774
+ response_data = unmarshal_json_response(
778
775
  errors.HTTPValidationErrorData, http_res
779
776
  )
780
777
  raise errors.HTTPValidationError(response_data, http_res)
@@ -864,9 +861,9 @@ class Prompts(BaseSDK):
864
861
 
865
862
  response_data: Any = None
866
863
  if utils.match_response(http_res, "200", "application/json"):
867
- return utils.unmarshal_json_response(Any, http_res)
864
+ return unmarshal_json_response(Any, http_res)
868
865
  if utils.match_response(http_res, "422", "application/json"):
869
- response_data = utils.unmarshal_json_response(
866
+ response_data = unmarshal_json_response(
870
867
  errors.HTTPValidationErrorData, http_res
871
868
  )
872
869
  raise errors.HTTPValidationError(response_data, http_res)
@@ -956,9 +953,9 @@ class Prompts(BaseSDK):
956
953
 
957
954
  response_data: Any = None
958
955
  if utils.match_response(http_res, "200", "application/json"):
959
- return utils.unmarshal_json_response(Any, http_res)
956
+ return unmarshal_json_response(Any, http_res)
960
957
  if utils.match_response(http_res, "422", "application/json"):
961
- response_data = utils.unmarshal_json_response(
958
+ response_data = unmarshal_json_response(
962
959
  errors.HTTPValidationErrorData, http_res
963
960
  )
964
961
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1045,9 +1042,9 @@ class Prompts(BaseSDK):
1045
1042
 
1046
1043
  response_data: Any = None
1047
1044
  if utils.match_response(http_res, "200", "application/json"):
1048
- return utils.unmarshal_json_response(List[models.PromptHistory], http_res)
1045
+ return unmarshal_json_response(List[models.PromptHistory], http_res)
1049
1046
  if utils.match_response(http_res, "422", "application/json"):
1050
- response_data = utils.unmarshal_json_response(
1047
+ response_data = unmarshal_json_response(
1051
1048
  errors.HTTPValidationErrorData, http_res
1052
1049
  )
1053
1050
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1134,9 +1131,9 @@ class Prompts(BaseSDK):
1134
1131
 
1135
1132
  response_data: Any = None
1136
1133
  if utils.match_response(http_res, "200", "application/json"):
1137
- return utils.unmarshal_json_response(List[models.PromptHistory], http_res)
1134
+ return unmarshal_json_response(List[models.PromptHistory], http_res)
1138
1135
  if utils.match_response(http_res, "422", "application/json"):
1139
- response_data = utils.unmarshal_json_response(
1136
+ response_data = unmarshal_json_response(
1140
1137
  errors.HTTPValidationErrorData, http_res
1141
1138
  )
1142
1139
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1215,7 +1212,7 @@ class Prompts(BaseSDK):
1215
1212
  )
1216
1213
 
1217
1214
  if utils.match_response(http_res, "200", "application/json"):
1218
- return utils.unmarshal_json_response(List[models.SupportedLlm], http_res)
1215
+ return unmarshal_json_response(List[models.SupportedLlm], http_res)
1219
1216
  if utils.match_response(http_res, "4XX", "*"):
1220
1217
  http_res_text = utils.stream_to_text(http_res)
1221
1218
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -1291,7 +1288,7 @@ class Prompts(BaseSDK):
1291
1288
  )
1292
1289
 
1293
1290
  if utils.match_response(http_res, "200", "application/json"):
1294
- return utils.unmarshal_json_response(List[models.SupportedLlm], http_res)
1291
+ return unmarshal_json_response(List[models.SupportedLlm], http_res)
1295
1292
  if utils.match_response(http_res, "4XX", "*"):
1296
1293
  http_res_text = await utils.stream_to_text_async(http_res)
1297
1294
  raise errors.APIError("API error occurred", http_res, http_res_text)
syllable_sdk/roles.py CHANGED
@@ -5,6 +5,7 @@ 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,11 +110,9 @@ class Roles(BaseSDK):
109
110
 
110
111
  response_data: Any = None
111
112
  if utils.match_response(http_res, "200", "application/json"):
112
- return utils.unmarshal_json_response(
113
- models.ListResponseRoleResponse, http_res
114
- )
113
+ return unmarshal_json_response(models.ListResponseRoleResponse, http_res)
115
114
  if utils.match_response(http_res, "422", "application/json"):
116
- response_data = utils.unmarshal_json_response(
115
+ response_data = unmarshal_json_response(
117
116
  errors.HTTPValidationErrorData, http_res
118
117
  )
119
118
  raise errors.HTTPValidationError(response_data, http_res)
@@ -224,11 +223,9 @@ class Roles(BaseSDK):
224
223
 
225
224
  response_data: Any = None
226
225
  if utils.match_response(http_res, "200", "application/json"):
227
- return utils.unmarshal_json_response(
228
- models.ListResponseRoleResponse, http_res
229
- )
226
+ return unmarshal_json_response(models.ListResponseRoleResponse, http_res)
230
227
  if utils.match_response(http_res, "422", "application/json"):
231
- response_data = utils.unmarshal_json_response(
228
+ response_data = unmarshal_json_response(
232
229
  errors.HTTPValidationErrorData, http_res
233
230
  )
234
231
  raise errors.HTTPValidationError(response_data, http_res)
@@ -318,9 +315,9 @@ class Roles(BaseSDK):
318
315
 
319
316
  response_data: Any = None
320
317
  if utils.match_response(http_res, "200", "application/json"):
321
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
318
+ return unmarshal_json_response(models.RoleResponse, http_res)
322
319
  if utils.match_response(http_res, "422", "application/json"):
323
- response_data = utils.unmarshal_json_response(
320
+ response_data = unmarshal_json_response(
324
321
  errors.HTTPValidationErrorData, http_res
325
322
  )
326
323
  raise errors.HTTPValidationError(response_data, http_res)
@@ -410,9 +407,9 @@ class Roles(BaseSDK):
410
407
 
411
408
  response_data: Any = None
412
409
  if utils.match_response(http_res, "200", "application/json"):
413
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
410
+ return unmarshal_json_response(models.RoleResponse, http_res)
414
411
  if utils.match_response(http_res, "422", "application/json"):
415
- response_data = utils.unmarshal_json_response(
412
+ response_data = unmarshal_json_response(
416
413
  errors.HTTPValidationErrorData, http_res
417
414
  )
418
415
  raise errors.HTTPValidationError(response_data, http_res)
@@ -502,9 +499,9 @@ class Roles(BaseSDK):
502
499
 
503
500
  response_data: Any = None
504
501
  if utils.match_response(http_res, "200", "application/json"):
505
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
502
+ return unmarshal_json_response(models.RoleResponse, http_res)
506
503
  if utils.match_response(http_res, "422", "application/json"):
507
- response_data = utils.unmarshal_json_response(
504
+ response_data = unmarshal_json_response(
508
505
  errors.HTTPValidationErrorData, http_res
509
506
  )
510
507
  raise errors.HTTPValidationError(response_data, http_res)
@@ -594,9 +591,9 @@ class Roles(BaseSDK):
594
591
 
595
592
  response_data: Any = None
596
593
  if utils.match_response(http_res, "200", "application/json"):
597
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
594
+ return unmarshal_json_response(models.RoleResponse, http_res)
598
595
  if utils.match_response(http_res, "422", "application/json"):
599
- response_data = utils.unmarshal_json_response(
596
+ response_data = unmarshal_json_response(
600
597
  errors.HTTPValidationErrorData, http_res
601
598
  )
602
599
  raise errors.HTTPValidationError(response_data, http_res)
@@ -683,9 +680,9 @@ class Roles(BaseSDK):
683
680
 
684
681
  response_data: Any = None
685
682
  if utils.match_response(http_res, "200", "application/json"):
686
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
683
+ return unmarshal_json_response(models.RoleResponse, http_res)
687
684
  if utils.match_response(http_res, "422", "application/json"):
688
- response_data = utils.unmarshal_json_response(
685
+ response_data = unmarshal_json_response(
689
686
  errors.HTTPValidationErrorData, http_res
690
687
  )
691
688
  raise errors.HTTPValidationError(response_data, http_res)
@@ -772,9 +769,9 @@ class Roles(BaseSDK):
772
769
 
773
770
  response_data: Any = None
774
771
  if utils.match_response(http_res, "200", "application/json"):
775
- return utils.unmarshal_json_response(models.RoleResponse, http_res)
772
+ return unmarshal_json_response(models.RoleResponse, http_res)
776
773
  if utils.match_response(http_res, "422", "application/json"):
777
- response_data = utils.unmarshal_json_response(
774
+ response_data = unmarshal_json_response(
778
775
  errors.HTTPValidationErrorData, http_res
779
776
  )
780
777
  raise errors.HTTPValidationError(response_data, http_res)
@@ -867,9 +864,9 @@ class Roles(BaseSDK):
867
864
 
868
865
  response_data: Any = None
869
866
  if utils.match_response(http_res, "200", "application/json"):
870
- return utils.unmarshal_json_response(Any, http_res)
867
+ return unmarshal_json_response(Any, http_res)
871
868
  if utils.match_response(http_res, "422", "application/json"):
872
- response_data = utils.unmarshal_json_response(
869
+ response_data = unmarshal_json_response(
873
870
  errors.HTTPValidationErrorData, http_res
874
871
  )
875
872
  raise errors.HTTPValidationError(response_data, http_res)
@@ -962,9 +959,9 @@ class Roles(BaseSDK):
962
959
 
963
960
  response_data: Any = None
964
961
  if utils.match_response(http_res, "200", "application/json"):
965
- return utils.unmarshal_json_response(Any, http_res)
962
+ return unmarshal_json_response(Any, http_res)
966
963
  if utils.match_response(http_res, "422", "application/json"):
967
- response_data = utils.unmarshal_json_response(
964
+ response_data = unmarshal_json_response(
968
965
  errors.HTTPValidationErrorData, http_res
969
966
  )
970
967
  raise errors.HTTPValidationError(response_data, http_res)
syllable_sdk/services.py CHANGED
@@ -5,6 +5,7 @@ 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,11 +110,9 @@ class Services(BaseSDK):
109
110
 
110
111
  response_data: Any = None
111
112
  if utils.match_response(http_res, "200", "application/json"):
112
- return utils.unmarshal_json_response(
113
- models.ListResponseServiceResponse, http_res
114
- )
113
+ return unmarshal_json_response(models.ListResponseServiceResponse, http_res)
115
114
  if utils.match_response(http_res, "422", "application/json"):
116
- response_data = utils.unmarshal_json_response(
115
+ response_data = unmarshal_json_response(
117
116
  errors.HTTPValidationErrorData, http_res
118
117
  )
119
118
  raise errors.HTTPValidationError(response_data, http_res)
@@ -224,11 +223,9 @@ class Services(BaseSDK):
224
223
 
225
224
  response_data: Any = None
226
225
  if utils.match_response(http_res, "200", "application/json"):
227
- return utils.unmarshal_json_response(
228
- models.ListResponseServiceResponse, http_res
229
- )
226
+ return unmarshal_json_response(models.ListResponseServiceResponse, http_res)
230
227
  if utils.match_response(http_res, "422", "application/json"):
231
- response_data = utils.unmarshal_json_response(
228
+ response_data = unmarshal_json_response(
232
229
  errors.HTTPValidationErrorData, http_res
233
230
  )
234
231
  raise errors.HTTPValidationError(response_data, http_res)
@@ -320,9 +317,9 @@ class Services(BaseSDK):
320
317
 
321
318
  response_data: Any = None
322
319
  if utils.match_response(http_res, "200", "application/json"):
323
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
320
+ return unmarshal_json_response(models.ServiceResponse, http_res)
324
321
  if utils.match_response(http_res, "422", "application/json"):
325
- response_data = utils.unmarshal_json_response(
322
+ response_data = unmarshal_json_response(
326
323
  errors.HTTPValidationErrorData, http_res
327
324
  )
328
325
  raise errors.HTTPValidationError(response_data, http_res)
@@ -414,9 +411,9 @@ class Services(BaseSDK):
414
411
 
415
412
  response_data: Any = None
416
413
  if utils.match_response(http_res, "200", "application/json"):
417
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
414
+ return unmarshal_json_response(models.ServiceResponse, http_res)
418
415
  if utils.match_response(http_res, "422", "application/json"):
419
- response_data = utils.unmarshal_json_response(
416
+ response_data = unmarshal_json_response(
420
417
  errors.HTTPValidationErrorData, http_res
421
418
  )
422
419
  raise errors.HTTPValidationError(response_data, http_res)
@@ -508,9 +505,9 @@ class Services(BaseSDK):
508
505
 
509
506
  response_data: Any = None
510
507
  if utils.match_response(http_res, "200", "application/json"):
511
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
508
+ return unmarshal_json_response(models.ServiceResponse, http_res)
512
509
  if utils.match_response(http_res, "422", "application/json"):
513
- response_data = utils.unmarshal_json_response(
510
+ response_data = unmarshal_json_response(
514
511
  errors.HTTPValidationErrorData, http_res
515
512
  )
516
513
  raise errors.HTTPValidationError(response_data, http_res)
@@ -602,9 +599,9 @@ class Services(BaseSDK):
602
599
 
603
600
  response_data: Any = None
604
601
  if utils.match_response(http_res, "200", "application/json"):
605
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
602
+ return unmarshal_json_response(models.ServiceResponse, http_res)
606
603
  if utils.match_response(http_res, "422", "application/json"):
607
- response_data = utils.unmarshal_json_response(
604
+ response_data = unmarshal_json_response(
608
605
  errors.HTTPValidationErrorData, http_res
609
606
  )
610
607
  raise errors.HTTPValidationError(response_data, http_res)
@@ -691,9 +688,9 @@ class Services(BaseSDK):
691
688
 
692
689
  response_data: Any = None
693
690
  if utils.match_response(http_res, "200", "application/json"):
694
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
691
+ return unmarshal_json_response(models.ServiceResponse, http_res)
695
692
  if utils.match_response(http_res, "422", "application/json"):
696
- response_data = utils.unmarshal_json_response(
693
+ response_data = unmarshal_json_response(
697
694
  errors.HTTPValidationErrorData, http_res
698
695
  )
699
696
  raise errors.HTTPValidationError(response_data, http_res)
@@ -780,9 +777,9 @@ class Services(BaseSDK):
780
777
 
781
778
  response_data: Any = None
782
779
  if utils.match_response(http_res, "200", "application/json"):
783
- return utils.unmarshal_json_response(models.ServiceResponse, http_res)
780
+ return unmarshal_json_response(models.ServiceResponse, http_res)
784
781
  if utils.match_response(http_res, "422", "application/json"):
785
- response_data = utils.unmarshal_json_response(
782
+ response_data = unmarshal_json_response(
786
783
  errors.HTTPValidationErrorData, http_res
787
784
  )
788
785
  raise errors.HTTPValidationError(response_data, http_res)
@@ -872,9 +869,9 @@ class Services(BaseSDK):
872
869
 
873
870
  response_data: Any = None
874
871
  if utils.match_response(http_res, "200", "application/json"):
875
- return utils.unmarshal_json_response(Any, http_res)
872
+ return unmarshal_json_response(Any, http_res)
876
873
  if utils.match_response(http_res, "422", "application/json"):
877
- response_data = utils.unmarshal_json_response(
874
+ response_data = unmarshal_json_response(
878
875
  errors.HTTPValidationErrorData, http_res
879
876
  )
880
877
  raise errors.HTTPValidationError(response_data, http_res)
@@ -964,9 +961,9 @@ class Services(BaseSDK):
964
961
 
965
962
  response_data: Any = None
966
963
  if utils.match_response(http_res, "200", "application/json"):
967
- return utils.unmarshal_json_response(Any, http_res)
964
+ return unmarshal_json_response(Any, http_res)
968
965
  if utils.match_response(http_res, "422", "application/json"):
969
- response_data = utils.unmarshal_json_response(
966
+ response_data = unmarshal_json_response(
970
967
  errors.HTTPValidationErrorData, http_res
971
968
  )
972
969
  raise errors.HTTPValidationError(response_data, http_res)