syllable-sdk 0.35.33__py3-none-any.whl → 0.35.38__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 (46) 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/models/agentsttprovider.py +1 -1
  19. syllable_sdk/models/insightworkflowcondition.py +8 -1
  20. syllable_sdk/models/insightworkflowinput.py +10 -10
  21. syllable_sdk/models/insightworkflowoutput.py +10 -10
  22. syllable_sdk/numbers.py +13 -24
  23. syllable_sdk/organizations.py +15 -14
  24. syllable_sdk/permissions.py +3 -2
  25. syllable_sdk/prompts.py +27 -30
  26. syllable_sdk/roles.py +21 -24
  27. syllable_sdk/sdk.py +23 -8
  28. syllable_sdk/services.py +21 -24
  29. syllable_sdk/session_debug.py +13 -12
  30. syllable_sdk/session_labels.py +13 -16
  31. syllable_sdk/sessions.py +15 -18
  32. syllable_sdk/takeouts.py +9 -8
  33. syllable_sdk/targets.py +21 -24
  34. syllable_sdk/test.py +5 -4
  35. syllable_sdk/tools.py +21 -24
  36. syllable_sdk/transcript.py +5 -4
  37. syllable_sdk/twilio.py +13 -12
  38. syllable_sdk/users.py +27 -30
  39. syllable_sdk/utils/__init__.py +0 -3
  40. syllable_sdk/utils/serializers.py +1 -18
  41. syllable_sdk/utils/unmarshal_json_response.py +24 -0
  42. syllable_sdk/v1.py +27 -30
  43. syllable_sdk/workflows.py +33 -32
  44. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/METADATA +24 -8
  45. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/RECORD +46 -45
  46. {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/WHEEL +0 -0
syllable_sdk/test.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, Mapping, Optional, Union, cast
9
10
 
10
11
 
@@ -88,9 +89,9 @@ class Test(BaseSDK):
88
89
 
89
90
  response_data: Any = None
90
91
  if utils.match_response(http_res, "200", "application/json"):
91
- return utils.unmarshal_json_response(models.TestMessageResponse, http_res)
92
+ return unmarshal_json_response(models.TestMessageResponse, http_res)
92
93
  if utils.match_response(http_res, "422", "application/json"):
93
- response_data = utils.unmarshal_json_response(
94
+ response_data = unmarshal_json_response(
94
95
  errors.HTTPValidationErrorData, http_res
95
96
  )
96
97
  raise errors.HTTPValidationError(response_data, http_res)
@@ -180,9 +181,9 @@ class Test(BaseSDK):
180
181
 
181
182
  response_data: Any = None
182
183
  if utils.match_response(http_res, "200", "application/json"):
183
- return utils.unmarshal_json_response(models.TestMessageResponse, http_res)
184
+ return unmarshal_json_response(models.TestMessageResponse, http_res)
184
185
  if utils.match_response(http_res, "422", "application/json"):
185
- response_data = utils.unmarshal_json_response(
186
+ response_data = unmarshal_json_response(
186
187
  errors.HTTPValidationErrorData, http_res
187
188
  )
188
189
  raise errors.HTTPValidationError(response_data, http_res)
syllable_sdk/tools.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 Tools(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.ListResponseToolResponse, http_res
114
- )
113
+ return unmarshal_json_response(models.ListResponseToolResponse, 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 Tools(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.ListResponseToolResponse, http_res
229
- )
226
+ return unmarshal_json_response(models.ListResponseToolResponse, 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 Tools(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.ToolResponse, http_res)
318
+ return unmarshal_json_response(models.ToolResponse, 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 Tools(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.ToolResponse, http_res)
410
+ return unmarshal_json_response(models.ToolResponse, 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 Tools(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.ToolResponse, http_res)
502
+ return unmarshal_json_response(models.ToolResponse, 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 Tools(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.ToolResponse, http_res)
594
+ return unmarshal_json_response(models.ToolResponse, 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 Tools(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.ToolDetailResponse, http_res)
683
+ return unmarshal_json_response(models.ToolDetailResponse, 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 Tools(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.ToolDetailResponse, http_res)
772
+ return unmarshal_json_response(models.ToolDetailResponse, 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 Tools(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 Tools(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)
@@ -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
9
10
 
10
11
 
@@ -81,11 +82,11 @@ class Transcript(BaseSDK):
81
82
 
82
83
  response_data: Any = None
83
84
  if utils.match_response(http_res, "200", "application/json"):
84
- return utils.unmarshal_json_response(
85
+ return unmarshal_json_response(
85
86
  models.SessionTranscriptionResponse, http_res
86
87
  )
87
88
  if utils.match_response(http_res, "422", "application/json"):
88
- response_data = utils.unmarshal_json_response(
89
+ response_data = unmarshal_json_response(
89
90
  errors.HTTPValidationErrorData, http_res
90
91
  )
91
92
  raise errors.HTTPValidationError(response_data, http_res)
@@ -170,11 +171,11 @@ class Transcript(BaseSDK):
170
171
 
171
172
  response_data: Any = None
172
173
  if utils.match_response(http_res, "200", "application/json"):
173
- return utils.unmarshal_json_response(
174
+ return unmarshal_json_response(
174
175
  models.SessionTranscriptionResponse, http_res
175
176
  )
176
177
  if utils.match_response(http_res, "422", "application/json"):
177
- response_data = utils.unmarshal_json_response(
178
+ response_data = unmarshal_json_response(
178
179
  errors.HTTPValidationErrorData, http_res
179
180
  )
180
181
  raise errors.HTTPValidationError(response_data, http_res)
syllable_sdk/twilio.py CHANGED
@@ -7,6 +7,7 @@ from syllable_sdk._hooks import HookContext
7
7
  from syllable_sdk.numbers import Numbers
8
8
  from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
9
9
  from syllable_sdk.utils import get_security_from_env
10
+ from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
10
11
  from typing import Any, Mapping, Optional, Union, cast
11
12
 
12
13
 
@@ -96,9 +97,9 @@ class Twilio(BaseSDK):
96
97
 
97
98
  response_data: Any = None
98
99
  if utils.match_response(http_res, "200", "application/json"):
99
- return utils.unmarshal_json_response(models.Channel, http_res)
100
+ return unmarshal_json_response(models.Channel, http_res)
100
101
  if utils.match_response(http_res, "422", "application/json"):
101
- response_data = utils.unmarshal_json_response(
102
+ response_data = unmarshal_json_response(
102
103
  errors.HTTPValidationErrorData, http_res
103
104
  )
104
105
  raise errors.HTTPValidationError(response_data, http_res)
@@ -183,9 +184,9 @@ class Twilio(BaseSDK):
183
184
 
184
185
  response_data: Any = None
185
186
  if utils.match_response(http_res, "200", "application/json"):
186
- return utils.unmarshal_json_response(models.Channel, http_res)
187
+ return unmarshal_json_response(models.Channel, http_res)
187
188
  if utils.match_response(http_res, "422", "application/json"):
188
- response_data = utils.unmarshal_json_response(
189
+ response_data = unmarshal_json_response(
189
190
  errors.HTTPValidationErrorData, http_res
190
191
  )
191
192
  raise errors.HTTPValidationError(response_data, http_res)
@@ -276,9 +277,9 @@ class Twilio(BaseSDK):
276
277
 
277
278
  response_data: Any = None
278
279
  if utils.match_response(http_res, "200", "application/json"):
279
- return utils.unmarshal_json_response(models.Channel, http_res)
280
+ return unmarshal_json_response(models.Channel, http_res)
280
281
  if utils.match_response(http_res, "422", "application/json"):
281
- response_data = utils.unmarshal_json_response(
282
+ response_data = unmarshal_json_response(
282
283
  errors.HTTPValidationErrorData, http_res
283
284
  )
284
285
  raise errors.HTTPValidationError(response_data, http_res)
@@ -369,9 +370,9 @@ class Twilio(BaseSDK):
369
370
 
370
371
  response_data: Any = None
371
372
  if utils.match_response(http_res, "200", "application/json"):
372
- return utils.unmarshal_json_response(models.Channel, http_res)
373
+ return unmarshal_json_response(models.Channel, http_res)
373
374
  if utils.match_response(http_res, "422", "application/json"):
374
- response_data = utils.unmarshal_json_response(
375
+ response_data = unmarshal_json_response(
375
376
  errors.HTTPValidationErrorData, http_res
376
377
  )
377
378
  raise errors.HTTPValidationError(response_data, http_res)
@@ -462,9 +463,9 @@ class Twilio(BaseSDK):
462
463
 
463
464
  response_data: Any = None
464
465
  if utils.match_response(http_res, "200", "application/json"):
465
- return utils.unmarshal_json_response(models.Channel, http_res)
466
+ return unmarshal_json_response(models.Channel, http_res)
466
467
  if utils.match_response(http_res, "422", "application/json"):
467
- response_data = utils.unmarshal_json_response(
468
+ response_data = unmarshal_json_response(
468
469
  errors.HTTPValidationErrorData, http_res
469
470
  )
470
471
  raise errors.HTTPValidationError(response_data, http_res)
@@ -555,9 +556,9 @@ class Twilio(BaseSDK):
555
556
 
556
557
  response_data: Any = None
557
558
  if utils.match_response(http_res, "200", "application/json"):
558
- return utils.unmarshal_json_response(models.Channel, http_res)
559
+ return unmarshal_json_response(models.Channel, http_res)
559
560
  if utils.match_response(http_res, "422", "application/json"):
560
- response_data = utils.unmarshal_json_response(
561
+ response_data = unmarshal_json_response(
561
562
  errors.HTTPValidationErrorData, http_res
562
563
  )
563
564
  raise errors.HTTPValidationError(response_data, http_res)
syllable_sdk/users.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
 
@@ -107,11 +108,9 @@ class Users(BaseSDK):
107
108
 
108
109
  response_data: Any = None
109
110
  if utils.match_response(http_res, "200", "application/json"):
110
- return utils.unmarshal_json_response(
111
- models.ListResponseUserResponse, http_res
112
- )
111
+ return unmarshal_json_response(models.ListResponseUserResponse, http_res)
113
112
  if utils.match_response(http_res, "422", "application/json"):
114
- response_data = utils.unmarshal_json_response(
113
+ response_data = unmarshal_json_response(
115
114
  errors.HTTPValidationErrorData, http_res
116
115
  )
117
116
  raise errors.HTTPValidationError(response_data, http_res)
@@ -222,11 +221,9 @@ class Users(BaseSDK):
222
221
 
223
222
  response_data: Any = None
224
223
  if utils.match_response(http_res, "200", "application/json"):
225
- return utils.unmarshal_json_response(
226
- models.ListResponseUserResponse, http_res
227
- )
224
+ return unmarshal_json_response(models.ListResponseUserResponse, http_res)
228
225
  if utils.match_response(http_res, "422", "application/json"):
229
- response_data = utils.unmarshal_json_response(
226
+ response_data = unmarshal_json_response(
230
227
  errors.HTTPValidationErrorData, http_res
231
228
  )
232
229
  raise errors.HTTPValidationError(response_data, http_res)
@@ -316,9 +313,9 @@ class Users(BaseSDK):
316
313
 
317
314
  response_data: Any = None
318
315
  if utils.match_response(http_res, "200", "application/json"):
319
- return utils.unmarshal_json_response(models.UserResponse, http_res)
316
+ return unmarshal_json_response(models.UserResponse, http_res)
320
317
  if utils.match_response(http_res, "422", "application/json"):
321
- response_data = utils.unmarshal_json_response(
318
+ response_data = unmarshal_json_response(
322
319
  errors.HTTPValidationErrorData, http_res
323
320
  )
324
321
  raise errors.HTTPValidationError(response_data, http_res)
@@ -408,9 +405,9 @@ class Users(BaseSDK):
408
405
 
409
406
  response_data: Any = None
410
407
  if utils.match_response(http_res, "200", "application/json"):
411
- return utils.unmarshal_json_response(models.UserResponse, http_res)
408
+ return unmarshal_json_response(models.UserResponse, http_res)
412
409
  if utils.match_response(http_res, "422", "application/json"):
413
- response_data = utils.unmarshal_json_response(
410
+ response_data = unmarshal_json_response(
414
411
  errors.HTTPValidationErrorData, http_res
415
412
  )
416
413
  raise errors.HTTPValidationError(response_data, http_res)
@@ -500,9 +497,9 @@ class Users(BaseSDK):
500
497
 
501
498
  response_data: Any = None
502
499
  if utils.match_response(http_res, "200", "application/json"):
503
- return utils.unmarshal_json_response(models.UserResponse, http_res)
500
+ return unmarshal_json_response(models.UserResponse, http_res)
504
501
  if utils.match_response(http_res, "422", "application/json"):
505
- response_data = utils.unmarshal_json_response(
502
+ response_data = unmarshal_json_response(
506
503
  errors.HTTPValidationErrorData, http_res
507
504
  )
508
505
  raise errors.HTTPValidationError(response_data, http_res)
@@ -592,9 +589,9 @@ class Users(BaseSDK):
592
589
 
593
590
  response_data: Any = None
594
591
  if utils.match_response(http_res, "200", "application/json"):
595
- return utils.unmarshal_json_response(models.UserResponse, http_res)
592
+ return unmarshal_json_response(models.UserResponse, http_res)
596
593
  if utils.match_response(http_res, "422", "application/json"):
597
- response_data = utils.unmarshal_json_response(
594
+ response_data = unmarshal_json_response(
598
595
  errors.HTTPValidationErrorData, http_res
599
596
  )
600
597
  raise errors.HTTPValidationError(response_data, http_res)
@@ -684,9 +681,9 @@ class Users(BaseSDK):
684
681
 
685
682
  response_data: Any = None
686
683
  if utils.match_response(http_res, "200", "application/json"):
687
- return utils.unmarshal_json_response(Any, http_res)
684
+ return unmarshal_json_response(Any, http_res)
688
685
  if utils.match_response(http_res, "422", "application/json"):
689
- response_data = utils.unmarshal_json_response(
686
+ response_data = unmarshal_json_response(
690
687
  errors.HTTPValidationErrorData, http_res
691
688
  )
692
689
  raise errors.HTTPValidationError(response_data, http_res)
@@ -776,9 +773,9 @@ class Users(BaseSDK):
776
773
 
777
774
  response_data: Any = None
778
775
  if utils.match_response(http_res, "200", "application/json"):
779
- return utils.unmarshal_json_response(Any, http_res)
776
+ return unmarshal_json_response(Any, http_res)
780
777
  if utils.match_response(http_res, "422", "application/json"):
781
- response_data = utils.unmarshal_json_response(
778
+ response_data = unmarshal_json_response(
782
779
  errors.HTTPValidationErrorData, http_res
783
780
  )
784
781
  raise errors.HTTPValidationError(response_data, http_res)
@@ -865,9 +862,9 @@ class Users(BaseSDK):
865
862
 
866
863
  response_data: Any = None
867
864
  if utils.match_response(http_res, "200", "application/json"):
868
- return utils.unmarshal_json_response(models.UserResponse, http_res)
865
+ return unmarshal_json_response(models.UserResponse, http_res)
869
866
  if utils.match_response(http_res, "422", "application/json"):
870
- response_data = utils.unmarshal_json_response(
867
+ response_data = unmarshal_json_response(
871
868
  errors.HTTPValidationErrorData, http_res
872
869
  )
873
870
  raise errors.HTTPValidationError(response_data, http_res)
@@ -954,9 +951,9 @@ class Users(BaseSDK):
954
951
 
955
952
  response_data: Any = None
956
953
  if utils.match_response(http_res, "200", "application/json"):
957
- return utils.unmarshal_json_response(models.UserResponse, http_res)
954
+ return unmarshal_json_response(models.UserResponse, http_res)
958
955
  if utils.match_response(http_res, "422", "application/json"):
959
- response_data = utils.unmarshal_json_response(
956
+ response_data = unmarshal_json_response(
960
957
  errors.HTTPValidationErrorData, http_res
961
958
  )
962
959
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1043,9 +1040,9 @@ class Users(BaseSDK):
1043
1040
 
1044
1041
  response_data: Any = None
1045
1042
  if utils.match_response(http_res, "200", "application/json"):
1046
- return utils.unmarshal_json_response(Any, http_res)
1043
+ return unmarshal_json_response(Any, http_res)
1047
1044
  if utils.match_response(http_res, "422", "application/json"):
1048
- response_data = utils.unmarshal_json_response(
1045
+ response_data = unmarshal_json_response(
1049
1046
  errors.HTTPValidationErrorData, http_res
1050
1047
  )
1051
1048
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1132,9 +1129,9 @@ class Users(BaseSDK):
1132
1129
 
1133
1130
  response_data: Any = None
1134
1131
  if utils.match_response(http_res, "200", "application/json"):
1135
- return utils.unmarshal_json_response(Any, http_res)
1132
+ return unmarshal_json_response(Any, http_res)
1136
1133
  if utils.match_response(http_res, "422", "application/json"):
1137
- response_data = utils.unmarshal_json_response(
1134
+ response_data = unmarshal_json_response(
1138
1135
  errors.HTTPValidationErrorData, http_res
1139
1136
  )
1140
1137
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1214,7 +1211,7 @@ class Users(BaseSDK):
1214
1211
  )
1215
1212
 
1216
1213
  if utils.match_response(http_res, "200", "application/json"):
1217
- return utils.unmarshal_json_response(Any, http_res)
1214
+ return unmarshal_json_response(Any, http_res)
1218
1215
  if utils.match_response(http_res, "4XX", "*"):
1219
1216
  http_res_text = utils.stream_to_text(http_res)
1220
1217
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -1291,7 +1288,7 @@ class Users(BaseSDK):
1291
1288
  )
1292
1289
 
1293
1290
  if utils.match_response(http_res, "200", "application/json"):
1294
- return utils.unmarshal_json_response(Any, http_res)
1291
+ return unmarshal_json_response(Any, 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)
@@ -29,7 +29,6 @@ if TYPE_CHECKING:
29
29
  marshal_json,
30
30
  unmarshal,
31
31
  unmarshal_json,
32
- unmarshal_json_response,
33
32
  serialize_decimal,
34
33
  serialize_float,
35
34
  serialize_int,
@@ -99,7 +98,6 @@ __all__ = [
99
98
  "template_url",
100
99
  "unmarshal",
101
100
  "unmarshal_json",
102
- "unmarshal_json_response",
103
101
  "validate_decimal",
104
102
  "validate_const",
105
103
  "validate_float",
@@ -154,7 +152,6 @@ _dynamic_imports: dict[str, str] = {
154
152
  "template_url": ".url",
155
153
  "unmarshal": ".serializers",
156
154
  "unmarshal_json": ".serializers",
157
- "unmarshal_json_response": ".serializers",
158
155
  "validate_decimal": ".serializers",
159
156
  "validate_const": ".serializers",
160
157
  "validate_float": ".serializers",
@@ -4,7 +4,7 @@ from decimal import Decimal
4
4
  import functools
5
5
  import json
6
6
  import typing
7
- from typing import Any, Dict, List, Optional, Tuple, Union, get_args
7
+ from typing import Any, Dict, List, Tuple, Union, get_args
8
8
  import typing_extensions
9
9
  from typing_extensions import get_origin
10
10
 
@@ -13,7 +13,6 @@ from pydantic import ConfigDict, create_model
13
13
  from pydantic_core import from_json
14
14
 
15
15
  from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset
16
- from syllable_sdk import errors
17
16
 
18
17
 
19
18
  def serialize_decimal(as_str: bool):
@@ -141,22 +140,6 @@ def unmarshal_json(raw, typ: Any) -> Any:
141
140
  return unmarshal(from_json(raw), typ)
142
141
 
143
142
 
144
- def unmarshal_json_response(
145
- typ: Any, http_res: httpx.Response, body: Optional[str] = None
146
- ) -> Any:
147
- if body is None:
148
- body = http_res.text
149
- try:
150
- return unmarshal_json(body, typ)
151
- except Exception as e:
152
- raise errors.ResponseValidationError(
153
- "Response validation failed",
154
- http_res,
155
- e,
156
- body,
157
- ) from e
158
-
159
-
160
143
  def unmarshal(val, typ: Any) -> Any:
161
144
  unmarshaller = create_model(
162
145
  "Unmarshaller",
@@ -0,0 +1,24 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from typing import Any, Optional
4
+
5
+ import httpx
6
+
7
+ from .serializers import unmarshal_json
8
+ from syllable_sdk import errors
9
+
10
+
11
+ def unmarshal_json_response(
12
+ typ: Any, http_res: httpx.Response, body: Optional[str] = None
13
+ ) -> Any:
14
+ if body is None:
15
+ body = http_res.text
16
+ try:
17
+ return unmarshal_json(body, typ)
18
+ except Exception as e:
19
+ raise errors.ResponseValidationError(
20
+ "Response validation failed",
21
+ http_res,
22
+ e,
23
+ body,
24
+ ) from e