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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .dubbed_output_in_alt_format_request_payload_output_format import (
|
|
10
|
+
DubbedOutputInAltFormatRequestPayloadOutputFormat,
|
|
11
|
+
)
|
|
12
|
+
from .get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response import (
|
|
13
|
+
GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse,
|
|
14
|
+
)
|
|
15
|
+
from .get_dubbed_run_info_dub_result_run_id_get_response import GetDubbedRunInfoDubResultRunIdGetResponse
|
|
16
|
+
from .get_dubbing_runs_results_dubbing_results_post_response_value import (
|
|
17
|
+
GetDubbingRunsResultsDubbingResultsPostResponseValue,
|
|
18
|
+
)
|
|
19
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
20
|
+
"DubbedOutputInAltFormatRequestPayloadOutputFormat": ".dubbed_output_in_alt_format_request_payload_output_format",
|
|
21
|
+
"GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse": ".get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response",
|
|
22
|
+
"GetDubbedRunInfoDubResultRunIdGetResponse": ".get_dubbed_run_info_dub_result_run_id_get_response",
|
|
23
|
+
"GetDubbingRunsResultsDubbingResultsPostResponseValue": ".get_dubbing_runs_results_dubbing_results_post_response_value",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
28
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
29
|
+
if module_name is None:
|
|
30
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
31
|
+
try:
|
|
32
|
+
module = import_module(module_name, __package__)
|
|
33
|
+
if module_name == f".{attr_name}":
|
|
34
|
+
return module
|
|
35
|
+
else:
|
|
36
|
+
return getattr(module, attr_name)
|
|
37
|
+
except ImportError as e:
|
|
38
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
39
|
+
except AttributeError as e:
|
|
40
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def __dir__():
|
|
44
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
45
|
+
return sorted(lazy_attrs)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
"DubbedOutputInAltFormatRequestPayloadOutputFormat",
|
|
50
|
+
"GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse",
|
|
51
|
+
"GetDubbedRunInfoDubResultRunIdGetResponse",
|
|
52
|
+
"GetDubbingRunsResultsDubbingResultsPostResponseValue",
|
|
53
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...types.audio_output_type import AudioOutputType
|
|
6
|
+
from ...types.video_output_type_without_avi import VideoOutputTypeWithoutAvi
|
|
7
|
+
|
|
8
|
+
DubbedOutputInAltFormatRequestPayloadOutputFormat = typing.Union[AudioOutputType, VideoOutputTypeWithoutAvi]
|
camb/dub/types/get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
|
|
6
|
+
|
|
7
|
+
GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse = typing.Union[
|
|
8
|
+
typing.Dict[str, str], OrchestratorPipelineCallResult
|
|
9
|
+
]
|
camb/environment.py
ADDED
camb/errors/__init__.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .unprocessable_entity_error import UnprocessableEntityError
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"UnprocessableEntityError": ".unprocessable_entity_error"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
14
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
15
|
+
if module_name is None:
|
|
16
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
17
|
+
try:
|
|
18
|
+
module = import_module(module_name, __package__)
|
|
19
|
+
if module_name == f".{attr_name}":
|
|
20
|
+
return module
|
|
21
|
+
else:
|
|
22
|
+
return getattr(module, attr_name)
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
25
|
+
except AttributeError as e:
|
|
26
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __dir__():
|
|
30
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
31
|
+
return sorted(lazy_attrs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["UnprocessableEntityError"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.api_error import ApiError
|
|
6
|
+
from ..types.http_validation_error import HttpValidationError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UnprocessableEntityError(ApiError):
|
|
10
|
+
def __init__(self, body: HttpValidationError, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
11
|
+
super().__init__(status_code=422, headers=headers, body=body)
|
camb/folders/__init__.py
ADDED
camb/folders/client.py
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
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.folder import Folder
|
|
8
|
+
from .raw_client import AsyncRawFoldersClient, RawFoldersClient
|
|
9
|
+
|
|
10
|
+
# this is used as the default value for optional parameters
|
|
11
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FoldersClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawFoldersClient(client_wrapper=client_wrapper)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def with_raw_response(self) -> RawFoldersClient:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
RawFoldersClient
|
|
26
|
+
"""
|
|
27
|
+
return self._raw_client
|
|
28
|
+
|
|
29
|
+
def list_folders(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
limit: typing.Optional[int] = None,
|
|
33
|
+
search_query: typing.Optional[str] = None,
|
|
34
|
+
run_id: typing.Optional[int] = None,
|
|
35
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
+
) -> typing.List[Folder]:
|
|
37
|
+
"""
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
limit : typing.Optional[int]
|
|
41
|
+
|
|
42
|
+
search_query : typing.Optional[str]
|
|
43
|
+
|
|
44
|
+
run_id : typing.Optional[int]
|
|
45
|
+
|
|
46
|
+
request_options : typing.Optional[RequestOptions]
|
|
47
|
+
Request-specific configuration.
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
typing.List[Folder]
|
|
52
|
+
Successful Response
|
|
53
|
+
|
|
54
|
+
Examples
|
|
55
|
+
--------
|
|
56
|
+
from camb import CambApi
|
|
57
|
+
|
|
58
|
+
client = CambApi(
|
|
59
|
+
api_key="YOUR_API_KEY",
|
|
60
|
+
)
|
|
61
|
+
client.folders.list_folders()
|
|
62
|
+
"""
|
|
63
|
+
_response = self._raw_client.list_folders(
|
|
64
|
+
limit=limit, search_query=search_query, run_id=run_id, request_options=request_options
|
|
65
|
+
)
|
|
66
|
+
return _response.data
|
|
67
|
+
|
|
68
|
+
def create_folder(
|
|
69
|
+
self,
|
|
70
|
+
*,
|
|
71
|
+
folder_name: str,
|
|
72
|
+
run_id: typing.Optional[int] = None,
|
|
73
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
74
|
+
) -> typing.Any:
|
|
75
|
+
"""
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
folder_name : str
|
|
79
|
+
|
|
80
|
+
run_id : typing.Optional[int]
|
|
81
|
+
|
|
82
|
+
request_options : typing.Optional[RequestOptions]
|
|
83
|
+
Request-specific configuration.
|
|
84
|
+
|
|
85
|
+
Returns
|
|
86
|
+
-------
|
|
87
|
+
typing.Any
|
|
88
|
+
Successful Response
|
|
89
|
+
|
|
90
|
+
Examples
|
|
91
|
+
--------
|
|
92
|
+
from camb import CambApi
|
|
93
|
+
|
|
94
|
+
client = CambApi(
|
|
95
|
+
api_key="YOUR_API_KEY",
|
|
96
|
+
)
|
|
97
|
+
client.folders.create_folder(
|
|
98
|
+
folder_name="folder_name",
|
|
99
|
+
)
|
|
100
|
+
"""
|
|
101
|
+
_response = self._raw_client.create_folder(
|
|
102
|
+
folder_name=folder_name, run_id=run_id, request_options=request_options
|
|
103
|
+
)
|
|
104
|
+
return _response.data
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class AsyncFoldersClient:
|
|
108
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
109
|
+
self._raw_client = AsyncRawFoldersClient(client_wrapper=client_wrapper)
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def with_raw_response(self) -> AsyncRawFoldersClient:
|
|
113
|
+
"""
|
|
114
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
AsyncRawFoldersClient
|
|
119
|
+
"""
|
|
120
|
+
return self._raw_client
|
|
121
|
+
|
|
122
|
+
async def list_folders(
|
|
123
|
+
self,
|
|
124
|
+
*,
|
|
125
|
+
limit: typing.Optional[int] = None,
|
|
126
|
+
search_query: typing.Optional[str] = None,
|
|
127
|
+
run_id: typing.Optional[int] = None,
|
|
128
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
129
|
+
) -> typing.List[Folder]:
|
|
130
|
+
"""
|
|
131
|
+
Parameters
|
|
132
|
+
----------
|
|
133
|
+
limit : typing.Optional[int]
|
|
134
|
+
|
|
135
|
+
search_query : typing.Optional[str]
|
|
136
|
+
|
|
137
|
+
run_id : typing.Optional[int]
|
|
138
|
+
|
|
139
|
+
request_options : typing.Optional[RequestOptions]
|
|
140
|
+
Request-specific configuration.
|
|
141
|
+
|
|
142
|
+
Returns
|
|
143
|
+
-------
|
|
144
|
+
typing.List[Folder]
|
|
145
|
+
Successful Response
|
|
146
|
+
|
|
147
|
+
Examples
|
|
148
|
+
--------
|
|
149
|
+
import asyncio
|
|
150
|
+
|
|
151
|
+
from camb import AsyncCambApi
|
|
152
|
+
|
|
153
|
+
client = AsyncCambApi(
|
|
154
|
+
api_key="YOUR_API_KEY",
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def main() -> None:
|
|
159
|
+
await client.folders.list_folders()
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
asyncio.run(main())
|
|
163
|
+
"""
|
|
164
|
+
_response = await self._raw_client.list_folders(
|
|
165
|
+
limit=limit, search_query=search_query, run_id=run_id, request_options=request_options
|
|
166
|
+
)
|
|
167
|
+
return _response.data
|
|
168
|
+
|
|
169
|
+
async def create_folder(
|
|
170
|
+
self,
|
|
171
|
+
*,
|
|
172
|
+
folder_name: str,
|
|
173
|
+
run_id: typing.Optional[int] = None,
|
|
174
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
175
|
+
) -> typing.Any:
|
|
176
|
+
"""
|
|
177
|
+
Parameters
|
|
178
|
+
----------
|
|
179
|
+
folder_name : str
|
|
180
|
+
|
|
181
|
+
run_id : typing.Optional[int]
|
|
182
|
+
|
|
183
|
+
request_options : typing.Optional[RequestOptions]
|
|
184
|
+
Request-specific configuration.
|
|
185
|
+
|
|
186
|
+
Returns
|
|
187
|
+
-------
|
|
188
|
+
typing.Any
|
|
189
|
+
Successful Response
|
|
190
|
+
|
|
191
|
+
Examples
|
|
192
|
+
--------
|
|
193
|
+
import asyncio
|
|
194
|
+
|
|
195
|
+
from camb import AsyncCambApi
|
|
196
|
+
|
|
197
|
+
client = AsyncCambApi(
|
|
198
|
+
api_key="YOUR_API_KEY",
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
async def main() -> None:
|
|
203
|
+
await client.folders.create_folder(
|
|
204
|
+
folder_name="folder_name",
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
asyncio.run(main())
|
|
209
|
+
"""
|
|
210
|
+
_response = await self._raw_client.create_folder(
|
|
211
|
+
folder_name=folder_name, run_id=run_id, request_options=request_options
|
|
212
|
+
)
|
|
213
|
+
return _response.data
|
|
@@ -0,0 +1,278 @@
|
|
|
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.folder import Folder
|
|
13
|
+
from ..types.http_validation_error import HttpValidationError
|
|
14
|
+
|
|
15
|
+
# this is used as the default value for optional parameters
|
|
16
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RawFoldersClient:
|
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
|
+
self._client_wrapper = client_wrapper
|
|
22
|
+
|
|
23
|
+
def list_folders(
|
|
24
|
+
self,
|
|
25
|
+
*,
|
|
26
|
+
limit: typing.Optional[int] = None,
|
|
27
|
+
search_query: typing.Optional[str] = None,
|
|
28
|
+
run_id: typing.Optional[int] = None,
|
|
29
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
30
|
+
) -> HttpResponse[typing.List[Folder]]:
|
|
31
|
+
"""
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
limit : typing.Optional[int]
|
|
35
|
+
|
|
36
|
+
search_query : typing.Optional[str]
|
|
37
|
+
|
|
38
|
+
run_id : typing.Optional[int]
|
|
39
|
+
|
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
|
41
|
+
Request-specific configuration.
|
|
42
|
+
|
|
43
|
+
Returns
|
|
44
|
+
-------
|
|
45
|
+
HttpResponse[typing.List[Folder]]
|
|
46
|
+
Successful Response
|
|
47
|
+
"""
|
|
48
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
49
|
+
"folders",
|
|
50
|
+
method="GET",
|
|
51
|
+
params={
|
|
52
|
+
"limit": limit,
|
|
53
|
+
"search_query": search_query,
|
|
54
|
+
"run_id": run_id,
|
|
55
|
+
},
|
|
56
|
+
request_options=request_options,
|
|
57
|
+
)
|
|
58
|
+
try:
|
|
59
|
+
if 200 <= _response.status_code < 300:
|
|
60
|
+
_data = typing.cast(
|
|
61
|
+
typing.List[Folder],
|
|
62
|
+
parse_obj_as(
|
|
63
|
+
type_=typing.List[Folder], # type: ignore
|
|
64
|
+
object_=_response.json(),
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
return HttpResponse(response=_response, data=_data)
|
|
68
|
+
if _response.status_code == 422:
|
|
69
|
+
raise UnprocessableEntityError(
|
|
70
|
+
headers=dict(_response.headers),
|
|
71
|
+
body=typing.cast(
|
|
72
|
+
HttpValidationError,
|
|
73
|
+
parse_obj_as(
|
|
74
|
+
type_=HttpValidationError, # type: ignore
|
|
75
|
+
object_=_response.json(),
|
|
76
|
+
),
|
|
77
|
+
),
|
|
78
|
+
)
|
|
79
|
+
_response_json = _response.json()
|
|
80
|
+
except JSONDecodeError:
|
|
81
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
82
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
83
|
+
|
|
84
|
+
def create_folder(
|
|
85
|
+
self,
|
|
86
|
+
*,
|
|
87
|
+
folder_name: str,
|
|
88
|
+
run_id: typing.Optional[int] = None,
|
|
89
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
90
|
+
) -> HttpResponse[typing.Any]:
|
|
91
|
+
"""
|
|
92
|
+
Parameters
|
|
93
|
+
----------
|
|
94
|
+
folder_name : str
|
|
95
|
+
|
|
96
|
+
run_id : typing.Optional[int]
|
|
97
|
+
|
|
98
|
+
request_options : typing.Optional[RequestOptions]
|
|
99
|
+
Request-specific configuration.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
HttpResponse[typing.Any]
|
|
104
|
+
Successful Response
|
|
105
|
+
"""
|
|
106
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
107
|
+
"folders/create",
|
|
108
|
+
method="POST",
|
|
109
|
+
params={
|
|
110
|
+
"run_id": run_id,
|
|
111
|
+
},
|
|
112
|
+
json={
|
|
113
|
+
"folder_name": folder_name,
|
|
114
|
+
},
|
|
115
|
+
headers={
|
|
116
|
+
"content-type": "application/json",
|
|
117
|
+
},
|
|
118
|
+
request_options=request_options,
|
|
119
|
+
omit=OMIT,
|
|
120
|
+
)
|
|
121
|
+
try:
|
|
122
|
+
if _response is None or not _response.text.strip():
|
|
123
|
+
return HttpResponse(response=_response, data=None)
|
|
124
|
+
if 200 <= _response.status_code < 300:
|
|
125
|
+
_data = typing.cast(
|
|
126
|
+
typing.Any,
|
|
127
|
+
parse_obj_as(
|
|
128
|
+
type_=typing.Any, # type: ignore
|
|
129
|
+
object_=_response.json(),
|
|
130
|
+
),
|
|
131
|
+
)
|
|
132
|
+
return HttpResponse(response=_response, data=_data)
|
|
133
|
+
if _response.status_code == 422:
|
|
134
|
+
raise UnprocessableEntityError(
|
|
135
|
+
headers=dict(_response.headers),
|
|
136
|
+
body=typing.cast(
|
|
137
|
+
HttpValidationError,
|
|
138
|
+
parse_obj_as(
|
|
139
|
+
type_=HttpValidationError, # type: ignore
|
|
140
|
+
object_=_response.json(),
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
_response_json = _response.json()
|
|
145
|
+
except JSONDecodeError:
|
|
146
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
147
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class AsyncRawFoldersClient:
|
|
151
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
152
|
+
self._client_wrapper = client_wrapper
|
|
153
|
+
|
|
154
|
+
async def list_folders(
|
|
155
|
+
self,
|
|
156
|
+
*,
|
|
157
|
+
limit: typing.Optional[int] = None,
|
|
158
|
+
search_query: typing.Optional[str] = None,
|
|
159
|
+
run_id: typing.Optional[int] = None,
|
|
160
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
161
|
+
) -> AsyncHttpResponse[typing.List[Folder]]:
|
|
162
|
+
"""
|
|
163
|
+
Parameters
|
|
164
|
+
----------
|
|
165
|
+
limit : typing.Optional[int]
|
|
166
|
+
|
|
167
|
+
search_query : typing.Optional[str]
|
|
168
|
+
|
|
169
|
+
run_id : typing.Optional[int]
|
|
170
|
+
|
|
171
|
+
request_options : typing.Optional[RequestOptions]
|
|
172
|
+
Request-specific configuration.
|
|
173
|
+
|
|
174
|
+
Returns
|
|
175
|
+
-------
|
|
176
|
+
AsyncHttpResponse[typing.List[Folder]]
|
|
177
|
+
Successful Response
|
|
178
|
+
"""
|
|
179
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
180
|
+
"folders",
|
|
181
|
+
method="GET",
|
|
182
|
+
params={
|
|
183
|
+
"limit": limit,
|
|
184
|
+
"search_query": search_query,
|
|
185
|
+
"run_id": run_id,
|
|
186
|
+
},
|
|
187
|
+
request_options=request_options,
|
|
188
|
+
)
|
|
189
|
+
try:
|
|
190
|
+
if 200 <= _response.status_code < 300:
|
|
191
|
+
_data = typing.cast(
|
|
192
|
+
typing.List[Folder],
|
|
193
|
+
parse_obj_as(
|
|
194
|
+
type_=typing.List[Folder], # type: ignore
|
|
195
|
+
object_=_response.json(),
|
|
196
|
+
),
|
|
197
|
+
)
|
|
198
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
199
|
+
if _response.status_code == 422:
|
|
200
|
+
raise UnprocessableEntityError(
|
|
201
|
+
headers=dict(_response.headers),
|
|
202
|
+
body=typing.cast(
|
|
203
|
+
HttpValidationError,
|
|
204
|
+
parse_obj_as(
|
|
205
|
+
type_=HttpValidationError, # type: ignore
|
|
206
|
+
object_=_response.json(),
|
|
207
|
+
),
|
|
208
|
+
),
|
|
209
|
+
)
|
|
210
|
+
_response_json = _response.json()
|
|
211
|
+
except JSONDecodeError:
|
|
212
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
213
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
214
|
+
|
|
215
|
+
async def create_folder(
|
|
216
|
+
self,
|
|
217
|
+
*,
|
|
218
|
+
folder_name: str,
|
|
219
|
+
run_id: typing.Optional[int] = None,
|
|
220
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
221
|
+
) -> AsyncHttpResponse[typing.Any]:
|
|
222
|
+
"""
|
|
223
|
+
Parameters
|
|
224
|
+
----------
|
|
225
|
+
folder_name : str
|
|
226
|
+
|
|
227
|
+
run_id : typing.Optional[int]
|
|
228
|
+
|
|
229
|
+
request_options : typing.Optional[RequestOptions]
|
|
230
|
+
Request-specific configuration.
|
|
231
|
+
|
|
232
|
+
Returns
|
|
233
|
+
-------
|
|
234
|
+
AsyncHttpResponse[typing.Any]
|
|
235
|
+
Successful Response
|
|
236
|
+
"""
|
|
237
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
238
|
+
"folders/create",
|
|
239
|
+
method="POST",
|
|
240
|
+
params={
|
|
241
|
+
"run_id": run_id,
|
|
242
|
+
},
|
|
243
|
+
json={
|
|
244
|
+
"folder_name": folder_name,
|
|
245
|
+
},
|
|
246
|
+
headers={
|
|
247
|
+
"content-type": "application/json",
|
|
248
|
+
},
|
|
249
|
+
request_options=request_options,
|
|
250
|
+
omit=OMIT,
|
|
251
|
+
)
|
|
252
|
+
try:
|
|
253
|
+
if _response is None or not _response.text.strip():
|
|
254
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
255
|
+
if 200 <= _response.status_code < 300:
|
|
256
|
+
_data = typing.cast(
|
|
257
|
+
typing.Any,
|
|
258
|
+
parse_obj_as(
|
|
259
|
+
type_=typing.Any, # type: ignore
|
|
260
|
+
object_=_response.json(),
|
|
261
|
+
),
|
|
262
|
+
)
|
|
263
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
264
|
+
if _response.status_code == 422:
|
|
265
|
+
raise UnprocessableEntityError(
|
|
266
|
+
headers=dict(_response.headers),
|
|
267
|
+
body=typing.cast(
|
|
268
|
+
HttpValidationError,
|
|
269
|
+
parse_obj_as(
|
|
270
|
+
type_=HttpValidationError, # type: ignore
|
|
271
|
+
object_=_response.json(),
|
|
272
|
+
),
|
|
273
|
+
),
|
|
274
|
+
)
|
|
275
|
+
_response_json = _response.json()
|
|
276
|
+
except JSONDecodeError:
|
|
277
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
278
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|