stackit-modelserving 0.0.1a0__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.
- stackit/modelserving/__init__.py +55 -0
- stackit/modelserving/api/__init__.py +4 -0
- stackit/modelserving/api/default_api.py +2137 -0
- stackit/modelserving/api_client.py +627 -0
- stackit/modelserving/api_response.py +23 -0
- stackit/modelserving/configuration.py +138 -0
- stackit/modelserving/exceptions.py +199 -0
- stackit/modelserving/models/__init__.py +36 -0
- stackit/modelserving/models/chat_model_details.py +189 -0
- stackit/modelserving/models/create_token_payload.py +108 -0
- stackit/modelserving/models/create_token_response.py +93 -0
- stackit/modelserving/models/embedding_model_details.py +160 -0
- stackit/modelserving/models/error_message_response.py +83 -0
- stackit/modelserving/models/get_chat_model_response.py +93 -0
- stackit/modelserving/models/get_embeddings_model_resp.py +93 -0
- stackit/modelserving/models/get_token_response.py +93 -0
- stackit/modelserving/models/list_models_response.py +99 -0
- stackit/modelserving/models/list_token_resp.py +99 -0
- stackit/modelserving/models/message_response.py +82 -0
- stackit/modelserving/models/model.py +153 -0
- stackit/modelserving/models/partial_update_token_payload.py +104 -0
- stackit/modelserving/models/sku.py +84 -0
- stackit/modelserving/models/token.py +122 -0
- stackit/modelserving/models/token_created.py +131 -0
- stackit/modelserving/models/update_token_response.py +93 -0
- stackit/modelserving/py.typed +0 -0
- stackit/modelserving/rest.py +149 -0
- stackit_modelserving-0.0.1a0.dist-info/METADATA +45 -0
- stackit_modelserving-0.0.1a0.dist-info/RECORD +30 -0
- stackit_modelserving-0.0.1a0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2137 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Model Serving API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the model serving api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: model-serving@mail.schwarz
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501 docstring might be too long
|
|
14
|
+
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
|
|
18
|
+
from stackit.core.configuration import Configuration
|
|
19
|
+
from typing_extensions import Annotated
|
|
20
|
+
|
|
21
|
+
from stackit.modelserving.api_client import ApiClient, RequestSerialized
|
|
22
|
+
from stackit.modelserving.api_response import ApiResponse
|
|
23
|
+
from stackit.modelserving.models.create_token_payload import CreateTokenPayload
|
|
24
|
+
from stackit.modelserving.models.create_token_response import CreateTokenResponse
|
|
25
|
+
from stackit.modelserving.models.get_chat_model_response import GetChatModelResponse
|
|
26
|
+
from stackit.modelserving.models.get_embeddings_model_resp import GetEmbeddingsModelResp
|
|
27
|
+
from stackit.modelserving.models.get_token_response import GetTokenResponse
|
|
28
|
+
from stackit.modelserving.models.list_models_response import ListModelsResponse
|
|
29
|
+
from stackit.modelserving.models.list_token_resp import ListTokenResp
|
|
30
|
+
from stackit.modelserving.models.message_response import MessageResponse
|
|
31
|
+
from stackit.modelserving.models.partial_update_token_payload import (
|
|
32
|
+
PartialUpdateTokenPayload,
|
|
33
|
+
)
|
|
34
|
+
from stackit.modelserving.models.update_token_response import UpdateTokenResponse
|
|
35
|
+
from stackit.modelserving.rest import RESTResponseType
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class DefaultApi:
|
|
39
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
40
|
+
Ref: https://openapi-generator.tech
|
|
41
|
+
|
|
42
|
+
Do not edit the class manually.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(self, configuration: Configuration = None) -> None:
|
|
46
|
+
if configuration is None:
|
|
47
|
+
configuration = Configuration()
|
|
48
|
+
self.configuration = configuration
|
|
49
|
+
self.api_client = ApiClient(self.configuration)
|
|
50
|
+
|
|
51
|
+
@validate_call
|
|
52
|
+
def create_token(
|
|
53
|
+
self,
|
|
54
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
55
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
56
|
+
create_token_payload: Optional[CreateTokenPayload] = None,
|
|
57
|
+
_request_timeout: Union[
|
|
58
|
+
None,
|
|
59
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
60
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
61
|
+
] = None,
|
|
62
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
63
|
+
_content_type: Optional[StrictStr] = None,
|
|
64
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
65
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
66
|
+
) -> CreateTokenResponse:
|
|
67
|
+
"""create auth token for shared model use
|
|
68
|
+
|
|
69
|
+
create auth token for shared model use
|
|
70
|
+
|
|
71
|
+
:param region_id: region name (required)
|
|
72
|
+
:type region_id: str
|
|
73
|
+
:param project_id: portal project id (required)
|
|
74
|
+
:type project_id: str
|
|
75
|
+
:param create_token_payload:
|
|
76
|
+
:type create_token_payload: CreateTokenPayload
|
|
77
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
78
|
+
number provided, it will be total request
|
|
79
|
+
timeout. It can also be a pair (tuple) of
|
|
80
|
+
(connection, read) timeouts.
|
|
81
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
82
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
83
|
+
request; this effectively ignores the
|
|
84
|
+
authentication in the spec for a single request.
|
|
85
|
+
:type _request_auth: dict, optional
|
|
86
|
+
:param _content_type: force content-type for the request.
|
|
87
|
+
:type _content_type: str, Optional
|
|
88
|
+
:param _headers: set to override the headers for a single
|
|
89
|
+
request; this effectively ignores the headers
|
|
90
|
+
in the spec for a single request.
|
|
91
|
+
:type _headers: dict, optional
|
|
92
|
+
:param _host_index: set to override the host_index for a single
|
|
93
|
+
request; this effectively ignores the host_index
|
|
94
|
+
in the spec for a single request.
|
|
95
|
+
:type _host_index: int, optional
|
|
96
|
+
:return: Returns the result object.
|
|
97
|
+
""" # noqa: E501 docstring might be too long
|
|
98
|
+
|
|
99
|
+
_param = self._create_token_serialize(
|
|
100
|
+
region_id=region_id,
|
|
101
|
+
project_id=project_id,
|
|
102
|
+
create_token_payload=create_token_payload,
|
|
103
|
+
_request_auth=_request_auth,
|
|
104
|
+
_content_type=_content_type,
|
|
105
|
+
_headers=_headers,
|
|
106
|
+
_host_index=_host_index,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
110
|
+
"202": "CreateTokenResponse",
|
|
111
|
+
"400": "ErrorMessageResponse",
|
|
112
|
+
"401": "ErrorMessageResponse",
|
|
113
|
+
"409": "ErrorMessageResponse",
|
|
114
|
+
"500": "ErrorMessageResponse",
|
|
115
|
+
}
|
|
116
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
117
|
+
response_data.read()
|
|
118
|
+
return self.api_client.response_deserialize(
|
|
119
|
+
response_data=response_data,
|
|
120
|
+
response_types_map=_response_types_map,
|
|
121
|
+
).data
|
|
122
|
+
|
|
123
|
+
@validate_call
|
|
124
|
+
def create_token_with_http_info(
|
|
125
|
+
self,
|
|
126
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
127
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
128
|
+
create_token_payload: Optional[CreateTokenPayload] = None,
|
|
129
|
+
_request_timeout: Union[
|
|
130
|
+
None,
|
|
131
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
132
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
133
|
+
] = None,
|
|
134
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
135
|
+
_content_type: Optional[StrictStr] = None,
|
|
136
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
137
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
138
|
+
) -> ApiResponse[CreateTokenResponse]:
|
|
139
|
+
"""create auth token for shared model use
|
|
140
|
+
|
|
141
|
+
create auth token for shared model use
|
|
142
|
+
|
|
143
|
+
:param region_id: region name (required)
|
|
144
|
+
:type region_id: str
|
|
145
|
+
:param project_id: portal project id (required)
|
|
146
|
+
:type project_id: str
|
|
147
|
+
:param create_token_payload:
|
|
148
|
+
:type create_token_payload: CreateTokenPayload
|
|
149
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
150
|
+
number provided, it will be total request
|
|
151
|
+
timeout. It can also be a pair (tuple) of
|
|
152
|
+
(connection, read) timeouts.
|
|
153
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
154
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
155
|
+
request; this effectively ignores the
|
|
156
|
+
authentication in the spec for a single request.
|
|
157
|
+
:type _request_auth: dict, optional
|
|
158
|
+
:param _content_type: force content-type for the request.
|
|
159
|
+
:type _content_type: str, Optional
|
|
160
|
+
:param _headers: set to override the headers for a single
|
|
161
|
+
request; this effectively ignores the headers
|
|
162
|
+
in the spec for a single request.
|
|
163
|
+
:type _headers: dict, optional
|
|
164
|
+
:param _host_index: set to override the host_index for a single
|
|
165
|
+
request; this effectively ignores the host_index
|
|
166
|
+
in the spec for a single request.
|
|
167
|
+
:type _host_index: int, optional
|
|
168
|
+
:return: Returns the result object.
|
|
169
|
+
""" # noqa: E501 docstring might be too long
|
|
170
|
+
|
|
171
|
+
_param = self._create_token_serialize(
|
|
172
|
+
region_id=region_id,
|
|
173
|
+
project_id=project_id,
|
|
174
|
+
create_token_payload=create_token_payload,
|
|
175
|
+
_request_auth=_request_auth,
|
|
176
|
+
_content_type=_content_type,
|
|
177
|
+
_headers=_headers,
|
|
178
|
+
_host_index=_host_index,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
182
|
+
"202": "CreateTokenResponse",
|
|
183
|
+
"400": "ErrorMessageResponse",
|
|
184
|
+
"401": "ErrorMessageResponse",
|
|
185
|
+
"409": "ErrorMessageResponse",
|
|
186
|
+
"500": "ErrorMessageResponse",
|
|
187
|
+
}
|
|
188
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
189
|
+
response_data.read()
|
|
190
|
+
return self.api_client.response_deserialize(
|
|
191
|
+
response_data=response_data,
|
|
192
|
+
response_types_map=_response_types_map,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
@validate_call
|
|
196
|
+
def create_token_without_preload_content(
|
|
197
|
+
self,
|
|
198
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
199
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
200
|
+
create_token_payload: Optional[CreateTokenPayload] = None,
|
|
201
|
+
_request_timeout: Union[
|
|
202
|
+
None,
|
|
203
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
204
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
205
|
+
] = None,
|
|
206
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
207
|
+
_content_type: Optional[StrictStr] = None,
|
|
208
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
209
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
210
|
+
) -> RESTResponseType:
|
|
211
|
+
"""create auth token for shared model use
|
|
212
|
+
|
|
213
|
+
create auth token for shared model use
|
|
214
|
+
|
|
215
|
+
:param region_id: region name (required)
|
|
216
|
+
:type region_id: str
|
|
217
|
+
:param project_id: portal project id (required)
|
|
218
|
+
:type project_id: str
|
|
219
|
+
:param create_token_payload:
|
|
220
|
+
:type create_token_payload: CreateTokenPayload
|
|
221
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
222
|
+
number provided, it will be total request
|
|
223
|
+
timeout. It can also be a pair (tuple) of
|
|
224
|
+
(connection, read) timeouts.
|
|
225
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
226
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
227
|
+
request; this effectively ignores the
|
|
228
|
+
authentication in the spec for a single request.
|
|
229
|
+
:type _request_auth: dict, optional
|
|
230
|
+
:param _content_type: force content-type for the request.
|
|
231
|
+
:type _content_type: str, Optional
|
|
232
|
+
:param _headers: set to override the headers for a single
|
|
233
|
+
request; this effectively ignores the headers
|
|
234
|
+
in the spec for a single request.
|
|
235
|
+
:type _headers: dict, optional
|
|
236
|
+
:param _host_index: set to override the host_index for a single
|
|
237
|
+
request; this effectively ignores the host_index
|
|
238
|
+
in the spec for a single request.
|
|
239
|
+
:type _host_index: int, optional
|
|
240
|
+
:return: Returns the result object.
|
|
241
|
+
""" # noqa: E501 docstring might be too long
|
|
242
|
+
|
|
243
|
+
_param = self._create_token_serialize(
|
|
244
|
+
region_id=region_id,
|
|
245
|
+
project_id=project_id,
|
|
246
|
+
create_token_payload=create_token_payload,
|
|
247
|
+
_request_auth=_request_auth,
|
|
248
|
+
_content_type=_content_type,
|
|
249
|
+
_headers=_headers,
|
|
250
|
+
_host_index=_host_index,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
254
|
+
"202": "CreateTokenResponse",
|
|
255
|
+
"400": "ErrorMessageResponse",
|
|
256
|
+
"401": "ErrorMessageResponse",
|
|
257
|
+
"409": "ErrorMessageResponse",
|
|
258
|
+
"500": "ErrorMessageResponse",
|
|
259
|
+
}
|
|
260
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
261
|
+
return response_data.response
|
|
262
|
+
|
|
263
|
+
def _create_token_serialize(
|
|
264
|
+
self,
|
|
265
|
+
region_id,
|
|
266
|
+
project_id,
|
|
267
|
+
create_token_payload,
|
|
268
|
+
_request_auth,
|
|
269
|
+
_content_type,
|
|
270
|
+
_headers,
|
|
271
|
+
_host_index,
|
|
272
|
+
) -> RequestSerialized:
|
|
273
|
+
|
|
274
|
+
_host = None
|
|
275
|
+
|
|
276
|
+
_collection_formats: Dict[str, str] = {}
|
|
277
|
+
|
|
278
|
+
_path_params: Dict[str, str] = {}
|
|
279
|
+
_query_params: List[Tuple[str, str]] = []
|
|
280
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
281
|
+
_form_params: List[Tuple[str, str]] = []
|
|
282
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
283
|
+
_body_params: Optional[bytes] = None
|
|
284
|
+
|
|
285
|
+
# process the path parameters
|
|
286
|
+
if region_id is not None:
|
|
287
|
+
_path_params["regionId"] = region_id
|
|
288
|
+
if project_id is not None:
|
|
289
|
+
_path_params["projectId"] = project_id
|
|
290
|
+
# process the query parameters
|
|
291
|
+
# process the header parameters
|
|
292
|
+
# process the form parameters
|
|
293
|
+
# process the body parameter
|
|
294
|
+
if create_token_payload is not None:
|
|
295
|
+
_body_params = create_token_payload
|
|
296
|
+
|
|
297
|
+
# set the HTTP header `Accept`
|
|
298
|
+
if "Accept" not in _header_params:
|
|
299
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
300
|
+
|
|
301
|
+
# set the HTTP header `Content-Type`
|
|
302
|
+
if _content_type:
|
|
303
|
+
_header_params["Content-Type"] = _content_type
|
|
304
|
+
else:
|
|
305
|
+
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
|
306
|
+
if _default_content_type is not None:
|
|
307
|
+
_header_params["Content-Type"] = _default_content_type
|
|
308
|
+
|
|
309
|
+
# authentication setting
|
|
310
|
+
_auth_settings: List[str] = []
|
|
311
|
+
|
|
312
|
+
return self.api_client.param_serialize(
|
|
313
|
+
method="POST",
|
|
314
|
+
resource_path="/v1/projects/{projectId}/regions/{regionId}/tokens",
|
|
315
|
+
path_params=_path_params,
|
|
316
|
+
query_params=_query_params,
|
|
317
|
+
header_params=_header_params,
|
|
318
|
+
body=_body_params,
|
|
319
|
+
post_params=_form_params,
|
|
320
|
+
files=_files,
|
|
321
|
+
auth_settings=_auth_settings,
|
|
322
|
+
collection_formats=_collection_formats,
|
|
323
|
+
_host=_host,
|
|
324
|
+
_request_auth=_request_auth,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
@validate_call
|
|
328
|
+
def delete_token(
|
|
329
|
+
self,
|
|
330
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
331
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
332
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
333
|
+
_request_timeout: Union[
|
|
334
|
+
None,
|
|
335
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
336
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
337
|
+
] = None,
|
|
338
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
339
|
+
_content_type: Optional[StrictStr] = None,
|
|
340
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
341
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
342
|
+
) -> MessageResponse:
|
|
343
|
+
"""delete auth token in shared model use
|
|
344
|
+
|
|
345
|
+
delete auth token in shared model use
|
|
346
|
+
|
|
347
|
+
:param region_id: region name (required)
|
|
348
|
+
:type region_id: str
|
|
349
|
+
:param project_id: portal project id (required)
|
|
350
|
+
:type project_id: str
|
|
351
|
+
:param t_id: token id (required)
|
|
352
|
+
:type t_id: str
|
|
353
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
354
|
+
number provided, it will be total request
|
|
355
|
+
timeout. It can also be a pair (tuple) of
|
|
356
|
+
(connection, read) timeouts.
|
|
357
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
358
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
359
|
+
request; this effectively ignores the
|
|
360
|
+
authentication in the spec for a single request.
|
|
361
|
+
:type _request_auth: dict, optional
|
|
362
|
+
:param _content_type: force content-type for the request.
|
|
363
|
+
:type _content_type: str, Optional
|
|
364
|
+
:param _headers: set to override the headers for a single
|
|
365
|
+
request; this effectively ignores the headers
|
|
366
|
+
in the spec for a single request.
|
|
367
|
+
:type _headers: dict, optional
|
|
368
|
+
:param _host_index: set to override the host_index for a single
|
|
369
|
+
request; this effectively ignores the host_index
|
|
370
|
+
in the spec for a single request.
|
|
371
|
+
:type _host_index: int, optional
|
|
372
|
+
:return: Returns the result object.
|
|
373
|
+
""" # noqa: E501 docstring might be too long
|
|
374
|
+
|
|
375
|
+
_param = self._delete_token_serialize(
|
|
376
|
+
region_id=region_id,
|
|
377
|
+
project_id=project_id,
|
|
378
|
+
t_id=t_id,
|
|
379
|
+
_request_auth=_request_auth,
|
|
380
|
+
_content_type=_content_type,
|
|
381
|
+
_headers=_headers,
|
|
382
|
+
_host_index=_host_index,
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
386
|
+
"202": "MessageResponse",
|
|
387
|
+
"400": "ErrorMessageResponse",
|
|
388
|
+
"401": "ErrorMessageResponse",
|
|
389
|
+
"404": "ErrorMessageResponse",
|
|
390
|
+
"500": "ErrorMessageResponse",
|
|
391
|
+
}
|
|
392
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
393
|
+
response_data.read()
|
|
394
|
+
return self.api_client.response_deserialize(
|
|
395
|
+
response_data=response_data,
|
|
396
|
+
response_types_map=_response_types_map,
|
|
397
|
+
).data
|
|
398
|
+
|
|
399
|
+
@validate_call
|
|
400
|
+
def delete_token_with_http_info(
|
|
401
|
+
self,
|
|
402
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
403
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
404
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
405
|
+
_request_timeout: Union[
|
|
406
|
+
None,
|
|
407
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
408
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
409
|
+
] = None,
|
|
410
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
411
|
+
_content_type: Optional[StrictStr] = None,
|
|
412
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
413
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
414
|
+
) -> ApiResponse[MessageResponse]:
|
|
415
|
+
"""delete auth token in shared model use
|
|
416
|
+
|
|
417
|
+
delete auth token in shared model use
|
|
418
|
+
|
|
419
|
+
:param region_id: region name (required)
|
|
420
|
+
:type region_id: str
|
|
421
|
+
:param project_id: portal project id (required)
|
|
422
|
+
:type project_id: str
|
|
423
|
+
:param t_id: token id (required)
|
|
424
|
+
:type t_id: str
|
|
425
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
426
|
+
number provided, it will be total request
|
|
427
|
+
timeout. It can also be a pair (tuple) of
|
|
428
|
+
(connection, read) timeouts.
|
|
429
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
430
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
431
|
+
request; this effectively ignores the
|
|
432
|
+
authentication in the spec for a single request.
|
|
433
|
+
:type _request_auth: dict, optional
|
|
434
|
+
:param _content_type: force content-type for the request.
|
|
435
|
+
:type _content_type: str, Optional
|
|
436
|
+
:param _headers: set to override the headers for a single
|
|
437
|
+
request; this effectively ignores the headers
|
|
438
|
+
in the spec for a single request.
|
|
439
|
+
:type _headers: dict, optional
|
|
440
|
+
:param _host_index: set to override the host_index for a single
|
|
441
|
+
request; this effectively ignores the host_index
|
|
442
|
+
in the spec for a single request.
|
|
443
|
+
:type _host_index: int, optional
|
|
444
|
+
:return: Returns the result object.
|
|
445
|
+
""" # noqa: E501 docstring might be too long
|
|
446
|
+
|
|
447
|
+
_param = self._delete_token_serialize(
|
|
448
|
+
region_id=region_id,
|
|
449
|
+
project_id=project_id,
|
|
450
|
+
t_id=t_id,
|
|
451
|
+
_request_auth=_request_auth,
|
|
452
|
+
_content_type=_content_type,
|
|
453
|
+
_headers=_headers,
|
|
454
|
+
_host_index=_host_index,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
458
|
+
"202": "MessageResponse",
|
|
459
|
+
"400": "ErrorMessageResponse",
|
|
460
|
+
"401": "ErrorMessageResponse",
|
|
461
|
+
"404": "ErrorMessageResponse",
|
|
462
|
+
"500": "ErrorMessageResponse",
|
|
463
|
+
}
|
|
464
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
465
|
+
response_data.read()
|
|
466
|
+
return self.api_client.response_deserialize(
|
|
467
|
+
response_data=response_data,
|
|
468
|
+
response_types_map=_response_types_map,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
@validate_call
|
|
472
|
+
def delete_token_without_preload_content(
|
|
473
|
+
self,
|
|
474
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
475
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
476
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
477
|
+
_request_timeout: Union[
|
|
478
|
+
None,
|
|
479
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
480
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
481
|
+
] = None,
|
|
482
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
483
|
+
_content_type: Optional[StrictStr] = None,
|
|
484
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
485
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
486
|
+
) -> RESTResponseType:
|
|
487
|
+
"""delete auth token in shared model use
|
|
488
|
+
|
|
489
|
+
delete auth token in shared model use
|
|
490
|
+
|
|
491
|
+
:param region_id: region name (required)
|
|
492
|
+
:type region_id: str
|
|
493
|
+
:param project_id: portal project id (required)
|
|
494
|
+
:type project_id: str
|
|
495
|
+
:param t_id: token id (required)
|
|
496
|
+
:type t_id: str
|
|
497
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
498
|
+
number provided, it will be total request
|
|
499
|
+
timeout. It can also be a pair (tuple) of
|
|
500
|
+
(connection, read) timeouts.
|
|
501
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
502
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
503
|
+
request; this effectively ignores the
|
|
504
|
+
authentication in the spec for a single request.
|
|
505
|
+
:type _request_auth: dict, optional
|
|
506
|
+
:param _content_type: force content-type for the request.
|
|
507
|
+
:type _content_type: str, Optional
|
|
508
|
+
:param _headers: set to override the headers for a single
|
|
509
|
+
request; this effectively ignores the headers
|
|
510
|
+
in the spec for a single request.
|
|
511
|
+
:type _headers: dict, optional
|
|
512
|
+
:param _host_index: set to override the host_index for a single
|
|
513
|
+
request; this effectively ignores the host_index
|
|
514
|
+
in the spec for a single request.
|
|
515
|
+
:type _host_index: int, optional
|
|
516
|
+
:return: Returns the result object.
|
|
517
|
+
""" # noqa: E501 docstring might be too long
|
|
518
|
+
|
|
519
|
+
_param = self._delete_token_serialize(
|
|
520
|
+
region_id=region_id,
|
|
521
|
+
project_id=project_id,
|
|
522
|
+
t_id=t_id,
|
|
523
|
+
_request_auth=_request_auth,
|
|
524
|
+
_content_type=_content_type,
|
|
525
|
+
_headers=_headers,
|
|
526
|
+
_host_index=_host_index,
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
530
|
+
"202": "MessageResponse",
|
|
531
|
+
"400": "ErrorMessageResponse",
|
|
532
|
+
"401": "ErrorMessageResponse",
|
|
533
|
+
"404": "ErrorMessageResponse",
|
|
534
|
+
"500": "ErrorMessageResponse",
|
|
535
|
+
}
|
|
536
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
537
|
+
return response_data.response
|
|
538
|
+
|
|
539
|
+
def _delete_token_serialize(
|
|
540
|
+
self,
|
|
541
|
+
region_id,
|
|
542
|
+
project_id,
|
|
543
|
+
t_id,
|
|
544
|
+
_request_auth,
|
|
545
|
+
_content_type,
|
|
546
|
+
_headers,
|
|
547
|
+
_host_index,
|
|
548
|
+
) -> RequestSerialized:
|
|
549
|
+
|
|
550
|
+
_host = None
|
|
551
|
+
|
|
552
|
+
_collection_formats: Dict[str, str] = {}
|
|
553
|
+
|
|
554
|
+
_path_params: Dict[str, str] = {}
|
|
555
|
+
_query_params: List[Tuple[str, str]] = []
|
|
556
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
557
|
+
_form_params: List[Tuple[str, str]] = []
|
|
558
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
559
|
+
_body_params: Optional[bytes] = None
|
|
560
|
+
|
|
561
|
+
# process the path parameters
|
|
562
|
+
if region_id is not None:
|
|
563
|
+
_path_params["regionId"] = region_id
|
|
564
|
+
if project_id is not None:
|
|
565
|
+
_path_params["projectId"] = project_id
|
|
566
|
+
if t_id is not None:
|
|
567
|
+
_path_params["tId"] = t_id
|
|
568
|
+
# process the query parameters
|
|
569
|
+
# process the header parameters
|
|
570
|
+
# process the form parameters
|
|
571
|
+
# process the body parameter
|
|
572
|
+
|
|
573
|
+
# set the HTTP header `Accept`
|
|
574
|
+
if "Accept" not in _header_params:
|
|
575
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
576
|
+
|
|
577
|
+
# authentication setting
|
|
578
|
+
_auth_settings: List[str] = []
|
|
579
|
+
|
|
580
|
+
return self.api_client.param_serialize(
|
|
581
|
+
method="DELETE",
|
|
582
|
+
resource_path="/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}",
|
|
583
|
+
path_params=_path_params,
|
|
584
|
+
query_params=_query_params,
|
|
585
|
+
header_params=_header_params,
|
|
586
|
+
body=_body_params,
|
|
587
|
+
post_params=_form_params,
|
|
588
|
+
files=_files,
|
|
589
|
+
auth_settings=_auth_settings,
|
|
590
|
+
collection_formats=_collection_formats,
|
|
591
|
+
_host=_host,
|
|
592
|
+
_request_auth=_request_auth,
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
@validate_call
|
|
596
|
+
def get_chat_model(
|
|
597
|
+
self,
|
|
598
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
599
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
600
|
+
_request_timeout: Union[
|
|
601
|
+
None,
|
|
602
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
603
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
604
|
+
] = None,
|
|
605
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
606
|
+
_content_type: Optional[StrictStr] = None,
|
|
607
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
608
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
609
|
+
) -> GetChatModelResponse:
|
|
610
|
+
"""details of a llm model
|
|
611
|
+
|
|
612
|
+
details of a llm model
|
|
613
|
+
|
|
614
|
+
:param region_id: region name (required)
|
|
615
|
+
:type region_id: str
|
|
616
|
+
:param model_id: model id (required)
|
|
617
|
+
:type model_id: str
|
|
618
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
619
|
+
number provided, it will be total request
|
|
620
|
+
timeout. It can also be a pair (tuple) of
|
|
621
|
+
(connection, read) timeouts.
|
|
622
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
623
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
624
|
+
request; this effectively ignores the
|
|
625
|
+
authentication in the spec for a single request.
|
|
626
|
+
:type _request_auth: dict, optional
|
|
627
|
+
:param _content_type: force content-type for the request.
|
|
628
|
+
:type _content_type: str, Optional
|
|
629
|
+
:param _headers: set to override the headers for a single
|
|
630
|
+
request; this effectively ignores the headers
|
|
631
|
+
in the spec for a single request.
|
|
632
|
+
:type _headers: dict, optional
|
|
633
|
+
:param _host_index: set to override the host_index for a single
|
|
634
|
+
request; this effectively ignores the host_index
|
|
635
|
+
in the spec for a single request.
|
|
636
|
+
:type _host_index: int, optional
|
|
637
|
+
:return: Returns the result object.
|
|
638
|
+
""" # noqa: E501 docstring might be too long
|
|
639
|
+
|
|
640
|
+
_param = self._get_chat_model_serialize(
|
|
641
|
+
region_id=region_id,
|
|
642
|
+
model_id=model_id,
|
|
643
|
+
_request_auth=_request_auth,
|
|
644
|
+
_content_type=_content_type,
|
|
645
|
+
_headers=_headers,
|
|
646
|
+
_host_index=_host_index,
|
|
647
|
+
)
|
|
648
|
+
|
|
649
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
650
|
+
"200": "GetChatModelResponse",
|
|
651
|
+
"400": "ErrorMessageResponse",
|
|
652
|
+
"401": "ErrorMessageResponse",
|
|
653
|
+
"500": "ErrorMessageResponse",
|
|
654
|
+
}
|
|
655
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
656
|
+
response_data.read()
|
|
657
|
+
return self.api_client.response_deserialize(
|
|
658
|
+
response_data=response_data,
|
|
659
|
+
response_types_map=_response_types_map,
|
|
660
|
+
).data
|
|
661
|
+
|
|
662
|
+
@validate_call
|
|
663
|
+
def get_chat_model_with_http_info(
|
|
664
|
+
self,
|
|
665
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
666
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
667
|
+
_request_timeout: Union[
|
|
668
|
+
None,
|
|
669
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
670
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
671
|
+
] = None,
|
|
672
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
673
|
+
_content_type: Optional[StrictStr] = None,
|
|
674
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
675
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
676
|
+
) -> ApiResponse[GetChatModelResponse]:
|
|
677
|
+
"""details of a llm model
|
|
678
|
+
|
|
679
|
+
details of a llm model
|
|
680
|
+
|
|
681
|
+
:param region_id: region name (required)
|
|
682
|
+
:type region_id: str
|
|
683
|
+
:param model_id: model id (required)
|
|
684
|
+
:type model_id: str
|
|
685
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
686
|
+
number provided, it will be total request
|
|
687
|
+
timeout. It can also be a pair (tuple) of
|
|
688
|
+
(connection, read) timeouts.
|
|
689
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
690
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
691
|
+
request; this effectively ignores the
|
|
692
|
+
authentication in the spec for a single request.
|
|
693
|
+
:type _request_auth: dict, optional
|
|
694
|
+
:param _content_type: force content-type for the request.
|
|
695
|
+
:type _content_type: str, Optional
|
|
696
|
+
:param _headers: set to override the headers for a single
|
|
697
|
+
request; this effectively ignores the headers
|
|
698
|
+
in the spec for a single request.
|
|
699
|
+
:type _headers: dict, optional
|
|
700
|
+
:param _host_index: set to override the host_index for a single
|
|
701
|
+
request; this effectively ignores the host_index
|
|
702
|
+
in the spec for a single request.
|
|
703
|
+
:type _host_index: int, optional
|
|
704
|
+
:return: Returns the result object.
|
|
705
|
+
""" # noqa: E501 docstring might be too long
|
|
706
|
+
|
|
707
|
+
_param = self._get_chat_model_serialize(
|
|
708
|
+
region_id=region_id,
|
|
709
|
+
model_id=model_id,
|
|
710
|
+
_request_auth=_request_auth,
|
|
711
|
+
_content_type=_content_type,
|
|
712
|
+
_headers=_headers,
|
|
713
|
+
_host_index=_host_index,
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
717
|
+
"200": "GetChatModelResponse",
|
|
718
|
+
"400": "ErrorMessageResponse",
|
|
719
|
+
"401": "ErrorMessageResponse",
|
|
720
|
+
"500": "ErrorMessageResponse",
|
|
721
|
+
}
|
|
722
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
723
|
+
response_data.read()
|
|
724
|
+
return self.api_client.response_deserialize(
|
|
725
|
+
response_data=response_data,
|
|
726
|
+
response_types_map=_response_types_map,
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
@validate_call
|
|
730
|
+
def get_chat_model_without_preload_content(
|
|
731
|
+
self,
|
|
732
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
733
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
734
|
+
_request_timeout: Union[
|
|
735
|
+
None,
|
|
736
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
737
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
738
|
+
] = None,
|
|
739
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
740
|
+
_content_type: Optional[StrictStr] = None,
|
|
741
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
742
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
743
|
+
) -> RESTResponseType:
|
|
744
|
+
"""details of a llm model
|
|
745
|
+
|
|
746
|
+
details of a llm model
|
|
747
|
+
|
|
748
|
+
:param region_id: region name (required)
|
|
749
|
+
:type region_id: str
|
|
750
|
+
:param model_id: model id (required)
|
|
751
|
+
:type model_id: str
|
|
752
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
753
|
+
number provided, it will be total request
|
|
754
|
+
timeout. It can also be a pair (tuple) of
|
|
755
|
+
(connection, read) timeouts.
|
|
756
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
757
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
758
|
+
request; this effectively ignores the
|
|
759
|
+
authentication in the spec for a single request.
|
|
760
|
+
:type _request_auth: dict, optional
|
|
761
|
+
:param _content_type: force content-type for the request.
|
|
762
|
+
:type _content_type: str, Optional
|
|
763
|
+
:param _headers: set to override the headers for a single
|
|
764
|
+
request; this effectively ignores the headers
|
|
765
|
+
in the spec for a single request.
|
|
766
|
+
:type _headers: dict, optional
|
|
767
|
+
:param _host_index: set to override the host_index for a single
|
|
768
|
+
request; this effectively ignores the host_index
|
|
769
|
+
in the spec for a single request.
|
|
770
|
+
:type _host_index: int, optional
|
|
771
|
+
:return: Returns the result object.
|
|
772
|
+
""" # noqa: E501 docstring might be too long
|
|
773
|
+
|
|
774
|
+
_param = self._get_chat_model_serialize(
|
|
775
|
+
region_id=region_id,
|
|
776
|
+
model_id=model_id,
|
|
777
|
+
_request_auth=_request_auth,
|
|
778
|
+
_content_type=_content_type,
|
|
779
|
+
_headers=_headers,
|
|
780
|
+
_host_index=_host_index,
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
784
|
+
"200": "GetChatModelResponse",
|
|
785
|
+
"400": "ErrorMessageResponse",
|
|
786
|
+
"401": "ErrorMessageResponse",
|
|
787
|
+
"500": "ErrorMessageResponse",
|
|
788
|
+
}
|
|
789
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
790
|
+
return response_data.response
|
|
791
|
+
|
|
792
|
+
def _get_chat_model_serialize(
|
|
793
|
+
self,
|
|
794
|
+
region_id,
|
|
795
|
+
model_id,
|
|
796
|
+
_request_auth,
|
|
797
|
+
_content_type,
|
|
798
|
+
_headers,
|
|
799
|
+
_host_index,
|
|
800
|
+
) -> RequestSerialized:
|
|
801
|
+
|
|
802
|
+
_host = None
|
|
803
|
+
|
|
804
|
+
_collection_formats: Dict[str, str] = {}
|
|
805
|
+
|
|
806
|
+
_path_params: Dict[str, str] = {}
|
|
807
|
+
_query_params: List[Tuple[str, str]] = []
|
|
808
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
809
|
+
_form_params: List[Tuple[str, str]] = []
|
|
810
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
811
|
+
_body_params: Optional[bytes] = None
|
|
812
|
+
|
|
813
|
+
# process the path parameters
|
|
814
|
+
if region_id is not None:
|
|
815
|
+
_path_params["regionId"] = region_id
|
|
816
|
+
if model_id is not None:
|
|
817
|
+
_path_params["modelId"] = model_id
|
|
818
|
+
# process the query parameters
|
|
819
|
+
# process the header parameters
|
|
820
|
+
# process the form parameters
|
|
821
|
+
# process the body parameter
|
|
822
|
+
|
|
823
|
+
# set the HTTP header `Accept`
|
|
824
|
+
if "Accept" not in _header_params:
|
|
825
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
826
|
+
|
|
827
|
+
# authentication setting
|
|
828
|
+
_auth_settings: List[str] = []
|
|
829
|
+
|
|
830
|
+
return self.api_client.param_serialize(
|
|
831
|
+
method="GET",
|
|
832
|
+
resource_path="/v1/regions/{regionId}/chat/models/{modelId}",
|
|
833
|
+
path_params=_path_params,
|
|
834
|
+
query_params=_query_params,
|
|
835
|
+
header_params=_header_params,
|
|
836
|
+
body=_body_params,
|
|
837
|
+
post_params=_form_params,
|
|
838
|
+
files=_files,
|
|
839
|
+
auth_settings=_auth_settings,
|
|
840
|
+
collection_formats=_collection_formats,
|
|
841
|
+
_host=_host,
|
|
842
|
+
_request_auth=_request_auth,
|
|
843
|
+
)
|
|
844
|
+
|
|
845
|
+
@validate_call
|
|
846
|
+
def get_embedding_model(
|
|
847
|
+
self,
|
|
848
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
849
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
850
|
+
_request_timeout: Union[
|
|
851
|
+
None,
|
|
852
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
853
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
854
|
+
] = None,
|
|
855
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
856
|
+
_content_type: Optional[StrictStr] = None,
|
|
857
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
858
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
859
|
+
) -> GetEmbeddingsModelResp:
|
|
860
|
+
"""details of an embedding model
|
|
861
|
+
|
|
862
|
+
details of an embedding model
|
|
863
|
+
|
|
864
|
+
:param region_id: region name (required)
|
|
865
|
+
:type region_id: str
|
|
866
|
+
:param model_id: model id (required)
|
|
867
|
+
:type model_id: str
|
|
868
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
869
|
+
number provided, it will be total request
|
|
870
|
+
timeout. It can also be a pair (tuple) of
|
|
871
|
+
(connection, read) timeouts.
|
|
872
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
873
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
874
|
+
request; this effectively ignores the
|
|
875
|
+
authentication in the spec for a single request.
|
|
876
|
+
:type _request_auth: dict, optional
|
|
877
|
+
:param _content_type: force content-type for the request.
|
|
878
|
+
:type _content_type: str, Optional
|
|
879
|
+
:param _headers: set to override the headers for a single
|
|
880
|
+
request; this effectively ignores the headers
|
|
881
|
+
in the spec for a single request.
|
|
882
|
+
:type _headers: dict, optional
|
|
883
|
+
:param _host_index: set to override the host_index for a single
|
|
884
|
+
request; this effectively ignores the host_index
|
|
885
|
+
in the spec for a single request.
|
|
886
|
+
:type _host_index: int, optional
|
|
887
|
+
:return: Returns the result object.
|
|
888
|
+
""" # noqa: E501 docstring might be too long
|
|
889
|
+
|
|
890
|
+
_param = self._get_embedding_model_serialize(
|
|
891
|
+
region_id=region_id,
|
|
892
|
+
model_id=model_id,
|
|
893
|
+
_request_auth=_request_auth,
|
|
894
|
+
_content_type=_content_type,
|
|
895
|
+
_headers=_headers,
|
|
896
|
+
_host_index=_host_index,
|
|
897
|
+
)
|
|
898
|
+
|
|
899
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
900
|
+
"200": "GetEmbeddingsModelResp",
|
|
901
|
+
"400": "ErrorMessageResponse",
|
|
902
|
+
"401": "ErrorMessageResponse",
|
|
903
|
+
"500": "ErrorMessageResponse",
|
|
904
|
+
}
|
|
905
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
906
|
+
response_data.read()
|
|
907
|
+
return self.api_client.response_deserialize(
|
|
908
|
+
response_data=response_data,
|
|
909
|
+
response_types_map=_response_types_map,
|
|
910
|
+
).data
|
|
911
|
+
|
|
912
|
+
@validate_call
|
|
913
|
+
def get_embedding_model_with_http_info(
|
|
914
|
+
self,
|
|
915
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
916
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
917
|
+
_request_timeout: Union[
|
|
918
|
+
None,
|
|
919
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
920
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
921
|
+
] = None,
|
|
922
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
923
|
+
_content_type: Optional[StrictStr] = None,
|
|
924
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
925
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
926
|
+
) -> ApiResponse[GetEmbeddingsModelResp]:
|
|
927
|
+
"""details of an embedding model
|
|
928
|
+
|
|
929
|
+
details of an embedding model
|
|
930
|
+
|
|
931
|
+
:param region_id: region name (required)
|
|
932
|
+
:type region_id: str
|
|
933
|
+
:param model_id: model id (required)
|
|
934
|
+
:type model_id: str
|
|
935
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
936
|
+
number provided, it will be total request
|
|
937
|
+
timeout. It can also be a pair (tuple) of
|
|
938
|
+
(connection, read) timeouts.
|
|
939
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
940
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
941
|
+
request; this effectively ignores the
|
|
942
|
+
authentication in the spec for a single request.
|
|
943
|
+
:type _request_auth: dict, optional
|
|
944
|
+
:param _content_type: force content-type for the request.
|
|
945
|
+
:type _content_type: str, Optional
|
|
946
|
+
:param _headers: set to override the headers for a single
|
|
947
|
+
request; this effectively ignores the headers
|
|
948
|
+
in the spec for a single request.
|
|
949
|
+
:type _headers: dict, optional
|
|
950
|
+
:param _host_index: set to override the host_index for a single
|
|
951
|
+
request; this effectively ignores the host_index
|
|
952
|
+
in the spec for a single request.
|
|
953
|
+
:type _host_index: int, optional
|
|
954
|
+
:return: Returns the result object.
|
|
955
|
+
""" # noqa: E501 docstring might be too long
|
|
956
|
+
|
|
957
|
+
_param = self._get_embedding_model_serialize(
|
|
958
|
+
region_id=region_id,
|
|
959
|
+
model_id=model_id,
|
|
960
|
+
_request_auth=_request_auth,
|
|
961
|
+
_content_type=_content_type,
|
|
962
|
+
_headers=_headers,
|
|
963
|
+
_host_index=_host_index,
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
967
|
+
"200": "GetEmbeddingsModelResp",
|
|
968
|
+
"400": "ErrorMessageResponse",
|
|
969
|
+
"401": "ErrorMessageResponse",
|
|
970
|
+
"500": "ErrorMessageResponse",
|
|
971
|
+
}
|
|
972
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
973
|
+
response_data.read()
|
|
974
|
+
return self.api_client.response_deserialize(
|
|
975
|
+
response_data=response_data,
|
|
976
|
+
response_types_map=_response_types_map,
|
|
977
|
+
)
|
|
978
|
+
|
|
979
|
+
@validate_call
|
|
980
|
+
def get_embedding_model_without_preload_content(
|
|
981
|
+
self,
|
|
982
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
983
|
+
model_id: Annotated[StrictStr, Field(description="model id")],
|
|
984
|
+
_request_timeout: Union[
|
|
985
|
+
None,
|
|
986
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
987
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
988
|
+
] = None,
|
|
989
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
990
|
+
_content_type: Optional[StrictStr] = None,
|
|
991
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
992
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
993
|
+
) -> RESTResponseType:
|
|
994
|
+
"""details of an embedding model
|
|
995
|
+
|
|
996
|
+
details of an embedding model
|
|
997
|
+
|
|
998
|
+
:param region_id: region name (required)
|
|
999
|
+
:type region_id: str
|
|
1000
|
+
:param model_id: model id (required)
|
|
1001
|
+
:type model_id: str
|
|
1002
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1003
|
+
number provided, it will be total request
|
|
1004
|
+
timeout. It can also be a pair (tuple) of
|
|
1005
|
+
(connection, read) timeouts.
|
|
1006
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1007
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1008
|
+
request; this effectively ignores the
|
|
1009
|
+
authentication in the spec for a single request.
|
|
1010
|
+
:type _request_auth: dict, optional
|
|
1011
|
+
:param _content_type: force content-type for the request.
|
|
1012
|
+
:type _content_type: str, Optional
|
|
1013
|
+
:param _headers: set to override the headers for a single
|
|
1014
|
+
request; this effectively ignores the headers
|
|
1015
|
+
in the spec for a single request.
|
|
1016
|
+
:type _headers: dict, optional
|
|
1017
|
+
:param _host_index: set to override the host_index for a single
|
|
1018
|
+
request; this effectively ignores the host_index
|
|
1019
|
+
in the spec for a single request.
|
|
1020
|
+
:type _host_index: int, optional
|
|
1021
|
+
:return: Returns the result object.
|
|
1022
|
+
""" # noqa: E501 docstring might be too long
|
|
1023
|
+
|
|
1024
|
+
_param = self._get_embedding_model_serialize(
|
|
1025
|
+
region_id=region_id,
|
|
1026
|
+
model_id=model_id,
|
|
1027
|
+
_request_auth=_request_auth,
|
|
1028
|
+
_content_type=_content_type,
|
|
1029
|
+
_headers=_headers,
|
|
1030
|
+
_host_index=_host_index,
|
|
1031
|
+
)
|
|
1032
|
+
|
|
1033
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1034
|
+
"200": "GetEmbeddingsModelResp",
|
|
1035
|
+
"400": "ErrorMessageResponse",
|
|
1036
|
+
"401": "ErrorMessageResponse",
|
|
1037
|
+
"500": "ErrorMessageResponse",
|
|
1038
|
+
}
|
|
1039
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1040
|
+
return response_data.response
|
|
1041
|
+
|
|
1042
|
+
def _get_embedding_model_serialize(
|
|
1043
|
+
self,
|
|
1044
|
+
region_id,
|
|
1045
|
+
model_id,
|
|
1046
|
+
_request_auth,
|
|
1047
|
+
_content_type,
|
|
1048
|
+
_headers,
|
|
1049
|
+
_host_index,
|
|
1050
|
+
) -> RequestSerialized:
|
|
1051
|
+
|
|
1052
|
+
_host = None
|
|
1053
|
+
|
|
1054
|
+
_collection_formats: Dict[str, str] = {}
|
|
1055
|
+
|
|
1056
|
+
_path_params: Dict[str, str] = {}
|
|
1057
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1058
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1059
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1060
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
1061
|
+
_body_params: Optional[bytes] = None
|
|
1062
|
+
|
|
1063
|
+
# process the path parameters
|
|
1064
|
+
if region_id is not None:
|
|
1065
|
+
_path_params["regionId"] = region_id
|
|
1066
|
+
if model_id is not None:
|
|
1067
|
+
_path_params["modelId"] = model_id
|
|
1068
|
+
# process the query parameters
|
|
1069
|
+
# process the header parameters
|
|
1070
|
+
# process the form parameters
|
|
1071
|
+
# process the body parameter
|
|
1072
|
+
|
|
1073
|
+
# set the HTTP header `Accept`
|
|
1074
|
+
if "Accept" not in _header_params:
|
|
1075
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
1076
|
+
|
|
1077
|
+
# authentication setting
|
|
1078
|
+
_auth_settings: List[str] = []
|
|
1079
|
+
|
|
1080
|
+
return self.api_client.param_serialize(
|
|
1081
|
+
method="GET",
|
|
1082
|
+
resource_path="/v1/regions/{regionId}/embedding/models/{modelId}",
|
|
1083
|
+
path_params=_path_params,
|
|
1084
|
+
query_params=_query_params,
|
|
1085
|
+
header_params=_header_params,
|
|
1086
|
+
body=_body_params,
|
|
1087
|
+
post_params=_form_params,
|
|
1088
|
+
files=_files,
|
|
1089
|
+
auth_settings=_auth_settings,
|
|
1090
|
+
collection_formats=_collection_formats,
|
|
1091
|
+
_host=_host,
|
|
1092
|
+
_request_auth=_request_auth,
|
|
1093
|
+
)
|
|
1094
|
+
|
|
1095
|
+
@validate_call
|
|
1096
|
+
def get_token(
|
|
1097
|
+
self,
|
|
1098
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1099
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1100
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
1101
|
+
_request_timeout: Union[
|
|
1102
|
+
None,
|
|
1103
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1104
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1105
|
+
] = None,
|
|
1106
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1107
|
+
_content_type: Optional[StrictStr] = None,
|
|
1108
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1109
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1110
|
+
) -> GetTokenResponse:
|
|
1111
|
+
"""get auth token for shared model use
|
|
1112
|
+
|
|
1113
|
+
get auth token for shared model use
|
|
1114
|
+
|
|
1115
|
+
:param region_id: region name (required)
|
|
1116
|
+
:type region_id: str
|
|
1117
|
+
:param project_id: portal project id (required)
|
|
1118
|
+
:type project_id: str
|
|
1119
|
+
:param t_id: token id (required)
|
|
1120
|
+
:type t_id: str
|
|
1121
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1122
|
+
number provided, it will be total request
|
|
1123
|
+
timeout. It can also be a pair (tuple) of
|
|
1124
|
+
(connection, read) timeouts.
|
|
1125
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1126
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1127
|
+
request; this effectively ignores the
|
|
1128
|
+
authentication in the spec for a single request.
|
|
1129
|
+
:type _request_auth: dict, optional
|
|
1130
|
+
:param _content_type: force content-type for the request.
|
|
1131
|
+
:type _content_type: str, Optional
|
|
1132
|
+
:param _headers: set to override the headers for a single
|
|
1133
|
+
request; this effectively ignores the headers
|
|
1134
|
+
in the spec for a single request.
|
|
1135
|
+
:type _headers: dict, optional
|
|
1136
|
+
:param _host_index: set to override the host_index for a single
|
|
1137
|
+
request; this effectively ignores the host_index
|
|
1138
|
+
in the spec for a single request.
|
|
1139
|
+
:type _host_index: int, optional
|
|
1140
|
+
:return: Returns the result object.
|
|
1141
|
+
""" # noqa: E501 docstring might be too long
|
|
1142
|
+
|
|
1143
|
+
_param = self._get_token_serialize(
|
|
1144
|
+
region_id=region_id,
|
|
1145
|
+
project_id=project_id,
|
|
1146
|
+
t_id=t_id,
|
|
1147
|
+
_request_auth=_request_auth,
|
|
1148
|
+
_content_type=_content_type,
|
|
1149
|
+
_headers=_headers,
|
|
1150
|
+
_host_index=_host_index,
|
|
1151
|
+
)
|
|
1152
|
+
|
|
1153
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1154
|
+
"200": "GetTokenResponse",
|
|
1155
|
+
"400": "ErrorMessageResponse",
|
|
1156
|
+
"401": "ErrorMessageResponse",
|
|
1157
|
+
"404": "ErrorMessageResponse",
|
|
1158
|
+
"500": "ErrorMessageResponse",
|
|
1159
|
+
}
|
|
1160
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1161
|
+
response_data.read()
|
|
1162
|
+
return self.api_client.response_deserialize(
|
|
1163
|
+
response_data=response_data,
|
|
1164
|
+
response_types_map=_response_types_map,
|
|
1165
|
+
).data
|
|
1166
|
+
|
|
1167
|
+
@validate_call
|
|
1168
|
+
def get_token_with_http_info(
|
|
1169
|
+
self,
|
|
1170
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1171
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1172
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
1173
|
+
_request_timeout: Union[
|
|
1174
|
+
None,
|
|
1175
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1176
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1177
|
+
] = None,
|
|
1178
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1179
|
+
_content_type: Optional[StrictStr] = None,
|
|
1180
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1181
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1182
|
+
) -> ApiResponse[GetTokenResponse]:
|
|
1183
|
+
"""get auth token for shared model use
|
|
1184
|
+
|
|
1185
|
+
get auth token for shared model use
|
|
1186
|
+
|
|
1187
|
+
:param region_id: region name (required)
|
|
1188
|
+
:type region_id: str
|
|
1189
|
+
:param project_id: portal project id (required)
|
|
1190
|
+
:type project_id: str
|
|
1191
|
+
:param t_id: token id (required)
|
|
1192
|
+
:type t_id: str
|
|
1193
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1194
|
+
number provided, it will be total request
|
|
1195
|
+
timeout. It can also be a pair (tuple) of
|
|
1196
|
+
(connection, read) timeouts.
|
|
1197
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1198
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1199
|
+
request; this effectively ignores the
|
|
1200
|
+
authentication in the spec for a single request.
|
|
1201
|
+
:type _request_auth: dict, optional
|
|
1202
|
+
:param _content_type: force content-type for the request.
|
|
1203
|
+
:type _content_type: str, Optional
|
|
1204
|
+
:param _headers: set to override the headers for a single
|
|
1205
|
+
request; this effectively ignores the headers
|
|
1206
|
+
in the spec for a single request.
|
|
1207
|
+
:type _headers: dict, optional
|
|
1208
|
+
:param _host_index: set to override the host_index for a single
|
|
1209
|
+
request; this effectively ignores the host_index
|
|
1210
|
+
in the spec for a single request.
|
|
1211
|
+
:type _host_index: int, optional
|
|
1212
|
+
:return: Returns the result object.
|
|
1213
|
+
""" # noqa: E501 docstring might be too long
|
|
1214
|
+
|
|
1215
|
+
_param = self._get_token_serialize(
|
|
1216
|
+
region_id=region_id,
|
|
1217
|
+
project_id=project_id,
|
|
1218
|
+
t_id=t_id,
|
|
1219
|
+
_request_auth=_request_auth,
|
|
1220
|
+
_content_type=_content_type,
|
|
1221
|
+
_headers=_headers,
|
|
1222
|
+
_host_index=_host_index,
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1226
|
+
"200": "GetTokenResponse",
|
|
1227
|
+
"400": "ErrorMessageResponse",
|
|
1228
|
+
"401": "ErrorMessageResponse",
|
|
1229
|
+
"404": "ErrorMessageResponse",
|
|
1230
|
+
"500": "ErrorMessageResponse",
|
|
1231
|
+
}
|
|
1232
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1233
|
+
response_data.read()
|
|
1234
|
+
return self.api_client.response_deserialize(
|
|
1235
|
+
response_data=response_data,
|
|
1236
|
+
response_types_map=_response_types_map,
|
|
1237
|
+
)
|
|
1238
|
+
|
|
1239
|
+
@validate_call
|
|
1240
|
+
def get_token_without_preload_content(
|
|
1241
|
+
self,
|
|
1242
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1243
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1244
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
1245
|
+
_request_timeout: Union[
|
|
1246
|
+
None,
|
|
1247
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1248
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1249
|
+
] = None,
|
|
1250
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1251
|
+
_content_type: Optional[StrictStr] = None,
|
|
1252
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1253
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1254
|
+
) -> RESTResponseType:
|
|
1255
|
+
"""get auth token for shared model use
|
|
1256
|
+
|
|
1257
|
+
get auth token for shared model use
|
|
1258
|
+
|
|
1259
|
+
:param region_id: region name (required)
|
|
1260
|
+
:type region_id: str
|
|
1261
|
+
:param project_id: portal project id (required)
|
|
1262
|
+
:type project_id: str
|
|
1263
|
+
:param t_id: token id (required)
|
|
1264
|
+
:type t_id: str
|
|
1265
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1266
|
+
number provided, it will be total request
|
|
1267
|
+
timeout. It can also be a pair (tuple) of
|
|
1268
|
+
(connection, read) timeouts.
|
|
1269
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1270
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1271
|
+
request; this effectively ignores the
|
|
1272
|
+
authentication in the spec for a single request.
|
|
1273
|
+
:type _request_auth: dict, optional
|
|
1274
|
+
:param _content_type: force content-type for the request.
|
|
1275
|
+
:type _content_type: str, Optional
|
|
1276
|
+
:param _headers: set to override the headers for a single
|
|
1277
|
+
request; this effectively ignores the headers
|
|
1278
|
+
in the spec for a single request.
|
|
1279
|
+
:type _headers: dict, optional
|
|
1280
|
+
:param _host_index: set to override the host_index for a single
|
|
1281
|
+
request; this effectively ignores the host_index
|
|
1282
|
+
in the spec for a single request.
|
|
1283
|
+
:type _host_index: int, optional
|
|
1284
|
+
:return: Returns the result object.
|
|
1285
|
+
""" # noqa: E501 docstring might be too long
|
|
1286
|
+
|
|
1287
|
+
_param = self._get_token_serialize(
|
|
1288
|
+
region_id=region_id,
|
|
1289
|
+
project_id=project_id,
|
|
1290
|
+
t_id=t_id,
|
|
1291
|
+
_request_auth=_request_auth,
|
|
1292
|
+
_content_type=_content_type,
|
|
1293
|
+
_headers=_headers,
|
|
1294
|
+
_host_index=_host_index,
|
|
1295
|
+
)
|
|
1296
|
+
|
|
1297
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1298
|
+
"200": "GetTokenResponse",
|
|
1299
|
+
"400": "ErrorMessageResponse",
|
|
1300
|
+
"401": "ErrorMessageResponse",
|
|
1301
|
+
"404": "ErrorMessageResponse",
|
|
1302
|
+
"500": "ErrorMessageResponse",
|
|
1303
|
+
}
|
|
1304
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1305
|
+
return response_data.response
|
|
1306
|
+
|
|
1307
|
+
def _get_token_serialize(
|
|
1308
|
+
self,
|
|
1309
|
+
region_id,
|
|
1310
|
+
project_id,
|
|
1311
|
+
t_id,
|
|
1312
|
+
_request_auth,
|
|
1313
|
+
_content_type,
|
|
1314
|
+
_headers,
|
|
1315
|
+
_host_index,
|
|
1316
|
+
) -> RequestSerialized:
|
|
1317
|
+
|
|
1318
|
+
_host = None
|
|
1319
|
+
|
|
1320
|
+
_collection_formats: Dict[str, str] = {}
|
|
1321
|
+
|
|
1322
|
+
_path_params: Dict[str, str] = {}
|
|
1323
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1324
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1325
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1326
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
1327
|
+
_body_params: Optional[bytes] = None
|
|
1328
|
+
|
|
1329
|
+
# process the path parameters
|
|
1330
|
+
if region_id is not None:
|
|
1331
|
+
_path_params["regionId"] = region_id
|
|
1332
|
+
if project_id is not None:
|
|
1333
|
+
_path_params["projectId"] = project_id
|
|
1334
|
+
if t_id is not None:
|
|
1335
|
+
_path_params["tId"] = t_id
|
|
1336
|
+
# process the query parameters
|
|
1337
|
+
# process the header parameters
|
|
1338
|
+
# process the form parameters
|
|
1339
|
+
# process the body parameter
|
|
1340
|
+
|
|
1341
|
+
# set the HTTP header `Accept`
|
|
1342
|
+
if "Accept" not in _header_params:
|
|
1343
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
1344
|
+
|
|
1345
|
+
# authentication setting
|
|
1346
|
+
_auth_settings: List[str] = []
|
|
1347
|
+
|
|
1348
|
+
return self.api_client.param_serialize(
|
|
1349
|
+
method="GET",
|
|
1350
|
+
resource_path="/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}",
|
|
1351
|
+
path_params=_path_params,
|
|
1352
|
+
query_params=_query_params,
|
|
1353
|
+
header_params=_header_params,
|
|
1354
|
+
body=_body_params,
|
|
1355
|
+
post_params=_form_params,
|
|
1356
|
+
files=_files,
|
|
1357
|
+
auth_settings=_auth_settings,
|
|
1358
|
+
collection_formats=_collection_formats,
|
|
1359
|
+
_host=_host,
|
|
1360
|
+
_request_auth=_request_auth,
|
|
1361
|
+
)
|
|
1362
|
+
|
|
1363
|
+
@validate_call
|
|
1364
|
+
def list_models(
|
|
1365
|
+
self,
|
|
1366
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1367
|
+
_request_timeout: Union[
|
|
1368
|
+
None,
|
|
1369
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1370
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1371
|
+
] = None,
|
|
1372
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1373
|
+
_content_type: Optional[StrictStr] = None,
|
|
1374
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1375
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1376
|
+
) -> ListModelsResponse:
|
|
1377
|
+
"""List of shared model
|
|
1378
|
+
|
|
1379
|
+
List of shared model
|
|
1380
|
+
|
|
1381
|
+
:param region_id: region name (required)
|
|
1382
|
+
:type region_id: str
|
|
1383
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1384
|
+
number provided, it will be total request
|
|
1385
|
+
timeout. It can also be a pair (tuple) of
|
|
1386
|
+
(connection, read) timeouts.
|
|
1387
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1388
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1389
|
+
request; this effectively ignores the
|
|
1390
|
+
authentication in the spec for a single request.
|
|
1391
|
+
:type _request_auth: dict, optional
|
|
1392
|
+
:param _content_type: force content-type for the request.
|
|
1393
|
+
:type _content_type: str, Optional
|
|
1394
|
+
:param _headers: set to override the headers for a single
|
|
1395
|
+
request; this effectively ignores the headers
|
|
1396
|
+
in the spec for a single request.
|
|
1397
|
+
:type _headers: dict, optional
|
|
1398
|
+
:param _host_index: set to override the host_index for a single
|
|
1399
|
+
request; this effectively ignores the host_index
|
|
1400
|
+
in the spec for a single request.
|
|
1401
|
+
:type _host_index: int, optional
|
|
1402
|
+
:return: Returns the result object.
|
|
1403
|
+
""" # noqa: E501 docstring might be too long
|
|
1404
|
+
|
|
1405
|
+
_param = self._list_models_serialize(
|
|
1406
|
+
region_id=region_id,
|
|
1407
|
+
_request_auth=_request_auth,
|
|
1408
|
+
_content_type=_content_type,
|
|
1409
|
+
_headers=_headers,
|
|
1410
|
+
_host_index=_host_index,
|
|
1411
|
+
)
|
|
1412
|
+
|
|
1413
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1414
|
+
"200": "ListModelsResponse",
|
|
1415
|
+
"400": "ErrorMessageResponse",
|
|
1416
|
+
"401": "ErrorMessageResponse",
|
|
1417
|
+
"500": "ErrorMessageResponse",
|
|
1418
|
+
}
|
|
1419
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1420
|
+
response_data.read()
|
|
1421
|
+
return self.api_client.response_deserialize(
|
|
1422
|
+
response_data=response_data,
|
|
1423
|
+
response_types_map=_response_types_map,
|
|
1424
|
+
).data
|
|
1425
|
+
|
|
1426
|
+
@validate_call
|
|
1427
|
+
def list_models_with_http_info(
|
|
1428
|
+
self,
|
|
1429
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1430
|
+
_request_timeout: Union[
|
|
1431
|
+
None,
|
|
1432
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1433
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1434
|
+
] = None,
|
|
1435
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1436
|
+
_content_type: Optional[StrictStr] = None,
|
|
1437
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1438
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1439
|
+
) -> ApiResponse[ListModelsResponse]:
|
|
1440
|
+
"""List of shared model
|
|
1441
|
+
|
|
1442
|
+
List of shared model
|
|
1443
|
+
|
|
1444
|
+
:param region_id: region name (required)
|
|
1445
|
+
:type region_id: str
|
|
1446
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1447
|
+
number provided, it will be total request
|
|
1448
|
+
timeout. It can also be a pair (tuple) of
|
|
1449
|
+
(connection, read) timeouts.
|
|
1450
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1451
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1452
|
+
request; this effectively ignores the
|
|
1453
|
+
authentication in the spec for a single request.
|
|
1454
|
+
:type _request_auth: dict, optional
|
|
1455
|
+
:param _content_type: force content-type for the request.
|
|
1456
|
+
:type _content_type: str, Optional
|
|
1457
|
+
:param _headers: set to override the headers for a single
|
|
1458
|
+
request; this effectively ignores the headers
|
|
1459
|
+
in the spec for a single request.
|
|
1460
|
+
:type _headers: dict, optional
|
|
1461
|
+
:param _host_index: set to override the host_index for a single
|
|
1462
|
+
request; this effectively ignores the host_index
|
|
1463
|
+
in the spec for a single request.
|
|
1464
|
+
:type _host_index: int, optional
|
|
1465
|
+
:return: Returns the result object.
|
|
1466
|
+
""" # noqa: E501 docstring might be too long
|
|
1467
|
+
|
|
1468
|
+
_param = self._list_models_serialize(
|
|
1469
|
+
region_id=region_id,
|
|
1470
|
+
_request_auth=_request_auth,
|
|
1471
|
+
_content_type=_content_type,
|
|
1472
|
+
_headers=_headers,
|
|
1473
|
+
_host_index=_host_index,
|
|
1474
|
+
)
|
|
1475
|
+
|
|
1476
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1477
|
+
"200": "ListModelsResponse",
|
|
1478
|
+
"400": "ErrorMessageResponse",
|
|
1479
|
+
"401": "ErrorMessageResponse",
|
|
1480
|
+
"500": "ErrorMessageResponse",
|
|
1481
|
+
}
|
|
1482
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1483
|
+
response_data.read()
|
|
1484
|
+
return self.api_client.response_deserialize(
|
|
1485
|
+
response_data=response_data,
|
|
1486
|
+
response_types_map=_response_types_map,
|
|
1487
|
+
)
|
|
1488
|
+
|
|
1489
|
+
@validate_call
|
|
1490
|
+
def list_models_without_preload_content(
|
|
1491
|
+
self,
|
|
1492
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1493
|
+
_request_timeout: Union[
|
|
1494
|
+
None,
|
|
1495
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1496
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1497
|
+
] = None,
|
|
1498
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1499
|
+
_content_type: Optional[StrictStr] = None,
|
|
1500
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1501
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1502
|
+
) -> RESTResponseType:
|
|
1503
|
+
"""List of shared model
|
|
1504
|
+
|
|
1505
|
+
List of shared model
|
|
1506
|
+
|
|
1507
|
+
:param region_id: region name (required)
|
|
1508
|
+
:type region_id: str
|
|
1509
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1510
|
+
number provided, it will be total request
|
|
1511
|
+
timeout. It can also be a pair (tuple) of
|
|
1512
|
+
(connection, read) timeouts.
|
|
1513
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1514
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1515
|
+
request; this effectively ignores the
|
|
1516
|
+
authentication in the spec for a single request.
|
|
1517
|
+
:type _request_auth: dict, optional
|
|
1518
|
+
:param _content_type: force content-type for the request.
|
|
1519
|
+
:type _content_type: str, Optional
|
|
1520
|
+
:param _headers: set to override the headers for a single
|
|
1521
|
+
request; this effectively ignores the headers
|
|
1522
|
+
in the spec for a single request.
|
|
1523
|
+
:type _headers: dict, optional
|
|
1524
|
+
:param _host_index: set to override the host_index for a single
|
|
1525
|
+
request; this effectively ignores the host_index
|
|
1526
|
+
in the spec for a single request.
|
|
1527
|
+
:type _host_index: int, optional
|
|
1528
|
+
:return: Returns the result object.
|
|
1529
|
+
""" # noqa: E501 docstring might be too long
|
|
1530
|
+
|
|
1531
|
+
_param = self._list_models_serialize(
|
|
1532
|
+
region_id=region_id,
|
|
1533
|
+
_request_auth=_request_auth,
|
|
1534
|
+
_content_type=_content_type,
|
|
1535
|
+
_headers=_headers,
|
|
1536
|
+
_host_index=_host_index,
|
|
1537
|
+
)
|
|
1538
|
+
|
|
1539
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1540
|
+
"200": "ListModelsResponse",
|
|
1541
|
+
"400": "ErrorMessageResponse",
|
|
1542
|
+
"401": "ErrorMessageResponse",
|
|
1543
|
+
"500": "ErrorMessageResponse",
|
|
1544
|
+
}
|
|
1545
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1546
|
+
return response_data.response
|
|
1547
|
+
|
|
1548
|
+
def _list_models_serialize(
|
|
1549
|
+
self,
|
|
1550
|
+
region_id,
|
|
1551
|
+
_request_auth,
|
|
1552
|
+
_content_type,
|
|
1553
|
+
_headers,
|
|
1554
|
+
_host_index,
|
|
1555
|
+
) -> RequestSerialized:
|
|
1556
|
+
|
|
1557
|
+
_host = None
|
|
1558
|
+
|
|
1559
|
+
_collection_formats: Dict[str, str] = {}
|
|
1560
|
+
|
|
1561
|
+
_path_params: Dict[str, str] = {}
|
|
1562
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1563
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1564
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1565
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
1566
|
+
_body_params: Optional[bytes] = None
|
|
1567
|
+
|
|
1568
|
+
# process the path parameters
|
|
1569
|
+
if region_id is not None:
|
|
1570
|
+
_path_params["regionId"] = region_id
|
|
1571
|
+
# process the query parameters
|
|
1572
|
+
# process the header parameters
|
|
1573
|
+
# process the form parameters
|
|
1574
|
+
# process the body parameter
|
|
1575
|
+
|
|
1576
|
+
# set the HTTP header `Accept`
|
|
1577
|
+
if "Accept" not in _header_params:
|
|
1578
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
1579
|
+
|
|
1580
|
+
# authentication setting
|
|
1581
|
+
_auth_settings: List[str] = []
|
|
1582
|
+
|
|
1583
|
+
return self.api_client.param_serialize(
|
|
1584
|
+
method="GET",
|
|
1585
|
+
resource_path="/v1/regions/{regionId}/models",
|
|
1586
|
+
path_params=_path_params,
|
|
1587
|
+
query_params=_query_params,
|
|
1588
|
+
header_params=_header_params,
|
|
1589
|
+
body=_body_params,
|
|
1590
|
+
post_params=_form_params,
|
|
1591
|
+
files=_files,
|
|
1592
|
+
auth_settings=_auth_settings,
|
|
1593
|
+
collection_formats=_collection_formats,
|
|
1594
|
+
_host=_host,
|
|
1595
|
+
_request_auth=_request_auth,
|
|
1596
|
+
)
|
|
1597
|
+
|
|
1598
|
+
@validate_call
|
|
1599
|
+
def list_tokens(
|
|
1600
|
+
self,
|
|
1601
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1602
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1603
|
+
_request_timeout: Union[
|
|
1604
|
+
None,
|
|
1605
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1606
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1607
|
+
] = None,
|
|
1608
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1609
|
+
_content_type: Optional[StrictStr] = None,
|
|
1610
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1611
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1612
|
+
) -> ListTokenResp:
|
|
1613
|
+
"""auth tokens for shared model in non dedicated instances
|
|
1614
|
+
|
|
1615
|
+
auth tokens for shared model in non dedicated instances
|
|
1616
|
+
|
|
1617
|
+
:param region_id: region name (required)
|
|
1618
|
+
:type region_id: str
|
|
1619
|
+
:param project_id: portal project id (required)
|
|
1620
|
+
:type project_id: str
|
|
1621
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1622
|
+
number provided, it will be total request
|
|
1623
|
+
timeout. It can also be a pair (tuple) of
|
|
1624
|
+
(connection, read) timeouts.
|
|
1625
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1626
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1627
|
+
request; this effectively ignores the
|
|
1628
|
+
authentication in the spec for a single request.
|
|
1629
|
+
:type _request_auth: dict, optional
|
|
1630
|
+
:param _content_type: force content-type for the request.
|
|
1631
|
+
:type _content_type: str, Optional
|
|
1632
|
+
:param _headers: set to override the headers for a single
|
|
1633
|
+
request; this effectively ignores the headers
|
|
1634
|
+
in the spec for a single request.
|
|
1635
|
+
:type _headers: dict, optional
|
|
1636
|
+
:param _host_index: set to override the host_index for a single
|
|
1637
|
+
request; this effectively ignores the host_index
|
|
1638
|
+
in the spec for a single request.
|
|
1639
|
+
:type _host_index: int, optional
|
|
1640
|
+
:return: Returns the result object.
|
|
1641
|
+
""" # noqa: E501 docstring might be too long
|
|
1642
|
+
|
|
1643
|
+
_param = self._list_tokens_serialize(
|
|
1644
|
+
region_id=region_id,
|
|
1645
|
+
project_id=project_id,
|
|
1646
|
+
_request_auth=_request_auth,
|
|
1647
|
+
_content_type=_content_type,
|
|
1648
|
+
_headers=_headers,
|
|
1649
|
+
_host_index=_host_index,
|
|
1650
|
+
)
|
|
1651
|
+
|
|
1652
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1653
|
+
"200": "ListTokenResp",
|
|
1654
|
+
"400": "ErrorMessageResponse",
|
|
1655
|
+
"401": "ErrorMessageResponse",
|
|
1656
|
+
"500": "ErrorMessageResponse",
|
|
1657
|
+
}
|
|
1658
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1659
|
+
response_data.read()
|
|
1660
|
+
return self.api_client.response_deserialize(
|
|
1661
|
+
response_data=response_data,
|
|
1662
|
+
response_types_map=_response_types_map,
|
|
1663
|
+
).data
|
|
1664
|
+
|
|
1665
|
+
@validate_call
|
|
1666
|
+
def list_tokens_with_http_info(
|
|
1667
|
+
self,
|
|
1668
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1669
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1670
|
+
_request_timeout: Union[
|
|
1671
|
+
None,
|
|
1672
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1673
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1674
|
+
] = None,
|
|
1675
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1676
|
+
_content_type: Optional[StrictStr] = None,
|
|
1677
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1678
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1679
|
+
) -> ApiResponse[ListTokenResp]:
|
|
1680
|
+
"""auth tokens for shared model in non dedicated instances
|
|
1681
|
+
|
|
1682
|
+
auth tokens for shared model in non dedicated instances
|
|
1683
|
+
|
|
1684
|
+
:param region_id: region name (required)
|
|
1685
|
+
:type region_id: str
|
|
1686
|
+
:param project_id: portal project id (required)
|
|
1687
|
+
:type project_id: str
|
|
1688
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1689
|
+
number provided, it will be total request
|
|
1690
|
+
timeout. It can also be a pair (tuple) of
|
|
1691
|
+
(connection, read) timeouts.
|
|
1692
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1693
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1694
|
+
request; this effectively ignores the
|
|
1695
|
+
authentication in the spec for a single request.
|
|
1696
|
+
:type _request_auth: dict, optional
|
|
1697
|
+
:param _content_type: force content-type for the request.
|
|
1698
|
+
:type _content_type: str, Optional
|
|
1699
|
+
:param _headers: set to override the headers for a single
|
|
1700
|
+
request; this effectively ignores the headers
|
|
1701
|
+
in the spec for a single request.
|
|
1702
|
+
:type _headers: dict, optional
|
|
1703
|
+
:param _host_index: set to override the host_index for a single
|
|
1704
|
+
request; this effectively ignores the host_index
|
|
1705
|
+
in the spec for a single request.
|
|
1706
|
+
:type _host_index: int, optional
|
|
1707
|
+
:return: Returns the result object.
|
|
1708
|
+
""" # noqa: E501 docstring might be too long
|
|
1709
|
+
|
|
1710
|
+
_param = self._list_tokens_serialize(
|
|
1711
|
+
region_id=region_id,
|
|
1712
|
+
project_id=project_id,
|
|
1713
|
+
_request_auth=_request_auth,
|
|
1714
|
+
_content_type=_content_type,
|
|
1715
|
+
_headers=_headers,
|
|
1716
|
+
_host_index=_host_index,
|
|
1717
|
+
)
|
|
1718
|
+
|
|
1719
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1720
|
+
"200": "ListTokenResp",
|
|
1721
|
+
"400": "ErrorMessageResponse",
|
|
1722
|
+
"401": "ErrorMessageResponse",
|
|
1723
|
+
"500": "ErrorMessageResponse",
|
|
1724
|
+
}
|
|
1725
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1726
|
+
response_data.read()
|
|
1727
|
+
return self.api_client.response_deserialize(
|
|
1728
|
+
response_data=response_data,
|
|
1729
|
+
response_types_map=_response_types_map,
|
|
1730
|
+
)
|
|
1731
|
+
|
|
1732
|
+
@validate_call
|
|
1733
|
+
def list_tokens_without_preload_content(
|
|
1734
|
+
self,
|
|
1735
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1736
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1737
|
+
_request_timeout: Union[
|
|
1738
|
+
None,
|
|
1739
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1740
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1741
|
+
] = None,
|
|
1742
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1743
|
+
_content_type: Optional[StrictStr] = None,
|
|
1744
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1745
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1746
|
+
) -> RESTResponseType:
|
|
1747
|
+
"""auth tokens for shared model in non dedicated instances
|
|
1748
|
+
|
|
1749
|
+
auth tokens for shared model in non dedicated instances
|
|
1750
|
+
|
|
1751
|
+
:param region_id: region name (required)
|
|
1752
|
+
:type region_id: str
|
|
1753
|
+
:param project_id: portal project id (required)
|
|
1754
|
+
:type project_id: str
|
|
1755
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1756
|
+
number provided, it will be total request
|
|
1757
|
+
timeout. It can also be a pair (tuple) of
|
|
1758
|
+
(connection, read) timeouts.
|
|
1759
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1760
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1761
|
+
request; this effectively ignores the
|
|
1762
|
+
authentication in the spec for a single request.
|
|
1763
|
+
:type _request_auth: dict, optional
|
|
1764
|
+
:param _content_type: force content-type for the request.
|
|
1765
|
+
:type _content_type: str, Optional
|
|
1766
|
+
:param _headers: set to override the headers for a single
|
|
1767
|
+
request; this effectively ignores the headers
|
|
1768
|
+
in the spec for a single request.
|
|
1769
|
+
:type _headers: dict, optional
|
|
1770
|
+
:param _host_index: set to override the host_index for a single
|
|
1771
|
+
request; this effectively ignores the host_index
|
|
1772
|
+
in the spec for a single request.
|
|
1773
|
+
:type _host_index: int, optional
|
|
1774
|
+
:return: Returns the result object.
|
|
1775
|
+
""" # noqa: E501 docstring might be too long
|
|
1776
|
+
|
|
1777
|
+
_param = self._list_tokens_serialize(
|
|
1778
|
+
region_id=region_id,
|
|
1779
|
+
project_id=project_id,
|
|
1780
|
+
_request_auth=_request_auth,
|
|
1781
|
+
_content_type=_content_type,
|
|
1782
|
+
_headers=_headers,
|
|
1783
|
+
_host_index=_host_index,
|
|
1784
|
+
)
|
|
1785
|
+
|
|
1786
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1787
|
+
"200": "ListTokenResp",
|
|
1788
|
+
"400": "ErrorMessageResponse",
|
|
1789
|
+
"401": "ErrorMessageResponse",
|
|
1790
|
+
"500": "ErrorMessageResponse",
|
|
1791
|
+
}
|
|
1792
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1793
|
+
return response_data.response
|
|
1794
|
+
|
|
1795
|
+
def _list_tokens_serialize(
|
|
1796
|
+
self,
|
|
1797
|
+
region_id,
|
|
1798
|
+
project_id,
|
|
1799
|
+
_request_auth,
|
|
1800
|
+
_content_type,
|
|
1801
|
+
_headers,
|
|
1802
|
+
_host_index,
|
|
1803
|
+
) -> RequestSerialized:
|
|
1804
|
+
|
|
1805
|
+
_host = None
|
|
1806
|
+
|
|
1807
|
+
_collection_formats: Dict[str, str] = {}
|
|
1808
|
+
|
|
1809
|
+
_path_params: Dict[str, str] = {}
|
|
1810
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1811
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1812
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1813
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
1814
|
+
_body_params: Optional[bytes] = None
|
|
1815
|
+
|
|
1816
|
+
# process the path parameters
|
|
1817
|
+
if region_id is not None:
|
|
1818
|
+
_path_params["regionId"] = region_id
|
|
1819
|
+
if project_id is not None:
|
|
1820
|
+
_path_params["projectId"] = project_id
|
|
1821
|
+
# process the query parameters
|
|
1822
|
+
# process the header parameters
|
|
1823
|
+
# process the form parameters
|
|
1824
|
+
# process the body parameter
|
|
1825
|
+
|
|
1826
|
+
# set the HTTP header `Accept`
|
|
1827
|
+
if "Accept" not in _header_params:
|
|
1828
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
1829
|
+
|
|
1830
|
+
# authentication setting
|
|
1831
|
+
_auth_settings: List[str] = []
|
|
1832
|
+
|
|
1833
|
+
return self.api_client.param_serialize(
|
|
1834
|
+
method="GET",
|
|
1835
|
+
resource_path="/v1/projects/{projectId}/regions/{regionId}/tokens",
|
|
1836
|
+
path_params=_path_params,
|
|
1837
|
+
query_params=_query_params,
|
|
1838
|
+
header_params=_header_params,
|
|
1839
|
+
body=_body_params,
|
|
1840
|
+
post_params=_form_params,
|
|
1841
|
+
files=_files,
|
|
1842
|
+
auth_settings=_auth_settings,
|
|
1843
|
+
collection_formats=_collection_formats,
|
|
1844
|
+
_host=_host,
|
|
1845
|
+
_request_auth=_request_auth,
|
|
1846
|
+
)
|
|
1847
|
+
|
|
1848
|
+
@validate_call
|
|
1849
|
+
def partial_update_token(
|
|
1850
|
+
self,
|
|
1851
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1852
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1853
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
1854
|
+
partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
|
|
1855
|
+
_request_timeout: Union[
|
|
1856
|
+
None,
|
|
1857
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1858
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1859
|
+
] = None,
|
|
1860
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1861
|
+
_content_type: Optional[StrictStr] = None,
|
|
1862
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1863
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1864
|
+
) -> UpdateTokenResponse:
|
|
1865
|
+
"""partial update auth token for shared model use
|
|
1866
|
+
|
|
1867
|
+
partial update auth token for shared model use
|
|
1868
|
+
|
|
1869
|
+
:param region_id: region name (required)
|
|
1870
|
+
:type region_id: str
|
|
1871
|
+
:param project_id: portal project id (required)
|
|
1872
|
+
:type project_id: str
|
|
1873
|
+
:param t_id: token id (required)
|
|
1874
|
+
:type t_id: str
|
|
1875
|
+
:param partial_update_token_payload:
|
|
1876
|
+
:type partial_update_token_payload: PartialUpdateTokenPayload
|
|
1877
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1878
|
+
number provided, it will be total request
|
|
1879
|
+
timeout. It can also be a pair (tuple) of
|
|
1880
|
+
(connection, read) timeouts.
|
|
1881
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1882
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1883
|
+
request; this effectively ignores the
|
|
1884
|
+
authentication in the spec for a single request.
|
|
1885
|
+
:type _request_auth: dict, optional
|
|
1886
|
+
:param _content_type: force content-type for the request.
|
|
1887
|
+
:type _content_type: str, Optional
|
|
1888
|
+
:param _headers: set to override the headers for a single
|
|
1889
|
+
request; this effectively ignores the headers
|
|
1890
|
+
in the spec for a single request.
|
|
1891
|
+
:type _headers: dict, optional
|
|
1892
|
+
:param _host_index: set to override the host_index for a single
|
|
1893
|
+
request; this effectively ignores the host_index
|
|
1894
|
+
in the spec for a single request.
|
|
1895
|
+
:type _host_index: int, optional
|
|
1896
|
+
:return: Returns the result object.
|
|
1897
|
+
""" # noqa: E501 docstring might be too long
|
|
1898
|
+
|
|
1899
|
+
_param = self._partial_update_token_serialize(
|
|
1900
|
+
region_id=region_id,
|
|
1901
|
+
project_id=project_id,
|
|
1902
|
+
t_id=t_id,
|
|
1903
|
+
partial_update_token_payload=partial_update_token_payload,
|
|
1904
|
+
_request_auth=_request_auth,
|
|
1905
|
+
_content_type=_content_type,
|
|
1906
|
+
_headers=_headers,
|
|
1907
|
+
_host_index=_host_index,
|
|
1908
|
+
)
|
|
1909
|
+
|
|
1910
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1911
|
+
"202": "UpdateTokenResponse",
|
|
1912
|
+
"400": "ErrorMessageResponse",
|
|
1913
|
+
"401": "ErrorMessageResponse",
|
|
1914
|
+
"404": "ErrorMessageResponse",
|
|
1915
|
+
"500": "ErrorMessageResponse",
|
|
1916
|
+
}
|
|
1917
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1918
|
+
response_data.read()
|
|
1919
|
+
return self.api_client.response_deserialize(
|
|
1920
|
+
response_data=response_data,
|
|
1921
|
+
response_types_map=_response_types_map,
|
|
1922
|
+
).data
|
|
1923
|
+
|
|
1924
|
+
@validate_call
|
|
1925
|
+
def partial_update_token_with_http_info(
|
|
1926
|
+
self,
|
|
1927
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
1928
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
1929
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
1930
|
+
partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
|
|
1931
|
+
_request_timeout: Union[
|
|
1932
|
+
None,
|
|
1933
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1934
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1935
|
+
] = None,
|
|
1936
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1937
|
+
_content_type: Optional[StrictStr] = None,
|
|
1938
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1939
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1940
|
+
) -> ApiResponse[UpdateTokenResponse]:
|
|
1941
|
+
"""partial update auth token for shared model use
|
|
1942
|
+
|
|
1943
|
+
partial update auth token for shared model use
|
|
1944
|
+
|
|
1945
|
+
:param region_id: region name (required)
|
|
1946
|
+
:type region_id: str
|
|
1947
|
+
:param project_id: portal project id (required)
|
|
1948
|
+
:type project_id: str
|
|
1949
|
+
:param t_id: token id (required)
|
|
1950
|
+
:type t_id: str
|
|
1951
|
+
:param partial_update_token_payload:
|
|
1952
|
+
:type partial_update_token_payload: PartialUpdateTokenPayload
|
|
1953
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1954
|
+
number provided, it will be total request
|
|
1955
|
+
timeout. It can also be a pair (tuple) of
|
|
1956
|
+
(connection, read) timeouts.
|
|
1957
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1958
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1959
|
+
request; this effectively ignores the
|
|
1960
|
+
authentication in the spec for a single request.
|
|
1961
|
+
:type _request_auth: dict, optional
|
|
1962
|
+
:param _content_type: force content-type for the request.
|
|
1963
|
+
:type _content_type: str, Optional
|
|
1964
|
+
:param _headers: set to override the headers for a single
|
|
1965
|
+
request; this effectively ignores the headers
|
|
1966
|
+
in the spec for a single request.
|
|
1967
|
+
:type _headers: dict, optional
|
|
1968
|
+
:param _host_index: set to override the host_index for a single
|
|
1969
|
+
request; this effectively ignores the host_index
|
|
1970
|
+
in the spec for a single request.
|
|
1971
|
+
:type _host_index: int, optional
|
|
1972
|
+
:return: Returns the result object.
|
|
1973
|
+
""" # noqa: E501 docstring might be too long
|
|
1974
|
+
|
|
1975
|
+
_param = self._partial_update_token_serialize(
|
|
1976
|
+
region_id=region_id,
|
|
1977
|
+
project_id=project_id,
|
|
1978
|
+
t_id=t_id,
|
|
1979
|
+
partial_update_token_payload=partial_update_token_payload,
|
|
1980
|
+
_request_auth=_request_auth,
|
|
1981
|
+
_content_type=_content_type,
|
|
1982
|
+
_headers=_headers,
|
|
1983
|
+
_host_index=_host_index,
|
|
1984
|
+
)
|
|
1985
|
+
|
|
1986
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1987
|
+
"202": "UpdateTokenResponse",
|
|
1988
|
+
"400": "ErrorMessageResponse",
|
|
1989
|
+
"401": "ErrorMessageResponse",
|
|
1990
|
+
"404": "ErrorMessageResponse",
|
|
1991
|
+
"500": "ErrorMessageResponse",
|
|
1992
|
+
}
|
|
1993
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1994
|
+
response_data.read()
|
|
1995
|
+
return self.api_client.response_deserialize(
|
|
1996
|
+
response_data=response_data,
|
|
1997
|
+
response_types_map=_response_types_map,
|
|
1998
|
+
)
|
|
1999
|
+
|
|
2000
|
+
@validate_call
|
|
2001
|
+
def partial_update_token_without_preload_content(
|
|
2002
|
+
self,
|
|
2003
|
+
region_id: Annotated[StrictStr, Field(description="region name")],
|
|
2004
|
+
project_id: Annotated[StrictStr, Field(description="portal project id")],
|
|
2005
|
+
t_id: Annotated[StrictStr, Field(description="token id")],
|
|
2006
|
+
partial_update_token_payload: Optional[PartialUpdateTokenPayload] = None,
|
|
2007
|
+
_request_timeout: Union[
|
|
2008
|
+
None,
|
|
2009
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2010
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
2011
|
+
] = None,
|
|
2012
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2013
|
+
_content_type: Optional[StrictStr] = None,
|
|
2014
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2015
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2016
|
+
) -> RESTResponseType:
|
|
2017
|
+
"""partial update auth token for shared model use
|
|
2018
|
+
|
|
2019
|
+
partial update auth token for shared model use
|
|
2020
|
+
|
|
2021
|
+
:param region_id: region name (required)
|
|
2022
|
+
:type region_id: str
|
|
2023
|
+
:param project_id: portal project id (required)
|
|
2024
|
+
:type project_id: str
|
|
2025
|
+
:param t_id: token id (required)
|
|
2026
|
+
:type t_id: str
|
|
2027
|
+
:param partial_update_token_payload:
|
|
2028
|
+
:type partial_update_token_payload: PartialUpdateTokenPayload
|
|
2029
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2030
|
+
number provided, it will be total request
|
|
2031
|
+
timeout. It can also be a pair (tuple) of
|
|
2032
|
+
(connection, read) timeouts.
|
|
2033
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2034
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2035
|
+
request; this effectively ignores the
|
|
2036
|
+
authentication in the spec for a single request.
|
|
2037
|
+
:type _request_auth: dict, optional
|
|
2038
|
+
:param _content_type: force content-type for the request.
|
|
2039
|
+
:type _content_type: str, Optional
|
|
2040
|
+
:param _headers: set to override the headers for a single
|
|
2041
|
+
request; this effectively ignores the headers
|
|
2042
|
+
in the spec for a single request.
|
|
2043
|
+
:type _headers: dict, optional
|
|
2044
|
+
:param _host_index: set to override the host_index for a single
|
|
2045
|
+
request; this effectively ignores the host_index
|
|
2046
|
+
in the spec for a single request.
|
|
2047
|
+
:type _host_index: int, optional
|
|
2048
|
+
:return: Returns the result object.
|
|
2049
|
+
""" # noqa: E501 docstring might be too long
|
|
2050
|
+
|
|
2051
|
+
_param = self._partial_update_token_serialize(
|
|
2052
|
+
region_id=region_id,
|
|
2053
|
+
project_id=project_id,
|
|
2054
|
+
t_id=t_id,
|
|
2055
|
+
partial_update_token_payload=partial_update_token_payload,
|
|
2056
|
+
_request_auth=_request_auth,
|
|
2057
|
+
_content_type=_content_type,
|
|
2058
|
+
_headers=_headers,
|
|
2059
|
+
_host_index=_host_index,
|
|
2060
|
+
)
|
|
2061
|
+
|
|
2062
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2063
|
+
"202": "UpdateTokenResponse",
|
|
2064
|
+
"400": "ErrorMessageResponse",
|
|
2065
|
+
"401": "ErrorMessageResponse",
|
|
2066
|
+
"404": "ErrorMessageResponse",
|
|
2067
|
+
"500": "ErrorMessageResponse",
|
|
2068
|
+
}
|
|
2069
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
2070
|
+
return response_data.response
|
|
2071
|
+
|
|
2072
|
+
def _partial_update_token_serialize(
|
|
2073
|
+
self,
|
|
2074
|
+
region_id,
|
|
2075
|
+
project_id,
|
|
2076
|
+
t_id,
|
|
2077
|
+
partial_update_token_payload,
|
|
2078
|
+
_request_auth,
|
|
2079
|
+
_content_type,
|
|
2080
|
+
_headers,
|
|
2081
|
+
_host_index,
|
|
2082
|
+
) -> RequestSerialized:
|
|
2083
|
+
|
|
2084
|
+
_host = None
|
|
2085
|
+
|
|
2086
|
+
_collection_formats: Dict[str, str] = {}
|
|
2087
|
+
|
|
2088
|
+
_path_params: Dict[str, str] = {}
|
|
2089
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2090
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2091
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2092
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
|
2093
|
+
_body_params: Optional[bytes] = None
|
|
2094
|
+
|
|
2095
|
+
# process the path parameters
|
|
2096
|
+
if region_id is not None:
|
|
2097
|
+
_path_params["regionId"] = region_id
|
|
2098
|
+
if project_id is not None:
|
|
2099
|
+
_path_params["projectId"] = project_id
|
|
2100
|
+
if t_id is not None:
|
|
2101
|
+
_path_params["tId"] = t_id
|
|
2102
|
+
# process the query parameters
|
|
2103
|
+
# process the header parameters
|
|
2104
|
+
# process the form parameters
|
|
2105
|
+
# process the body parameter
|
|
2106
|
+
if partial_update_token_payload is not None:
|
|
2107
|
+
_body_params = partial_update_token_payload
|
|
2108
|
+
|
|
2109
|
+
# set the HTTP header `Accept`
|
|
2110
|
+
if "Accept" not in _header_params:
|
|
2111
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
2112
|
+
|
|
2113
|
+
# set the HTTP header `Content-Type`
|
|
2114
|
+
if _content_type:
|
|
2115
|
+
_header_params["Content-Type"] = _content_type
|
|
2116
|
+
else:
|
|
2117
|
+
_default_content_type = self.api_client.select_header_content_type(["application/json"])
|
|
2118
|
+
if _default_content_type is not None:
|
|
2119
|
+
_header_params["Content-Type"] = _default_content_type
|
|
2120
|
+
|
|
2121
|
+
# authentication setting
|
|
2122
|
+
_auth_settings: List[str] = []
|
|
2123
|
+
|
|
2124
|
+
return self.api_client.param_serialize(
|
|
2125
|
+
method="PATCH",
|
|
2126
|
+
resource_path="/v1/projects/{projectId}/regions/{regionId}/tokens/{tId}",
|
|
2127
|
+
path_params=_path_params,
|
|
2128
|
+
query_params=_query_params,
|
|
2129
|
+
header_params=_header_params,
|
|
2130
|
+
body=_body_params,
|
|
2131
|
+
post_params=_form_params,
|
|
2132
|
+
files=_files,
|
|
2133
|
+
auth_settings=_auth_settings,
|
|
2134
|
+
collection_formats=_collection_formats,
|
|
2135
|
+
_host=_host,
|
|
2136
|
+
_request_auth=_request_auth,
|
|
2137
|
+
)
|