syllable-sdk 0.38.20__py3-none-any.whl → 0.38.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- syllable_sdk/_version.py +2 -2
- syllable_sdk/language_groups.py +59 -20
- syllable_sdk/models/__init__.py +64 -0
- syllable_sdk/models/channelservices.py +1 -0
- syllable_sdk/models/languagegroupcreaterequest.py +2 -2
- syllable_sdk/models/languagegroupproperties.py +1 -1
- syllable_sdk/models/languagegroupresponse.py +6 -6
- syllable_sdk/models/languagegroupupdaterequest.py +2 -2
- syllable_sdk/models/languagesamplecreaterequest.py +95 -0
- syllable_sdk/models/listresponse_voicegroupresponse_.py +74 -0
- syllable_sdk/models/organizationchannelconfig.py +18 -2
- syllable_sdk/models/voice_groups_deleteop.py +21 -0
- syllable_sdk/models/voice_groups_get_by_idop.py +16 -0
- syllable_sdk/models/voice_groups_listop.py +140 -0
- syllable_sdk/models/voicegroupcreaterequest.py +73 -0
- syllable_sdk/models/voicegroupproperties.py +14 -0
- syllable_sdk/models/voicegroupresponse.py +111 -0
- syllable_sdk/models/voicegroupupdaterequest.py +83 -0
- syllable_sdk/sdk.py +3 -0
- syllable_sdk/voice_groups.py +1174 -0
- {syllable_sdk-0.38.20.dist-info → syllable_sdk-0.38.22.dist-info}/METADATA +17 -8
- {syllable_sdk-0.38.20.dist-info → syllable_sdk-0.38.22.dist-info}/RECORD +23 -13
- {syllable_sdk-0.38.20.dist-info → syllable_sdk-0.38.22.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,1174 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
import httpx
|
|
5
|
+
from syllable_sdk import errors, models, utils
|
|
6
|
+
from syllable_sdk._hooks import HookContext
|
|
7
|
+
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
8
|
+
from syllable_sdk.utils import get_security_from_env
|
|
9
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
+
from typing import Any, List, Mapping, Optional, Union, cast
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class VoiceGroups(BaseSDK):
|
|
14
|
+
def list(
|
|
15
|
+
self,
|
|
16
|
+
*,
|
|
17
|
+
page: OptionalNullable[int] = UNSET,
|
|
18
|
+
limit: Optional[int] = 25,
|
|
19
|
+
search_fields: Optional[List[models.VoiceGroupProperties]] = None,
|
|
20
|
+
search_field_values: Optional[List[str]] = None,
|
|
21
|
+
order_by: OptionalNullable[models.VoiceGroupProperties] = UNSET,
|
|
22
|
+
order_by_direction: OptionalNullable[models.OrderByDirection] = UNSET,
|
|
23
|
+
fields: OptionalNullable[List[models.VoiceGroupProperties]] = UNSET,
|
|
24
|
+
start_datetime: OptionalNullable[str] = UNSET,
|
|
25
|
+
end_datetime: OptionalNullable[str] = UNSET,
|
|
26
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
27
|
+
server_url: Optional[str] = None,
|
|
28
|
+
timeout_ms: Optional[int] = None,
|
|
29
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
30
|
+
) -> models.ListResponseVoiceGroupResponse:
|
|
31
|
+
r"""List Voice Groups
|
|
32
|
+
|
|
33
|
+
Fetch voice groups.
|
|
34
|
+
|
|
35
|
+
:param page: The page number from which to start (0-based)
|
|
36
|
+
:param limit: The maximum number of items to return
|
|
37
|
+
:param search_fields: String names of fields to search. Correspond by index to search field values
|
|
38
|
+
:param search_field_values: Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list
|
|
39
|
+
:param order_by: The field whose value should be used to order the results
|
|
40
|
+
:param order_by_direction: The direction in which to order the results
|
|
41
|
+
:param fields: The fields to include in the response
|
|
42
|
+
:param start_datetime: The start datetime for filtering results
|
|
43
|
+
:param end_datetime: The end datetime for filtering results
|
|
44
|
+
:param retries: Override the default retry configuration for this method
|
|
45
|
+
:param server_url: Override the default server URL for this method
|
|
46
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
47
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
48
|
+
"""
|
|
49
|
+
base_url = None
|
|
50
|
+
url_variables = None
|
|
51
|
+
if timeout_ms is None:
|
|
52
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
53
|
+
|
|
54
|
+
if server_url is not None:
|
|
55
|
+
base_url = server_url
|
|
56
|
+
else:
|
|
57
|
+
base_url = self._get_url(base_url, url_variables)
|
|
58
|
+
|
|
59
|
+
request = models.VoiceGroupsListRequest(
|
|
60
|
+
page=page,
|
|
61
|
+
limit=limit,
|
|
62
|
+
search_fields=search_fields,
|
|
63
|
+
search_field_values=search_field_values,
|
|
64
|
+
order_by=order_by,
|
|
65
|
+
order_by_direction=order_by_direction,
|
|
66
|
+
fields=fields,
|
|
67
|
+
start_datetime=start_datetime,
|
|
68
|
+
end_datetime=end_datetime,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
req = self._build_request(
|
|
72
|
+
method="GET",
|
|
73
|
+
path="/api/v1/voice_groups/",
|
|
74
|
+
base_url=base_url,
|
|
75
|
+
url_variables=url_variables,
|
|
76
|
+
request=request,
|
|
77
|
+
request_body_required=False,
|
|
78
|
+
request_has_path_params=False,
|
|
79
|
+
request_has_query_params=True,
|
|
80
|
+
user_agent_header="user-agent",
|
|
81
|
+
accept_header_value="application/json",
|
|
82
|
+
http_headers=http_headers,
|
|
83
|
+
security=self.sdk_configuration.security,
|
|
84
|
+
timeout_ms=timeout_ms,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
if retries == UNSET:
|
|
88
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
89
|
+
retries = self.sdk_configuration.retry_config
|
|
90
|
+
|
|
91
|
+
retry_config = None
|
|
92
|
+
if isinstance(retries, utils.RetryConfig):
|
|
93
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
94
|
+
|
|
95
|
+
http_res = self.do_request(
|
|
96
|
+
hook_ctx=HookContext(
|
|
97
|
+
config=self.sdk_configuration,
|
|
98
|
+
base_url=base_url or "",
|
|
99
|
+
operation_id="voice_groups_list",
|
|
100
|
+
oauth2_scopes=None,
|
|
101
|
+
security_source=get_security_from_env(
|
|
102
|
+
self.sdk_configuration.security, models.Security
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
request=req,
|
|
106
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
107
|
+
retry_config=retry_config,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response_data: Any = None
|
|
111
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
+
return unmarshal_json_response(
|
|
113
|
+
models.ListResponseVoiceGroupResponse, http_res
|
|
114
|
+
)
|
|
115
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
+
response_data = unmarshal_json_response(
|
|
117
|
+
errors.HTTPValidationErrorData, http_res
|
|
118
|
+
)
|
|
119
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
120
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
121
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
123
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
124
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
125
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
126
|
+
|
|
127
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
128
|
+
|
|
129
|
+
async def list_async(
|
|
130
|
+
self,
|
|
131
|
+
*,
|
|
132
|
+
page: OptionalNullable[int] = UNSET,
|
|
133
|
+
limit: Optional[int] = 25,
|
|
134
|
+
search_fields: Optional[List[models.VoiceGroupProperties]] = None,
|
|
135
|
+
search_field_values: Optional[List[str]] = None,
|
|
136
|
+
order_by: OptionalNullable[models.VoiceGroupProperties] = UNSET,
|
|
137
|
+
order_by_direction: OptionalNullable[models.OrderByDirection] = UNSET,
|
|
138
|
+
fields: OptionalNullable[List[models.VoiceGroupProperties]] = UNSET,
|
|
139
|
+
start_datetime: OptionalNullable[str] = UNSET,
|
|
140
|
+
end_datetime: OptionalNullable[str] = UNSET,
|
|
141
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
142
|
+
server_url: Optional[str] = None,
|
|
143
|
+
timeout_ms: Optional[int] = None,
|
|
144
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
145
|
+
) -> models.ListResponseVoiceGroupResponse:
|
|
146
|
+
r"""List Voice Groups
|
|
147
|
+
|
|
148
|
+
Fetch voice groups.
|
|
149
|
+
|
|
150
|
+
:param page: The page number from which to start (0-based)
|
|
151
|
+
:param limit: The maximum number of items to return
|
|
152
|
+
:param search_fields: String names of fields to search. Correspond by index to search field values
|
|
153
|
+
:param search_field_values: Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list
|
|
154
|
+
:param order_by: The field whose value should be used to order the results
|
|
155
|
+
:param order_by_direction: The direction in which to order the results
|
|
156
|
+
:param fields: The fields to include in the response
|
|
157
|
+
:param start_datetime: The start datetime for filtering results
|
|
158
|
+
:param end_datetime: The end datetime for filtering results
|
|
159
|
+
:param retries: Override the default retry configuration for this method
|
|
160
|
+
:param server_url: Override the default server URL for this method
|
|
161
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
162
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
163
|
+
"""
|
|
164
|
+
base_url = None
|
|
165
|
+
url_variables = None
|
|
166
|
+
if timeout_ms is None:
|
|
167
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
168
|
+
|
|
169
|
+
if server_url is not None:
|
|
170
|
+
base_url = server_url
|
|
171
|
+
else:
|
|
172
|
+
base_url = self._get_url(base_url, url_variables)
|
|
173
|
+
|
|
174
|
+
request = models.VoiceGroupsListRequest(
|
|
175
|
+
page=page,
|
|
176
|
+
limit=limit,
|
|
177
|
+
search_fields=search_fields,
|
|
178
|
+
search_field_values=search_field_values,
|
|
179
|
+
order_by=order_by,
|
|
180
|
+
order_by_direction=order_by_direction,
|
|
181
|
+
fields=fields,
|
|
182
|
+
start_datetime=start_datetime,
|
|
183
|
+
end_datetime=end_datetime,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
req = self._build_request_async(
|
|
187
|
+
method="GET",
|
|
188
|
+
path="/api/v1/voice_groups/",
|
|
189
|
+
base_url=base_url,
|
|
190
|
+
url_variables=url_variables,
|
|
191
|
+
request=request,
|
|
192
|
+
request_body_required=False,
|
|
193
|
+
request_has_path_params=False,
|
|
194
|
+
request_has_query_params=True,
|
|
195
|
+
user_agent_header="user-agent",
|
|
196
|
+
accept_header_value="application/json",
|
|
197
|
+
http_headers=http_headers,
|
|
198
|
+
security=self.sdk_configuration.security,
|
|
199
|
+
timeout_ms=timeout_ms,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if retries == UNSET:
|
|
203
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
204
|
+
retries = self.sdk_configuration.retry_config
|
|
205
|
+
|
|
206
|
+
retry_config = None
|
|
207
|
+
if isinstance(retries, utils.RetryConfig):
|
|
208
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
209
|
+
|
|
210
|
+
http_res = await self.do_request_async(
|
|
211
|
+
hook_ctx=HookContext(
|
|
212
|
+
config=self.sdk_configuration,
|
|
213
|
+
base_url=base_url or "",
|
|
214
|
+
operation_id="voice_groups_list",
|
|
215
|
+
oauth2_scopes=None,
|
|
216
|
+
security_source=get_security_from_env(
|
|
217
|
+
self.sdk_configuration.security, models.Security
|
|
218
|
+
),
|
|
219
|
+
),
|
|
220
|
+
request=req,
|
|
221
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
222
|
+
retry_config=retry_config,
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
response_data: Any = None
|
|
226
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
227
|
+
return unmarshal_json_response(
|
|
228
|
+
models.ListResponseVoiceGroupResponse, http_res
|
|
229
|
+
)
|
|
230
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
231
|
+
response_data = unmarshal_json_response(
|
|
232
|
+
errors.HTTPValidationErrorData, http_res
|
|
233
|
+
)
|
|
234
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
235
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
236
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
237
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
238
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
239
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
240
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
241
|
+
|
|
242
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
243
|
+
|
|
244
|
+
def create(
|
|
245
|
+
self,
|
|
246
|
+
*,
|
|
247
|
+
request: Union[
|
|
248
|
+
models.VoiceGroupCreateRequest, models.VoiceGroupCreateRequestTypedDict
|
|
249
|
+
],
|
|
250
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
251
|
+
server_url: Optional[str] = None,
|
|
252
|
+
timeout_ms: Optional[int] = None,
|
|
253
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
254
|
+
) -> models.VoiceGroupResponse:
|
|
255
|
+
r"""Create Voice Group
|
|
256
|
+
|
|
257
|
+
Create a new voice group.
|
|
258
|
+
|
|
259
|
+
:param request: The request object to send.
|
|
260
|
+
:param retries: Override the default retry configuration for this method
|
|
261
|
+
:param server_url: Override the default server URL for this method
|
|
262
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
263
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
264
|
+
"""
|
|
265
|
+
base_url = None
|
|
266
|
+
url_variables = None
|
|
267
|
+
if timeout_ms is None:
|
|
268
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
269
|
+
|
|
270
|
+
if server_url is not None:
|
|
271
|
+
base_url = server_url
|
|
272
|
+
else:
|
|
273
|
+
base_url = self._get_url(base_url, url_variables)
|
|
274
|
+
|
|
275
|
+
if not isinstance(request, BaseModel):
|
|
276
|
+
request = utils.unmarshal(request, models.VoiceGroupCreateRequest)
|
|
277
|
+
request = cast(models.VoiceGroupCreateRequest, request)
|
|
278
|
+
|
|
279
|
+
req = self._build_request(
|
|
280
|
+
method="POST",
|
|
281
|
+
path="/api/v1/voice_groups/",
|
|
282
|
+
base_url=base_url,
|
|
283
|
+
url_variables=url_variables,
|
|
284
|
+
request=request,
|
|
285
|
+
request_body_required=True,
|
|
286
|
+
request_has_path_params=False,
|
|
287
|
+
request_has_query_params=True,
|
|
288
|
+
user_agent_header="user-agent",
|
|
289
|
+
accept_header_value="application/json",
|
|
290
|
+
http_headers=http_headers,
|
|
291
|
+
security=self.sdk_configuration.security,
|
|
292
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
293
|
+
request, False, False, "json", models.VoiceGroupCreateRequest
|
|
294
|
+
),
|
|
295
|
+
timeout_ms=timeout_ms,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
if retries == UNSET:
|
|
299
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
300
|
+
retries = self.sdk_configuration.retry_config
|
|
301
|
+
|
|
302
|
+
retry_config = None
|
|
303
|
+
if isinstance(retries, utils.RetryConfig):
|
|
304
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
305
|
+
|
|
306
|
+
http_res = self.do_request(
|
|
307
|
+
hook_ctx=HookContext(
|
|
308
|
+
config=self.sdk_configuration,
|
|
309
|
+
base_url=base_url or "",
|
|
310
|
+
operation_id="voice_groups_create",
|
|
311
|
+
oauth2_scopes=None,
|
|
312
|
+
security_source=get_security_from_env(
|
|
313
|
+
self.sdk_configuration.security, models.Security
|
|
314
|
+
),
|
|
315
|
+
),
|
|
316
|
+
request=req,
|
|
317
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
318
|
+
retry_config=retry_config,
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
response_data: Any = None
|
|
322
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
323
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
324
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
325
|
+
response_data = unmarshal_json_response(
|
|
326
|
+
errors.HTTPValidationErrorData, http_res
|
|
327
|
+
)
|
|
328
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
329
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
330
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
331
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
332
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
333
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
334
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
335
|
+
|
|
336
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
337
|
+
|
|
338
|
+
async def create_async(
|
|
339
|
+
self,
|
|
340
|
+
*,
|
|
341
|
+
request: Union[
|
|
342
|
+
models.VoiceGroupCreateRequest, models.VoiceGroupCreateRequestTypedDict
|
|
343
|
+
],
|
|
344
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
345
|
+
server_url: Optional[str] = None,
|
|
346
|
+
timeout_ms: Optional[int] = None,
|
|
347
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
348
|
+
) -> models.VoiceGroupResponse:
|
|
349
|
+
r"""Create Voice Group
|
|
350
|
+
|
|
351
|
+
Create a new voice group.
|
|
352
|
+
|
|
353
|
+
:param request: The request object to send.
|
|
354
|
+
:param retries: Override the default retry configuration for this method
|
|
355
|
+
:param server_url: Override the default server URL for this method
|
|
356
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
357
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
358
|
+
"""
|
|
359
|
+
base_url = None
|
|
360
|
+
url_variables = None
|
|
361
|
+
if timeout_ms is None:
|
|
362
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
363
|
+
|
|
364
|
+
if server_url is not None:
|
|
365
|
+
base_url = server_url
|
|
366
|
+
else:
|
|
367
|
+
base_url = self._get_url(base_url, url_variables)
|
|
368
|
+
|
|
369
|
+
if not isinstance(request, BaseModel):
|
|
370
|
+
request = utils.unmarshal(request, models.VoiceGroupCreateRequest)
|
|
371
|
+
request = cast(models.VoiceGroupCreateRequest, request)
|
|
372
|
+
|
|
373
|
+
req = self._build_request_async(
|
|
374
|
+
method="POST",
|
|
375
|
+
path="/api/v1/voice_groups/",
|
|
376
|
+
base_url=base_url,
|
|
377
|
+
url_variables=url_variables,
|
|
378
|
+
request=request,
|
|
379
|
+
request_body_required=True,
|
|
380
|
+
request_has_path_params=False,
|
|
381
|
+
request_has_query_params=True,
|
|
382
|
+
user_agent_header="user-agent",
|
|
383
|
+
accept_header_value="application/json",
|
|
384
|
+
http_headers=http_headers,
|
|
385
|
+
security=self.sdk_configuration.security,
|
|
386
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
387
|
+
request, False, False, "json", models.VoiceGroupCreateRequest
|
|
388
|
+
),
|
|
389
|
+
timeout_ms=timeout_ms,
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
if retries == UNSET:
|
|
393
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
394
|
+
retries = self.sdk_configuration.retry_config
|
|
395
|
+
|
|
396
|
+
retry_config = None
|
|
397
|
+
if isinstance(retries, utils.RetryConfig):
|
|
398
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
399
|
+
|
|
400
|
+
http_res = await self.do_request_async(
|
|
401
|
+
hook_ctx=HookContext(
|
|
402
|
+
config=self.sdk_configuration,
|
|
403
|
+
base_url=base_url or "",
|
|
404
|
+
operation_id="voice_groups_create",
|
|
405
|
+
oauth2_scopes=None,
|
|
406
|
+
security_source=get_security_from_env(
|
|
407
|
+
self.sdk_configuration.security, models.Security
|
|
408
|
+
),
|
|
409
|
+
),
|
|
410
|
+
request=req,
|
|
411
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
412
|
+
retry_config=retry_config,
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
response_data: Any = None
|
|
416
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
417
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
418
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
419
|
+
response_data = unmarshal_json_response(
|
|
420
|
+
errors.HTTPValidationErrorData, http_res
|
|
421
|
+
)
|
|
422
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
423
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
424
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
425
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
426
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
427
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
428
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
429
|
+
|
|
430
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
431
|
+
|
|
432
|
+
def update(
|
|
433
|
+
self,
|
|
434
|
+
*,
|
|
435
|
+
request: Union[
|
|
436
|
+
models.VoiceGroupUpdateRequest, models.VoiceGroupUpdateRequestTypedDict
|
|
437
|
+
],
|
|
438
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
439
|
+
server_url: Optional[str] = None,
|
|
440
|
+
timeout_ms: Optional[int] = None,
|
|
441
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
442
|
+
) -> models.VoiceGroupResponse:
|
|
443
|
+
r"""Update Voice Group
|
|
444
|
+
|
|
445
|
+
Update an existing voice group
|
|
446
|
+
|
|
447
|
+
:param request: The request object to send.
|
|
448
|
+
:param retries: Override the default retry configuration for this method
|
|
449
|
+
:param server_url: Override the default server URL for this method
|
|
450
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
451
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
452
|
+
"""
|
|
453
|
+
base_url = None
|
|
454
|
+
url_variables = None
|
|
455
|
+
if timeout_ms is None:
|
|
456
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
457
|
+
|
|
458
|
+
if server_url is not None:
|
|
459
|
+
base_url = server_url
|
|
460
|
+
else:
|
|
461
|
+
base_url = self._get_url(base_url, url_variables)
|
|
462
|
+
|
|
463
|
+
if not isinstance(request, BaseModel):
|
|
464
|
+
request = utils.unmarshal(request, models.VoiceGroupUpdateRequest)
|
|
465
|
+
request = cast(models.VoiceGroupUpdateRequest, request)
|
|
466
|
+
|
|
467
|
+
req = self._build_request(
|
|
468
|
+
method="PUT",
|
|
469
|
+
path="/api/v1/voice_groups/",
|
|
470
|
+
base_url=base_url,
|
|
471
|
+
url_variables=url_variables,
|
|
472
|
+
request=request,
|
|
473
|
+
request_body_required=True,
|
|
474
|
+
request_has_path_params=False,
|
|
475
|
+
request_has_query_params=True,
|
|
476
|
+
user_agent_header="user-agent",
|
|
477
|
+
accept_header_value="application/json",
|
|
478
|
+
http_headers=http_headers,
|
|
479
|
+
security=self.sdk_configuration.security,
|
|
480
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
481
|
+
request, False, False, "json", models.VoiceGroupUpdateRequest
|
|
482
|
+
),
|
|
483
|
+
timeout_ms=timeout_ms,
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
if retries == UNSET:
|
|
487
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
488
|
+
retries = self.sdk_configuration.retry_config
|
|
489
|
+
|
|
490
|
+
retry_config = None
|
|
491
|
+
if isinstance(retries, utils.RetryConfig):
|
|
492
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
493
|
+
|
|
494
|
+
http_res = self.do_request(
|
|
495
|
+
hook_ctx=HookContext(
|
|
496
|
+
config=self.sdk_configuration,
|
|
497
|
+
base_url=base_url or "",
|
|
498
|
+
operation_id="voice_groups_update",
|
|
499
|
+
oauth2_scopes=None,
|
|
500
|
+
security_source=get_security_from_env(
|
|
501
|
+
self.sdk_configuration.security, models.Security
|
|
502
|
+
),
|
|
503
|
+
),
|
|
504
|
+
request=req,
|
|
505
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
506
|
+
retry_config=retry_config,
|
|
507
|
+
)
|
|
508
|
+
|
|
509
|
+
response_data: Any = None
|
|
510
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
511
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
512
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
513
|
+
response_data = unmarshal_json_response(
|
|
514
|
+
errors.HTTPValidationErrorData, http_res
|
|
515
|
+
)
|
|
516
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
517
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
518
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
519
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
520
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
521
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
522
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
523
|
+
|
|
524
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
525
|
+
|
|
526
|
+
async def update_async(
|
|
527
|
+
self,
|
|
528
|
+
*,
|
|
529
|
+
request: Union[
|
|
530
|
+
models.VoiceGroupUpdateRequest, models.VoiceGroupUpdateRequestTypedDict
|
|
531
|
+
],
|
|
532
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
533
|
+
server_url: Optional[str] = None,
|
|
534
|
+
timeout_ms: Optional[int] = None,
|
|
535
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
536
|
+
) -> models.VoiceGroupResponse:
|
|
537
|
+
r"""Update Voice Group
|
|
538
|
+
|
|
539
|
+
Update an existing voice group
|
|
540
|
+
|
|
541
|
+
:param request: The request object to send.
|
|
542
|
+
:param retries: Override the default retry configuration for this method
|
|
543
|
+
:param server_url: Override the default server URL for this method
|
|
544
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
545
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
546
|
+
"""
|
|
547
|
+
base_url = None
|
|
548
|
+
url_variables = None
|
|
549
|
+
if timeout_ms is None:
|
|
550
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
551
|
+
|
|
552
|
+
if server_url is not None:
|
|
553
|
+
base_url = server_url
|
|
554
|
+
else:
|
|
555
|
+
base_url = self._get_url(base_url, url_variables)
|
|
556
|
+
|
|
557
|
+
if not isinstance(request, BaseModel):
|
|
558
|
+
request = utils.unmarshal(request, models.VoiceGroupUpdateRequest)
|
|
559
|
+
request = cast(models.VoiceGroupUpdateRequest, request)
|
|
560
|
+
|
|
561
|
+
req = self._build_request_async(
|
|
562
|
+
method="PUT",
|
|
563
|
+
path="/api/v1/voice_groups/",
|
|
564
|
+
base_url=base_url,
|
|
565
|
+
url_variables=url_variables,
|
|
566
|
+
request=request,
|
|
567
|
+
request_body_required=True,
|
|
568
|
+
request_has_path_params=False,
|
|
569
|
+
request_has_query_params=True,
|
|
570
|
+
user_agent_header="user-agent",
|
|
571
|
+
accept_header_value="application/json",
|
|
572
|
+
http_headers=http_headers,
|
|
573
|
+
security=self.sdk_configuration.security,
|
|
574
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
575
|
+
request, False, False, "json", models.VoiceGroupUpdateRequest
|
|
576
|
+
),
|
|
577
|
+
timeout_ms=timeout_ms,
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
if retries == UNSET:
|
|
581
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
582
|
+
retries = self.sdk_configuration.retry_config
|
|
583
|
+
|
|
584
|
+
retry_config = None
|
|
585
|
+
if isinstance(retries, utils.RetryConfig):
|
|
586
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
587
|
+
|
|
588
|
+
http_res = await self.do_request_async(
|
|
589
|
+
hook_ctx=HookContext(
|
|
590
|
+
config=self.sdk_configuration,
|
|
591
|
+
base_url=base_url or "",
|
|
592
|
+
operation_id="voice_groups_update",
|
|
593
|
+
oauth2_scopes=None,
|
|
594
|
+
security_source=get_security_from_env(
|
|
595
|
+
self.sdk_configuration.security, models.Security
|
|
596
|
+
),
|
|
597
|
+
),
|
|
598
|
+
request=req,
|
|
599
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
600
|
+
retry_config=retry_config,
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
response_data: Any = None
|
|
604
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
605
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
606
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
607
|
+
response_data = unmarshal_json_response(
|
|
608
|
+
errors.HTTPValidationErrorData, http_res
|
|
609
|
+
)
|
|
610
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
611
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
612
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
613
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
614
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
615
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
616
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
617
|
+
|
|
618
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
619
|
+
|
|
620
|
+
def get_by_id(
|
|
621
|
+
self,
|
|
622
|
+
*,
|
|
623
|
+
voice_group_id: int,
|
|
624
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
625
|
+
server_url: Optional[str] = None,
|
|
626
|
+
timeout_ms: Optional[int] = None,
|
|
627
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
628
|
+
) -> models.VoiceGroupResponse:
|
|
629
|
+
r"""Get Voice Group
|
|
630
|
+
|
|
631
|
+
Fetch a given voice group.
|
|
632
|
+
|
|
633
|
+
:param voice_group_id:
|
|
634
|
+
:param retries: Override the default retry configuration for this method
|
|
635
|
+
:param server_url: Override the default server URL for this method
|
|
636
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
637
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
638
|
+
"""
|
|
639
|
+
base_url = None
|
|
640
|
+
url_variables = None
|
|
641
|
+
if timeout_ms is None:
|
|
642
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
643
|
+
|
|
644
|
+
if server_url is not None:
|
|
645
|
+
base_url = server_url
|
|
646
|
+
else:
|
|
647
|
+
base_url = self._get_url(base_url, url_variables)
|
|
648
|
+
|
|
649
|
+
request = models.VoiceGroupsGetByIDRequest(
|
|
650
|
+
voice_group_id=voice_group_id,
|
|
651
|
+
)
|
|
652
|
+
|
|
653
|
+
req = self._build_request(
|
|
654
|
+
method="GET",
|
|
655
|
+
path="/api/v1/voice_groups/{voice_group_id}",
|
|
656
|
+
base_url=base_url,
|
|
657
|
+
url_variables=url_variables,
|
|
658
|
+
request=request,
|
|
659
|
+
request_body_required=False,
|
|
660
|
+
request_has_path_params=True,
|
|
661
|
+
request_has_query_params=True,
|
|
662
|
+
user_agent_header="user-agent",
|
|
663
|
+
accept_header_value="application/json",
|
|
664
|
+
http_headers=http_headers,
|
|
665
|
+
security=self.sdk_configuration.security,
|
|
666
|
+
timeout_ms=timeout_ms,
|
|
667
|
+
)
|
|
668
|
+
|
|
669
|
+
if retries == UNSET:
|
|
670
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
671
|
+
retries = self.sdk_configuration.retry_config
|
|
672
|
+
|
|
673
|
+
retry_config = None
|
|
674
|
+
if isinstance(retries, utils.RetryConfig):
|
|
675
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
676
|
+
|
|
677
|
+
http_res = self.do_request(
|
|
678
|
+
hook_ctx=HookContext(
|
|
679
|
+
config=self.sdk_configuration,
|
|
680
|
+
base_url=base_url or "",
|
|
681
|
+
operation_id="voice_groups_get_by_id",
|
|
682
|
+
oauth2_scopes=None,
|
|
683
|
+
security_source=get_security_from_env(
|
|
684
|
+
self.sdk_configuration.security, models.Security
|
|
685
|
+
),
|
|
686
|
+
),
|
|
687
|
+
request=req,
|
|
688
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
689
|
+
retry_config=retry_config,
|
|
690
|
+
)
|
|
691
|
+
|
|
692
|
+
response_data: Any = None
|
|
693
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
694
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
695
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
696
|
+
response_data = unmarshal_json_response(
|
|
697
|
+
errors.HTTPValidationErrorData, http_res
|
|
698
|
+
)
|
|
699
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
700
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
701
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
702
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
703
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
704
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
705
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
706
|
+
|
|
707
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
708
|
+
|
|
709
|
+
async def get_by_id_async(
|
|
710
|
+
self,
|
|
711
|
+
*,
|
|
712
|
+
voice_group_id: int,
|
|
713
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
714
|
+
server_url: Optional[str] = None,
|
|
715
|
+
timeout_ms: Optional[int] = None,
|
|
716
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
717
|
+
) -> models.VoiceGroupResponse:
|
|
718
|
+
r"""Get Voice Group
|
|
719
|
+
|
|
720
|
+
Fetch a given voice group.
|
|
721
|
+
|
|
722
|
+
:param voice_group_id:
|
|
723
|
+
:param retries: Override the default retry configuration for this method
|
|
724
|
+
:param server_url: Override the default server URL for this method
|
|
725
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
726
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
727
|
+
"""
|
|
728
|
+
base_url = None
|
|
729
|
+
url_variables = None
|
|
730
|
+
if timeout_ms is None:
|
|
731
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
732
|
+
|
|
733
|
+
if server_url is not None:
|
|
734
|
+
base_url = server_url
|
|
735
|
+
else:
|
|
736
|
+
base_url = self._get_url(base_url, url_variables)
|
|
737
|
+
|
|
738
|
+
request = models.VoiceGroupsGetByIDRequest(
|
|
739
|
+
voice_group_id=voice_group_id,
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
req = self._build_request_async(
|
|
743
|
+
method="GET",
|
|
744
|
+
path="/api/v1/voice_groups/{voice_group_id}",
|
|
745
|
+
base_url=base_url,
|
|
746
|
+
url_variables=url_variables,
|
|
747
|
+
request=request,
|
|
748
|
+
request_body_required=False,
|
|
749
|
+
request_has_path_params=True,
|
|
750
|
+
request_has_query_params=True,
|
|
751
|
+
user_agent_header="user-agent",
|
|
752
|
+
accept_header_value="application/json",
|
|
753
|
+
http_headers=http_headers,
|
|
754
|
+
security=self.sdk_configuration.security,
|
|
755
|
+
timeout_ms=timeout_ms,
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
if retries == UNSET:
|
|
759
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
760
|
+
retries = self.sdk_configuration.retry_config
|
|
761
|
+
|
|
762
|
+
retry_config = None
|
|
763
|
+
if isinstance(retries, utils.RetryConfig):
|
|
764
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
765
|
+
|
|
766
|
+
http_res = await self.do_request_async(
|
|
767
|
+
hook_ctx=HookContext(
|
|
768
|
+
config=self.sdk_configuration,
|
|
769
|
+
base_url=base_url or "",
|
|
770
|
+
operation_id="voice_groups_get_by_id",
|
|
771
|
+
oauth2_scopes=None,
|
|
772
|
+
security_source=get_security_from_env(
|
|
773
|
+
self.sdk_configuration.security, models.Security
|
|
774
|
+
),
|
|
775
|
+
),
|
|
776
|
+
request=req,
|
|
777
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
778
|
+
retry_config=retry_config,
|
|
779
|
+
)
|
|
780
|
+
|
|
781
|
+
response_data: Any = None
|
|
782
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
783
|
+
return unmarshal_json_response(models.VoiceGroupResponse, http_res)
|
|
784
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
785
|
+
response_data = unmarshal_json_response(
|
|
786
|
+
errors.HTTPValidationErrorData, http_res
|
|
787
|
+
)
|
|
788
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
789
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
790
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
791
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
792
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
793
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
794
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
795
|
+
|
|
796
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
797
|
+
|
|
798
|
+
def delete(
|
|
799
|
+
self,
|
|
800
|
+
*,
|
|
801
|
+
voice_group_id: int,
|
|
802
|
+
reason: str,
|
|
803
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
804
|
+
server_url: Optional[str] = None,
|
|
805
|
+
timeout_ms: Optional[int] = None,
|
|
806
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
807
|
+
) -> Any:
|
|
808
|
+
r"""Delete Voice Group
|
|
809
|
+
|
|
810
|
+
Delete a voice group.
|
|
811
|
+
|
|
812
|
+
:param voice_group_id:
|
|
813
|
+
:param reason:
|
|
814
|
+
:param retries: Override the default retry configuration for this method
|
|
815
|
+
:param server_url: Override the default server URL for this method
|
|
816
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
817
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
818
|
+
"""
|
|
819
|
+
base_url = None
|
|
820
|
+
url_variables = None
|
|
821
|
+
if timeout_ms is None:
|
|
822
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
823
|
+
|
|
824
|
+
if server_url is not None:
|
|
825
|
+
base_url = server_url
|
|
826
|
+
else:
|
|
827
|
+
base_url = self._get_url(base_url, url_variables)
|
|
828
|
+
|
|
829
|
+
request = models.VoiceGroupsDeleteRequest(
|
|
830
|
+
voice_group_id=voice_group_id,
|
|
831
|
+
reason=reason,
|
|
832
|
+
)
|
|
833
|
+
|
|
834
|
+
req = self._build_request(
|
|
835
|
+
method="DELETE",
|
|
836
|
+
path="/api/v1/voice_groups/{voice_group_id}",
|
|
837
|
+
base_url=base_url,
|
|
838
|
+
url_variables=url_variables,
|
|
839
|
+
request=request,
|
|
840
|
+
request_body_required=False,
|
|
841
|
+
request_has_path_params=True,
|
|
842
|
+
request_has_query_params=True,
|
|
843
|
+
user_agent_header="user-agent",
|
|
844
|
+
accept_header_value="application/json",
|
|
845
|
+
http_headers=http_headers,
|
|
846
|
+
security=self.sdk_configuration.security,
|
|
847
|
+
timeout_ms=timeout_ms,
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
if retries == UNSET:
|
|
851
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
852
|
+
retries = self.sdk_configuration.retry_config
|
|
853
|
+
|
|
854
|
+
retry_config = None
|
|
855
|
+
if isinstance(retries, utils.RetryConfig):
|
|
856
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
857
|
+
|
|
858
|
+
http_res = self.do_request(
|
|
859
|
+
hook_ctx=HookContext(
|
|
860
|
+
config=self.sdk_configuration,
|
|
861
|
+
base_url=base_url or "",
|
|
862
|
+
operation_id="voice_groups_delete",
|
|
863
|
+
oauth2_scopes=None,
|
|
864
|
+
security_source=get_security_from_env(
|
|
865
|
+
self.sdk_configuration.security, models.Security
|
|
866
|
+
),
|
|
867
|
+
),
|
|
868
|
+
request=req,
|
|
869
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
870
|
+
retry_config=retry_config,
|
|
871
|
+
)
|
|
872
|
+
|
|
873
|
+
response_data: Any = None
|
|
874
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
875
|
+
return unmarshal_json_response(Any, http_res)
|
|
876
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
877
|
+
response_data = unmarshal_json_response(
|
|
878
|
+
errors.HTTPValidationErrorData, http_res
|
|
879
|
+
)
|
|
880
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
881
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
882
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
883
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
884
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
885
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
886
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
887
|
+
|
|
888
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
889
|
+
|
|
890
|
+
async def delete_async(
|
|
891
|
+
self,
|
|
892
|
+
*,
|
|
893
|
+
voice_group_id: int,
|
|
894
|
+
reason: str,
|
|
895
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
896
|
+
server_url: Optional[str] = None,
|
|
897
|
+
timeout_ms: Optional[int] = None,
|
|
898
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
899
|
+
) -> Any:
|
|
900
|
+
r"""Delete Voice Group
|
|
901
|
+
|
|
902
|
+
Delete a voice group.
|
|
903
|
+
|
|
904
|
+
:param voice_group_id:
|
|
905
|
+
:param reason:
|
|
906
|
+
:param retries: Override the default retry configuration for this method
|
|
907
|
+
:param server_url: Override the default server URL for this method
|
|
908
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
909
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
910
|
+
"""
|
|
911
|
+
base_url = None
|
|
912
|
+
url_variables = None
|
|
913
|
+
if timeout_ms is None:
|
|
914
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
915
|
+
|
|
916
|
+
if server_url is not None:
|
|
917
|
+
base_url = server_url
|
|
918
|
+
else:
|
|
919
|
+
base_url = self._get_url(base_url, url_variables)
|
|
920
|
+
|
|
921
|
+
request = models.VoiceGroupsDeleteRequest(
|
|
922
|
+
voice_group_id=voice_group_id,
|
|
923
|
+
reason=reason,
|
|
924
|
+
)
|
|
925
|
+
|
|
926
|
+
req = self._build_request_async(
|
|
927
|
+
method="DELETE",
|
|
928
|
+
path="/api/v1/voice_groups/{voice_group_id}",
|
|
929
|
+
base_url=base_url,
|
|
930
|
+
url_variables=url_variables,
|
|
931
|
+
request=request,
|
|
932
|
+
request_body_required=False,
|
|
933
|
+
request_has_path_params=True,
|
|
934
|
+
request_has_query_params=True,
|
|
935
|
+
user_agent_header="user-agent",
|
|
936
|
+
accept_header_value="application/json",
|
|
937
|
+
http_headers=http_headers,
|
|
938
|
+
security=self.sdk_configuration.security,
|
|
939
|
+
timeout_ms=timeout_ms,
|
|
940
|
+
)
|
|
941
|
+
|
|
942
|
+
if retries == UNSET:
|
|
943
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
944
|
+
retries = self.sdk_configuration.retry_config
|
|
945
|
+
|
|
946
|
+
retry_config = None
|
|
947
|
+
if isinstance(retries, utils.RetryConfig):
|
|
948
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
949
|
+
|
|
950
|
+
http_res = await self.do_request_async(
|
|
951
|
+
hook_ctx=HookContext(
|
|
952
|
+
config=self.sdk_configuration,
|
|
953
|
+
base_url=base_url or "",
|
|
954
|
+
operation_id="voice_groups_delete",
|
|
955
|
+
oauth2_scopes=None,
|
|
956
|
+
security_source=get_security_from_env(
|
|
957
|
+
self.sdk_configuration.security, models.Security
|
|
958
|
+
),
|
|
959
|
+
),
|
|
960
|
+
request=req,
|
|
961
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
962
|
+
retry_config=retry_config,
|
|
963
|
+
)
|
|
964
|
+
|
|
965
|
+
response_data: Any = None
|
|
966
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
967
|
+
return unmarshal_json_response(Any, http_res)
|
|
968
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
969
|
+
response_data = unmarshal_json_response(
|
|
970
|
+
errors.HTTPValidationErrorData, http_res
|
|
971
|
+
)
|
|
972
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
973
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
974
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
975
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
976
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
977
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
978
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
979
|
+
|
|
980
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
981
|
+
|
|
982
|
+
def voice_groups_create_voice_sample(
|
|
983
|
+
self,
|
|
984
|
+
*,
|
|
985
|
+
request: Union[
|
|
986
|
+
models.VoiceSampleCreateRequest, models.VoiceSampleCreateRequestTypedDict
|
|
987
|
+
],
|
|
988
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
989
|
+
server_url: Optional[str] = None,
|
|
990
|
+
timeout_ms: Optional[int] = None,
|
|
991
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
992
|
+
) -> httpx.Response:
|
|
993
|
+
r"""Create Voice Sample
|
|
994
|
+
|
|
995
|
+
Generate voice sample.
|
|
996
|
+
|
|
997
|
+
:param request: The request object to send.
|
|
998
|
+
:param retries: Override the default retry configuration for this method
|
|
999
|
+
:param server_url: Override the default server URL for this method
|
|
1000
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1001
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1002
|
+
"""
|
|
1003
|
+
base_url = None
|
|
1004
|
+
url_variables = None
|
|
1005
|
+
if timeout_ms is None:
|
|
1006
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1007
|
+
|
|
1008
|
+
if server_url is not None:
|
|
1009
|
+
base_url = server_url
|
|
1010
|
+
else:
|
|
1011
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1012
|
+
|
|
1013
|
+
if not isinstance(request, BaseModel):
|
|
1014
|
+
request = utils.unmarshal(request, models.VoiceSampleCreateRequest)
|
|
1015
|
+
request = cast(models.VoiceSampleCreateRequest, request)
|
|
1016
|
+
|
|
1017
|
+
req = self._build_request(
|
|
1018
|
+
method="POST",
|
|
1019
|
+
path="/api/v1/voice_groups/voices/sample",
|
|
1020
|
+
base_url=base_url,
|
|
1021
|
+
url_variables=url_variables,
|
|
1022
|
+
request=request,
|
|
1023
|
+
request_body_required=True,
|
|
1024
|
+
request_has_path_params=False,
|
|
1025
|
+
request_has_query_params=True,
|
|
1026
|
+
user_agent_header="user-agent",
|
|
1027
|
+
accept_header_value="application/octet-stream",
|
|
1028
|
+
http_headers=http_headers,
|
|
1029
|
+
security=self.sdk_configuration.security,
|
|
1030
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1031
|
+
request, False, False, "json", models.VoiceSampleCreateRequest
|
|
1032
|
+
),
|
|
1033
|
+
timeout_ms=timeout_ms,
|
|
1034
|
+
)
|
|
1035
|
+
|
|
1036
|
+
if retries == UNSET:
|
|
1037
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1038
|
+
retries = self.sdk_configuration.retry_config
|
|
1039
|
+
|
|
1040
|
+
retry_config = None
|
|
1041
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1042
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1043
|
+
|
|
1044
|
+
http_res = self.do_request(
|
|
1045
|
+
hook_ctx=HookContext(
|
|
1046
|
+
config=self.sdk_configuration,
|
|
1047
|
+
base_url=base_url or "",
|
|
1048
|
+
operation_id="voice_groups_create_voice_sample",
|
|
1049
|
+
oauth2_scopes=None,
|
|
1050
|
+
security_source=get_security_from_env(
|
|
1051
|
+
self.sdk_configuration.security, models.Security
|
|
1052
|
+
),
|
|
1053
|
+
),
|
|
1054
|
+
request=req,
|
|
1055
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1056
|
+
stream=True,
|
|
1057
|
+
retry_config=retry_config,
|
|
1058
|
+
)
|
|
1059
|
+
|
|
1060
|
+
response_data: Any = None
|
|
1061
|
+
if utils.match_response(http_res, "200", "application/octet-stream"):
|
|
1062
|
+
return http_res
|
|
1063
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1064
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1065
|
+
response_data = unmarshal_json_response(
|
|
1066
|
+
errors.HTTPValidationErrorData, http_res, http_res_text
|
|
1067
|
+
)
|
|
1068
|
+
raise errors.HTTPValidationError(response_data, http_res, http_res_text)
|
|
1069
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1070
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1071
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1072
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1073
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1074
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1075
|
+
|
|
1076
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1077
|
+
raise errors.APIError("Unexpected response received", http_res, http_res_text)
|
|
1078
|
+
|
|
1079
|
+
async def voice_groups_create_voice_sample_async(
|
|
1080
|
+
self,
|
|
1081
|
+
*,
|
|
1082
|
+
request: Union[
|
|
1083
|
+
models.VoiceSampleCreateRequest, models.VoiceSampleCreateRequestTypedDict
|
|
1084
|
+
],
|
|
1085
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1086
|
+
server_url: Optional[str] = None,
|
|
1087
|
+
timeout_ms: Optional[int] = None,
|
|
1088
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1089
|
+
) -> httpx.Response:
|
|
1090
|
+
r"""Create Voice Sample
|
|
1091
|
+
|
|
1092
|
+
Generate voice sample.
|
|
1093
|
+
|
|
1094
|
+
:param request: The request object to send.
|
|
1095
|
+
:param retries: Override the default retry configuration for this method
|
|
1096
|
+
:param server_url: Override the default server URL for this method
|
|
1097
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1098
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1099
|
+
"""
|
|
1100
|
+
base_url = None
|
|
1101
|
+
url_variables = None
|
|
1102
|
+
if timeout_ms is None:
|
|
1103
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1104
|
+
|
|
1105
|
+
if server_url is not None:
|
|
1106
|
+
base_url = server_url
|
|
1107
|
+
else:
|
|
1108
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1109
|
+
|
|
1110
|
+
if not isinstance(request, BaseModel):
|
|
1111
|
+
request = utils.unmarshal(request, models.VoiceSampleCreateRequest)
|
|
1112
|
+
request = cast(models.VoiceSampleCreateRequest, request)
|
|
1113
|
+
|
|
1114
|
+
req = self._build_request_async(
|
|
1115
|
+
method="POST",
|
|
1116
|
+
path="/api/v1/voice_groups/voices/sample",
|
|
1117
|
+
base_url=base_url,
|
|
1118
|
+
url_variables=url_variables,
|
|
1119
|
+
request=request,
|
|
1120
|
+
request_body_required=True,
|
|
1121
|
+
request_has_path_params=False,
|
|
1122
|
+
request_has_query_params=True,
|
|
1123
|
+
user_agent_header="user-agent",
|
|
1124
|
+
accept_header_value="application/octet-stream",
|
|
1125
|
+
http_headers=http_headers,
|
|
1126
|
+
security=self.sdk_configuration.security,
|
|
1127
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1128
|
+
request, False, False, "json", models.VoiceSampleCreateRequest
|
|
1129
|
+
),
|
|
1130
|
+
timeout_ms=timeout_ms,
|
|
1131
|
+
)
|
|
1132
|
+
|
|
1133
|
+
if retries == UNSET:
|
|
1134
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1135
|
+
retries = self.sdk_configuration.retry_config
|
|
1136
|
+
|
|
1137
|
+
retry_config = None
|
|
1138
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1139
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1140
|
+
|
|
1141
|
+
http_res = await self.do_request_async(
|
|
1142
|
+
hook_ctx=HookContext(
|
|
1143
|
+
config=self.sdk_configuration,
|
|
1144
|
+
base_url=base_url or "",
|
|
1145
|
+
operation_id="voice_groups_create_voice_sample",
|
|
1146
|
+
oauth2_scopes=None,
|
|
1147
|
+
security_source=get_security_from_env(
|
|
1148
|
+
self.sdk_configuration.security, models.Security
|
|
1149
|
+
),
|
|
1150
|
+
),
|
|
1151
|
+
request=req,
|
|
1152
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1153
|
+
stream=True,
|
|
1154
|
+
retry_config=retry_config,
|
|
1155
|
+
)
|
|
1156
|
+
|
|
1157
|
+
response_data: Any = None
|
|
1158
|
+
if utils.match_response(http_res, "200", "application/octet-stream"):
|
|
1159
|
+
return http_res
|
|
1160
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1161
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1162
|
+
response_data = unmarshal_json_response(
|
|
1163
|
+
errors.HTTPValidationErrorData, http_res, http_res_text
|
|
1164
|
+
)
|
|
1165
|
+
raise errors.HTTPValidationError(response_data, http_res, http_res_text)
|
|
1166
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1167
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1168
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1169
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1170
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1171
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1172
|
+
|
|
1173
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1174
|
+
raise errors.APIError("Unexpected response received", http_res, http_res_text)
|