camb-sdk 1.0.0__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.

Potentially problematic release.


This version of camb-sdk might be problematic. Click here for more details.

Files changed (64) hide show
  1. camb_sdk-1.0.0.dist-info/METADATA +266 -0
  2. camb_sdk-1.0.0.dist-info/RECORD +64 -0
  3. camb_sdk-1.0.0.dist-info/WHEEL +5 -0
  4. camb_sdk-1.0.0.dist-info/licenses/LICENSE +21 -0
  5. camb_sdk-1.0.0.dist-info/top_level.txt +1 -0
  6. cambai/__init__.py +145 -0
  7. cambai/api/__init__.py +12 -0
  8. cambai/api/apis_api.py +10291 -0
  9. cambai/api/audio_separation_api.py +837 -0
  10. cambai/api/dictionaries_api.py +286 -0
  11. cambai/api/dub_api.py +906 -0
  12. cambai/api/stories_api.py +1511 -0
  13. cambai/api/text_to_audio_api.py +835 -0
  14. cambai/api/text_to_speech_api.py +574 -0
  15. cambai/api/text_to_voice_api.py +840 -0
  16. cambai/api_client.py +801 -0
  17. cambai/api_response.py +21 -0
  18. cambai/configuration.py +603 -0
  19. cambai/exceptions.py +216 -0
  20. cambai/models/__init__.py +58 -0
  21. cambai/models/audio_output_file_url_response.py +87 -0
  22. cambai/models/audio_output_type.py +39 -0
  23. cambai/models/audio_separation_run_info_response.py +89 -0
  24. cambai/models/body_translate_translate_post.py +103 -0
  25. cambai/models/create_api_key_request_payload.py +89 -0
  26. cambai/models/create_custom_voice_out.py +87 -0
  27. cambai/models/create_text_to_audio_request_payload.py +89 -0
  28. cambai/models/create_text_to_voice_request_payload.py +89 -0
  29. cambai/models/create_translated_story_request_payload.py +88 -0
  30. cambai/models/create_translated_tts_request_payload.py +120 -0
  31. cambai/models/create_translation_stream_request_payload.py +108 -0
  32. cambai/models/create_tts_request_payload.py +102 -0
  33. cambai/models/create_tts_stream_request_payload.py +100 -0
  34. cambai/models/dialogue_item.py +93 -0
  35. cambai/models/dictionary.py +96 -0
  36. cambai/models/dub_alt_format_response_body.py +92 -0
  37. cambai/models/dubbed_output_in_alt_format_request_payload.py +91 -0
  38. cambai/models/end_to_end_dubbing_request_payload.py +99 -0
  39. cambai/models/expire_api_key_request_payload.py +87 -0
  40. cambai/models/formalities.py +37 -0
  41. cambai/models/gender.py +39 -0
  42. cambai/models/http_validation_error.py +95 -0
  43. cambai/models/language_item.py +91 -0
  44. cambai/models/languages.py +183 -0
  45. cambai/models/orchestrator_pipeline_result.py +95 -0
  46. cambai/models/output_api_key.py +105 -0
  47. cambai/models/output_format.py +134 -0
  48. cambai/models/output_type.py +37 -0
  49. cambai/models/request_dubbed_output_in_alt_format200_response.py +137 -0
  50. cambai/models/run_info_response.py +101 -0
  51. cambai/models/story_run_info_response.py +99 -0
  52. cambai/models/task_id.py +87 -0
  53. cambai/models/task_status.py +40 -0
  54. cambai/models/text_to_voice_run_info_response.py +87 -0
  55. cambai/models/transcript_data_type.py +37 -0
  56. cambai/models/transcript_file_format.py +38 -0
  57. cambai/models/translation_result.py +87 -0
  58. cambai/models/tts_stream_output_format.py +40 -0
  59. cambai/models/validation_error.py +99 -0
  60. cambai/models/validation_error_loc_inner.py +138 -0
  61. cambai/models/video_output_type_without_avi.py +38 -0
  62. cambai/models/voice_item.py +102 -0
  63. cambai/py.typed +0 -0
  64. cambai/rest.py +258 -0
