mixpeek 0.11.2__py3-none-any.whl → 0.13__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.
- mixpeek/__init__.py +9 -1
- mixpeek/_hooks/__init__.py +5 -0
- mixpeek/_hooks/registration.py +13 -0
- mixpeek/_hooks/sdkhooks.py +76 -0
- mixpeek/_hooks/types.py +94 -0
- mixpeek/_version.py +12 -0
- mixpeek/assets.py +1561 -0
- mixpeek/basesdk.py +350 -0
- mixpeek/collections.py +1029 -0
- mixpeek/featureextractors.py +205 -0
- mixpeek/features.py +1181 -0
- mixpeek/health.py +167 -0
- mixpeek/httpclient.py +84 -0
- mixpeek/ingest.py +831 -0
- mixpeek/interactions.py +221 -0
- mixpeek/models/__init__.py +751 -0
- mixpeek/models/actionusage.py +16 -0
- mixpeek/models/apierror.py +22 -0
- mixpeek/models/apikey.py +25 -0
- mixpeek/models/apikeyupdate.py +49 -0
- mixpeek/models/assetfeatures.py +55 -0
- mixpeek/models/assetresponse.py +166 -0
- mixpeek/models/assets_model_searchquery.py +21 -0
- mixpeek/models/assetupdate.py +28 -0
- mixpeek/models/availableindexesresponse.py +23 -0
- mixpeek/models/availablemodels.py +12 -0
- mixpeek/models/boolindexparams.py +18 -0
- mixpeek/models/collectionmodel.py +70 -0
- mixpeek/models/collectionresult.py +73 -0
- mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +23 -0
- mixpeek/models/create_collection_collections_postop.py +62 -0
- mixpeek/models/create_interaction_features_search_interactions_postop.py +59 -0
- mixpeek/models/createcollectionrequest.py +59 -0
- mixpeek/models/createnamespacerequest.py +62 -0
- mixpeek/models/datetimeindexparams.py +18 -0
- mixpeek/models/dateusage.py +22 -0
- mixpeek/models/db_model_paginationresponse.py +59 -0
- mixpeek/models/db_model_taskresponse.py +20 -0
- mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +23 -0
- mixpeek/models/delete_asset_assets_asset_id_deleteop.py +57 -0
- mixpeek/models/delete_collection_collections_collection_deleteop.py +59 -0
- mixpeek/models/delete_feature_features_feature_id_deleteop.py +57 -0
- mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +59 -0
- mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +18 -0
- mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +16 -0
- mixpeek/models/denseembedding.py +16 -0
- mixpeek/models/embeddingrequest.py +59 -0
- mixpeek/models/embeddingresponse.py +64 -0
- mixpeek/models/errormessage.py +13 -0
- mixpeek/models/errorresponse.py +21 -0
- mixpeek/models/facedetectsettings.py +52 -0
- mixpeek/models/featureextractionembeddingrequest.py +54 -0
- mixpeek/models/featureresponse.py +74 -0
- mixpeek/models/features_model_paginationresponse.py +59 -0
- mixpeek/models/featureupdaterequest.py +21 -0
- mixpeek/models/filtercondition.py +74 -0
- mixpeek/models/floatindexparams.py +18 -0
- mixpeek/models/full_asset_update_assets_asset_id_putop.py +69 -0
- mixpeek/models/full_feature_update_features_feature_id_putop.py +69 -0
- mixpeek/models/geoindexparams.py +18 -0
- mixpeek/models/get_asset_assets_asset_id_getop.py +73 -0
- mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +73 -0
- mixpeek/models/get_collection_collections_collection_getop.py +59 -0
- mixpeek/models/get_feature_features_feature_id_getop.py +70 -0
- mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +59 -0
- mixpeek/models/get_namespace_namespaces_namespace_getop.py +18 -0
- mixpeek/models/get_task_tasks_task_id_getop.py +57 -0
- mixpeek/models/get_user_organizations_users_user_email_getop.py +16 -0
- mixpeek/models/groupbyoptions.py +71 -0
- mixpeek/models/groupbyoptionsasset.py +71 -0
- mixpeek/models/groupedassetdata.py +18 -0
- mixpeek/models/healthcheckresponse.py +13 -0
- mixpeek/models/httpvalidationerror.py +21 -0
- mixpeek/models/imagedescribesettings.py +82 -0
- mixpeek/models/imagedetectsettings.py +53 -0
- mixpeek/models/imagereadsettings.py +71 -0
- mixpeek/models/imagesettings.py +79 -0
- mixpeek/models/ingest_image_url_ingest_images_url_postop.py +59 -0
- mixpeek/models/ingest_text_ingest_text_postop.py +59 -0
- mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +59 -0
- mixpeek/models/inputtype.py +11 -0
- mixpeek/models/integerindexparams.py +24 -0
- mixpeek/models/interactionresponse.py +87 -0
- mixpeek/models/interactiontype.py +11 -0
- mixpeek/models/jsonimageoutputsettings.py +55 -0
- mixpeek/models/jsontextoutputsettings.py +55 -0
- mixpeek/models/jsonvideooutputsettings.py +55 -0
- mixpeek/models/keywordindexparams.py +21 -0
- mixpeek/models/kill_task_tasks_task_id_deleteop.py +57 -0
- mixpeek/models/list_assets_assets_postop.py +77 -0
- mixpeek/models/list_collections_collections_getop.py +65 -0
- mixpeek/models/list_features_features_postop.py +79 -0
- mixpeek/models/list_interactions_features_search_interactions_getop.py +96 -0
- mixpeek/models/listassetsrequest.py +75 -0
- mixpeek/models/listassetsresponse.py +22 -0
- mixpeek/models/listcollectionsresponse.py +22 -0
- mixpeek/models/listfeaturesrequest.py +77 -0
- mixpeek/models/listfeaturesresponse.py +22 -0
- mixpeek/models/logicaloperator_input.py +88 -0
- mixpeek/models/logicaloperator_output.py +103 -0
- mixpeek/models/logodetectsettings.py +52 -0
- mixpeek/models/modality.py +13 -0
- mixpeek/models/modeldetails.py +57 -0
- mixpeek/models/namespaceresponse.py +54 -0
- mixpeek/models/organizationmodel.py +45 -0
- mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +69 -0
- mixpeek/models/payloadindexconfig.py +94 -0
- mixpeek/models/payloadindextype.py +17 -0
- mixpeek/models/payloadschematype.py +15 -0
- mixpeek/models/percolaterequest.py +57 -0
- mixpeek/models/permission.py +10 -0
- mixpeek/models/processimageurlinput.py +99 -0
- mixpeek/models/processtextinput.py +94 -0
- mixpeek/models/processvideourlinput.py +99 -0
- mixpeek/models/querysettings.py +56 -0
- mixpeek/models/rerankingoptions.py +47 -0
- mixpeek/models/search_assets_assets_search_postop.py +59 -0
- mixpeek/models/search_features_features_search_postop.py +96 -0
- mixpeek/models/search_model_searchquery_input.py +76 -0
- mixpeek/models/searchassetsrequest.py +78 -0
- mixpeek/models/searchinteraction.py +82 -0
- mixpeek/models/searchquery_output.py +79 -0
- mixpeek/models/searchrequestfeatures_input.py +151 -0
- mixpeek/models/searchrequestfeatures_output.py +151 -0
- mixpeek/models/sortoption.py +28 -0
- mixpeek/models/sparseembedding.py +21 -0
- mixpeek/models/tasks_model_taskresponse.py +24 -0
- mixpeek/models/taskstatus.py +16 -0
- mixpeek/models/textindexparams.py +31 -0
- mixpeek/models/textsettings.py +61 -0
- mixpeek/models/tokenizertype.py +11 -0
- mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +30 -0
- mixpeek/models/update_collection_collections_collection_putop.py +74 -0
- mixpeek/models/update_namespace_namespaces_namespace_putop.py +28 -0
- mixpeek/models/updateassetrequest.py +60 -0
- mixpeek/models/updatenamespacerequest.py +26 -0
- mixpeek/models/usage.py +18 -0
- mixpeek/models/usermodel_input.py +36 -0
- mixpeek/models/usermodel_output.py +36 -0
- mixpeek/models/uuidindexparams.py +21 -0
- mixpeek/models/validationerror.py +26 -0
- mixpeek/models/vectormodel.py +11 -0
- mixpeek/models/vectortype.py +9 -0
- mixpeek/models/videodescribesettings.py +82 -0
- mixpeek/models/videodetectsettings.py +53 -0
- mixpeek/models/videoreadsettings.py +71 -0
- mixpeek/models/videosettings.py +101 -0
- mixpeek/models/videotranscriptionsettings.py +69 -0
- mixpeek/namespaces.py +1143 -0
- mixpeek/organizations.py +1508 -0
- mixpeek/py.typed +1 -0
- mixpeek/sdk.py +135 -0
- mixpeek/sdkconfiguration.py +45 -0
- mixpeek/searchinteractions.py +647 -0
- mixpeek/tasks.py +387 -0
- mixpeek/types/__init__.py +21 -0
- mixpeek/types/basemodel.py +39 -0
- mixpeek/utils/__init__.py +97 -0
- mixpeek/utils/annotations.py +55 -0
- mixpeek/utils/enums.py +34 -0
- mixpeek/utils/eventstreaming.py +238 -0
- mixpeek/utils/forms.py +202 -0
- mixpeek/utils/headers.py +136 -0
- mixpeek/utils/logger.py +27 -0
- mixpeek/utils/metadata.py +118 -0
- mixpeek/utils/queryparams.py +205 -0
- mixpeek/utils/requestbodies.py +66 -0
- mixpeek/utils/retries.py +217 -0
- mixpeek/utils/security.py +174 -0
- mixpeek/utils/serializers.py +215 -0
- mixpeek/utils/url.py +155 -0
- mixpeek/utils/values.py +134 -0
- mixpeek-0.13.dist-info/METADATA +439 -0
- mixpeek-0.13.dist-info/RECORD +176 -0
- {mixpeek-0.11.2.dist-info → mixpeek-0.13.dist-info}/WHEEL +1 -2
- py.typed +1 -0
- mixpeek/client.py +0 -27
- mixpeek/endpoints/__init__.py +0 -0
- mixpeek/endpoints/collections.py +0 -86
- mixpeek/endpoints/embed.py +0 -66
- mixpeek/endpoints/index.py +0 -51
- mixpeek/endpoints/register.py +0 -34
- mixpeek/endpoints/search.py +0 -44
- mixpeek/endpoints/tasks.py +0 -26
- mixpeek/endpoints/tools.py +0 -138
- mixpeek/exceptions.py +0 -13
- mixpeek-0.11.2.dist-info/METADATA +0 -375
- mixpeek-0.11.2.dist-info/RECORD +0 -15
- mixpeek-0.11.2.dist-info/top_level.txt +0 -1
mixpeek/namespaces.py
ADDED
@@ -0,0 +1,1143 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from mixpeek import models, utils
|
5
|
+
from mixpeek._hooks import HookContext
|
6
|
+
from mixpeek.types import OptionalNullable, UNSET
|
7
|
+
from typing import Any, List, Mapping, Optional, Union
|
8
|
+
|
9
|
+
|
10
|
+
class Namespaces(BaseSDK):
|
11
|
+
def create(
|
12
|
+
self,
|
13
|
+
*,
|
14
|
+
namespace_name: str,
|
15
|
+
vector_indexes: List[str],
|
16
|
+
payload_indexes: OptionalNullable[
|
17
|
+
Union[
|
18
|
+
List[models.PayloadIndexConfig],
|
19
|
+
List[models.PayloadIndexConfigTypedDict],
|
20
|
+
]
|
21
|
+
] = UNSET,
|
22
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
23
|
+
server_url: Optional[str] = None,
|
24
|
+
timeout_ms: Optional[int] = None,
|
25
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
26
|
+
) -> models.NamespaceResponse:
|
27
|
+
r"""Create Namespace
|
28
|
+
|
29
|
+
Creates a new namespace with the specified configuration
|
30
|
+
|
31
|
+
:param namespace_name: Name of the namespace to create
|
32
|
+
:param vector_indexes: List of vector indexes to be used within this namespace. Must be one of: 'image', 'multimodal', 'text', 'keyword'
|
33
|
+
:param payload_indexes: List of payload index configurations
|
34
|
+
:param retries: Override the default retry configuration for this method
|
35
|
+
:param server_url: Override the default server URL for this method
|
36
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
37
|
+
:param http_headers: Additional headers to set or replace on requests.
|
38
|
+
"""
|
39
|
+
base_url = None
|
40
|
+
url_variables = None
|
41
|
+
if timeout_ms is None:
|
42
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
43
|
+
|
44
|
+
if server_url is not None:
|
45
|
+
base_url = server_url
|
46
|
+
|
47
|
+
request = models.CreateNamespaceRequest(
|
48
|
+
namespace_name=namespace_name,
|
49
|
+
vector_indexes=vector_indexes,
|
50
|
+
payload_indexes=utils.get_pydantic_model(
|
51
|
+
payload_indexes, OptionalNullable[List[models.PayloadIndexConfig]]
|
52
|
+
),
|
53
|
+
)
|
54
|
+
|
55
|
+
req = self.build_request(
|
56
|
+
method="POST",
|
57
|
+
path="/namespaces",
|
58
|
+
base_url=base_url,
|
59
|
+
url_variables=url_variables,
|
60
|
+
request=request,
|
61
|
+
request_body_required=True,
|
62
|
+
request_has_path_params=False,
|
63
|
+
request_has_query_params=False,
|
64
|
+
user_agent_header="user-agent",
|
65
|
+
accept_header_value="application/json",
|
66
|
+
http_headers=http_headers,
|
67
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
68
|
+
request, False, False, "json", models.CreateNamespaceRequest
|
69
|
+
),
|
70
|
+
timeout_ms=timeout_ms,
|
71
|
+
)
|
72
|
+
|
73
|
+
if retries == UNSET:
|
74
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
75
|
+
retries = self.sdk_configuration.retry_config
|
76
|
+
|
77
|
+
retry_config = None
|
78
|
+
if isinstance(retries, utils.RetryConfig):
|
79
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
80
|
+
|
81
|
+
http_res = self.do_request(
|
82
|
+
hook_ctx=HookContext(
|
83
|
+
operation_id="create_namespace_namespaces_post",
|
84
|
+
oauth2_scopes=[],
|
85
|
+
security_source=None,
|
86
|
+
),
|
87
|
+
request=req,
|
88
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
89
|
+
retry_config=retry_config,
|
90
|
+
)
|
91
|
+
|
92
|
+
data: Any = None
|
93
|
+
if utils.match_response(http_res, "200", "application/json"):
|
94
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
95
|
+
if utils.match_response(
|
96
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
97
|
+
):
|
98
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
99
|
+
raise models.ErrorResponse(data=data)
|
100
|
+
if utils.match_response(http_res, "422", "application/json"):
|
101
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
102
|
+
raise models.HTTPValidationError(data=data)
|
103
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
104
|
+
http_res_text = utils.stream_to_text(http_res)
|
105
|
+
raise models.APIError(
|
106
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
107
|
+
)
|
108
|
+
|
109
|
+
content_type = http_res.headers.get("Content-Type")
|
110
|
+
http_res_text = utils.stream_to_text(http_res)
|
111
|
+
raise models.APIError(
|
112
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
113
|
+
http_res.status_code,
|
114
|
+
http_res_text,
|
115
|
+
http_res,
|
116
|
+
)
|
117
|
+
|
118
|
+
async def create_async(
|
119
|
+
self,
|
120
|
+
*,
|
121
|
+
namespace_name: str,
|
122
|
+
vector_indexes: List[str],
|
123
|
+
payload_indexes: OptionalNullable[
|
124
|
+
Union[
|
125
|
+
List[models.PayloadIndexConfig],
|
126
|
+
List[models.PayloadIndexConfigTypedDict],
|
127
|
+
]
|
128
|
+
] = UNSET,
|
129
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
130
|
+
server_url: Optional[str] = None,
|
131
|
+
timeout_ms: Optional[int] = None,
|
132
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
133
|
+
) -> models.NamespaceResponse:
|
134
|
+
r"""Create Namespace
|
135
|
+
|
136
|
+
Creates a new namespace with the specified configuration
|
137
|
+
|
138
|
+
:param namespace_name: Name of the namespace to create
|
139
|
+
:param vector_indexes: List of vector indexes to be used within this namespace. Must be one of: 'image', 'multimodal', 'text', 'keyword'
|
140
|
+
:param payload_indexes: List of payload index configurations
|
141
|
+
:param retries: Override the default retry configuration for this method
|
142
|
+
:param server_url: Override the default server URL for this method
|
143
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
144
|
+
:param http_headers: Additional headers to set or replace on requests.
|
145
|
+
"""
|
146
|
+
base_url = None
|
147
|
+
url_variables = None
|
148
|
+
if timeout_ms is None:
|
149
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
150
|
+
|
151
|
+
if server_url is not None:
|
152
|
+
base_url = server_url
|
153
|
+
|
154
|
+
request = models.CreateNamespaceRequest(
|
155
|
+
namespace_name=namespace_name,
|
156
|
+
vector_indexes=vector_indexes,
|
157
|
+
payload_indexes=utils.get_pydantic_model(
|
158
|
+
payload_indexes, OptionalNullable[List[models.PayloadIndexConfig]]
|
159
|
+
),
|
160
|
+
)
|
161
|
+
|
162
|
+
req = self.build_request_async(
|
163
|
+
method="POST",
|
164
|
+
path="/namespaces",
|
165
|
+
base_url=base_url,
|
166
|
+
url_variables=url_variables,
|
167
|
+
request=request,
|
168
|
+
request_body_required=True,
|
169
|
+
request_has_path_params=False,
|
170
|
+
request_has_query_params=False,
|
171
|
+
user_agent_header="user-agent",
|
172
|
+
accept_header_value="application/json",
|
173
|
+
http_headers=http_headers,
|
174
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
175
|
+
request, False, False, "json", models.CreateNamespaceRequest
|
176
|
+
),
|
177
|
+
timeout_ms=timeout_ms,
|
178
|
+
)
|
179
|
+
|
180
|
+
if retries == UNSET:
|
181
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
182
|
+
retries = self.sdk_configuration.retry_config
|
183
|
+
|
184
|
+
retry_config = None
|
185
|
+
if isinstance(retries, utils.RetryConfig):
|
186
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
187
|
+
|
188
|
+
http_res = await self.do_request_async(
|
189
|
+
hook_ctx=HookContext(
|
190
|
+
operation_id="create_namespace_namespaces_post",
|
191
|
+
oauth2_scopes=[],
|
192
|
+
security_source=None,
|
193
|
+
),
|
194
|
+
request=req,
|
195
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
196
|
+
retry_config=retry_config,
|
197
|
+
)
|
198
|
+
|
199
|
+
data: Any = None
|
200
|
+
if utils.match_response(http_res, "200", "application/json"):
|
201
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
202
|
+
if utils.match_response(
|
203
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
204
|
+
):
|
205
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
206
|
+
raise models.ErrorResponse(data=data)
|
207
|
+
if utils.match_response(http_res, "422", "application/json"):
|
208
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
209
|
+
raise models.HTTPValidationError(data=data)
|
210
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
211
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
212
|
+
raise models.APIError(
|
213
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
214
|
+
)
|
215
|
+
|
216
|
+
content_type = http_res.headers.get("Content-Type")
|
217
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
218
|
+
raise models.APIError(
|
219
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
220
|
+
http_res.status_code,
|
221
|
+
http_res_text,
|
222
|
+
http_res,
|
223
|
+
)
|
224
|
+
|
225
|
+
def list(
|
226
|
+
self,
|
227
|
+
*,
|
228
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
229
|
+
server_url: Optional[str] = None,
|
230
|
+
timeout_ms: Optional[int] = None,
|
231
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
232
|
+
) -> List[models.NamespaceResponse]:
|
233
|
+
r"""List Namespaces
|
234
|
+
|
235
|
+
List all namespaces for a user
|
236
|
+
|
237
|
+
:param retries: Override the default retry configuration for this method
|
238
|
+
:param server_url: Override the default server URL for this method
|
239
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
240
|
+
:param http_headers: Additional headers to set or replace on requests.
|
241
|
+
"""
|
242
|
+
base_url = None
|
243
|
+
url_variables = None
|
244
|
+
if timeout_ms is None:
|
245
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
246
|
+
|
247
|
+
if server_url is not None:
|
248
|
+
base_url = server_url
|
249
|
+
req = self.build_request(
|
250
|
+
method="GET",
|
251
|
+
path="/namespaces",
|
252
|
+
base_url=base_url,
|
253
|
+
url_variables=url_variables,
|
254
|
+
request=None,
|
255
|
+
request_body_required=False,
|
256
|
+
request_has_path_params=False,
|
257
|
+
request_has_query_params=False,
|
258
|
+
user_agent_header="user-agent",
|
259
|
+
accept_header_value="application/json",
|
260
|
+
http_headers=http_headers,
|
261
|
+
timeout_ms=timeout_ms,
|
262
|
+
)
|
263
|
+
|
264
|
+
if retries == UNSET:
|
265
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
266
|
+
retries = self.sdk_configuration.retry_config
|
267
|
+
|
268
|
+
retry_config = None
|
269
|
+
if isinstance(retries, utils.RetryConfig):
|
270
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
271
|
+
|
272
|
+
http_res = self.do_request(
|
273
|
+
hook_ctx=HookContext(
|
274
|
+
operation_id="list_namespaces_namespaces_get",
|
275
|
+
oauth2_scopes=[],
|
276
|
+
security_source=None,
|
277
|
+
),
|
278
|
+
request=req,
|
279
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
280
|
+
retry_config=retry_config,
|
281
|
+
)
|
282
|
+
|
283
|
+
data: Any = None
|
284
|
+
if utils.match_response(http_res, "200", "application/json"):
|
285
|
+
return utils.unmarshal_json(http_res.text, List[models.NamespaceResponse])
|
286
|
+
if utils.match_response(
|
287
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
288
|
+
):
|
289
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
290
|
+
raise models.ErrorResponse(data=data)
|
291
|
+
if utils.match_response(http_res, "422", "application/json"):
|
292
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
293
|
+
raise models.HTTPValidationError(data=data)
|
294
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
295
|
+
http_res_text = utils.stream_to_text(http_res)
|
296
|
+
raise models.APIError(
|
297
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
298
|
+
)
|
299
|
+
|
300
|
+
content_type = http_res.headers.get("Content-Type")
|
301
|
+
http_res_text = utils.stream_to_text(http_res)
|
302
|
+
raise models.APIError(
|
303
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
304
|
+
http_res.status_code,
|
305
|
+
http_res_text,
|
306
|
+
http_res,
|
307
|
+
)
|
308
|
+
|
309
|
+
async def list_async(
|
310
|
+
self,
|
311
|
+
*,
|
312
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
313
|
+
server_url: Optional[str] = None,
|
314
|
+
timeout_ms: Optional[int] = None,
|
315
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
316
|
+
) -> List[models.NamespaceResponse]:
|
317
|
+
r"""List Namespaces
|
318
|
+
|
319
|
+
List all namespaces for a user
|
320
|
+
|
321
|
+
:param retries: Override the default retry configuration for this method
|
322
|
+
:param server_url: Override the default server URL for this method
|
323
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
324
|
+
:param http_headers: Additional headers to set or replace on requests.
|
325
|
+
"""
|
326
|
+
base_url = None
|
327
|
+
url_variables = None
|
328
|
+
if timeout_ms is None:
|
329
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
330
|
+
|
331
|
+
if server_url is not None:
|
332
|
+
base_url = server_url
|
333
|
+
req = self.build_request_async(
|
334
|
+
method="GET",
|
335
|
+
path="/namespaces",
|
336
|
+
base_url=base_url,
|
337
|
+
url_variables=url_variables,
|
338
|
+
request=None,
|
339
|
+
request_body_required=False,
|
340
|
+
request_has_path_params=False,
|
341
|
+
request_has_query_params=False,
|
342
|
+
user_agent_header="user-agent",
|
343
|
+
accept_header_value="application/json",
|
344
|
+
http_headers=http_headers,
|
345
|
+
timeout_ms=timeout_ms,
|
346
|
+
)
|
347
|
+
|
348
|
+
if retries == UNSET:
|
349
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
350
|
+
retries = self.sdk_configuration.retry_config
|
351
|
+
|
352
|
+
retry_config = None
|
353
|
+
if isinstance(retries, utils.RetryConfig):
|
354
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
355
|
+
|
356
|
+
http_res = await self.do_request_async(
|
357
|
+
hook_ctx=HookContext(
|
358
|
+
operation_id="list_namespaces_namespaces_get",
|
359
|
+
oauth2_scopes=[],
|
360
|
+
security_source=None,
|
361
|
+
),
|
362
|
+
request=req,
|
363
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
364
|
+
retry_config=retry_config,
|
365
|
+
)
|
366
|
+
|
367
|
+
data: Any = None
|
368
|
+
if utils.match_response(http_res, "200", "application/json"):
|
369
|
+
return utils.unmarshal_json(http_res.text, List[models.NamespaceResponse])
|
370
|
+
if utils.match_response(
|
371
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
372
|
+
):
|
373
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
374
|
+
raise models.ErrorResponse(data=data)
|
375
|
+
if utils.match_response(http_res, "422", "application/json"):
|
376
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
377
|
+
raise models.HTTPValidationError(data=data)
|
378
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
379
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
380
|
+
raise models.APIError(
|
381
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
382
|
+
)
|
383
|
+
|
384
|
+
content_type = http_res.headers.get("Content-Type")
|
385
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
386
|
+
raise models.APIError(
|
387
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
388
|
+
http_res.status_code,
|
389
|
+
http_res_text,
|
390
|
+
http_res,
|
391
|
+
)
|
392
|
+
|
393
|
+
def delete(
|
394
|
+
self,
|
395
|
+
*,
|
396
|
+
namespace: str,
|
397
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
398
|
+
server_url: Optional[str] = None,
|
399
|
+
timeout_ms: Optional[int] = None,
|
400
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
401
|
+
) -> Any:
|
402
|
+
r"""Delete Namespace
|
403
|
+
|
404
|
+
Deletes an existing namespace using either its name or ID
|
405
|
+
|
406
|
+
:param namespace: Either the namespace name or namespace ID
|
407
|
+
:param retries: Override the default retry configuration for this method
|
408
|
+
:param server_url: Override the default server URL for this method
|
409
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
410
|
+
:param http_headers: Additional headers to set or replace on requests.
|
411
|
+
"""
|
412
|
+
base_url = None
|
413
|
+
url_variables = None
|
414
|
+
if timeout_ms is None:
|
415
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
416
|
+
|
417
|
+
if server_url is not None:
|
418
|
+
base_url = server_url
|
419
|
+
|
420
|
+
request = models.DeleteNamespaceNamespacesNamespaceDeleteRequest(
|
421
|
+
namespace=namespace,
|
422
|
+
)
|
423
|
+
|
424
|
+
req = self.build_request(
|
425
|
+
method="DELETE",
|
426
|
+
path="/namespaces/{namespace}",
|
427
|
+
base_url=base_url,
|
428
|
+
url_variables=url_variables,
|
429
|
+
request=request,
|
430
|
+
request_body_required=False,
|
431
|
+
request_has_path_params=True,
|
432
|
+
request_has_query_params=False,
|
433
|
+
user_agent_header="user-agent",
|
434
|
+
accept_header_value="application/json",
|
435
|
+
http_headers=http_headers,
|
436
|
+
timeout_ms=timeout_ms,
|
437
|
+
)
|
438
|
+
|
439
|
+
if retries == UNSET:
|
440
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
441
|
+
retries = self.sdk_configuration.retry_config
|
442
|
+
|
443
|
+
retry_config = None
|
444
|
+
if isinstance(retries, utils.RetryConfig):
|
445
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
446
|
+
|
447
|
+
http_res = self.do_request(
|
448
|
+
hook_ctx=HookContext(
|
449
|
+
operation_id="delete_namespace_namespaces__namespace__delete",
|
450
|
+
oauth2_scopes=[],
|
451
|
+
security_source=None,
|
452
|
+
),
|
453
|
+
request=req,
|
454
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
455
|
+
retry_config=retry_config,
|
456
|
+
)
|
457
|
+
|
458
|
+
data: Any = None
|
459
|
+
if utils.match_response(http_res, "200", "application/json"):
|
460
|
+
return utils.unmarshal_json(http_res.text, Any)
|
461
|
+
if utils.match_response(
|
462
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
463
|
+
):
|
464
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
465
|
+
raise models.ErrorResponse(data=data)
|
466
|
+
if utils.match_response(http_res, "422", "application/json"):
|
467
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
468
|
+
raise models.HTTPValidationError(data=data)
|
469
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
470
|
+
http_res_text = utils.stream_to_text(http_res)
|
471
|
+
raise models.APIError(
|
472
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
473
|
+
)
|
474
|
+
|
475
|
+
content_type = http_res.headers.get("Content-Type")
|
476
|
+
http_res_text = utils.stream_to_text(http_res)
|
477
|
+
raise models.APIError(
|
478
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
479
|
+
http_res.status_code,
|
480
|
+
http_res_text,
|
481
|
+
http_res,
|
482
|
+
)
|
483
|
+
|
484
|
+
async def delete_async(
|
485
|
+
self,
|
486
|
+
*,
|
487
|
+
namespace: str,
|
488
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
489
|
+
server_url: Optional[str] = None,
|
490
|
+
timeout_ms: Optional[int] = None,
|
491
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
492
|
+
) -> Any:
|
493
|
+
r"""Delete Namespace
|
494
|
+
|
495
|
+
Deletes an existing namespace using either its name or ID
|
496
|
+
|
497
|
+
:param namespace: Either the namespace name or namespace ID
|
498
|
+
:param retries: Override the default retry configuration for this method
|
499
|
+
:param server_url: Override the default server URL for this method
|
500
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
501
|
+
:param http_headers: Additional headers to set or replace on requests.
|
502
|
+
"""
|
503
|
+
base_url = None
|
504
|
+
url_variables = None
|
505
|
+
if timeout_ms is None:
|
506
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
507
|
+
|
508
|
+
if server_url is not None:
|
509
|
+
base_url = server_url
|
510
|
+
|
511
|
+
request = models.DeleteNamespaceNamespacesNamespaceDeleteRequest(
|
512
|
+
namespace=namespace,
|
513
|
+
)
|
514
|
+
|
515
|
+
req = self.build_request_async(
|
516
|
+
method="DELETE",
|
517
|
+
path="/namespaces/{namespace}",
|
518
|
+
base_url=base_url,
|
519
|
+
url_variables=url_variables,
|
520
|
+
request=request,
|
521
|
+
request_body_required=False,
|
522
|
+
request_has_path_params=True,
|
523
|
+
request_has_query_params=False,
|
524
|
+
user_agent_header="user-agent",
|
525
|
+
accept_header_value="application/json",
|
526
|
+
http_headers=http_headers,
|
527
|
+
timeout_ms=timeout_ms,
|
528
|
+
)
|
529
|
+
|
530
|
+
if retries == UNSET:
|
531
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
532
|
+
retries = self.sdk_configuration.retry_config
|
533
|
+
|
534
|
+
retry_config = None
|
535
|
+
if isinstance(retries, utils.RetryConfig):
|
536
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
537
|
+
|
538
|
+
http_res = await self.do_request_async(
|
539
|
+
hook_ctx=HookContext(
|
540
|
+
operation_id="delete_namespace_namespaces__namespace__delete",
|
541
|
+
oauth2_scopes=[],
|
542
|
+
security_source=None,
|
543
|
+
),
|
544
|
+
request=req,
|
545
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
546
|
+
retry_config=retry_config,
|
547
|
+
)
|
548
|
+
|
549
|
+
data: Any = None
|
550
|
+
if utils.match_response(http_res, "200", "application/json"):
|
551
|
+
return utils.unmarshal_json(http_res.text, Any)
|
552
|
+
if utils.match_response(
|
553
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
554
|
+
):
|
555
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
556
|
+
raise models.ErrorResponse(data=data)
|
557
|
+
if utils.match_response(http_res, "422", "application/json"):
|
558
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
559
|
+
raise models.HTTPValidationError(data=data)
|
560
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
561
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
562
|
+
raise models.APIError(
|
563
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
564
|
+
)
|
565
|
+
|
566
|
+
content_type = http_res.headers.get("Content-Type")
|
567
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
568
|
+
raise models.APIError(
|
569
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
570
|
+
http_res.status_code,
|
571
|
+
http_res_text,
|
572
|
+
http_res,
|
573
|
+
)
|
574
|
+
|
575
|
+
def update(
|
576
|
+
self,
|
577
|
+
*,
|
578
|
+
namespace: str,
|
579
|
+
namespace_name: str,
|
580
|
+
payload_indexes: Union[
|
581
|
+
List[models.PayloadIndexConfig], List[models.PayloadIndexConfigTypedDict]
|
582
|
+
],
|
583
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
584
|
+
server_url: Optional[str] = None,
|
585
|
+
timeout_ms: Optional[int] = None,
|
586
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
587
|
+
) -> models.NamespaceResponse:
|
588
|
+
r"""Update Namespace
|
589
|
+
|
590
|
+
Updates an existing namespace's payload indexes, this is a full update
|
591
|
+
|
592
|
+
:param namespace: Either the namespace name or namespace ID
|
593
|
+
:param namespace_name: Name of the namespace to update
|
594
|
+
:param payload_indexes: Updated list of payload index configurations
|
595
|
+
:param retries: Override the default retry configuration for this method
|
596
|
+
:param server_url: Override the default server URL for this method
|
597
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
598
|
+
:param http_headers: Additional headers to set or replace on requests.
|
599
|
+
"""
|
600
|
+
base_url = None
|
601
|
+
url_variables = None
|
602
|
+
if timeout_ms is None:
|
603
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
604
|
+
|
605
|
+
if server_url is not None:
|
606
|
+
base_url = server_url
|
607
|
+
|
608
|
+
request = models.UpdateNamespaceNamespacesNamespacePutRequest(
|
609
|
+
namespace=namespace,
|
610
|
+
update_namespace_request=models.UpdateNamespaceRequest(
|
611
|
+
namespace_name=namespace_name,
|
612
|
+
payload_indexes=utils.get_pydantic_model(
|
613
|
+
payload_indexes, List[models.PayloadIndexConfig]
|
614
|
+
),
|
615
|
+
),
|
616
|
+
)
|
617
|
+
|
618
|
+
req = self.build_request(
|
619
|
+
method="PUT",
|
620
|
+
path="/namespaces/{namespace}",
|
621
|
+
base_url=base_url,
|
622
|
+
url_variables=url_variables,
|
623
|
+
request=request,
|
624
|
+
request_body_required=True,
|
625
|
+
request_has_path_params=True,
|
626
|
+
request_has_query_params=False,
|
627
|
+
user_agent_header="user-agent",
|
628
|
+
accept_header_value="application/json",
|
629
|
+
http_headers=http_headers,
|
630
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
631
|
+
request.update_namespace_request,
|
632
|
+
False,
|
633
|
+
False,
|
634
|
+
"json",
|
635
|
+
models.UpdateNamespaceRequest,
|
636
|
+
),
|
637
|
+
timeout_ms=timeout_ms,
|
638
|
+
)
|
639
|
+
|
640
|
+
if retries == UNSET:
|
641
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
642
|
+
retries = self.sdk_configuration.retry_config
|
643
|
+
|
644
|
+
retry_config = None
|
645
|
+
if isinstance(retries, utils.RetryConfig):
|
646
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
647
|
+
|
648
|
+
http_res = self.do_request(
|
649
|
+
hook_ctx=HookContext(
|
650
|
+
operation_id="update_namespace_namespaces__namespace__put",
|
651
|
+
oauth2_scopes=[],
|
652
|
+
security_source=None,
|
653
|
+
),
|
654
|
+
request=req,
|
655
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
656
|
+
retry_config=retry_config,
|
657
|
+
)
|
658
|
+
|
659
|
+
data: Any = None
|
660
|
+
if utils.match_response(http_res, "200", "application/json"):
|
661
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
662
|
+
if utils.match_response(
|
663
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
664
|
+
):
|
665
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
666
|
+
raise models.ErrorResponse(data=data)
|
667
|
+
if utils.match_response(http_res, "422", "application/json"):
|
668
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
669
|
+
raise models.HTTPValidationError(data=data)
|
670
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
671
|
+
http_res_text = utils.stream_to_text(http_res)
|
672
|
+
raise models.APIError(
|
673
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
674
|
+
)
|
675
|
+
|
676
|
+
content_type = http_res.headers.get("Content-Type")
|
677
|
+
http_res_text = utils.stream_to_text(http_res)
|
678
|
+
raise models.APIError(
|
679
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
680
|
+
http_res.status_code,
|
681
|
+
http_res_text,
|
682
|
+
http_res,
|
683
|
+
)
|
684
|
+
|
685
|
+
async def update_async(
|
686
|
+
self,
|
687
|
+
*,
|
688
|
+
namespace: str,
|
689
|
+
namespace_name: str,
|
690
|
+
payload_indexes: Union[
|
691
|
+
List[models.PayloadIndexConfig], List[models.PayloadIndexConfigTypedDict]
|
692
|
+
],
|
693
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
694
|
+
server_url: Optional[str] = None,
|
695
|
+
timeout_ms: Optional[int] = None,
|
696
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
697
|
+
) -> models.NamespaceResponse:
|
698
|
+
r"""Update Namespace
|
699
|
+
|
700
|
+
Updates an existing namespace's payload indexes, this is a full update
|
701
|
+
|
702
|
+
:param namespace: Either the namespace name or namespace ID
|
703
|
+
:param namespace_name: Name of the namespace to update
|
704
|
+
:param payload_indexes: Updated list of payload index configurations
|
705
|
+
:param retries: Override the default retry configuration for this method
|
706
|
+
:param server_url: Override the default server URL for this method
|
707
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
708
|
+
:param http_headers: Additional headers to set or replace on requests.
|
709
|
+
"""
|
710
|
+
base_url = None
|
711
|
+
url_variables = None
|
712
|
+
if timeout_ms is None:
|
713
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
714
|
+
|
715
|
+
if server_url is not None:
|
716
|
+
base_url = server_url
|
717
|
+
|
718
|
+
request = models.UpdateNamespaceNamespacesNamespacePutRequest(
|
719
|
+
namespace=namespace,
|
720
|
+
update_namespace_request=models.UpdateNamespaceRequest(
|
721
|
+
namespace_name=namespace_name,
|
722
|
+
payload_indexes=utils.get_pydantic_model(
|
723
|
+
payload_indexes, List[models.PayloadIndexConfig]
|
724
|
+
),
|
725
|
+
),
|
726
|
+
)
|
727
|
+
|
728
|
+
req = self.build_request_async(
|
729
|
+
method="PUT",
|
730
|
+
path="/namespaces/{namespace}",
|
731
|
+
base_url=base_url,
|
732
|
+
url_variables=url_variables,
|
733
|
+
request=request,
|
734
|
+
request_body_required=True,
|
735
|
+
request_has_path_params=True,
|
736
|
+
request_has_query_params=False,
|
737
|
+
user_agent_header="user-agent",
|
738
|
+
accept_header_value="application/json",
|
739
|
+
http_headers=http_headers,
|
740
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
741
|
+
request.update_namespace_request,
|
742
|
+
False,
|
743
|
+
False,
|
744
|
+
"json",
|
745
|
+
models.UpdateNamespaceRequest,
|
746
|
+
),
|
747
|
+
timeout_ms=timeout_ms,
|
748
|
+
)
|
749
|
+
|
750
|
+
if retries == UNSET:
|
751
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
752
|
+
retries = self.sdk_configuration.retry_config
|
753
|
+
|
754
|
+
retry_config = None
|
755
|
+
if isinstance(retries, utils.RetryConfig):
|
756
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
757
|
+
|
758
|
+
http_res = await self.do_request_async(
|
759
|
+
hook_ctx=HookContext(
|
760
|
+
operation_id="update_namespace_namespaces__namespace__put",
|
761
|
+
oauth2_scopes=[],
|
762
|
+
security_source=None,
|
763
|
+
),
|
764
|
+
request=req,
|
765
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
766
|
+
retry_config=retry_config,
|
767
|
+
)
|
768
|
+
|
769
|
+
data: Any = None
|
770
|
+
if utils.match_response(http_res, "200", "application/json"):
|
771
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
772
|
+
if utils.match_response(
|
773
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
774
|
+
):
|
775
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
776
|
+
raise models.ErrorResponse(data=data)
|
777
|
+
if utils.match_response(http_res, "422", "application/json"):
|
778
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
779
|
+
raise models.HTTPValidationError(data=data)
|
780
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
781
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
782
|
+
raise models.APIError(
|
783
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
784
|
+
)
|
785
|
+
|
786
|
+
content_type = http_res.headers.get("Content-Type")
|
787
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
788
|
+
raise models.APIError(
|
789
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
790
|
+
http_res.status_code,
|
791
|
+
http_res_text,
|
792
|
+
http_res,
|
793
|
+
)
|
794
|
+
|
795
|
+
def get(
|
796
|
+
self,
|
797
|
+
*,
|
798
|
+
namespace: str,
|
799
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
800
|
+
server_url: Optional[str] = None,
|
801
|
+
timeout_ms: Optional[int] = None,
|
802
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
803
|
+
) -> models.NamespaceResponse:
|
804
|
+
r"""Get Namespace
|
805
|
+
|
806
|
+
Retrieve details of a specific namespace using either its name or ID
|
807
|
+
|
808
|
+
:param namespace: Either the namespace name or namespace ID
|
809
|
+
:param retries: Override the default retry configuration for this method
|
810
|
+
:param server_url: Override the default server URL for this method
|
811
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
812
|
+
:param http_headers: Additional headers to set or replace on requests.
|
813
|
+
"""
|
814
|
+
base_url = None
|
815
|
+
url_variables = None
|
816
|
+
if timeout_ms is None:
|
817
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
818
|
+
|
819
|
+
if server_url is not None:
|
820
|
+
base_url = server_url
|
821
|
+
|
822
|
+
request = models.GetNamespaceNamespacesNamespaceGetRequest(
|
823
|
+
namespace=namespace,
|
824
|
+
)
|
825
|
+
|
826
|
+
req = self.build_request(
|
827
|
+
method="GET",
|
828
|
+
path="/namespaces/{namespace}",
|
829
|
+
base_url=base_url,
|
830
|
+
url_variables=url_variables,
|
831
|
+
request=request,
|
832
|
+
request_body_required=False,
|
833
|
+
request_has_path_params=True,
|
834
|
+
request_has_query_params=False,
|
835
|
+
user_agent_header="user-agent",
|
836
|
+
accept_header_value="application/json",
|
837
|
+
http_headers=http_headers,
|
838
|
+
timeout_ms=timeout_ms,
|
839
|
+
)
|
840
|
+
|
841
|
+
if retries == UNSET:
|
842
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
843
|
+
retries = self.sdk_configuration.retry_config
|
844
|
+
|
845
|
+
retry_config = None
|
846
|
+
if isinstance(retries, utils.RetryConfig):
|
847
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
848
|
+
|
849
|
+
http_res = self.do_request(
|
850
|
+
hook_ctx=HookContext(
|
851
|
+
operation_id="get_namespace_namespaces__namespace__get",
|
852
|
+
oauth2_scopes=[],
|
853
|
+
security_source=None,
|
854
|
+
),
|
855
|
+
request=req,
|
856
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
857
|
+
retry_config=retry_config,
|
858
|
+
)
|
859
|
+
|
860
|
+
data: Any = None
|
861
|
+
if utils.match_response(http_res, "200", "application/json"):
|
862
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
863
|
+
if utils.match_response(
|
864
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
865
|
+
):
|
866
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
867
|
+
raise models.ErrorResponse(data=data)
|
868
|
+
if utils.match_response(http_res, "422", "application/json"):
|
869
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
870
|
+
raise models.HTTPValidationError(data=data)
|
871
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
872
|
+
http_res_text = utils.stream_to_text(http_res)
|
873
|
+
raise models.APIError(
|
874
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
875
|
+
)
|
876
|
+
|
877
|
+
content_type = http_res.headers.get("Content-Type")
|
878
|
+
http_res_text = utils.stream_to_text(http_res)
|
879
|
+
raise models.APIError(
|
880
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
881
|
+
http_res.status_code,
|
882
|
+
http_res_text,
|
883
|
+
http_res,
|
884
|
+
)
|
885
|
+
|
886
|
+
async def get_async(
|
887
|
+
self,
|
888
|
+
*,
|
889
|
+
namespace: str,
|
890
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
891
|
+
server_url: Optional[str] = None,
|
892
|
+
timeout_ms: Optional[int] = None,
|
893
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
894
|
+
) -> models.NamespaceResponse:
|
895
|
+
r"""Get Namespace
|
896
|
+
|
897
|
+
Retrieve details of a specific namespace using either its name or ID
|
898
|
+
|
899
|
+
:param namespace: Either the namespace name or namespace ID
|
900
|
+
:param retries: Override the default retry configuration for this method
|
901
|
+
:param server_url: Override the default server URL for this method
|
902
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
903
|
+
:param http_headers: Additional headers to set or replace on requests.
|
904
|
+
"""
|
905
|
+
base_url = None
|
906
|
+
url_variables = None
|
907
|
+
if timeout_ms is None:
|
908
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
909
|
+
|
910
|
+
if server_url is not None:
|
911
|
+
base_url = server_url
|
912
|
+
|
913
|
+
request = models.GetNamespaceNamespacesNamespaceGetRequest(
|
914
|
+
namespace=namespace,
|
915
|
+
)
|
916
|
+
|
917
|
+
req = self.build_request_async(
|
918
|
+
method="GET",
|
919
|
+
path="/namespaces/{namespace}",
|
920
|
+
base_url=base_url,
|
921
|
+
url_variables=url_variables,
|
922
|
+
request=request,
|
923
|
+
request_body_required=False,
|
924
|
+
request_has_path_params=True,
|
925
|
+
request_has_query_params=False,
|
926
|
+
user_agent_header="user-agent",
|
927
|
+
accept_header_value="application/json",
|
928
|
+
http_headers=http_headers,
|
929
|
+
timeout_ms=timeout_ms,
|
930
|
+
)
|
931
|
+
|
932
|
+
if retries == UNSET:
|
933
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
934
|
+
retries = self.sdk_configuration.retry_config
|
935
|
+
|
936
|
+
retry_config = None
|
937
|
+
if isinstance(retries, utils.RetryConfig):
|
938
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
939
|
+
|
940
|
+
http_res = await self.do_request_async(
|
941
|
+
hook_ctx=HookContext(
|
942
|
+
operation_id="get_namespace_namespaces__namespace__get",
|
943
|
+
oauth2_scopes=[],
|
944
|
+
security_source=None,
|
945
|
+
),
|
946
|
+
request=req,
|
947
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
948
|
+
retry_config=retry_config,
|
949
|
+
)
|
950
|
+
|
951
|
+
data: Any = None
|
952
|
+
if utils.match_response(http_res, "200", "application/json"):
|
953
|
+
return utils.unmarshal_json(http_res.text, models.NamespaceResponse)
|
954
|
+
if utils.match_response(
|
955
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
956
|
+
):
|
957
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
958
|
+
raise models.ErrorResponse(data=data)
|
959
|
+
if utils.match_response(http_res, "422", "application/json"):
|
960
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
961
|
+
raise models.HTTPValidationError(data=data)
|
962
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
963
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
964
|
+
raise models.APIError(
|
965
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
966
|
+
)
|
967
|
+
|
968
|
+
content_type = http_res.headers.get("Content-Type")
|
969
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
970
|
+
raise models.APIError(
|
971
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
972
|
+
http_res.status_code,
|
973
|
+
http_res_text,
|
974
|
+
http_res,
|
975
|
+
)
|
976
|
+
|
977
|
+
def list_indexes(
|
978
|
+
self,
|
979
|
+
*,
|
980
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
981
|
+
server_url: Optional[str] = None,
|
982
|
+
timeout_ms: Optional[int] = None,
|
983
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
984
|
+
) -> models.AvailableIndexesResponse:
|
985
|
+
r"""List Available Indexes
|
986
|
+
|
987
|
+
Returns all available indexes and their configurations
|
988
|
+
|
989
|
+
:param retries: Override the default retry configuration for this method
|
990
|
+
:param server_url: Override the default server URL for this method
|
991
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
992
|
+
:param http_headers: Additional headers to set or replace on requests.
|
993
|
+
"""
|
994
|
+
base_url = None
|
995
|
+
url_variables = None
|
996
|
+
if timeout_ms is None:
|
997
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
998
|
+
|
999
|
+
if server_url is not None:
|
1000
|
+
base_url = server_url
|
1001
|
+
req = self.build_request(
|
1002
|
+
method="GET",
|
1003
|
+
path="/namespaces/indexes",
|
1004
|
+
base_url=base_url,
|
1005
|
+
url_variables=url_variables,
|
1006
|
+
request=None,
|
1007
|
+
request_body_required=False,
|
1008
|
+
request_has_path_params=False,
|
1009
|
+
request_has_query_params=False,
|
1010
|
+
user_agent_header="user-agent",
|
1011
|
+
accept_header_value="application/json",
|
1012
|
+
http_headers=http_headers,
|
1013
|
+
timeout_ms=timeout_ms,
|
1014
|
+
)
|
1015
|
+
|
1016
|
+
if retries == UNSET:
|
1017
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1018
|
+
retries = self.sdk_configuration.retry_config
|
1019
|
+
|
1020
|
+
retry_config = None
|
1021
|
+
if isinstance(retries, utils.RetryConfig):
|
1022
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1023
|
+
|
1024
|
+
http_res = self.do_request(
|
1025
|
+
hook_ctx=HookContext(
|
1026
|
+
operation_id="list_available_indexes_namespaces_indexes_get",
|
1027
|
+
oauth2_scopes=[],
|
1028
|
+
security_source=None,
|
1029
|
+
),
|
1030
|
+
request=req,
|
1031
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1032
|
+
retry_config=retry_config,
|
1033
|
+
)
|
1034
|
+
|
1035
|
+
data: Any = None
|
1036
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1037
|
+
return utils.unmarshal_json(http_res.text, models.AvailableIndexesResponse)
|
1038
|
+
if utils.match_response(
|
1039
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
1040
|
+
):
|
1041
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1042
|
+
raise models.ErrorResponse(data=data)
|
1043
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1044
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1045
|
+
raise models.HTTPValidationError(data=data)
|
1046
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
1047
|
+
http_res_text = utils.stream_to_text(http_res)
|
1048
|
+
raise models.APIError(
|
1049
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1050
|
+
)
|
1051
|
+
|
1052
|
+
content_type = http_res.headers.get("Content-Type")
|
1053
|
+
http_res_text = utils.stream_to_text(http_res)
|
1054
|
+
raise models.APIError(
|
1055
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1056
|
+
http_res.status_code,
|
1057
|
+
http_res_text,
|
1058
|
+
http_res,
|
1059
|
+
)
|
1060
|
+
|
1061
|
+
async def list_indexes_async(
|
1062
|
+
self,
|
1063
|
+
*,
|
1064
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1065
|
+
server_url: Optional[str] = None,
|
1066
|
+
timeout_ms: Optional[int] = None,
|
1067
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1068
|
+
) -> models.AvailableIndexesResponse:
|
1069
|
+
r"""List Available Indexes
|
1070
|
+
|
1071
|
+
Returns all available indexes and their configurations
|
1072
|
+
|
1073
|
+
:param retries: Override the default retry configuration for this method
|
1074
|
+
:param server_url: Override the default server URL for this method
|
1075
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1076
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1077
|
+
"""
|
1078
|
+
base_url = None
|
1079
|
+
url_variables = None
|
1080
|
+
if timeout_ms is None:
|
1081
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1082
|
+
|
1083
|
+
if server_url is not None:
|
1084
|
+
base_url = server_url
|
1085
|
+
req = self.build_request_async(
|
1086
|
+
method="GET",
|
1087
|
+
path="/namespaces/indexes",
|
1088
|
+
base_url=base_url,
|
1089
|
+
url_variables=url_variables,
|
1090
|
+
request=None,
|
1091
|
+
request_body_required=False,
|
1092
|
+
request_has_path_params=False,
|
1093
|
+
request_has_query_params=False,
|
1094
|
+
user_agent_header="user-agent",
|
1095
|
+
accept_header_value="application/json",
|
1096
|
+
http_headers=http_headers,
|
1097
|
+
timeout_ms=timeout_ms,
|
1098
|
+
)
|
1099
|
+
|
1100
|
+
if retries == UNSET:
|
1101
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1102
|
+
retries = self.sdk_configuration.retry_config
|
1103
|
+
|
1104
|
+
retry_config = None
|
1105
|
+
if isinstance(retries, utils.RetryConfig):
|
1106
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1107
|
+
|
1108
|
+
http_res = await self.do_request_async(
|
1109
|
+
hook_ctx=HookContext(
|
1110
|
+
operation_id="list_available_indexes_namespaces_indexes_get",
|
1111
|
+
oauth2_scopes=[],
|
1112
|
+
security_source=None,
|
1113
|
+
),
|
1114
|
+
request=req,
|
1115
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1116
|
+
retry_config=retry_config,
|
1117
|
+
)
|
1118
|
+
|
1119
|
+
data: Any = None
|
1120
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1121
|
+
return utils.unmarshal_json(http_res.text, models.AvailableIndexesResponse)
|
1122
|
+
if utils.match_response(
|
1123
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
1124
|
+
):
|
1125
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1126
|
+
raise models.ErrorResponse(data=data)
|
1127
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1128
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1129
|
+
raise models.HTTPValidationError(data=data)
|
1130
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
1131
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1132
|
+
raise models.APIError(
|
1133
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1134
|
+
)
|
1135
|
+
|
1136
|
+
content_type = http_res.headers.get("Content-Type")
|
1137
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1138
|
+
raise models.APIError(
|
1139
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1140
|
+
http_res.status_code,
|
1141
|
+
http_res_text,
|
1142
|
+
http_res,
|
1143
|
+
)
|