camb-sdk 1.5.4__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.
- camb/__init__.py +335 -0
- camb/audio_separation/__init__.py +4 -0
- camb/audio_separation/client.py +406 -0
- camb/audio_separation/raw_client.py +534 -0
- camb/client.py +717 -0
- camb/core/__init__.py +105 -0
- camb/core/api_error.py +23 -0
- camb/core/client_wrapper.py +113 -0
- camb/core/datetime_utils.py +28 -0
- camb/core/file.py +67 -0
- camb/core/force_multipart.py +18 -0
- camb/core/http_client.py +663 -0
- camb/core/http_response.py +55 -0
- camb/core/http_sse/__init__.py +42 -0
- camb/core/http_sse/_api.py +112 -0
- camb/core/http_sse/_decoders.py +61 -0
- camb/core/http_sse/_exceptions.py +7 -0
- camb/core/http_sse/_models.py +17 -0
- camb/core/jsonable_encoder.py +100 -0
- camb/core/pydantic_utilities.py +260 -0
- camb/core/query_encoder.py +58 -0
- camb/core/remove_none_from_dict.py +11 -0
- camb/core/request_options.py +35 -0
- camb/core/serialization.py +276 -0
- camb/deprecated_streaming/__init__.py +4 -0
- camb/deprecated_streaming/client.py +532 -0
- camb/deprecated_streaming/raw_client.py +639 -0
- camb/dictionaries/__init__.py +4 -0
- camb/dictionaries/client.py +785 -0
- camb/dictionaries/raw_client.py +1048 -0
- camb/dub/__init__.py +49 -0
- camb/dub/client.py +846 -0
- camb/dub/raw_client.py +1194 -0
- camb/dub/types/__init__.py +53 -0
- camb/dub/types/dubbed_output_in_alt_format_request_payload_output_format.py +8 -0
- camb/dub/types/get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response.py +9 -0
- camb/dub/types/get_dubbed_run_info_dub_result_run_id_get_response.py +7 -0
- camb/dub/types/get_dubbing_runs_results_dubbing_results_post_response_value.py +7 -0
- camb/environment.py +7 -0
- camb/errors/__init__.py +34 -0
- camb/errors/unprocessable_entity_error.py +11 -0
- camb/folders/__init__.py +4 -0
- camb/folders/client.py +213 -0
- camb/folders/raw_client.py +278 -0
- camb/languages/__init__.py +4 -0
- camb/languages/client.py +168 -0
- camb/languages/raw_client.py +223 -0
- camb/project_setup/__init__.py +4 -0
- camb/project_setup/client.py +537 -0
- camb/project_setup/raw_client.py +655 -0
- camb/py.typed +0 -0
- camb/raw_client.py +236 -0
- camb/story/__init__.py +37 -0
- camb/story/client.py +579 -0
- camb/story/raw_client.py +743 -0
- camb/story/types/__init__.py +38 -0
- camb/story/types/create_story_story_post_response.py +8 -0
- camb/story/types/setup_story_story_setup_post_response.py +8 -0
- camb/streaming/__init__.py +4 -0
- camb/streaming/client.py +645 -0
- camb/streaming/raw_client.py +796 -0
- camb/text_to_audio/__init__.py +4 -0
- camb/text_to_audio/client.py +469 -0
- camb/text_to_audio/raw_client.py +610 -0
- camb/text_to_speech/__init__.py +49 -0
- camb/text_to_speech/baseten.py +214 -0
- camb/text_to_speech/client.py +742 -0
- camb/text_to_speech/raw_client.py +995 -0
- camb/text_to_speech/types/__init__.py +47 -0
- camb/text_to_speech/types/create_stream_tts_request_payload_language.py +71 -0
- camb/text_to_speech/types/create_stream_tts_request_payload_speech_model.py +7 -0
- camb/text_to_speech/types/get_tts_results_tts_results_post_response_value.py +7 -0
- camb/text_to_speech/types/get_tts_run_info_tts_result_run_id_get_response.py +7 -0
- camb/text_to_voice/__init__.py +4 -0
- camb/text_to_voice/client.py +329 -0
- camb/text_to_voice/raw_client.py +405 -0
- camb/transcription/__init__.py +4 -0
- camb/transcription/client.py +465 -0
- camb/transcription/raw_client.py +587 -0
- camb/translated_story/__init__.py +4 -0
- camb/translated_story/client.py +309 -0
- camb/translated_story/raw_client.py +381 -0
- camb/translated_tts/__init__.py +4 -0
- camb/translated_tts/client.py +313 -0
- camb/translated_tts/raw_client.py +357 -0
- camb/translation/__init__.py +4 -0
- camb/translation/client.py +631 -0
- camb/translation/raw_client.py +787 -0
- camb/types/__init__.py +236 -0
- camb/types/add_target_language_out.py +20 -0
- camb/types/audio_output_type.py +5 -0
- camb/types/audio_stream.py +31 -0
- camb/types/config_stream.py +22 -0
- camb/types/config_stream_pipeline.py +28 -0
- camb/types/create_custom_voice_out.py +19 -0
- camb/types/create_project_setup_out.py +19 -0
- camb/types/create_stream_out.py +22 -0
- camb/types/create_stream_request_payload.py +70 -0
- camb/types/create_translated_tts_out.py +19 -0
- camb/types/create_tts_out.py +19 -0
- camb/types/data_stream.py +24 -0
- camb/types/demixing_option.py +10 -0
- camb/types/dictionary_term.py +21 -0
- camb/types/dictionary_with_terms.py +28 -0
- camb/types/dubbing_result.py +22 -0
- camb/types/exception_reasons.py +30 -0
- camb/types/folder.py +20 -0
- camb/types/formalities.py +3 -0
- camb/types/gender.py +3 -0
- camb/types/get_audio_separation_result_out.py +20 -0
- camb/types/get_create_project_setup_response.py +21 -0
- camb/types/get_probe_stream_in.py +21 -0
- camb/types/get_probe_stream_out.py +24 -0
- camb/types/get_setup_story_result_response.py +21 -0
- camb/types/get_text_to_voice_result_out.py +19 -0
- camb/types/get_tts_result_out_file_url.py +19 -0
- camb/types/http_validation_error.py +20 -0
- camb/types/language_enums.py +154 -0
- camb/types/language_pydantic_model.py +21 -0
- camb/types/languages.py +3 -0
- camb/types/orchestrator_pipeline_call_result.py +19 -0
- camb/types/orchestrator_pipeline_result.py +25 -0
- camb/types/orchestrator_pipeline_result_exception_reason.py +7 -0
- camb/types/orchestrator_pipeline_result_message.py +5 -0
- camb/types/output_format.py +10 -0
- camb/types/overdub_config.py +37 -0
- camb/types/project_details.py +28 -0
- camb/types/revoicing_option.py +5 -0
- camb/types/run_i_ds_request_payload.py +19 -0
- camb/types/segmenting_option.py +5 -0
- camb/types/source_stream.py +30 -0
- camb/types/story_details.py +27 -0
- camb/types/stream_category.py +3 -0
- camb/types/stream_tts_inference_options.py +38 -0
- camb/types/stream_tts_output_configuration.py +33 -0
- camb/types/stream_tts_voice_settings.py +28 -0
- camb/types/stream_type.py +3 -0
- camb/types/stream_url_for_languages.py +21 -0
- camb/types/target_stream.py +34 -0
- camb/types/task_status.py +5 -0
- camb/types/term_translation_input.py +21 -0
- camb/types/term_translation_output.py +20 -0
- camb/types/text_to_audio_result.py +19 -0
- camb/types/text_to_audio_type.py +5 -0
- camb/types/transcribing_option.py +5 -0
- camb/types/transcript.py +22 -0
- camb/types/transcript_data_type.py +5 -0
- camb/types/transcript_file_format.py +5 -0
- camb/types/transcription_result.py +20 -0
- camb/types/translating_option.py +5 -0
- camb/types/translation_result.py +19 -0
- camb/types/tts_provider.py +3 -0
- camb/types/validation_error.py +22 -0
- camb/types/validation_error_loc_item.py +5 -0
- camb/types/video_output_type_without_avi.py +5 -0
- camb/types/video_stream.py +28 -0
- camb/types/voice.py +28 -0
- camb/voice_cloning/__init__.py +34 -0
- camb/voice_cloning/client.py +265 -0
- camb/voice_cloning/raw_client.py +320 -0
- camb/voice_cloning/types/__init__.py +36 -0
- camb/voice_cloning/types/list_voices_list_voices_get_response_item.py +7 -0
- camb_sdk-1.5.4.dist-info/METADATA +282 -0
- camb_sdk-1.5.4.dist-info/RECORD +167 -0
- camb_sdk-1.5.4.dist-info/WHEEL +5 -0
- camb_sdk-1.5.4.dist-info/licenses/LICENSE +21 -0
- camb_sdk-1.5.4.dist-info/top_level.txt +1 -0
camb/languages/client.py
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.language_pydantic_model import LanguagePydanticModel
|
|
8
|
+
from .raw_client import AsyncRawLanguagesClient, RawLanguagesClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class LanguagesClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawLanguagesClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawLanguagesClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawLanguagesClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def get_source_languages(
|
|
27
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
+
) -> typing.List[LanguagePydanticModel]:
|
|
29
|
+
"""
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
run_id : typing.Optional[int]
|
|
33
|
+
|
|
34
|
+
request_options : typing.Optional[RequestOptions]
|
|
35
|
+
Request-specific configuration.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
typing.List[LanguagePydanticModel]
|
|
40
|
+
Successful Response
|
|
41
|
+
|
|
42
|
+
Examples
|
|
43
|
+
--------
|
|
44
|
+
from camb import CambApi
|
|
45
|
+
|
|
46
|
+
client = CambApi(
|
|
47
|
+
api_key="YOUR_API_KEY",
|
|
48
|
+
)
|
|
49
|
+
client.languages.get_source_languages()
|
|
50
|
+
"""
|
|
51
|
+
_response = self._raw_client.get_source_languages(run_id=run_id, request_options=request_options)
|
|
52
|
+
return _response.data
|
|
53
|
+
|
|
54
|
+
def get_target_languages(
|
|
55
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
56
|
+
) -> typing.List[LanguagePydanticModel]:
|
|
57
|
+
"""
|
|
58
|
+
Parameters
|
|
59
|
+
----------
|
|
60
|
+
run_id : typing.Optional[int]
|
|
61
|
+
|
|
62
|
+
request_options : typing.Optional[RequestOptions]
|
|
63
|
+
Request-specific configuration.
|
|
64
|
+
|
|
65
|
+
Returns
|
|
66
|
+
-------
|
|
67
|
+
typing.List[LanguagePydanticModel]
|
|
68
|
+
Successful Response
|
|
69
|
+
|
|
70
|
+
Examples
|
|
71
|
+
--------
|
|
72
|
+
from camb import CambApi
|
|
73
|
+
|
|
74
|
+
client = CambApi(
|
|
75
|
+
api_key="YOUR_API_KEY",
|
|
76
|
+
)
|
|
77
|
+
client.languages.get_target_languages()
|
|
78
|
+
"""
|
|
79
|
+
_response = self._raw_client.get_target_languages(run_id=run_id, request_options=request_options)
|
|
80
|
+
return _response.data
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class AsyncLanguagesClient:
|
|
84
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
85
|
+
self._raw_client = AsyncRawLanguagesClient(client_wrapper=client_wrapper)
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def with_raw_response(self) -> AsyncRawLanguagesClient:
|
|
89
|
+
"""
|
|
90
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
AsyncRawLanguagesClient
|
|
95
|
+
"""
|
|
96
|
+
return self._raw_client
|
|
97
|
+
|
|
98
|
+
async def get_source_languages(
|
|
99
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
100
|
+
) -> typing.List[LanguagePydanticModel]:
|
|
101
|
+
"""
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
run_id : typing.Optional[int]
|
|
105
|
+
|
|
106
|
+
request_options : typing.Optional[RequestOptions]
|
|
107
|
+
Request-specific configuration.
|
|
108
|
+
|
|
109
|
+
Returns
|
|
110
|
+
-------
|
|
111
|
+
typing.List[LanguagePydanticModel]
|
|
112
|
+
Successful Response
|
|
113
|
+
|
|
114
|
+
Examples
|
|
115
|
+
--------
|
|
116
|
+
import asyncio
|
|
117
|
+
|
|
118
|
+
from camb import AsyncCambApi
|
|
119
|
+
|
|
120
|
+
client = AsyncCambApi(
|
|
121
|
+
api_key="YOUR_API_KEY",
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
async def main() -> None:
|
|
126
|
+
await client.languages.get_source_languages()
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
asyncio.run(main())
|
|
130
|
+
"""
|
|
131
|
+
_response = await self._raw_client.get_source_languages(run_id=run_id, request_options=request_options)
|
|
132
|
+
return _response.data
|
|
133
|
+
|
|
134
|
+
async def get_target_languages(
|
|
135
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
136
|
+
) -> typing.List[LanguagePydanticModel]:
|
|
137
|
+
"""
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
run_id : typing.Optional[int]
|
|
141
|
+
|
|
142
|
+
request_options : typing.Optional[RequestOptions]
|
|
143
|
+
Request-specific configuration.
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
typing.List[LanguagePydanticModel]
|
|
148
|
+
Successful Response
|
|
149
|
+
|
|
150
|
+
Examples
|
|
151
|
+
--------
|
|
152
|
+
import asyncio
|
|
153
|
+
|
|
154
|
+
from camb import AsyncCambApi
|
|
155
|
+
|
|
156
|
+
client = AsyncCambApi(
|
|
157
|
+
api_key="YOUR_API_KEY",
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
async def main() -> None:
|
|
162
|
+
await client.languages.get_target_languages()
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
asyncio.run(main())
|
|
166
|
+
"""
|
|
167
|
+
_response = await self._raw_client.get_target_languages(run_id=run_id, request_options=request_options)
|
|
168
|
+
return _response.data
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
+
from ..types.http_validation_error import HttpValidationError
|
|
13
|
+
from ..types.language_pydantic_model import LanguagePydanticModel
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class RawLanguagesClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._client_wrapper = client_wrapper
|
|
19
|
+
|
|
20
|
+
def get_source_languages(
|
|
21
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
22
|
+
) -> HttpResponse[typing.List[LanguagePydanticModel]]:
|
|
23
|
+
"""
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
run_id : typing.Optional[int]
|
|
27
|
+
|
|
28
|
+
request_options : typing.Optional[RequestOptions]
|
|
29
|
+
Request-specific configuration.
|
|
30
|
+
|
|
31
|
+
Returns
|
|
32
|
+
-------
|
|
33
|
+
HttpResponse[typing.List[LanguagePydanticModel]]
|
|
34
|
+
Successful Response
|
|
35
|
+
"""
|
|
36
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
37
|
+
"source-languages",
|
|
38
|
+
method="GET",
|
|
39
|
+
params={
|
|
40
|
+
"run_id": run_id,
|
|
41
|
+
},
|
|
42
|
+
request_options=request_options,
|
|
43
|
+
)
|
|
44
|
+
try:
|
|
45
|
+
if 200 <= _response.status_code < 300:
|
|
46
|
+
_data = typing.cast(
|
|
47
|
+
typing.List[LanguagePydanticModel],
|
|
48
|
+
parse_obj_as(
|
|
49
|
+
type_=typing.List[LanguagePydanticModel], # type: ignore
|
|
50
|
+
object_=_response.json(),
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
return HttpResponse(response=_response, data=_data)
|
|
54
|
+
if _response.status_code == 422:
|
|
55
|
+
raise UnprocessableEntityError(
|
|
56
|
+
headers=dict(_response.headers),
|
|
57
|
+
body=typing.cast(
|
|
58
|
+
HttpValidationError,
|
|
59
|
+
parse_obj_as(
|
|
60
|
+
type_=HttpValidationError, # type: ignore
|
|
61
|
+
object_=_response.json(),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
_response_json = _response.json()
|
|
66
|
+
except JSONDecodeError:
|
|
67
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
68
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
69
|
+
|
|
70
|
+
def get_target_languages(
|
|
71
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
72
|
+
) -> HttpResponse[typing.List[LanguagePydanticModel]]:
|
|
73
|
+
"""
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
run_id : typing.Optional[int]
|
|
77
|
+
|
|
78
|
+
request_options : typing.Optional[RequestOptions]
|
|
79
|
+
Request-specific configuration.
|
|
80
|
+
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
HttpResponse[typing.List[LanguagePydanticModel]]
|
|
84
|
+
Successful Response
|
|
85
|
+
"""
|
|
86
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
87
|
+
"target-languages",
|
|
88
|
+
method="GET",
|
|
89
|
+
params={
|
|
90
|
+
"run_id": run_id,
|
|
91
|
+
},
|
|
92
|
+
request_options=request_options,
|
|
93
|
+
)
|
|
94
|
+
try:
|
|
95
|
+
if 200 <= _response.status_code < 300:
|
|
96
|
+
_data = typing.cast(
|
|
97
|
+
typing.List[LanguagePydanticModel],
|
|
98
|
+
parse_obj_as(
|
|
99
|
+
type_=typing.List[LanguagePydanticModel], # type: ignore
|
|
100
|
+
object_=_response.json(),
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
return HttpResponse(response=_response, data=_data)
|
|
104
|
+
if _response.status_code == 422:
|
|
105
|
+
raise UnprocessableEntityError(
|
|
106
|
+
headers=dict(_response.headers),
|
|
107
|
+
body=typing.cast(
|
|
108
|
+
HttpValidationError,
|
|
109
|
+
parse_obj_as(
|
|
110
|
+
type_=HttpValidationError, # type: ignore
|
|
111
|
+
object_=_response.json(),
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
)
|
|
115
|
+
_response_json = _response.json()
|
|
116
|
+
except JSONDecodeError:
|
|
117
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
118
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class AsyncRawLanguagesClient:
|
|
122
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
123
|
+
self._client_wrapper = client_wrapper
|
|
124
|
+
|
|
125
|
+
async def get_source_languages(
|
|
126
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
127
|
+
) -> AsyncHttpResponse[typing.List[LanguagePydanticModel]]:
|
|
128
|
+
"""
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
run_id : typing.Optional[int]
|
|
132
|
+
|
|
133
|
+
request_options : typing.Optional[RequestOptions]
|
|
134
|
+
Request-specific configuration.
|
|
135
|
+
|
|
136
|
+
Returns
|
|
137
|
+
-------
|
|
138
|
+
AsyncHttpResponse[typing.List[LanguagePydanticModel]]
|
|
139
|
+
Successful Response
|
|
140
|
+
"""
|
|
141
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
142
|
+
"source-languages",
|
|
143
|
+
method="GET",
|
|
144
|
+
params={
|
|
145
|
+
"run_id": run_id,
|
|
146
|
+
},
|
|
147
|
+
request_options=request_options,
|
|
148
|
+
)
|
|
149
|
+
try:
|
|
150
|
+
if 200 <= _response.status_code < 300:
|
|
151
|
+
_data = typing.cast(
|
|
152
|
+
typing.List[LanguagePydanticModel],
|
|
153
|
+
parse_obj_as(
|
|
154
|
+
type_=typing.List[LanguagePydanticModel], # type: ignore
|
|
155
|
+
object_=_response.json(),
|
|
156
|
+
),
|
|
157
|
+
)
|
|
158
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
159
|
+
if _response.status_code == 422:
|
|
160
|
+
raise UnprocessableEntityError(
|
|
161
|
+
headers=dict(_response.headers),
|
|
162
|
+
body=typing.cast(
|
|
163
|
+
HttpValidationError,
|
|
164
|
+
parse_obj_as(
|
|
165
|
+
type_=HttpValidationError, # type: ignore
|
|
166
|
+
object_=_response.json(),
|
|
167
|
+
),
|
|
168
|
+
),
|
|
169
|
+
)
|
|
170
|
+
_response_json = _response.json()
|
|
171
|
+
except JSONDecodeError:
|
|
172
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
173
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
174
|
+
|
|
175
|
+
async def get_target_languages(
|
|
176
|
+
self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
|
|
177
|
+
) -> AsyncHttpResponse[typing.List[LanguagePydanticModel]]:
|
|
178
|
+
"""
|
|
179
|
+
Parameters
|
|
180
|
+
----------
|
|
181
|
+
run_id : typing.Optional[int]
|
|
182
|
+
|
|
183
|
+
request_options : typing.Optional[RequestOptions]
|
|
184
|
+
Request-specific configuration.
|
|
185
|
+
|
|
186
|
+
Returns
|
|
187
|
+
-------
|
|
188
|
+
AsyncHttpResponse[typing.List[LanguagePydanticModel]]
|
|
189
|
+
Successful Response
|
|
190
|
+
"""
|
|
191
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
192
|
+
"target-languages",
|
|
193
|
+
method="GET",
|
|
194
|
+
params={
|
|
195
|
+
"run_id": run_id,
|
|
196
|
+
},
|
|
197
|
+
request_options=request_options,
|
|
198
|
+
)
|
|
199
|
+
try:
|
|
200
|
+
if 200 <= _response.status_code < 300:
|
|
201
|
+
_data = typing.cast(
|
|
202
|
+
typing.List[LanguagePydanticModel],
|
|
203
|
+
parse_obj_as(
|
|
204
|
+
type_=typing.List[LanguagePydanticModel], # type: ignore
|
|
205
|
+
object_=_response.json(),
|
|
206
|
+
),
|
|
207
|
+
)
|
|
208
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
209
|
+
if _response.status_code == 422:
|
|
210
|
+
raise UnprocessableEntityError(
|
|
211
|
+
headers=dict(_response.headers),
|
|
212
|
+
body=typing.cast(
|
|
213
|
+
HttpValidationError,
|
|
214
|
+
parse_obj_as(
|
|
215
|
+
type_=HttpValidationError, # type: ignore
|
|
216
|
+
object_=_response.json(),
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
)
|
|
220
|
+
_response_json = _response.json()
|
|
221
|
+
except JSONDecodeError:
|
|
222
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
223
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|