@@ -0,0 +1,835 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBytes, StrictInt, StrictStr
20
+ from typing import Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from cambai.models.create_text_to_audio_request_payload import CreateTextToAudioRequestPayload
23
+ from cambai.models.orchestrator_pipeline_result import OrchestratorPipelineResult
24
+ from cambai.models.task_id import TaskID
25
+
26
+ from cambai.api_client import ApiClient, RequestSerialized
27
+ from cambai.api_response import ApiResponse
28
+ from cambai.rest import RESTResponseType
29
+
30
+
31
+ class TextToAudioApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ def create_text_to_sound(
46
+ self,
47
+ create_text_to_audio_request_payload: CreateTextToAudioRequestPayload,
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> TaskID:
61
+ """Create Text to Sound
62
+
63
+
64
+ :param create_text_to_audio_request_payload: (required)
65
+ :type create_text_to_audio_request_payload: CreateTextToAudioRequestPayload
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ :type _request_timeout: int, tuple(int, int), optional
71
+ :param _request_auth: set to override the auth_settings for an a single
72
+ request; this effectively ignores the
73
+ authentication in the spec for a single request.
74
+ :type _request_auth: dict, optional
75
+ :param _content_type: force content-type for the request.
76
+ :type _content_type: str, Optional
77
+ :param _headers: set to override the headers for a single
78
+ request; this effectively ignores the headers
79
+ in the spec for a single request.
80
+ :type _headers: dict, optional
81
+ :param _host_index: set to override the host_index for a single
82
+ request; this effectively ignores the host_index
83
+ in the spec for a single request.
84
+ :type _host_index: int, optional
85
+ :return: Returns the result object.
86
+ """ # noqa: E501
87
+
88
+ _param = self._create_text_to_sound_serialize(
89
+ create_text_to_audio_request_payload=create_text_to_audio_request_payload,
90
+ _request_auth=_request_auth,
91
+ _content_type=_content_type,
92
+ _headers=_headers,
93
+ _host_index=_host_index
94
+ )
95
+
96
+ _response_types_map: Dict[str, Optional[str]] = {
97
+ '200': "TaskID",
98
+ '422': "HTTPValidationError",
99
+ }
100
+ response_data = self.api_client.call_api(
101
+ *_param,
102
+ _request_timeout=_request_timeout
103
+ )
104
+ response_data.read()
105
+ return self.api_client.response_deserialize(
106
+ response_data=response_data,
107
+ response_types_map=_response_types_map,
108
+ ).data
109
+
110
+
111
+ @validate_call
112
+ def create_text_to_sound_with_http_info(
113
+ self,
114
+ create_text_to_audio_request_payload: CreateTextToAudioRequestPayload,
115
+ _request_timeout: Union[
116
+ None,
117
+ Annotated[StrictFloat, Field(gt=0)],
118
+ Tuple[
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Annotated[StrictFloat, Field(gt=0)]
121
+ ]
122
+ ] = None,
123
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
124
+ _content_type: Optional[StrictStr] = None,
125
+ _headers: Optional[Dict[StrictStr, Any]] = None,
126
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
127
+ ) -> ApiResponse[TaskID]:
128
+ """Create Text to Sound
129
+
130
+
131
+ :param create_text_to_audio_request_payload: (required)
132
+ :type create_text_to_audio_request_payload: CreateTextToAudioRequestPayload
133
+ :param _request_timeout: timeout setting for this request. If one
134
+ number provided, it will be total request
135
+ timeout. It can also be a pair (tuple) of
136
+ (connection, read) timeouts.
137
+ :type _request_timeout: int, tuple(int, int), optional
138
+ :param _request_auth: set to override the auth_settings for an a single
139
+ request; this effectively ignores the
140
+ authentication in the spec for a single request.
141
+ :type _request_auth: dict, optional
142
+ :param _content_type: force content-type for the request.
143
+ :type _content_type: str, Optional
144
+ :param _headers: set to override the headers for a single
145
+ request; this effectively ignores the headers
146
+ in the spec for a single request.
147
+ :type _headers: dict, optional
148
+ :param _host_index: set to override the host_index for a single
149
+ request; this effectively ignores the host_index
150
+ in the spec for a single request.
151
+ :type _host_index: int, optional
152
+ :return: Returns the result object.
153
+ """ # noqa: E501
154
+
155
+ _param = self._create_text_to_sound_serialize(
156
+ create_text_to_audio_request_payload=create_text_to_audio_request_payload,
157
+ _request_auth=_request_auth,
158
+ _content_type=_content_type,
159
+ _headers=_headers,
160
+ _host_index=_host_index
161
+ )
162
+
163
+ _response_types_map: Dict[str, Optional[str]] = {
164
+ '200': "TaskID",
165
+ '422': "HTTPValidationError",
166
+ }
167
+ response_data = self.api_client.call_api(
168
+ *_param,
169
+ _request_timeout=_request_timeout
170
+ )
171
+ response_data.read()
172
+ return self.api_client.response_deserialize(
173
+ response_data=response_data,
174
+ response_types_map=_response_types_map,
175
+ )
176
+
177
+
178
+ @validate_call
179
+ def create_text_to_sound_without_preload_content(
180
+ self,
181
+ create_text_to_audio_request_payload: CreateTextToAudioRequestPayload,
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Annotated[StrictFloat, Field(gt=0)]
188
+ ]
189
+ ] = None,
190
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
191
+ _content_type: Optional[StrictStr] = None,
192
+ _headers: Optional[Dict[StrictStr, Any]] = None,
193
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
194
+ ) -> RESTResponseType:
195
+ """Create Text to Sound
196
+
197
+
198
+ :param create_text_to_audio_request_payload: (required)
199
+ :type create_text_to_audio_request_payload: CreateTextToAudioRequestPayload
200
+ :param _request_timeout: timeout setting for this request. If one
201
+ number provided, it will be total request
202
+ timeout. It can also be a pair (tuple) of
203
+ (connection, read) timeouts.
204
+ :type _request_timeout: int, tuple(int, int), optional
205
+ :param _request_auth: set to override the auth_settings for an a single
206
+ request; this effectively ignores the
207
+ authentication in the spec for a single request.
208
+ :type _request_auth: dict, optional
209
+ :param _content_type: force content-type for the request.
210
+ :type _content_type: str, Optional
211
+ :param _headers: set to override the headers for a single
212
+ request; this effectively ignores the headers
213
+ in the spec for a single request.
214
+ :type _headers: dict, optional
215
+ :param _host_index: set to override the host_index for a single
216
+ request; this effectively ignores the host_index
217
+ in the spec for a single request.
218
+ :type _host_index: int, optional
219
+ :return: Returns the result object.
220
+ """ # noqa: E501
221
+
222
+ _param = self._create_text_to_sound_serialize(
223
+ create_text_to_audio_request_payload=create_text_to_audio_request_payload,
224
+ _request_auth=_request_auth,
225
+ _content_type=_content_type,
226
+ _headers=_headers,
227
+ _host_index=_host_index
228
+ )
229
+
230
+ _response_types_map: Dict[str, Optional[str]] = {
231
+ '200': "TaskID",
232
+ '422': "HTTPValidationError",
233
+ }
234
+ response_data = self.api_client.call_api(
235
+ *_param,
236
+ _request_timeout=_request_timeout
237
+ )
238
+ return response_data.response
239
+
240
+
241
+ def _create_text_to_sound_serialize(
242
+ self,
243
+ create_text_to_audio_request_payload,
244
+ _request_auth,
245
+ _content_type,
246
+ _headers,
247
+ _host_index,
248
+ ) -> RequestSerialized:
249
+
250
+ _host = None
251
+
252
+ _collection_formats: Dict[str, str] = {
253
+ }
254
+
255
+ _path_params: Dict[str, str] = {}
256
+ _query_params: List[Tuple[str, str]] = []
257
+ _header_params: Dict[str, Optional[str]] = _headers or {}
258
+ _form_params: List[Tuple[str, str]] = []
259
+ _files: Dict[
260
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
261
+ ] = {}
262
+ _body_params: Optional[bytes] = None
263
+
264
+ # process the path parameters
265
+ # process the query parameters
266
+ # process the header parameters
267
+ # process the form parameters
268
+ # process the body parameter
269
+ if create_text_to_audio_request_payload is not None:
270
+ _body_params = create_text_to_audio_request_payload
271
+
272
+
273
+ # set the HTTP header `Accept`
274
+ if 'Accept' not in _header_params:
275
+ _header_params['Accept'] = self.api_client.select_header_accept(
276
+ [
277
+ 'application/json'
278
+ ]
279
+ )
280
+
281
+ # set the HTTP header `Content-Type`
282
+ if _content_type:
283
+ _header_params['Content-Type'] = _content_type
284
+ else:
285
+ _default_content_type = (
286
+ self.api_client.select_header_content_type(
287
+ [
288
+ 'application/json'
289
+ ]
290
+ )
291
+ )
292
+ if _default_content_type is not None:
293
+ _header_params['Content-Type'] = _default_content_type
294
+
295
+ # authentication setting
296
+ _auth_settings: List[str] = [
297
+ 'APIKeyHeader'
298
+ ]
299
+
300
+ return self.api_client.param_serialize(
301
+ method='POST',
302
+ resource_path='/text-to-sound',
303
+ path_params=_path_params,
304
+ query_params=_query_params,
305
+ header_params=_header_params,
306
+ body=_body_params,
307
+ post_params=_form_params,
308
+ files=_files,
309
+ auth_settings=_auth_settings,
310
+ collection_formats=_collection_formats,
311
+ _host=_host,
312
+ _request_auth=_request_auth
313
+ )
314
+
315
+
316
+
317
+
318
+ @validate_call
319
+ def get_text_to_audio_status_by_id(
320
+ self,
321
+ task_id: StrictStr,
322
+ _request_timeout: Union[
323
+ None,
324
+ Annotated[StrictFloat, Field(gt=0)],
325
+ Tuple[
326
+ Annotated[StrictFloat, Field(gt=0)],
327
+ Annotated[StrictFloat, Field(gt=0)]
328
+ ]
329
+ ] = None,
330
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
331
+ _content_type: Optional[StrictStr] = None,
332
+ _headers: Optional[Dict[StrictStr, Any]] = None,
333
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
334
+ ) -> OrchestratorPipelineResult:
335
+ """Get Text To Audio Status
336
+
337
+
338
+ :param task_id: (required)
339
+ :type task_id: str
340
+ :param _request_timeout: timeout setting for this request. If one
341
+ number provided, it will be total request
342
+ timeout. It can also be a pair (tuple) of
343
+ (connection, read) timeouts.
344
+ :type _request_timeout: int, tuple(int, int), optional
345
+ :param _request_auth: set to override the auth_settings for an a single
346
+ request; this effectively ignores the
347
+ authentication in the spec for a single request.
348
+ :type _request_auth: dict, optional
349
+ :param _content_type: force content-type for the request.
350
+ :type _content_type: str, Optional
351
+ :param _headers: set to override the headers for a single
352
+ request; this effectively ignores the headers
353
+ in the spec for a single request.
354
+ :type _headers: dict, optional
355
+ :param _host_index: set to override the host_index for a single
356
+ request; this effectively ignores the host_index
357
+ in the spec for a single request.
358
+ :type _host_index: int, optional
359
+ :return: Returns the result object.
360
+ """ # noqa: E501
361
+
362
+ _param = self._get_text_to_audio_status_by_id_serialize(
363
+ task_id=task_id,
364
+ _request_auth=_request_auth,
365
+ _content_type=_content_type,
366
+ _headers=_headers,
367
+ _host_index=_host_index
368
+ )
369
+
370
+ _response_types_map: Dict[str, Optional[str]] = {
371
+ '200': "OrchestratorPipelineResult",
372
+ '422': "HTTPValidationError",
373
+ }
374
+ response_data = self.api_client.call_api(
375
+ *_param,
376
+ _request_timeout=_request_timeout
377
+ )
378
+ response_data.read()
379
+ return self.api_client.response_deserialize(
380
+ response_data=response_data,
381
+ response_types_map=_response_types_map,
382
+ ).data
383
+
384
+
385
+ @validate_call
386
+ def get_text_to_audio_status_by_id_with_http_info(
387
+ self,
388
+ task_id: StrictStr,
389
+ _request_timeout: Union[
390
+ None,
391
+ Annotated[StrictFloat, Field(gt=0)],
392
+ Tuple[
393
+ Annotated[StrictFloat, Field(gt=0)],
394
+ Annotated[StrictFloat, Field(gt=0)]
395
+ ]
396
+ ] = None,
397
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
398
+ _content_type: Optional[StrictStr] = None,
399
+ _headers: Optional[Dict[StrictStr, Any]] = None,
400
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
401
+ ) -> ApiResponse[OrchestratorPipelineResult]:
402
+ """Get Text To Audio Status
403
+
404
+
405
+ :param task_id: (required)
406
+ :type task_id: str
407
+ :param _request_timeout: timeout setting for this request. If one
408
+ number provided, it will be total request
409
+ timeout. It can also be a pair (tuple) of
410
+ (connection, read) timeouts.
411
+ :type _request_timeout: int, tuple(int, int), optional
412
+ :param _request_auth: set to override the auth_settings for an a single
413
+ request; this effectively ignores the
414
+ authentication in the spec for a single request.
415
+ :type _request_auth: dict, optional
416
+ :param _content_type: force content-type for the request.
417
+ :type _content_type: str, Optional
418
+ :param _headers: set to override the headers for a single
419
+ request; this effectively ignores the headers
420
+ in the spec for a single request.
421
+ :type _headers: dict, optional
422
+ :param _host_index: set to override the host_index for a single
423
+ request; this effectively ignores the host_index
424
+ in the spec for a single request.
425
+ :type _host_index: int, optional
426
+ :return: Returns the result object.
427
+ """ # noqa: E501
428
+
429
+ _param = self._get_text_to_audio_status_by_id_serialize(
430
+ task_id=task_id,
431
+ _request_auth=_request_auth,
432
+ _content_type=_content_type,
433
+ _headers=_headers,
434
+ _host_index=_host_index
435
+ )
436
+
437
+ _response_types_map: Dict[str, Optional[str]] = {
438
+ '200': "OrchestratorPipelineResult",
439
+ '422': "HTTPValidationError",
440
+ }
441
+ response_data = self.api_client.call_api(
442
+ *_param,
443
+ _request_timeout=_request_timeout
444
+ )
445
+ response_data.read()
446
+ return self.api_client.response_deserialize(
447
+ response_data=response_data,
448
+ response_types_map=_response_types_map,
449
+ )
450
+
451
+
452
+ @validate_call
453
+ def get_text_to_audio_status_by_id_without_preload_content(
454
+ self,
455
+ task_id: StrictStr,
456
+ _request_timeout: Union[
457
+ None,
458
+ Annotated[StrictFloat, Field(gt=0)],
459
+ Tuple[
460
+ Annotated[StrictFloat, Field(gt=0)],
461
+ Annotated[StrictFloat, Field(gt=0)]
462
+ ]
463
+ ] = None,
464
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
465
+ _content_type: Optional[StrictStr] = None,
466
+ _headers: Optional[Dict[StrictStr, Any]] = None,
467
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
468
+ ) -> RESTResponseType:
469
+ """Get Text To Audio Status
470
+
471
+
472
+ :param task_id: (required)
473
+ :type task_id: str
474
+ :param _request_timeout: timeout setting for this request. If one
475
+ number provided, it will be total request
476
+ timeout. It can also be a pair (tuple) of
477
+ (connection, read) timeouts.
478
+ :type _request_timeout: int, tuple(int, int), optional
479
+ :param _request_auth: set to override the auth_settings for an a single
480
+ request; this effectively ignores the
481
+ authentication in the spec for a single request.
482
+ :type _request_auth: dict, optional
483
+ :param _content_type: force content-type for the request.
484
+ :type _content_type: str, Optional
485
+ :param _headers: set to override the headers for a single
486
+ request; this effectively ignores the headers
487
+ in the spec for a single request.
488
+ :type _headers: dict, optional
489
+ :param _host_index: set to override the host_index for a single
490
+ request; this effectively ignores the host_index
491
+ in the spec for a single request.
492
+ :type _host_index: int, optional
493
+ :return: Returns the result object.
494
+ """ # noqa: E501
495
+
496
+ _param = self._get_text_to_audio_status_by_id_serialize(
497
+ task_id=task_id,
498
+ _request_auth=_request_auth,
499
+ _content_type=_content_type,
500
+ _headers=_headers,
501
+ _host_index=_host_index
502
+ )
503
+
504
+ _response_types_map: Dict[str, Optional[str]] = {
505
+ '200': "OrchestratorPipelineResult",
506
+ '422': "HTTPValidationError",
507
+ }
508
+ response_data = self.api_client.call_api(
509
+ *_param,
510
+ _request_timeout=_request_timeout
511
+ )
512
+ return response_data.response
513
+
514
+
515
+ def _get_text_to_audio_status_by_id_serialize(
516
+ self,
517
+ task_id,
518
+ _request_auth,
519
+ _content_type,
520
+ _headers,
521
+ _host_index,
522
+ ) -> RequestSerialized:
523
+
524
+ _host = None
525
+
526
+ _collection_formats: Dict[str, str] = {
527
+ }
528
+
529
+ _path_params: Dict[str, str] = {}
530
+ _query_params: List[Tuple[str, str]] = []
531
+ _header_params: Dict[str, Optional[str]] = _headers or {}
532
+ _form_params: List[Tuple[str, str]] = []
533
+ _files: Dict[
534
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
535
+ ] = {}
536
+ _body_params: Optional[bytes] = None
537
+
538
+ # process the path parameters
539
+ if task_id is not None:
540
+ _path_params['task_id'] = task_id
541
+ # process the query parameters
542
+ # process the header parameters
543
+ # process the form parameters
544
+ # process the body parameter
545
+
546
+
547
+ # set the HTTP header `Accept`
548
+ if 'Accept' not in _header_params:
549
+ _header_params['Accept'] = self.api_client.select_header_accept(
550
+ [
551
+ 'application/json'
552
+ ]
553
+ )
554
+
555
+
556
+ # authentication setting
557
+ _auth_settings: List[str] = [
558
+ 'APIKeyHeader'
559
+ ]
560
+
561
+ return self.api_client.param_serialize(
562
+ method='GET',
563
+ resource_path='/text-to-sound/{task_id}',
564
+ path_params=_path_params,
565
+ query_params=_query_params,
566
+ header_params=_header_params,
567
+ body=_body_params,
568
+ post_params=_form_params,
569
+ files=_files,
570
+ auth_settings=_auth_settings,
571
+ collection_formats=_collection_formats,
572
+ _host=_host,
573
+ _request_auth=_request_auth
574
+ )
575
+
576
+
577
+
578
+
579
+ @validate_call
580
+ def get_text_to_sound_run_result_by_id(
581
+ self,
582
+ run_id: Annotated[StrictInt, Field(description="The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion.")],
583
+ _request_timeout: Union[
584
+ None,
585
+ Annotated[StrictFloat, Field(gt=0)],
586
+ Tuple[
587
+ Annotated[StrictFloat, Field(gt=0)],
588
+ Annotated[StrictFloat, Field(gt=0)]
589
+ ]
590
+ ] = None,
591
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
592
+ _content_type: Optional[StrictStr] = None,
593
+ _headers: Optional[Dict[StrictStr, Any]] = None,
594
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
595
+ ) -> bytearray:
596
+ """Get Text to Sound Run Result
597
+
598
+
599
+ :param run_id: The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion. (required)
600
+ :type run_id: int
601
+ :param _request_timeout: timeout setting for this request. If one
602
+ number provided, it will be total request
603
+ timeout. It can also be a pair (tuple) of
604
+ (connection, read) timeouts.
605
+ :type _request_timeout: int, tuple(int, int), optional
606
+ :param _request_auth: set to override the auth_settings for an a single
607
+ request; this effectively ignores the
608
+ authentication in the spec for a single request.
609
+ :type _request_auth: dict, optional
610
+ :param _content_type: force content-type for the request.
611
+ :type _content_type: str, Optional
612
+ :param _headers: set to override the headers for a single
613
+ request; this effectively ignores the headers
614
+ in the spec for a single request.
615
+ :type _headers: dict, optional
616
+ :param _host_index: set to override the host_index for a single
617
+ request; this effectively ignores the host_index
618
+ in the spec for a single request.
619
+ :type _host_index: int, optional
620
+ :return: Returns the result object.
621
+ """ # noqa: E501
622
+
623
+ _param = self._get_text_to_sound_run_result_by_id_serialize(
624
+ run_id=run_id,
625
+ _request_auth=_request_auth,
626
+ _content_type=_content_type,
627
+ _headers=_headers,
628
+ _host_index=_host_index
629
+ )
630
+
631
+ _response_types_map: Dict[str, Optional[str]] = {
632
+ '200': "bytearray",
633
+ }
634
+ response_data = self.api_client.call_api(
635
+ *_param,
636
+ _request_timeout=_request_timeout
637
+ )
638
+ response_data.read()
639
+ return self.api_client.response_deserialize(
640
+ response_data=response_data,
641
+ response_types_map=_response_types_map,
642
+ ).data
643
+
644
+
645
+ @validate_call
646
+ def get_text_to_sound_run_result_by_id_with_http_info(
647
+ self,
648
+ run_id: Annotated[StrictInt, Field(description="The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion.")],
649
+ _request_timeout: Union[
650
+ None,
651
+ Annotated[StrictFloat, Field(gt=0)],
652
+ Tuple[
653
+ Annotated[StrictFloat, Field(gt=0)],
654
+ Annotated[StrictFloat, Field(gt=0)]
655
+ ]
656
+ ] = None,
657
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
658
+ _content_type: Optional[StrictStr] = None,
659
+ _headers: Optional[Dict[StrictStr, Any]] = None,
660
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
661
+ ) -> ApiResponse[bytearray]:
662
+ """Get Text to Sound Run Result
663
+
664
+
665
+ :param run_id: The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion. (required)
666
+ :type run_id: int
667
+ :param _request_timeout: timeout setting for this request. If one
668
+ number provided, it will be total request
669
+ timeout. It can also be a pair (tuple) of
670
+ (connection, read) timeouts.
671
+ :type _request_timeout: int, tuple(int, int), optional
672
+ :param _request_auth: set to override the auth_settings for an a single
673
+ request; this effectively ignores the
674
+ authentication in the spec for a single request.
675
+ :type _request_auth: dict, optional
676
+ :param _content_type: force content-type for the request.
677
+ :type _content_type: str, Optional
678
+ :param _headers: set to override the headers for a single
679
+ request; this effectively ignores the headers
680
+ in the spec for a single request.
681
+ :type _headers: dict, optional
682
+ :param _host_index: set to override the host_index for a single
683
+ request; this effectively ignores the host_index
684
+ in the spec for a single request.
685
+ :type _host_index: int, optional
686
+ :return: Returns the result object.
687
+ """ # noqa: E501
688
+
689
+ _param = self._get_text_to_sound_run_result_by_id_serialize(
690
+ run_id=run_id,
691
+ _request_auth=_request_auth,
692
+ _content_type=_content_type,
693
+ _headers=_headers,
694
+ _host_index=_host_index
695
+ )
696
+
697
+ _response_types_map: Dict[str, Optional[str]] = {
698
+ '200': "bytearray",
699
+ }
700
+ response_data = self.api_client.call_api(
701
+ *_param,
702
+ _request_timeout=_request_timeout
703
+ )
704
+ response_data.read()
705
+ return self.api_client.response_deserialize(
706
+ response_data=response_data,
707
+ response_types_map=_response_types_map,
708
+ )
709
+
710
+
711
+ @validate_call
712
+ def get_text_to_sound_run_result_by_id_without_preload_content(
713
+ self,
714
+ run_id: Annotated[StrictInt, Field(description="The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion.")],
715
+ _request_timeout: Union[
716
+ None,
717
+ Annotated[StrictFloat, Field(gt=0)],
718
+ Tuple[
719
+ Annotated[StrictFloat, Field(gt=0)],
720
+ Annotated[StrictFloat, Field(gt=0)]
721
+ ]
722
+ ] = None,
723
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
724
+ _content_type: Optional[StrictStr] = None,
725
+ _headers: Optional[Dict[StrictStr, Any]] = None,
726
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
727
+ ) -> RESTResponseType:
728
+ """Get Text to Sound Run Result
729
+
730
+
731
+ :param run_id: The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion. (required)
732
+ :type run_id: int
733
+ :param _request_timeout: timeout setting for this request. If one
734
+ number provided, it will be total request
735
+ timeout. It can also be a pair (tuple) of
736
+ (connection, read) timeouts.
737
+ :type _request_timeout: int, tuple(int, int), optional
738
+ :param _request_auth: set to override the auth_settings for an a single
739
+ request; this effectively ignores the
740
+ authentication in the spec for a single request.
741
+ :type _request_auth: dict, optional
742
+ :param _content_type: force content-type for the request.
743
+ :type _content_type: str, Optional
744
+ :param _headers: set to override the headers for a single
745
+ request; this effectively ignores the headers
746
+ in the spec for a single request.
747
+ :type _headers: dict, optional
748
+ :param _host_index: set to override the host_index for a single
749
+ request; this effectively ignores the host_index
750
+ in the spec for a single request.
751
+ :type _host_index: int, optional
752
+ :return: Returns the result object.
753
+ """ # noqa: E501
754
+
755
+ _param = self._get_text_to_sound_run_result_by_id_serialize(
756
+ run_id=run_id,
757
+ _request_auth=_request_auth,
758
+ _content_type=_content_type,
759
+ _headers=_headers,
760
+ _host_index=_host_index
761
+ )
762
+
763
+ _response_types_map: Dict[str, Optional[str]] = {
764
+ '200': "bytearray",
765
+ }
766
+ response_data = self.api_client.call_api(
767
+ *_param,
768
+ _request_timeout=_request_timeout
769
+ )
770
+ return response_data.response
771
+
772
+
773
+ def _get_text_to_sound_run_result_by_id_serialize(
774
+ self,
775
+ run_id,
776
+ _request_auth,
777
+ _content_type,
778
+ _headers,
779
+ _host_index,
780
+ ) -> RequestSerialized:
781
+
782
+ _host = None
783
+
784
+ _collection_formats: Dict[str, str] = {
785
+ }
786
+
787
+ _path_params: Dict[str, str] = {}
788
+ _query_params: List[Tuple[str, str]] = []
789
+ _header_params: Dict[str, Optional[str]] = _headers or {}
790
+ _form_params: List[Tuple[str, str]] = []
791
+ _files: Dict[
792
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
793
+ ] = {}
794
+ _body_params: Optional[bytes] = None
795
+
796
+ # process the path parameters
797
+ if run_id is not None:
798
+ _path_params['run_id'] = run_id
799
+ # process the query parameters
800
+ # process the header parameters
801
+ # process the form parameters
802
+ # process the body parameter
803
+
804
+
805
+ # set the HTTP header `Accept`
806
+ if 'Accept' not in _header_params:
807
+ _header_params['Accept'] = self.api_client.select_header_accept(
808
+ [
809
+ 'audio/wav',
810
+ 'application/json'
811
+ ]
812
+ )
813
+
814
+
815
+ # authentication setting
816
+ _auth_settings: List[str] = [
817
+ 'APIKeyHeader'
818
+ ]
819
+
820
+ return self.api_client.param_serialize(
821
+ method='GET',
822
+ resource_path='/text-to-sound-result/{run_id}',
823
+ path_params=_path_params,
824
+ query_params=_query_params,
825
+ header_params=_header_params,
826
+ body=_body_params,
827
+ post_params=_form_params,
828
+ files=_files,
829
+ auth_settings=_auth_settings,
830
+ collection_formats=_collection_formats,
831
+ _host=_host,
832
+ _request_auth=_request_auth
833
+ )
834
+
835
+