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,1511 @@
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, StrictBool, StrictBytes, StrictInt, StrictStr
20
+ from typing import List, Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from cambai.models.create_translated_story_request_payload import CreateTranslatedStoryRequestPayload
23
+ from cambai.models.languages import Languages
24
+ from cambai.models.orchestrator_pipeline_result import OrchestratorPipelineResult
25
+ from cambai.models.story_run_info_response import StoryRunInfoResponse
26
+ from cambai.models.task_id import TaskID
27
+
28
+ from cambai.api_client import ApiClient, RequestSerialized
29
+ from cambai.api_response import ApiResponse
30
+ from cambai.rest import RESTResponseType
31
+
32
+
33
+ class StoriesApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ def create_story(
48
+ self,
49
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story.")],
50
+ source_language: Annotated[Languages, Field(description="The language of the contents in the input file.")],
51
+ title: Annotated[Optional[StrictStr], Field(description="The title of the story.")] = None,
52
+ description: Annotated[Optional[StrictStr], Field(description="A brief description of the story.")] = None,
53
+ narrator_voice_id: Annotated[Optional[StrictInt], Field(description="Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.")] = None,
54
+ chosen_dictionaries: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.")] = None,
55
+ _request_timeout: Union[
56
+ None,
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Tuple[
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Annotated[StrictFloat, Field(gt=0)]
61
+ ]
62
+ ] = None,
63
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
64
+ _content_type: Optional[StrictStr] = None,
65
+ _headers: Optional[Dict[StrictStr, Any]] = None,
66
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
67
+ ) -> TaskID:
68
+ """Create Story
69
+
70
+
71
+ :param file: The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story. (required)
72
+ :type file: bytearray
73
+ :param source_language: The language of the contents in the input file. (required)
74
+ :type source_language: Languages
75
+ :param title: The title of the story.
76
+ :type title: str
77
+ :param description: A brief description of the story.
78
+ :type description: str
79
+ :param narrator_voice_id: Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.
80
+ :type narrator_voice_id: int
81
+ :param chosen_dictionaries: An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.
82
+ :type chosen_dictionaries: List[int]
83
+ :param _request_timeout: timeout setting for this request. If one
84
+ number provided, it will be total request
85
+ timeout. It can also be a pair (tuple) of
86
+ (connection, read) timeouts.
87
+ :type _request_timeout: int, tuple(int, int), optional
88
+ :param _request_auth: set to override the auth_settings for an a single
89
+ request; this effectively ignores the
90
+ authentication in the spec for a single request.
91
+ :type _request_auth: dict, optional
92
+ :param _content_type: force content-type for the request.
93
+ :type _content_type: str, Optional
94
+ :param _headers: set to override the headers for a single
95
+ request; this effectively ignores the headers
96
+ in the spec for a single request.
97
+ :type _headers: dict, optional
98
+ :param _host_index: set to override the host_index for a single
99
+ request; this effectively ignores the host_index
100
+ in the spec for a single request.
101
+ :type _host_index: int, optional
102
+ :return: Returns the result object.
103
+ """ # noqa: E501
104
+
105
+ _param = self._create_story_serialize(
106
+ file=file,
107
+ source_language=source_language,
108
+ title=title,
109
+ description=description,
110
+ narrator_voice_id=narrator_voice_id,
111
+ chosen_dictionaries=chosen_dictionaries,
112
+ _request_auth=_request_auth,
113
+ _content_type=_content_type,
114
+ _headers=_headers,
115
+ _host_index=_host_index
116
+ )
117
+
118
+ _response_types_map: Dict[str, Optional[str]] = {
119
+ '200': "TaskID",
120
+ '422': "HTTPValidationError",
121
+ }
122
+ response_data = self.api_client.call_api(
123
+ *_param,
124
+ _request_timeout=_request_timeout
125
+ )
126
+ response_data.read()
127
+ return self.api_client.response_deserialize(
128
+ response_data=response_data,
129
+ response_types_map=_response_types_map,
130
+ ).data
131
+
132
+
133
+ @validate_call
134
+ def create_story_with_http_info(
135
+ self,
136
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story.")],
137
+ source_language: Annotated[Languages, Field(description="The language of the contents in the input file.")],
138
+ title: Annotated[Optional[StrictStr], Field(description="The title of the story.")] = None,
139
+ description: Annotated[Optional[StrictStr], Field(description="A brief description of the story.")] = None,
140
+ narrator_voice_id: Annotated[Optional[StrictInt], Field(description="Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.")] = None,
141
+ chosen_dictionaries: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.")] = None,
142
+ _request_timeout: Union[
143
+ None,
144
+ Annotated[StrictFloat, Field(gt=0)],
145
+ Tuple[
146
+ Annotated[StrictFloat, Field(gt=0)],
147
+ Annotated[StrictFloat, Field(gt=0)]
148
+ ]
149
+ ] = None,
150
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
151
+ _content_type: Optional[StrictStr] = None,
152
+ _headers: Optional[Dict[StrictStr, Any]] = None,
153
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
154
+ ) -> ApiResponse[TaskID]:
155
+ """Create Story
156
+
157
+
158
+ :param file: The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story. (required)
159
+ :type file: bytearray
160
+ :param source_language: The language of the contents in the input file. (required)
161
+ :type source_language: Languages
162
+ :param title: The title of the story.
163
+ :type title: str
164
+ :param description: A brief description of the story.
165
+ :type description: str
166
+ :param narrator_voice_id: Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.
167
+ :type narrator_voice_id: int
168
+ :param chosen_dictionaries: An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.
169
+ :type chosen_dictionaries: List[int]
170
+ :param _request_timeout: timeout setting for this request. If one
171
+ number provided, it will be total request
172
+ timeout. It can also be a pair (tuple) of
173
+ (connection, read) timeouts.
174
+ :type _request_timeout: int, tuple(int, int), optional
175
+ :param _request_auth: set to override the auth_settings for an a single
176
+ request; this effectively ignores the
177
+ authentication in the spec for a single request.
178
+ :type _request_auth: dict, optional
179
+ :param _content_type: force content-type for the request.
180
+ :type _content_type: str, Optional
181
+ :param _headers: set to override the headers for a single
182
+ request; this effectively ignores the headers
183
+ in the spec for a single request.
184
+ :type _headers: dict, optional
185
+ :param _host_index: set to override the host_index for a single
186
+ request; this effectively ignores the host_index
187
+ in the spec for a single request.
188
+ :type _host_index: int, optional
189
+ :return: Returns the result object.
190
+ """ # noqa: E501
191
+
192
+ _param = self._create_story_serialize(
193
+ file=file,
194
+ source_language=source_language,
195
+ title=title,
196
+ description=description,
197
+ narrator_voice_id=narrator_voice_id,
198
+ chosen_dictionaries=chosen_dictionaries,
199
+ _request_auth=_request_auth,
200
+ _content_type=_content_type,
201
+ _headers=_headers,
202
+ _host_index=_host_index
203
+ )
204
+
205
+ _response_types_map: Dict[str, Optional[str]] = {
206
+ '200': "TaskID",
207
+ '422': "HTTPValidationError",
208
+ }
209
+ response_data = self.api_client.call_api(
210
+ *_param,
211
+ _request_timeout=_request_timeout
212
+ )
213
+ response_data.read()
214
+ return self.api_client.response_deserialize(
215
+ response_data=response_data,
216
+ response_types_map=_response_types_map,
217
+ )
218
+
219
+
220
+ @validate_call
221
+ def create_story_without_preload_content(
222
+ self,
223
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story.")],
224
+ source_language: Annotated[Languages, Field(description="The language of the contents in the input file.")],
225
+ title: Annotated[Optional[StrictStr], Field(description="The title of the story.")] = None,
226
+ description: Annotated[Optional[StrictStr], Field(description="A brief description of the story.")] = None,
227
+ narrator_voice_id: Annotated[Optional[StrictInt], Field(description="Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.")] = None,
228
+ chosen_dictionaries: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.")] = None,
229
+ _request_timeout: Union[
230
+ None,
231
+ Annotated[StrictFloat, Field(gt=0)],
232
+ Tuple[
233
+ Annotated[StrictFloat, Field(gt=0)],
234
+ Annotated[StrictFloat, Field(gt=0)]
235
+ ]
236
+ ] = None,
237
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
238
+ _content_type: Optional[StrictStr] = None,
239
+ _headers: Optional[Dict[StrictStr, Any]] = None,
240
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
241
+ ) -> RESTResponseType:
242
+ """Create Story
243
+
244
+
245
+ :param file: The text file (`.txt`) or Word document (`.docx`) that its contents will be used for creating a story. (required)
246
+ :type file: bytearray
247
+ :param source_language: The language of the contents in the input file. (required)
248
+ :type source_language: Languages
249
+ :param title: The title of the story.
250
+ :type title: str
251
+ :param description: A brief description of the story.
252
+ :type description: str
253
+ :param narrator_voice_id: Specifies the identifier of the AI voice that will narrate the story. This voice selection determines the tone, accent, and delivery style used to bring the contents of the uploaded .txt or .docx file to life.
254
+ :type narrator_voice_id: int
255
+ :param chosen_dictionaries: An optional list of dictionary IDs selected by the user. Each entry must be an integer corresponding to a valid dictionary ID. If provided, at least one ID is required.
256
+ :type chosen_dictionaries: List[int]
257
+ :param _request_timeout: timeout setting for this request. If one
258
+ number provided, it will be total request
259
+ timeout. It can also be a pair (tuple) of
260
+ (connection, read) timeouts.
261
+ :type _request_timeout: int, tuple(int, int), optional
262
+ :param _request_auth: set to override the auth_settings for an a single
263
+ request; this effectively ignores the
264
+ authentication in the spec for a single request.
265
+ :type _request_auth: dict, optional
266
+ :param _content_type: force content-type for the request.
267
+ :type _content_type: str, Optional
268
+ :param _headers: set to override the headers for a single
269
+ request; this effectively ignores the headers
270
+ in the spec for a single request.
271
+ :type _headers: dict, optional
272
+ :param _host_index: set to override the host_index for a single
273
+ request; this effectively ignores the host_index
274
+ in the spec for a single request.
275
+ :type _host_index: int, optional
276
+ :return: Returns the result object.
277
+ """ # noqa: E501
278
+
279
+ _param = self._create_story_serialize(
280
+ file=file,
281
+ source_language=source_language,
282
+ title=title,
283
+ description=description,
284
+ narrator_voice_id=narrator_voice_id,
285
+ chosen_dictionaries=chosen_dictionaries,
286
+ _request_auth=_request_auth,
287
+ _content_type=_content_type,
288
+ _headers=_headers,
289
+ _host_index=_host_index
290
+ )
291
+
292
+ _response_types_map: Dict[str, Optional[str]] = {
293
+ '200': "TaskID",
294
+ '422': "HTTPValidationError",
295
+ }
296
+ response_data = self.api_client.call_api(
297
+ *_param,
298
+ _request_timeout=_request_timeout
299
+ )
300
+ return response_data.response
301
+
302
+
303
+ def _create_story_serialize(
304
+ self,
305
+ file,
306
+ source_language,
307
+ title,
308
+ description,
309
+ narrator_voice_id,
310
+ chosen_dictionaries,
311
+ _request_auth,
312
+ _content_type,
313
+ _headers,
314
+ _host_index,
315
+ ) -> RequestSerialized:
316
+
317
+ _host = None
318
+
319
+ _collection_formats: Dict[str, str] = {
320
+ 'chosen_dictionaries': 'csv',
321
+ }
322
+
323
+ _path_params: Dict[str, str] = {}
324
+ _query_params: List[Tuple[str, str]] = []
325
+ _header_params: Dict[str, Optional[str]] = _headers or {}
326
+ _form_params: List[Tuple[str, str]] = []
327
+ _files: Dict[
328
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
329
+ ] = {}
330
+ _body_params: Optional[bytes] = None
331
+
332
+ # process the path parameters
333
+ # process the query parameters
334
+ # process the header parameters
335
+ # process the form parameters
336
+ if file is not None:
337
+ _files['file'] = file
338
+ if title is not None:
339
+ _form_params.append(('title', title))
340
+ if description is not None:
341
+ _form_params.append(('description', description))
342
+ if source_language is not None:
343
+ _form_params.append(('source_language', source_language))
344
+ if narrator_voice_id is not None:
345
+ _form_params.append(('narrator_voice_id', narrator_voice_id))
346
+ if chosen_dictionaries is not None:
347
+ _form_params.append(('chosen_dictionaries', chosen_dictionaries))
348
+ # process the body parameter
349
+
350
+
351
+ # set the HTTP header `Accept`
352
+ if 'Accept' not in _header_params:
353
+ _header_params['Accept'] = self.api_client.select_header_accept(
354
+ [
355
+ 'application/json'
356
+ ]
357
+ )
358
+
359
+ # set the HTTP header `Content-Type`
360
+ if _content_type:
361
+ _header_params['Content-Type'] = _content_type
362
+ else:
363
+ _default_content_type = (
364
+ self.api_client.select_header_content_type(
365
+ [
366
+ 'multipart/form-data'
367
+ ]
368
+ )
369
+ )
370
+ if _default_content_type is not None:
371
+ _header_params['Content-Type'] = _default_content_type
372
+
373
+ # authentication setting
374
+ _auth_settings: List[str] = [
375
+ 'APIKeyHeader'
376
+ ]
377
+
378
+ return self.api_client.param_serialize(
379
+ method='POST',
380
+ resource_path='/story',
381
+ path_params=_path_params,
382
+ query_params=_query_params,
383
+ header_params=_header_params,
384
+ body=_body_params,
385
+ post_params=_form_params,
386
+ files=_files,
387
+ auth_settings=_auth_settings,
388
+ collection_formats=_collection_formats,
389
+ _host=_host,
390
+ _request_auth=_request_auth
391
+ )
392
+
393
+
394
+
395
+
396
+ @validate_call
397
+ def create_translated_story(
398
+ self,
399
+ run_id: StrictInt,
400
+ create_translated_story_request_payload: CreateTranslatedStoryRequestPayload,
401
+ _request_timeout: Union[
402
+ None,
403
+ Annotated[StrictFloat, Field(gt=0)],
404
+ Tuple[
405
+ Annotated[StrictFloat, Field(gt=0)],
406
+ Annotated[StrictFloat, Field(gt=0)]
407
+ ]
408
+ ] = None,
409
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
410
+ _content_type: Optional[StrictStr] = None,
411
+ _headers: Optional[Dict[StrictStr, Any]] = None,
412
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
413
+ ) -> TaskID:
414
+ """Create Translated Story
415
+
416
+
417
+ :param run_id: (required)
418
+ :type run_id: int
419
+ :param create_translated_story_request_payload: (required)
420
+ :type create_translated_story_request_payload: CreateTranslatedStoryRequestPayload
421
+ :param _request_timeout: timeout setting for this request. If one
422
+ number provided, it will be total request
423
+ timeout. It can also be a pair (tuple) of
424
+ (connection, read) timeouts.
425
+ :type _request_timeout: int, tuple(int, int), optional
426
+ :param _request_auth: set to override the auth_settings for an a single
427
+ request; this effectively ignores the
428
+ authentication in the spec for a single request.
429
+ :type _request_auth: dict, optional
430
+ :param _content_type: force content-type for the request.
431
+ :type _content_type: str, Optional
432
+ :param _headers: set to override the headers for a single
433
+ request; this effectively ignores the headers
434
+ in the spec for a single request.
435
+ :type _headers: dict, optional
436
+ :param _host_index: set to override the host_index for a single
437
+ request; this effectively ignores the host_index
438
+ in the spec for a single request.
439
+ :type _host_index: int, optional
440
+ :return: Returns the result object.
441
+ """ # noqa: E501
442
+
443
+ _param = self._create_translated_story_serialize(
444
+ run_id=run_id,
445
+ create_translated_story_request_payload=create_translated_story_request_payload,
446
+ _request_auth=_request_auth,
447
+ _content_type=_content_type,
448
+ _headers=_headers,
449
+ _host_index=_host_index
450
+ )
451
+
452
+ _response_types_map: Dict[str, Optional[str]] = {
453
+ '200': "TaskID",
454
+ '422': "HTTPValidationError",
455
+ }
456
+ response_data = self.api_client.call_api(
457
+ *_param,
458
+ _request_timeout=_request_timeout
459
+ )
460
+ response_data.read()
461
+ return self.api_client.response_deserialize(
462
+ response_data=response_data,
463
+ response_types_map=_response_types_map,
464
+ ).data
465
+
466
+
467
+ @validate_call
468
+ def create_translated_story_with_http_info(
469
+ self,
470
+ run_id: StrictInt,
471
+ create_translated_story_request_payload: CreateTranslatedStoryRequestPayload,
472
+ _request_timeout: Union[
473
+ None,
474
+ Annotated[StrictFloat, Field(gt=0)],
475
+ Tuple[
476
+ Annotated[StrictFloat, Field(gt=0)],
477
+ Annotated[StrictFloat, Field(gt=0)]
478
+ ]
479
+ ] = None,
480
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
481
+ _content_type: Optional[StrictStr] = None,
482
+ _headers: Optional[Dict[StrictStr, Any]] = None,
483
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
484
+ ) -> ApiResponse[TaskID]:
485
+ """Create Translated Story
486
+
487
+
488
+ :param run_id: (required)
489
+ :type run_id: int
490
+ :param create_translated_story_request_payload: (required)
491
+ :type create_translated_story_request_payload: CreateTranslatedStoryRequestPayload
492
+ :param _request_timeout: timeout setting for this request. If one
493
+ number provided, it will be total request
494
+ timeout. It can also be a pair (tuple) of
495
+ (connection, read) timeouts.
496
+ :type _request_timeout: int, tuple(int, int), optional
497
+ :param _request_auth: set to override the auth_settings for an a single
498
+ request; this effectively ignores the
499
+ authentication in the spec for a single request.
500
+ :type _request_auth: dict, optional
501
+ :param _content_type: force content-type for the request.
502
+ :type _content_type: str, Optional
503
+ :param _headers: set to override the headers for a single
504
+ request; this effectively ignores the headers
505
+ in the spec for a single request.
506
+ :type _headers: dict, optional
507
+ :param _host_index: set to override the host_index for a single
508
+ request; this effectively ignores the host_index
509
+ in the spec for a single request.
510
+ :type _host_index: int, optional
511
+ :return: Returns the result object.
512
+ """ # noqa: E501
513
+
514
+ _param = self._create_translated_story_serialize(
515
+ run_id=run_id,
516
+ create_translated_story_request_payload=create_translated_story_request_payload,
517
+ _request_auth=_request_auth,
518
+ _content_type=_content_type,
519
+ _headers=_headers,
520
+ _host_index=_host_index
521
+ )
522
+
523
+ _response_types_map: Dict[str, Optional[str]] = {
524
+ '200': "TaskID",
525
+ '422': "HTTPValidationError",
526
+ }
527
+ response_data = self.api_client.call_api(
528
+ *_param,
529
+ _request_timeout=_request_timeout
530
+ )
531
+ response_data.read()
532
+ return self.api_client.response_deserialize(
533
+ response_data=response_data,
534
+ response_types_map=_response_types_map,
535
+ )
536
+
537
+
538
+ @validate_call
539
+ def create_translated_story_without_preload_content(
540
+ self,
541
+ run_id: StrictInt,
542
+ create_translated_story_request_payload: CreateTranslatedStoryRequestPayload,
543
+ _request_timeout: Union[
544
+ None,
545
+ Annotated[StrictFloat, Field(gt=0)],
546
+ Tuple[
547
+ Annotated[StrictFloat, Field(gt=0)],
548
+ Annotated[StrictFloat, Field(gt=0)]
549
+ ]
550
+ ] = None,
551
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
552
+ _content_type: Optional[StrictStr] = None,
553
+ _headers: Optional[Dict[StrictStr, Any]] = None,
554
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
555
+ ) -> RESTResponseType:
556
+ """Create Translated Story
557
+
558
+
559
+ :param run_id: (required)
560
+ :type run_id: int
561
+ :param create_translated_story_request_payload: (required)
562
+ :type create_translated_story_request_payload: CreateTranslatedStoryRequestPayload
563
+ :param _request_timeout: timeout setting for this request. If one
564
+ number provided, it will be total request
565
+ timeout. It can also be a pair (tuple) of
566
+ (connection, read) timeouts.
567
+ :type _request_timeout: int, tuple(int, int), optional
568
+ :param _request_auth: set to override the auth_settings for an a single
569
+ request; this effectively ignores the
570
+ authentication in the spec for a single request.
571
+ :type _request_auth: dict, optional
572
+ :param _content_type: force content-type for the request.
573
+ :type _content_type: str, Optional
574
+ :param _headers: set to override the headers for a single
575
+ request; this effectively ignores the headers
576
+ in the spec for a single request.
577
+ :type _headers: dict, optional
578
+ :param _host_index: set to override the host_index for a single
579
+ request; this effectively ignores the host_index
580
+ in the spec for a single request.
581
+ :type _host_index: int, optional
582
+ :return: Returns the result object.
583
+ """ # noqa: E501
584
+
585
+ _param = self._create_translated_story_serialize(
586
+ run_id=run_id,
587
+ create_translated_story_request_payload=create_translated_story_request_payload,
588
+ _request_auth=_request_auth,
589
+ _content_type=_content_type,
590
+ _headers=_headers,
591
+ _host_index=_host_index
592
+ )
593
+
594
+ _response_types_map: Dict[str, Optional[str]] = {
595
+ '200': "TaskID",
596
+ '422': "HTTPValidationError",
597
+ }
598
+ response_data = self.api_client.call_api(
599
+ *_param,
600
+ _request_timeout=_request_timeout
601
+ )
602
+ return response_data.response
603
+
604
+
605
+ def _create_translated_story_serialize(
606
+ self,
607
+ run_id,
608
+ create_translated_story_request_payload,
609
+ _request_auth,
610
+ _content_type,
611
+ _headers,
612
+ _host_index,
613
+ ) -> RequestSerialized:
614
+
615
+ _host = None
616
+
617
+ _collection_formats: Dict[str, str] = {
618
+ }
619
+
620
+ _path_params: Dict[str, str] = {}
621
+ _query_params: List[Tuple[str, str]] = []
622
+ _header_params: Dict[str, Optional[str]] = _headers or {}
623
+ _form_params: List[Tuple[str, str]] = []
624
+ _files: Dict[
625
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
626
+ ] = {}
627
+ _body_params: Optional[bytes] = None
628
+
629
+ # process the path parameters
630
+ if run_id is not None:
631
+ _path_params['run_id'] = run_id
632
+ # process the query parameters
633
+ # process the header parameters
634
+ # process the form parameters
635
+ # process the body parameter
636
+ if create_translated_story_request_payload is not None:
637
+ _body_params = create_translated_story_request_payload
638
+
639
+
640
+ # set the HTTP header `Accept`
641
+ if 'Accept' not in _header_params:
642
+ _header_params['Accept'] = self.api_client.select_header_accept(
643
+ [
644
+ 'application/json'
645
+ ]
646
+ )
647
+
648
+ # set the HTTP header `Content-Type`
649
+ if _content_type:
650
+ _header_params['Content-Type'] = _content_type
651
+ else:
652
+ _default_content_type = (
653
+ self.api_client.select_header_content_type(
654
+ [
655
+ 'application/json'
656
+ ]
657
+ )
658
+ )
659
+ if _default_content_type is not None:
660
+ _header_params['Content-Type'] = _default_content_type
661
+
662
+ # authentication setting
663
+ _auth_settings: List[str] = [
664
+ 'APIKeyHeader'
665
+ ]
666
+
667
+ return self.api_client.param_serialize(
668
+ method='POST',
669
+ resource_path='/translated-story/{run_id}',
670
+ path_params=_path_params,
671
+ query_params=_query_params,
672
+ header_params=_header_params,
673
+ body=_body_params,
674
+ post_params=_form_params,
675
+ files=_files,
676
+ auth_settings=_auth_settings,
677
+ collection_formats=_collection_formats,
678
+ _host=_host,
679
+ _request_auth=_request_auth
680
+ )
681
+
682
+
683
+
684
+
685
+ @validate_call
686
+ def get_story_run_info_by_id(
687
+ self,
688
+ run_id: StrictInt,
689
+ include_transcript: Optional[StrictBool] = None,
690
+ _request_timeout: Union[
691
+ None,
692
+ Annotated[StrictFloat, Field(gt=0)],
693
+ Tuple[
694
+ Annotated[StrictFloat, Field(gt=0)],
695
+ Annotated[StrictFloat, Field(gt=0)]
696
+ ]
697
+ ] = None,
698
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
699
+ _content_type: Optional[StrictStr] = None,
700
+ _headers: Optional[Dict[StrictStr, Any]] = None,
701
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
702
+ ) -> StoryRunInfoResponse:
703
+ """Get Story Run Info
704
+
705
+
706
+ :param run_id: (required)
707
+ :type run_id: int
708
+ :param include_transcript:
709
+ :type include_transcript: bool
710
+ :param _request_timeout: timeout setting for this request. If one
711
+ number provided, it will be total request
712
+ timeout. It can also be a pair (tuple) of
713
+ (connection, read) timeouts.
714
+ :type _request_timeout: int, tuple(int, int), optional
715
+ :param _request_auth: set to override the auth_settings for an a single
716
+ request; this effectively ignores the
717
+ authentication in the spec for a single request.
718
+ :type _request_auth: dict, optional
719
+ :param _content_type: force content-type for the request.
720
+ :type _content_type: str, Optional
721
+ :param _headers: set to override the headers for a single
722
+ request; this effectively ignores the headers
723
+ in the spec for a single request.
724
+ :type _headers: dict, optional
725
+ :param _host_index: set to override the host_index for a single
726
+ request; this effectively ignores the host_index
727
+ in the spec for a single request.
728
+ :type _host_index: int, optional
729
+ :return: Returns the result object.
730
+ """ # noqa: E501
731
+
732
+ _param = self._get_story_run_info_by_id_serialize(
733
+ run_id=run_id,
734
+ include_transcript=include_transcript,
735
+ _request_auth=_request_auth,
736
+ _content_type=_content_type,
737
+ _headers=_headers,
738
+ _host_index=_host_index
739
+ )
740
+
741
+ _response_types_map: Dict[str, Optional[str]] = {
742
+ '200': "StoryRunInfoResponse",
743
+ }
744
+ response_data = self.api_client.call_api(
745
+ *_param,
746
+ _request_timeout=_request_timeout
747
+ )
748
+ response_data.read()
749
+ return self.api_client.response_deserialize(
750
+ response_data=response_data,
751
+ response_types_map=_response_types_map,
752
+ ).data
753
+
754
+
755
+ @validate_call
756
+ def get_story_run_info_by_id_with_http_info(
757
+ self,
758
+ run_id: StrictInt,
759
+ include_transcript: Optional[StrictBool] = None,
760
+ _request_timeout: Union[
761
+ None,
762
+ Annotated[StrictFloat, Field(gt=0)],
763
+ Tuple[
764
+ Annotated[StrictFloat, Field(gt=0)],
765
+ Annotated[StrictFloat, Field(gt=0)]
766
+ ]
767
+ ] = None,
768
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
769
+ _content_type: Optional[StrictStr] = None,
770
+ _headers: Optional[Dict[StrictStr, Any]] = None,
771
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
772
+ ) -> ApiResponse[StoryRunInfoResponse]:
773
+ """Get Story Run Info
774
+
775
+
776
+ :param run_id: (required)
777
+ :type run_id: int
778
+ :param include_transcript:
779
+ :type include_transcript: bool
780
+ :param _request_timeout: timeout setting for this request. If one
781
+ number provided, it will be total request
782
+ timeout. It can also be a pair (tuple) of
783
+ (connection, read) timeouts.
784
+ :type _request_timeout: int, tuple(int, int), optional
785
+ :param _request_auth: set to override the auth_settings for an a single
786
+ request; this effectively ignores the
787
+ authentication in the spec for a single request.
788
+ :type _request_auth: dict, optional
789
+ :param _content_type: force content-type for the request.
790
+ :type _content_type: str, Optional
791
+ :param _headers: set to override the headers for a single
792
+ request; this effectively ignores the headers
793
+ in the spec for a single request.
794
+ :type _headers: dict, optional
795
+ :param _host_index: set to override the host_index for a single
796
+ request; this effectively ignores the host_index
797
+ in the spec for a single request.
798
+ :type _host_index: int, optional
799
+ :return: Returns the result object.
800
+ """ # noqa: E501
801
+
802
+ _param = self._get_story_run_info_by_id_serialize(
803
+ run_id=run_id,
804
+ include_transcript=include_transcript,
805
+ _request_auth=_request_auth,
806
+ _content_type=_content_type,
807
+ _headers=_headers,
808
+ _host_index=_host_index
809
+ )
810
+
811
+ _response_types_map: Dict[str, Optional[str]] = {
812
+ '200': "StoryRunInfoResponse",
813
+ }
814
+ response_data = self.api_client.call_api(
815
+ *_param,
816
+ _request_timeout=_request_timeout
817
+ )
818
+ response_data.read()
819
+ return self.api_client.response_deserialize(
820
+ response_data=response_data,
821
+ response_types_map=_response_types_map,
822
+ )
823
+
824
+
825
+ @validate_call
826
+ def get_story_run_info_by_id_without_preload_content(
827
+ self,
828
+ run_id: StrictInt,
829
+ include_transcript: Optional[StrictBool] = None,
830
+ _request_timeout: Union[
831
+ None,
832
+ Annotated[StrictFloat, Field(gt=0)],
833
+ Tuple[
834
+ Annotated[StrictFloat, Field(gt=0)],
835
+ Annotated[StrictFloat, Field(gt=0)]
836
+ ]
837
+ ] = None,
838
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
839
+ _content_type: Optional[StrictStr] = None,
840
+ _headers: Optional[Dict[StrictStr, Any]] = None,
841
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
842
+ ) -> RESTResponseType:
843
+ """Get Story Run Info
844
+
845
+
846
+ :param run_id: (required)
847
+ :type run_id: int
848
+ :param include_transcript:
849
+ :type include_transcript: bool
850
+ :param _request_timeout: timeout setting for this request. If one
851
+ number provided, it will be total request
852
+ timeout. It can also be a pair (tuple) of
853
+ (connection, read) timeouts.
854
+ :type _request_timeout: int, tuple(int, int), optional
855
+ :param _request_auth: set to override the auth_settings for an a single
856
+ request; this effectively ignores the
857
+ authentication in the spec for a single request.
858
+ :type _request_auth: dict, optional
859
+ :param _content_type: force content-type for the request.
860
+ :type _content_type: str, Optional
861
+ :param _headers: set to override the headers for a single
862
+ request; this effectively ignores the headers
863
+ in the spec for a single request.
864
+ :type _headers: dict, optional
865
+ :param _host_index: set to override the host_index for a single
866
+ request; this effectively ignores the host_index
867
+ in the spec for a single request.
868
+ :type _host_index: int, optional
869
+ :return: Returns the result object.
870
+ """ # noqa: E501
871
+
872
+ _param = self._get_story_run_info_by_id_serialize(
873
+ run_id=run_id,
874
+ include_transcript=include_transcript,
875
+ _request_auth=_request_auth,
876
+ _content_type=_content_type,
877
+ _headers=_headers,
878
+ _host_index=_host_index
879
+ )
880
+
881
+ _response_types_map: Dict[str, Optional[str]] = {
882
+ '200': "StoryRunInfoResponse",
883
+ }
884
+ response_data = self.api_client.call_api(
885
+ *_param,
886
+ _request_timeout=_request_timeout
887
+ )
888
+ return response_data.response
889
+
890
+
891
+ def _get_story_run_info_by_id_serialize(
892
+ self,
893
+ run_id,
894
+ include_transcript,
895
+ _request_auth,
896
+ _content_type,
897
+ _headers,
898
+ _host_index,
899
+ ) -> RequestSerialized:
900
+
901
+ _host = None
902
+
903
+ _collection_formats: Dict[str, str] = {
904
+ }
905
+
906
+ _path_params: Dict[str, str] = {}
907
+ _query_params: List[Tuple[str, str]] = []
908
+ _header_params: Dict[str, Optional[str]] = _headers or {}
909
+ _form_params: List[Tuple[str, str]] = []
910
+ _files: Dict[
911
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
912
+ ] = {}
913
+ _body_params: Optional[bytes] = None
914
+
915
+ # process the path parameters
916
+ if run_id is not None:
917
+ _path_params['run_id'] = run_id
918
+ # process the query parameters
919
+ if include_transcript is not None:
920
+
921
+ _query_params.append(('include_transcript', include_transcript))
922
+
923
+ # process the header parameters
924
+ # process the form parameters
925
+ # process the body parameter
926
+
927
+
928
+ # set the HTTP header `Accept`
929
+ if 'Accept' not in _header_params:
930
+ _header_params['Accept'] = self.api_client.select_header_accept(
931
+ [
932
+ 'application/json'
933
+ ]
934
+ )
935
+
936
+
937
+ # authentication setting
938
+ _auth_settings: List[str] = [
939
+ 'APIKeyHeader'
940
+ ]
941
+
942
+ return self.api_client.param_serialize(
943
+ method='GET',
944
+ resource_path='/story-result/{run_id}',
945
+ path_params=_path_params,
946
+ query_params=_query_params,
947
+ header_params=_header_params,
948
+ body=_body_params,
949
+ post_params=_form_params,
950
+ files=_files,
951
+ auth_settings=_auth_settings,
952
+ collection_formats=_collection_formats,
953
+ _host=_host,
954
+ _request_auth=_request_auth
955
+ )
956
+
957
+
958
+
959
+
960
+ @validate_call
961
+ def get_translated_story_run_info(
962
+ self,
963
+ run_id: StrictInt,
964
+ target_language: Languages,
965
+ include_transcript: Optional[StrictBool] = None,
966
+ _request_timeout: Union[
967
+ None,
968
+ Annotated[StrictFloat, Field(gt=0)],
969
+ Tuple[
970
+ Annotated[StrictFloat, Field(gt=0)],
971
+ Annotated[StrictFloat, Field(gt=0)]
972
+ ]
973
+ ] = None,
974
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
975
+ _content_type: Optional[StrictStr] = None,
976
+ _headers: Optional[Dict[StrictStr, Any]] = None,
977
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
978
+ ) -> StoryRunInfoResponse:
979
+ """Get Translated Story Run Info
980
+
981
+
982
+ :param run_id: (required)
983
+ :type run_id: int
984
+ :param target_language: (required)
985
+ :type target_language: Languages
986
+ :param include_transcript:
987
+ :type include_transcript: bool
988
+ :param _request_timeout: timeout setting for this request. If one
989
+ number provided, it will be total request
990
+ timeout. It can also be a pair (tuple) of
991
+ (connection, read) timeouts.
992
+ :type _request_timeout: int, tuple(int, int), optional
993
+ :param _request_auth: set to override the auth_settings for an a single
994
+ request; this effectively ignores the
995
+ authentication in the spec for a single request.
996
+ :type _request_auth: dict, optional
997
+ :param _content_type: force content-type for the request.
998
+ :type _content_type: str, Optional
999
+ :param _headers: set to override the headers for a single
1000
+ request; this effectively ignores the headers
1001
+ in the spec for a single request.
1002
+ :type _headers: dict, optional
1003
+ :param _host_index: set to override the host_index for a single
1004
+ request; this effectively ignores the host_index
1005
+ in the spec for a single request.
1006
+ :type _host_index: int, optional
1007
+ :return: Returns the result object.
1008
+ """ # noqa: E501
1009
+
1010
+ _param = self._get_translated_story_run_info_serialize(
1011
+ run_id=run_id,
1012
+ target_language=target_language,
1013
+ include_transcript=include_transcript,
1014
+ _request_auth=_request_auth,
1015
+ _content_type=_content_type,
1016
+ _headers=_headers,
1017
+ _host_index=_host_index
1018
+ )
1019
+
1020
+ _response_types_map: Dict[str, Optional[str]] = {
1021
+ '200': "StoryRunInfoResponse",
1022
+ '422': "HTTPValidationError",
1023
+ }
1024
+ response_data = self.api_client.call_api(
1025
+ *_param,
1026
+ _request_timeout=_request_timeout
1027
+ )
1028
+ response_data.read()
1029
+ return self.api_client.response_deserialize(
1030
+ response_data=response_data,
1031
+ response_types_map=_response_types_map,
1032
+ ).data
1033
+
1034
+
1035
+ @validate_call
1036
+ def get_translated_story_run_info_with_http_info(
1037
+ self,
1038
+ run_id: StrictInt,
1039
+ target_language: Languages,
1040
+ include_transcript: Optional[StrictBool] = None,
1041
+ _request_timeout: Union[
1042
+ None,
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Tuple[
1045
+ Annotated[StrictFloat, Field(gt=0)],
1046
+ Annotated[StrictFloat, Field(gt=0)]
1047
+ ]
1048
+ ] = None,
1049
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1050
+ _content_type: Optional[StrictStr] = None,
1051
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1052
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1053
+ ) -> ApiResponse[StoryRunInfoResponse]:
1054
+ """Get Translated Story Run Info
1055
+
1056
+
1057
+ :param run_id: (required)
1058
+ :type run_id: int
1059
+ :param target_language: (required)
1060
+ :type target_language: Languages
1061
+ :param include_transcript:
1062
+ :type include_transcript: bool
1063
+ :param _request_timeout: timeout setting for this request. If one
1064
+ number provided, it will be total request
1065
+ timeout. It can also be a pair (tuple) of
1066
+ (connection, read) timeouts.
1067
+ :type _request_timeout: int, tuple(int, int), optional
1068
+ :param _request_auth: set to override the auth_settings for an a single
1069
+ request; this effectively ignores the
1070
+ authentication in the spec for a single request.
1071
+ :type _request_auth: dict, optional
1072
+ :param _content_type: force content-type for the request.
1073
+ :type _content_type: str, Optional
1074
+ :param _headers: set to override the headers for a single
1075
+ request; this effectively ignores the headers
1076
+ in the spec for a single request.
1077
+ :type _headers: dict, optional
1078
+ :param _host_index: set to override the host_index for a single
1079
+ request; this effectively ignores the host_index
1080
+ in the spec for a single request.
1081
+ :type _host_index: int, optional
1082
+ :return: Returns the result object.
1083
+ """ # noqa: E501
1084
+
1085
+ _param = self._get_translated_story_run_info_serialize(
1086
+ run_id=run_id,
1087
+ target_language=target_language,
1088
+ include_transcript=include_transcript,
1089
+ _request_auth=_request_auth,
1090
+ _content_type=_content_type,
1091
+ _headers=_headers,
1092
+ _host_index=_host_index
1093
+ )
1094
+
1095
+ _response_types_map: Dict[str, Optional[str]] = {
1096
+ '200': "StoryRunInfoResponse",
1097
+ '422': "HTTPValidationError",
1098
+ }
1099
+ response_data = self.api_client.call_api(
1100
+ *_param,
1101
+ _request_timeout=_request_timeout
1102
+ )
1103
+ response_data.read()
1104
+ return self.api_client.response_deserialize(
1105
+ response_data=response_data,
1106
+ response_types_map=_response_types_map,
1107
+ )
1108
+
1109
+
1110
+ @validate_call
1111
+ def get_translated_story_run_info_without_preload_content(
1112
+ self,
1113
+ run_id: StrictInt,
1114
+ target_language: Languages,
1115
+ include_transcript: Optional[StrictBool] = None,
1116
+ _request_timeout: Union[
1117
+ None,
1118
+ Annotated[StrictFloat, Field(gt=0)],
1119
+ Tuple[
1120
+ Annotated[StrictFloat, Field(gt=0)],
1121
+ Annotated[StrictFloat, Field(gt=0)]
1122
+ ]
1123
+ ] = None,
1124
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1125
+ _content_type: Optional[StrictStr] = None,
1126
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1127
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1128
+ ) -> RESTResponseType:
1129
+ """Get Translated Story Run Info
1130
+
1131
+
1132
+ :param run_id: (required)
1133
+ :type run_id: int
1134
+ :param target_language: (required)
1135
+ :type target_language: Languages
1136
+ :param include_transcript:
1137
+ :type include_transcript: bool
1138
+ :param _request_timeout: timeout setting for this request. If one
1139
+ number provided, it will be total request
1140
+ timeout. It can also be a pair (tuple) of
1141
+ (connection, read) timeouts.
1142
+ :type _request_timeout: int, tuple(int, int), optional
1143
+ :param _request_auth: set to override the auth_settings for an a single
1144
+ request; this effectively ignores the
1145
+ authentication in the spec for a single request.
1146
+ :type _request_auth: dict, optional
1147
+ :param _content_type: force content-type for the request.
1148
+ :type _content_type: str, Optional
1149
+ :param _headers: set to override the headers for a single
1150
+ request; this effectively ignores the headers
1151
+ in the spec for a single request.
1152
+ :type _headers: dict, optional
1153
+ :param _host_index: set to override the host_index for a single
1154
+ request; this effectively ignores the host_index
1155
+ in the spec for a single request.
1156
+ :type _host_index: int, optional
1157
+ :return: Returns the result object.
1158
+ """ # noqa: E501
1159
+
1160
+ _param = self._get_translated_story_run_info_serialize(
1161
+ run_id=run_id,
1162
+ target_language=target_language,
1163
+ include_transcript=include_transcript,
1164
+ _request_auth=_request_auth,
1165
+ _content_type=_content_type,
1166
+ _headers=_headers,
1167
+ _host_index=_host_index
1168
+ )
1169
+
1170
+ _response_types_map: Dict[str, Optional[str]] = {
1171
+ '200': "StoryRunInfoResponse",
1172
+ '422': "HTTPValidationError",
1173
+ }
1174
+ response_data = self.api_client.call_api(
1175
+ *_param,
1176
+ _request_timeout=_request_timeout
1177
+ )
1178
+ return response_data.response
1179
+
1180
+
1181
+ def _get_translated_story_run_info_serialize(
1182
+ self,
1183
+ run_id,
1184
+ target_language,
1185
+ include_transcript,
1186
+ _request_auth,
1187
+ _content_type,
1188
+ _headers,
1189
+ _host_index,
1190
+ ) -> RequestSerialized:
1191
+
1192
+ _host = None
1193
+
1194
+ _collection_formats: Dict[str, str] = {
1195
+ }
1196
+
1197
+ _path_params: Dict[str, str] = {}
1198
+ _query_params: List[Tuple[str, str]] = []
1199
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1200
+ _form_params: List[Tuple[str, str]] = []
1201
+ _files: Dict[
1202
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1203
+ ] = {}
1204
+ _body_params: Optional[bytes] = None
1205
+
1206
+ # process the path parameters
1207
+ if run_id is not None:
1208
+ _path_params['run_id'] = run_id
1209
+ if target_language is not None:
1210
+ _path_params['target_language'] = target_language.value
1211
+ # process the query parameters
1212
+ if include_transcript is not None:
1213
+
1214
+ _query_params.append(('include_transcript', include_transcript))
1215
+
1216
+ # process the header parameters
1217
+ # process the form parameters
1218
+ # process the body parameter
1219
+
1220
+
1221
+ # set the HTTP header `Accept`
1222
+ if 'Accept' not in _header_params:
1223
+ _header_params['Accept'] = self.api_client.select_header_accept(
1224
+ [
1225
+ 'application/json'
1226
+ ]
1227
+ )
1228
+
1229
+
1230
+ # authentication setting
1231
+ _auth_settings: List[str] = [
1232
+ 'APIKeyHeader'
1233
+ ]
1234
+
1235
+ return self.api_client.param_serialize(
1236
+ method='GET',
1237
+ resource_path='/translated-story-result/{run_id}/{target_language}',
1238
+ path_params=_path_params,
1239
+ query_params=_query_params,
1240
+ header_params=_header_params,
1241
+ body=_body_params,
1242
+ post_params=_form_params,
1243
+ files=_files,
1244
+ auth_settings=_auth_settings,
1245
+ collection_formats=_collection_formats,
1246
+ _host=_host,
1247
+ _request_auth=_request_auth
1248
+ )
1249
+
1250
+
1251
+
1252
+
1253
+ @validate_call
1254
+ def get_translated_story_status_by_id(
1255
+ self,
1256
+ task_id: StrictStr,
1257
+ _request_timeout: Union[
1258
+ None,
1259
+ Annotated[StrictFloat, Field(gt=0)],
1260
+ Tuple[
1261
+ Annotated[StrictFloat, Field(gt=0)],
1262
+ Annotated[StrictFloat, Field(gt=0)]
1263
+ ]
1264
+ ] = None,
1265
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1266
+ _content_type: Optional[StrictStr] = None,
1267
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1268
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1269
+ ) -> OrchestratorPipelineResult:
1270
+ """Get Translated Story Status
1271
+
1272
+
1273
+ :param task_id: (required)
1274
+ :type task_id: str
1275
+ :param _request_timeout: timeout setting for this request. If one
1276
+ number provided, it will be total request
1277
+ timeout. It can also be a pair (tuple) of
1278
+ (connection, read) timeouts.
1279
+ :type _request_timeout: int, tuple(int, int), optional
1280
+ :param _request_auth: set to override the auth_settings for an a single
1281
+ request; this effectively ignores the
1282
+ authentication in the spec for a single request.
1283
+ :type _request_auth: dict, optional
1284
+ :param _content_type: force content-type for the request.
1285
+ :type _content_type: str, Optional
1286
+ :param _headers: set to override the headers for a single
1287
+ request; this effectively ignores the headers
1288
+ in the spec for a single request.
1289
+ :type _headers: dict, optional
1290
+ :param _host_index: set to override the host_index for a single
1291
+ request; this effectively ignores the host_index
1292
+ in the spec for a single request.
1293
+ :type _host_index: int, optional
1294
+ :return: Returns the result object.
1295
+ """ # noqa: E501
1296
+
1297
+ _param = self._get_translated_story_status_by_id_serialize(
1298
+ task_id=task_id,
1299
+ _request_auth=_request_auth,
1300
+ _content_type=_content_type,
1301
+ _headers=_headers,
1302
+ _host_index=_host_index
1303
+ )
1304
+
1305
+ _response_types_map: Dict[str, Optional[str]] = {
1306
+ '200': "OrchestratorPipelineResult",
1307
+ '422': "HTTPValidationError",
1308
+ }
1309
+ response_data = self.api_client.call_api(
1310
+ *_param,
1311
+ _request_timeout=_request_timeout
1312
+ )
1313
+ response_data.read()
1314
+ return self.api_client.response_deserialize(
1315
+ response_data=response_data,
1316
+ response_types_map=_response_types_map,
1317
+ ).data
1318
+
1319
+
1320
+ @validate_call
1321
+ def get_translated_story_status_by_id_with_http_info(
1322
+ self,
1323
+ task_id: StrictStr,
1324
+ _request_timeout: Union[
1325
+ None,
1326
+ Annotated[StrictFloat, Field(gt=0)],
1327
+ Tuple[
1328
+ Annotated[StrictFloat, Field(gt=0)],
1329
+ Annotated[StrictFloat, Field(gt=0)]
1330
+ ]
1331
+ ] = None,
1332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1333
+ _content_type: Optional[StrictStr] = None,
1334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1336
+ ) -> ApiResponse[OrchestratorPipelineResult]:
1337
+ """Get Translated Story Status
1338
+
1339
+
1340
+ :param task_id: (required)
1341
+ :type task_id: str
1342
+ :param _request_timeout: timeout setting for this request. If one
1343
+ number provided, it will be total request
1344
+ timeout. It can also be a pair (tuple) of
1345
+ (connection, read) timeouts.
1346
+ :type _request_timeout: int, tuple(int, int), optional
1347
+ :param _request_auth: set to override the auth_settings for an a single
1348
+ request; this effectively ignores the
1349
+ authentication in the spec for a single request.
1350
+ :type _request_auth: dict, optional
1351
+ :param _content_type: force content-type for the request.
1352
+ :type _content_type: str, Optional
1353
+ :param _headers: set to override the headers for a single
1354
+ request; this effectively ignores the headers
1355
+ in the spec for a single request.
1356
+ :type _headers: dict, optional
1357
+ :param _host_index: set to override the host_index for a single
1358
+ request; this effectively ignores the host_index
1359
+ in the spec for a single request.
1360
+ :type _host_index: int, optional
1361
+ :return: Returns the result object.
1362
+ """ # noqa: E501
1363
+
1364
+ _param = self._get_translated_story_status_by_id_serialize(
1365
+ task_id=task_id,
1366
+ _request_auth=_request_auth,
1367
+ _content_type=_content_type,
1368
+ _headers=_headers,
1369
+ _host_index=_host_index
1370
+ )
1371
+
1372
+ _response_types_map: Dict[str, Optional[str]] = {
1373
+ '200': "OrchestratorPipelineResult",
1374
+ '422': "HTTPValidationError",
1375
+ }
1376
+ response_data = self.api_client.call_api(
1377
+ *_param,
1378
+ _request_timeout=_request_timeout
1379
+ )
1380
+ response_data.read()
1381
+ return self.api_client.response_deserialize(
1382
+ response_data=response_data,
1383
+ response_types_map=_response_types_map,
1384
+ )
1385
+
1386
+
1387
+ @validate_call
1388
+ def get_translated_story_status_by_id_without_preload_content(
1389
+ self,
1390
+ task_id: StrictStr,
1391
+ _request_timeout: Union[
1392
+ None,
1393
+ Annotated[StrictFloat, Field(gt=0)],
1394
+ Tuple[
1395
+ Annotated[StrictFloat, Field(gt=0)],
1396
+ Annotated[StrictFloat, Field(gt=0)]
1397
+ ]
1398
+ ] = None,
1399
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1400
+ _content_type: Optional[StrictStr] = None,
1401
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1402
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1403
+ ) -> RESTResponseType:
1404
+ """Get Translated Story Status
1405
+
1406
+
1407
+ :param task_id: (required)
1408
+ :type task_id: str
1409
+ :param _request_timeout: timeout setting for this request. If one
1410
+ number provided, it will be total request
1411
+ timeout. It can also be a pair (tuple) of
1412
+ (connection, read) timeouts.
1413
+ :type _request_timeout: int, tuple(int, int), optional
1414
+ :param _request_auth: set to override the auth_settings for an a single
1415
+ request; this effectively ignores the
1416
+ authentication in the spec for a single request.
1417
+ :type _request_auth: dict, optional
1418
+ :param _content_type: force content-type for the request.
1419
+ :type _content_type: str, Optional
1420
+ :param _headers: set to override the headers for a single
1421
+ request; this effectively ignores the headers
1422
+ in the spec for a single request.
1423
+ :type _headers: dict, optional
1424
+ :param _host_index: set to override the host_index for a single
1425
+ request; this effectively ignores the host_index
1426
+ in the spec for a single request.
1427
+ :type _host_index: int, optional
1428
+ :return: Returns the result object.
1429
+ """ # noqa: E501
1430
+
1431
+ _param = self._get_translated_story_status_by_id_serialize(
1432
+ task_id=task_id,
1433
+ _request_auth=_request_auth,
1434
+ _content_type=_content_type,
1435
+ _headers=_headers,
1436
+ _host_index=_host_index
1437
+ )
1438
+
1439
+ _response_types_map: Dict[str, Optional[str]] = {
1440
+ '200': "OrchestratorPipelineResult",
1441
+ '422': "HTTPValidationError",
1442
+ }
1443
+ response_data = self.api_client.call_api(
1444
+ *_param,
1445
+ _request_timeout=_request_timeout
1446
+ )
1447
+ return response_data.response
1448
+
1449
+
1450
+ def _get_translated_story_status_by_id_serialize(
1451
+ self,
1452
+ task_id,
1453
+ _request_auth,
1454
+ _content_type,
1455
+ _headers,
1456
+ _host_index,
1457
+ ) -> RequestSerialized:
1458
+
1459
+ _host = None
1460
+
1461
+ _collection_formats: Dict[str, str] = {
1462
+ }
1463
+
1464
+ _path_params: Dict[str, str] = {}
1465
+ _query_params: List[Tuple[str, str]] = []
1466
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1467
+ _form_params: List[Tuple[str, str]] = []
1468
+ _files: Dict[
1469
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1470
+ ] = {}
1471
+ _body_params: Optional[bytes] = None
1472
+
1473
+ # process the path parameters
1474
+ if task_id is not None:
1475
+ _path_params['task_id'] = task_id
1476
+ # process the query parameters
1477
+ # process the header parameters
1478
+ # process the form parameters
1479
+ # process the body parameter
1480
+
1481
+
1482
+ # set the HTTP header `Accept`
1483
+ if 'Accept' not in _header_params:
1484
+ _header_params['Accept'] = self.api_client.select_header_accept(
1485
+ [
1486
+ 'application/json'
1487
+ ]
1488
+ )
1489
+
1490
+
1491
+ # authentication setting
1492
+ _auth_settings: List[str] = [
1493
+ 'APIKeyHeader'
1494
+ ]
1495
+
1496
+ return self.api_client.param_serialize(
1497
+ method='GET',
1498
+ resource_path='/translated-story/{task_id}',
1499
+ path_params=_path_params,
1500
+ query_params=_query_params,
1501
+ header_params=_header_params,
1502
+ body=_body_params,
1503
+ post_params=_form_params,
1504
+ files=_files,
1505
+ auth_settings=_auth_settings,
1506
+ collection_formats=_collection_formats,
1507
+ _host=_host,
1508
+ _request_auth=_request_auth
1509
+ )
1510
+
1511
+