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/sdk.py CHANGED
@@ -48,17 +48,32 @@ class SyllableSDK(BaseSDK):
48
48
  ## Overview
49
49
 
50
50
  The Syllable SDK provides a comprehensive set of tools and APIs to integrate powerful AI
51
- capabilities into your communication applications. Whether you're building chatbots, virtual
52
- assistants, or any other AI-driven solutions, Syllable SDK has got you covered.
51
+ capabilities into your communication applications. Whether you're building phone agents, chatbots,
52
+ virtual assistants, or any other AI-driven solutions, Syllable SDK has got you covered.
53
53
 
54
54
  ## Features
55
55
 
56
- - **Natural Language Processing (NLP)**: Understand and generate human language with ease.
57
- - **Machine Learning Models**: Leverage pre-trained models or train your own custom models.
58
- - **Speech Recognition**: Convert speech to text and vice versa.
59
- - **Data Analytics**: Analyze and visualize data to gain insights.
60
- - **Integration**: Seamlessly integrate with other services and platforms.
61
-
56
+ - **Agent Configuration**: Create and manage agents that can interact with users across various
57
+ channels.
58
+ - **Channel Management**: Configure channels like SMS, web chat, and more to connect agents with
59
+ users.
60
+ - **Custom Messages**: Set up custom messages that agents can deliver as greetings or responses.
61
+ - **Conversations**: Track and manage conversations between users and agents, including session
62
+ management.
63
+ - **Tools and Workflows**: Leverage tools and workflows to enhance agent capabilities, such as data
64
+ processing and API calls.
65
+ - **Data Sources**: Integrate data sources to provide agents with additional context and
66
+ information.
67
+ - **Insights and Analytics**: Analyze conversations and sessions to gain insights into user
68
+ interactions.
69
+ - **Permissions and Security**: Manage permissions to control access to various features and
70
+ functionalities.
71
+ - **Language Support**: Define language groups to enable multilingual support for agents.
72
+ - **Outbound Campaigns**: Create and manage outbound communication campaigns to reach users
73
+ effectively.
74
+ - **Session Labels**: Label sessions with evaluations of quality and descriptions of issues
75
+ encountered.
76
+ - **Incident Management**: Track and manage incidents related to agent interactions.
62
77
 
