syllable-sdk 0.35.32__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.
- syllable_sdk/__init__.py +0 -1
- syllable_sdk/_version.py +3 -3
- syllable_sdk/agents.py +80 -211
- syllable_sdk/basesdk.py +5 -5
- syllable_sdk/batches.py +132 -329
- syllable_sdk/campaigns.py +74 -183
- syllable_sdk/channels.py +30 -73
- syllable_sdk/conversations.py +16 -37
- syllable_sdk/custom_messages.py +74 -183
- syllable_sdk/dashboards.py +64 -195
- syllable_sdk/data_sources.py +74 -183
- syllable_sdk/errors/__init__.py +55 -0
- syllable_sdk/errors/apierror.py +38 -0
- syllable_sdk/errors/httpvalidationerror.py +26 -0
- syllable_sdk/errors/no_response_error.py +13 -0
- syllable_sdk/errors/responsevalidationerror.py +25 -0
- syllable_sdk/errors/syllablesdkerror.py +26 -0
- syllable_sdk/events.py +16 -37
- syllable_sdk/folders.py +116 -295
- syllable_sdk/full_summary.py +16 -37
- syllable_sdk/incidents.py +84 -215
- syllable_sdk/insights_sdk.py +16 -41
- syllable_sdk/insights_tools.py +96 -253
- syllable_sdk/language_groups.py +86 -215
- syllable_sdk/latency.py +16 -37
- syllable_sdk/models/__init__.py +0 -8
- syllable_sdk/numbers.py +44 -113
- syllable_sdk/organizations.py +52 -139
- syllable_sdk/permissions.py +12 -33
- syllable_sdk/prompts.py +94 -251
- syllable_sdk/roles.py +72 -181
- syllable_sdk/services.py +72 -185
- syllable_sdk/session_debug.py +44 -109
- syllable_sdk/session_labels.py +44 -109
- syllable_sdk/sessions.py +56 -141
- syllable_sdk/takeouts.py +36 -99
- syllable_sdk/targets.py +74 -187
- syllable_sdk/test.py +16 -37
- syllable_sdk/tools.py +72 -181
- syllable_sdk/transcript.py +18 -39
- syllable_sdk/twilio.py +44 -109
- syllable_sdk/users.py +94 -247
- syllable_sdk/utils/serializers.py +3 -2
- syllable_sdk/utils/unmarshal_json_response.py +24 -0
- syllable_sdk/v1.py +94 -247
- syllable_sdk/workflows.py +116 -291
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.34.dist-info}/METADATA +58 -45
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.34.dist-info}/RECORD +49 -44
- syllable_sdk/models/apierror.py +0 -22
- syllable_sdk/models/httpvalidationerror.py +0 -21
- {syllable_sdk-0.35.32.dist-info → syllable_sdk-0.35.34.dist-info}/WHEEL +0 -0
syllable_sdk/events.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from syllable_sdk import models, utils
|
|
4
|
+
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
|
|
9
10
|
|
|
10
11
|
|
|
@@ -107,31 +108,20 @@ class Events(BaseSDK):
|
|
|
107
108
|
|
|
108
109
|
response_data: Any = None
|
|
109
110
|
if utils.match_response(http_res, "200", "application/json"):
|
|
110
|
-
return
|
|
111
|
+
return unmarshal_json_response(models.ListResponseEvent, http_res)
|
|
111
112
|
if utils.match_response(http_res, "422", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
|
|
113
|
+
response_data = unmarshal_json_response(
|
|
114
|
+
errors.HTTPValidationErrorData, http_res
|
|
114
115
|
)
|
|
115
|
-
raise
|
|
116
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
116
117
|
if utils.match_response(http_res, "4XX", "*"):
|
|
117
118
|
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
-
raise
|
|
119
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
120
|
-
)
|
|
119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
121
120
|
if utils.match_response(http_res, "5XX", "*"):
|
|
122
121
|
http_res_text = utils.stream_to_text(http_res)
|
|
123
|
-
raise
|
|
124
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
125
|
-
)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
129
|
-
raise models.APIError(
|
|
130
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
131
|
-
http_res.status_code,
|
|
132
|
-
http_res_text,
|
|
133
|
-
http_res,
|
|
134
|
-
)
|
|
124
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
135
125
|
|
|
136
126
|
async def list_async(
|
|
137
127
|
self,
|
|
@@ -229,28 +219,17 @@ class Events(BaseSDK):
|
|
|
229
219
|
|
|
230
220
|
response_data: Any = None
|
|
231
221
|
if utils.match_response(http_res, "200", "application/json"):
|
|
232
|
-
return
|
|
222
|
+
return unmarshal_json_response(models.ListResponseEvent, http_res)
|
|
233
223
|
if utils.match_response(http_res, "422", "application/json"):
|
|
234
|
-
response_data =
|
|
235
|
-
|
|
224
|
+
response_data = unmarshal_json_response(
|
|
225
|
+
errors.HTTPValidationErrorData, http_res
|
|
236
226
|
)
|
|
237
|
-
raise
|
|
227
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
238
228
|
if utils.match_response(http_res, "4XX", "*"):
|
|
239
229
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
240
|
-
raise
|
|
241
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
242
|
-
)
|
|
230
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
243
231
|
if utils.match_response(http_res, "5XX", "*"):
|
|
244
232
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
245
|
-
raise
|
|
246
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
247
|
-
)
|
|
233
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
248
234
|
|
|
249
|
-
|
|
250
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
251
|
-
raise models.APIError(
|
|
252
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
253
|
-
http_res.status_code,
|
|
254
|
-
http_res_text,
|
|
255
|
-
http_res,
|
|
256
|
-
)
|
|
235
|
+
raise errors.APIError("Unexpected response received", http_res)
|