63
78
  """
64
79
 
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)
@@ -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
 
@@ -84,9 +85,9 @@ class SessionDebug(BaseSDK):
84
85
 
85
86
  response_data: Any = None
86
87
  if utils.match_response(http_res, "200", "application/json"):
87
- return utils.unmarshal_json_response(models.SessionData, http_res)
88
+ return unmarshal_json_response(models.SessionData, http_res)
88
89
  if utils.match_response(http_res, "422", "application/json"):
89
- response_data = utils.unmarshal_json_response(
90
+ response_data = unmarshal_json_response(
90
91
  errors.HTTPValidationErrorData, http_res
91
92
  )
92
93
  raise errors.HTTPValidationError(response_data, http_res)
@@ -174,9 +175,9 @@ class SessionDebug(BaseSDK):
174
175
 
175
176
  response_data: Any = None
176
177
  if utils.match_response(http_res, "200", "application/json"):
177
- return utils.unmarshal_json_response(models.SessionData, http_res)
178
+ return unmarshal_json_response(models.SessionData, http_res)
178
179
  if utils.match_response(http_res, "422", "application/json"):
179
- response_data = utils.unmarshal_json_response(
180
+ response_data = unmarshal_json_response(
180
181
  errors.HTTPValidationErrorData, http_res
181
182
  )
182
183
  raise errors.HTTPValidationError(response_data, http_res)
@@ -261,9 +262,9 @@ class SessionDebug(BaseSDK):
261
262
 
262
263
  response_data: Any = None
263
264
  if utils.match_response(http_res, "200", "application/json"):
264
- return utils.unmarshal_json_response(models.SessionData, http_res)
265
+ return unmarshal_json_response(models.SessionData, http_res)
265
266
  if utils.match_response(http_res, "422", "application/json"):
266
- response_data = utils.unmarshal_json_response(
267
+ response_data = unmarshal_json_response(
267
268
  errors.HTTPValidationErrorData, http_res
268
269
  )
269
270
  raise errors.HTTPValidationError(response_data, http_res)
@@ -348,9 +349,9 @@ class SessionDebug(BaseSDK):
348
349
 
349
350
  response_data: Any = None
350
351
  if utils.match_response(http_res, "200", "application/json"):
351
- return utils.unmarshal_json_response(models.SessionData, http_res)
352
+ return unmarshal_json_response(models.SessionData, http_res)
352
353
  if utils.match_response(http_res, "422", "application/json"):
353
- response_data = utils.unmarshal_json_response(
354
+ response_data = unmarshal_json_response(
354
355
  errors.HTTPValidationErrorData, http_res
355
356
  )
356
357
  raise errors.HTTPValidationError(response_data, http_res)
@@ -438,9 +439,9 @@ class SessionDebug(BaseSDK):
438
439
 
439
440
  response_data: Any = None
440
441
  if utils.match_response(http_res, "200", "application/json"):
441
- return utils.unmarshal_json_response(models.ToolResultData, http_res)
442
+ return unmarshal_json_response(models.ToolResultData, http_res)
442
443
  if utils.match_response(http_res, "422", "application/json"):
443
- response_data = utils.unmarshal_json_response(
444
+ response_data = unmarshal_json_response(
444
445
  errors.HTTPValidationErrorData, http_res
445
446
  )
446
447
  raise errors.HTTPValidationError(response_data, http_res)
@@ -528,9 +529,9 @@ class SessionDebug(BaseSDK):
528
529
 
529
530
  response_data: Any = None
530
531
  if utils.match_response(http_res, "200", "application/json"):
531
- return utils.unmarshal_json_response(models.ToolResultData, http_res)
532
+ return unmarshal_json_response(models.ToolResultData, http_res)
532
533
  if utils.match_response(http_res, "422", "application/json"):
533
- response_data = utils.unmarshal_json_response(
534
+ response_data = unmarshal_json_response(
534
535
  errors.HTTPValidationErrorData, http_res
535
536
  )
536
537
  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, List, Mapping, Optional, Union, cast
9
10
 
10
11
 
@@ -83,9 +84,9 @@ class SessionLabels(BaseSDK):
83
84
 
84
85
  response_data: Any = None
85
86
  if utils.match_response(http_res, "200", "application/json"):
86
- return utils.unmarshal_json_response(models.SessionLabel, http_res)
87
+ return unmarshal_json_response(models.SessionLabel, http_res)
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,9 +171,9 @@ class SessionLabels(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(models.SessionLabel, http_res)
174
+ return unmarshal_json_response(models.SessionLabel, http_res)
174
175
  if utils.match_response(http_res, "422", "application/json"):
175
- response_data = utils.unmarshal_json_response(
176
+ response_data = unmarshal_json_response(
176
177
  errors.HTTPValidationErrorData, http_res
177
178
  )
178
179
  raise errors.HTTPValidationError(response_data, http_res)
@@ -262,9 +263,9 @@ class SessionLabels(BaseSDK):
262
263
 
263
264
  response_data: Any = None
264
265
  if utils.match_response(http_res, "200", "application/json"):
265
- return utils.unmarshal_json_response(models.SessionLabel, http_res)
266
+ return unmarshal_json_response(models.SessionLabel, http_res)
266
267
  if utils.match_response(http_res, "422", "application/json"):
267
- response_data = utils.unmarshal_json_response(
268
+ response_data = unmarshal_json_response(
268
269
  errors.HTTPValidationErrorData, http_res
269
270
  )
270
271
  raise errors.HTTPValidationError(response_data, http_res)
@@ -354,9 +355,9 @@ class SessionLabels(BaseSDK):
354
355
 
355
356
  response_data: Any = None
356
357
  if utils.match_response(http_res, "200", "application/json"):
357
- return utils.unmarshal_json_response(models.SessionLabel, http_res)
358
+ return unmarshal_json_response(models.SessionLabel, http_res)
358
359
  if utils.match_response(http_res, "422", "application/json"):
359
- response_data = utils.unmarshal_json_response(
360
+ response_data = unmarshal_json_response(
360
361
  errors.HTTPValidationErrorData, http_res
361
362
  )
362
363
  raise errors.HTTPValidationError(response_data, http_res)
@@ -465,11 +466,9 @@ class SessionLabels(BaseSDK):
465
466
 
466
467
  response_data: Any = None
467
468
  if utils.match_response(http_res, "200", "application/json"):
468
- return utils.unmarshal_json_response(
469
- models.ListResponseSessionLabel, http_res
470
- )
469
+ return unmarshal_json_response(models.ListResponseSessionLabel, http_res)
471
470
  if utils.match_response(http_res, "422", "application/json"):
472
- response_data = utils.unmarshal_json_response(
471
+ response_data = unmarshal_json_response(
473
472
  errors.HTTPValidationErrorData, http_res
474
473
  )
475
474
  raise errors.HTTPValidationError(response_data, http_res)
@@ -578,11 +577,9 @@ class SessionLabels(BaseSDK):
578
577
 
579
578
  response_data: Any = None
580
579
  if utils.match_response(http_res, "200", "application/json"):
581
- return utils.unmarshal_json_response(
582
- models.ListResponseSessionLabel, http_res
583
- )
580
+ return unmarshal_json_response(models.ListResponseSessionLabel, http_res)
584
581
  if utils.match_response(http_res, "422", "application/json"):
585
- response_data = utils.unmarshal_json_response(
582
+ response_data = unmarshal_json_response(
586
583
  errors.HTTPValidationErrorData, http_res
587
584
  )
588
585
  raise errors.HTTPValidationError(response_data, http_res)
syllable_sdk/sessions.py CHANGED
@@ -10,6 +10,7 @@ from syllable_sdk.latency import Latency
10
10
  from syllable_sdk.transcript import Transcript
11
11
  from syllable_sdk.types import OptionalNullable, UNSET
12
12
  from syllable_sdk.utils import get_security_from_env
13
+ from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
13
14
  from typing import Any, List, Mapping, Optional
14
15
 
15
16
 
@@ -126,9 +127,9 @@ class Sessions(BaseSDK):
126
127
 
127
128
  response_data: Any = None
128
129
  if utils.match_response(http_res, "200", "application/json"):
129
- return utils.unmarshal_json_response(models.ListResponseSession, http_res)
130
+ return unmarshal_json_response(models.ListResponseSession, http_res)
130
131
  if utils.match_response(http_res, "422", "application/json"):
131
- response_data = utils.unmarshal_json_response(
132
+ response_data = unmarshal_json_response(
132
133
  errors.HTTPValidationErrorData, http_res
133
134
  )
134
135
  raise errors.HTTPValidationError(response_data, http_res)
@@ -237,9 +238,9 @@ class Sessions(BaseSDK):
237
238
 
238
239
  response_data: Any = None
239
240
  if utils.match_response(http_res, "200", "application/json"):
240
- return utils.unmarshal_json_response(models.ListResponseSession, http_res)
241
+ return unmarshal_json_response(models.ListResponseSession, http_res)
241
242
  if utils.match_response(http_res, "422", "application/json"):
242
- response_data = utils.unmarshal_json_response(
243
+ response_data = unmarshal_json_response(
243
244
  errors.HTTPValidationErrorData, http_res
244
245
  )
245
246
  raise errors.HTTPValidationError(response_data, http_res)
@@ -324,9 +325,9 @@ class Sessions(BaseSDK):
324
325
 
325
326
  response_data: Any = None
326
327
  if utils.match_response(http_res, "200", "application/json"):
327
- return utils.unmarshal_json_response(models.Session, http_res)
328
+ return unmarshal_json_response(models.Session, http_res)
328
329
  if utils.match_response(http_res, "422", "application/json"):
329
- response_data = utils.unmarshal_json_response(
330
+ response_data = unmarshal_json_response(
330
331
  errors.HTTPValidationErrorData, http_res
331
332
  )
332
333
  raise errors.HTTPValidationError(response_data, http_res)
@@ -411,9 +412,9 @@ class Sessions(BaseSDK):
411
412
 
412
413
  response_data: Any = None
413
414
  if utils.match_response(http_res, "200", "application/json"):
414
- return utils.unmarshal_json_response(models.Session, http_res)
415
+ return unmarshal_json_response(models.Session, http_res)
415
416
  if utils.match_response(http_res, "422", "application/json"):
416
- response_data = utils.unmarshal_json_response(
417
+ response_data = unmarshal_json_response(
417
418
  errors.HTTPValidationErrorData, http_res
418
419
  )
419
420
  raise errors.HTTPValidationError(response_data, http_res)
@@ -498,11 +499,9 @@ class Sessions(BaseSDK):
498
499
 
499
500
  response_data: Any = None
500
501
  if utils.match_response(http_res, "200", "application/json"):
501
- return utils.unmarshal_json_response(
502
- models.SessionRecordingResponse, http_res
503
- )
502
+ return unmarshal_json_response(models.SessionRecordingResponse, http_res)
504
503
  if utils.match_response(http_res, "422", "application/json"):
505
- response_data = utils.unmarshal_json_response(
504
+ response_data = unmarshal_json_response(
506
505
  errors.HTTPValidationErrorData, http_res
507
506
  )
508
507
  raise errors.HTTPValidationError(response_data, http_res)
@@ -587,11 +586,9 @@ class Sessions(BaseSDK):
587
586
 
588
587
  response_data: Any = None
589
588
  if utils.match_response(http_res, "200", "application/json"):
590
- return utils.unmarshal_json_response(
591
- models.SessionRecordingResponse, http_res
592
- )
589
+ return unmarshal_json_response(models.SessionRecordingResponse, http_res)
593
590
  if utils.match_response(http_res, "422", "application/json"):
594
- response_data = utils.unmarshal_json_response(
591
+ response_data = unmarshal_json_response(
595
592
  errors.HTTPValidationErrorData, http_res
596
593
  )
597
594
  raise errors.HTTPValidationError(response_data, http_res)
@@ -680,7 +677,7 @@ class Sessions(BaseSDK):
680
677
  return http_res
681
678
  if utils.match_response(http_res, "422", "application/json"):
682
679
  http_res_text = utils.stream_to_text(http_res)
683
- response_data = utils.unmarshal_json_response(
680
+ response_data = unmarshal_json_response(
684
681
  errors.HTTPValidationErrorData, http_res, http_res_text
685
682
  )
686
683
  raise errors.HTTPValidationError(response_data, http_res, http_res_text)
@@ -770,7 +767,7 @@ class Sessions(BaseSDK):
770
767
  return http_res
771
768
  if utils.match_response(http_res, "422", "application/json"):
772
769
  http_res_text = await utils.stream_to_text_async(http_res)
773
- response_data = utils.unmarshal_json_response(
770
+ response_data = unmarshal_json_response(
774
771
  errors.HTTPValidationErrorData, http_res, http_res_text
775
772
  )
776
773
  raise errors.HTTPValidationError(response_data, http_res, http_res_text)
syllable_sdk/takeouts.py CHANGED
@@ -6,6 +6,7 @@ from syllable_sdk import errors, models, utils
6
6
  from syllable_sdk._hooks import HookContext
7
7
  from syllable_sdk.types import OptionalNullable, UNSET
8
8
  from syllable_sdk.utils import get_security_from_env
9
+ from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import Any, Mapping, Optional
10
11
 
11
12
 
@@ -74,7 +75,7 @@ class Takeouts(BaseSDK):
74
75
  )
75
76
 
76
77
  if utils.match_response(http_res, "200", "application/json"):
77
- return utils.unmarshal_json_response(models.CreateTakeoutResponse, http_res)
78
+ return unmarshal_json_response(models.CreateTakeoutResponse, http_res)
78
79
  if utils.match_response(http_res, "4XX", "*"):
79
80
  http_res_text = utils.stream_to_text(http_res)
80
81
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -148,7 +149,7 @@ class Takeouts(BaseSDK):
148
149
  )
149
150
 
150
151
  if utils.match_response(http_res, "200", "application/json"):
151
- return utils.unmarshal_json_response(models.CreateTakeoutResponse, http_res)
152
+ return unmarshal_json_response(models.CreateTakeoutResponse, http_res)
152
153
  if utils.match_response(http_res, "4XX", "*"):
153
154
  http_res_text = await utils.stream_to_text_async(http_res)
154
155
  raise errors.APIError("API error occurred", http_res, http_res_text)
@@ -230,9 +231,9 @@ class Takeouts(BaseSDK):
230
231
 
231
232
  response_data: Any = None
232
233
  if utils.match_response(http_res, "200", "application/json"):
233
- return utils.unmarshal_json_response(models.TakeoutStatusResponse, http_res)
234
+ return unmarshal_json_response(models.TakeoutStatusResponse, http_res)
234
235
  if utils.match_response(http_res, "422", "application/json"):
235
- response_data = utils.unmarshal_json_response(
236
+ response_data = unmarshal_json_response(
236
237
  errors.HTTPValidationErrorData, http_res
237
238
  )
238
239
  raise errors.HTTPValidationError(response_data, http_res)
@@ -317,9 +318,9 @@ class Takeouts(BaseSDK):
317
318
 
318
319
  response_data: Any = None
319
320
  if utils.match_response(http_res, "200", "application/json"):
320
- return utils.unmarshal_json_response(models.TakeoutStatusResponse, http_res)
321
+ return unmarshal_json_response(models.TakeoutStatusResponse, http_res)
321
322
  if utils.match_response(http_res, "422", "application/json"):
322
- response_data = utils.unmarshal_json_response(
323
+ response_data = unmarshal_json_response(
323
324
  errors.HTTPValidationErrorData, http_res
324
325
  )
325
326
  raise errors.HTTPValidationError(response_data, http_res)
@@ -411,7 +412,7 @@ class Takeouts(BaseSDK):
411
412
  return http_res
412
413
  if utils.match_response(http_res, "422", "application/json"):
413
414
  http_res_text = utils.stream_to_text(http_res)
414
- response_data = utils.unmarshal_json_response(
415
+ response_data = unmarshal_json_response(
415
416
  errors.HTTPValidationErrorData, http_res, http_res_text
416
417
  )
417
418
  raise errors.HTTPValidationError(response_data, http_res, http_res_text)
@@ -504,7 +505,7 @@ class Takeouts(BaseSDK):
504
505
  return http_res
505
506
  if utils.match_response(http_res, "422", "application/json"):
506
507
  http_res_text = await utils.stream_to_text_async(http_res)
507
- response_data = utils.unmarshal_json_response(
508
+ response_data = unmarshal_json_response(
508
509
  errors.HTTPValidationErrorData, http_res, http_res_text
509
510
  )
510
511
  raise errors.HTTPValidationError(response_data, http_res, http_res_text)
syllable_sdk/targets.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, List, Mapping, Optional, Union
9
10
 
10
11
 
@@ -109,11 +110,9 @@ class Targets(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.ListResponseAvailableTarget, http_res
114
- )
113
+ return unmarshal_json_response(models.ListResponseAvailableTarget, 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 Targets(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.ListResponseAvailableTarget, http_res
229
- )
226
+ return unmarshal_json_response(models.ListResponseAvailableTarget, 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)
@@ -337,11 +334,11 @@ class Targets(BaseSDK):
337
334
 
338
335
  response_data: Any = None
339
336
  if utils.match_response(http_res, "200", "application/json"):
340
- return utils.unmarshal_json_response(
337
+ return unmarshal_json_response(
341
338
  models.ListResponseChannelTargetResponse, http_res
342
339
  )
343
340
  if utils.match_response(http_res, "422", "application/json"):
344
- response_data = utils.unmarshal_json_response(
341
+ response_data = unmarshal_json_response(
345
342
  errors.HTTPValidationErrorData, http_res
346
343
  )
347
344
  raise errors.HTTPValidationError(response_data, http_res)
@@ -450,11 +447,11 @@ class Targets(BaseSDK):
450
447
 
451
448
  response_data: Any = None
452
449
  if utils.match_response(http_res, "200", "application/json"):
453
- return utils.unmarshal_json_response(
450
+ return unmarshal_json_response(
454
451
  models.ListResponseChannelTargetResponse, http_res
455
452
  )
456
453
  if utils.match_response(http_res, "422", "application/json"):
457
- response_data = utils.unmarshal_json_response(
454
+ response_data = unmarshal_json_response(
458
455
  errors.HTTPValidationErrorData, http_res
459
456
  )
460
457
  raise errors.HTTPValidationError(response_data, http_res)
@@ -554,9 +551,9 @@ class Targets(BaseSDK):
554
551
 
555
552
  response_data: Any = None
556
553
  if utils.match_response(http_res, "200", "application/json"):
557
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
554
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
558
555
  if utils.match_response(http_res, "422", "application/json"):
559
- response_data = utils.unmarshal_json_response(
556
+ response_data = unmarshal_json_response(
560
557
  errors.HTTPValidationErrorData, http_res
561
558
  )
562
559
  raise errors.HTTPValidationError(response_data, http_res)
@@ -656,9 +653,9 @@ class Targets(BaseSDK):
656
653
 
657
654
  response_data: Any = None
658
655
  if utils.match_response(http_res, "200", "application/json"):
659
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
656
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
660
657
  if utils.match_response(http_res, "422", "application/json"):
661
- response_data = utils.unmarshal_json_response(
658
+ response_data = unmarshal_json_response(
662
659
  errors.HTTPValidationErrorData, http_res
663
660
  )
664
661
  raise errors.HTTPValidationError(response_data, http_res)
@@ -746,9 +743,9 @@ class Targets(BaseSDK):
746
743
 
747
744
  response_data: Any = None
748
745
  if utils.match_response(http_res, "200", "application/json"):
749
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
746
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
750
747
  if utils.match_response(http_res, "422", "application/json"):
751
- response_data = utils.unmarshal_json_response(
748
+ response_data = unmarshal_json_response(
752
749
  errors.HTTPValidationErrorData, http_res
753
750
  )
754
751
  raise errors.HTTPValidationError(response_data, http_res)
@@ -836,9 +833,9 @@ class Targets(BaseSDK):
836
833
 
837
834
  response_data: Any = None
838
835
  if utils.match_response(http_res, "200", "application/json"):
839
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
836
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
840
837
  if utils.match_response(http_res, "422", "application/json"):
841
- response_data = utils.unmarshal_json_response(
838
+ response_data = unmarshal_json_response(
842
839
  errors.HTTPValidationErrorData, http_res
843
840
  )
844
841
  raise errors.HTTPValidationError(response_data, http_res)
@@ -943,9 +940,9 @@ class Targets(BaseSDK):
943
940
 
944
941
  response_data: Any = None
945
942
  if utils.match_response(http_res, "200", "application/json"):
946
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
943
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
947
944
  if utils.match_response(http_res, "422", "application/json"):
948
- response_data = utils.unmarshal_json_response(
945
+ response_data = unmarshal_json_response(
949
946
  errors.HTTPValidationErrorData, http_res
950
947
  )
951
948
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1050,9 +1047,9 @@ class Targets(BaseSDK):
1050
1047
 
1051
1048
  response_data: Any = None
1052
1049
  if utils.match_response(http_res, "200", "application/json"):
1053
- return utils.unmarshal_json_response(models.ChannelTargetResponse, http_res)
1050
+ return unmarshal_json_response(models.ChannelTargetResponse, http_res)
1054
1051
  if utils.match_response(http_res, "422", "application/json"):
1055
- response_data = utils.unmarshal_json_response(
1052
+ response_data = unmarshal_json_response(
1056
1053
  errors.HTTPValidationErrorData, http_res
1057
1054
  )
1058
1055
  raise errors.HTTPValidationError(response_data, http_res)