stackit-modelexperiments 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. src/stackit/modelexperiments/__init__.py +120 -0
  2. src/stackit/modelexperiments/api/__init__.py +4 -0
  3. src/stackit/modelexperiments/api/default_api.py +2913 -0
  4. src/stackit/modelexperiments/api_client.py +651 -0
  5. src/stackit/modelexperiments/api_response.py +23 -0
  6. src/stackit/modelexperiments/configuration.py +164 -0
  7. src/stackit/modelexperiments/exceptions.py +218 -0
  8. src/stackit/modelexperiments/models/__init__.py +61 -0
  9. src/stackit/modelexperiments/models/create_instance_payload.py +141 -0
  10. src/stackit/modelexperiments/models/create_instance_response.py +94 -0
  11. src/stackit/modelexperiments/models/create_instance_token_payload.py +124 -0
  12. src/stackit/modelexperiments/models/create_instance_token_response.py +94 -0
  13. src/stackit/modelexperiments/models/delete_instance_response.py +94 -0
  14. src/stackit/modelexperiments/models/delete_instance_token_response.py +94 -0
  15. src/stackit/modelexperiments/models/error_response.py +85 -0
  16. src/stackit/modelexperiments/models/get_instance_response.py +94 -0
  17. src/stackit/modelexperiments/models/get_instance_token_response.py +94 -0
  18. src/stackit/modelexperiments/models/instance.py +197 -0
  19. src/stackit/modelexperiments/models/list_instance_tokens_response.py +102 -0
  20. src/stackit/modelexperiments/models/list_instances_response.py +102 -0
  21. src/stackit/modelexperiments/models/partial_update_instance_payload.py +144 -0
  22. src/stackit/modelexperiments/models/partial_update_instance_response.py +94 -0
  23. src/stackit/modelexperiments/models/partial_update_instance_token_payload.py +117 -0
  24. src/stackit/modelexperiments/models/partial_update_instance_token_response.py +94 -0
  25. src/stackit/modelexperiments/models/token.py +164 -0
  26. src/stackit/modelexperiments/models/token_metadata.py +143 -0
  27. src/stackit/modelexperiments/models/token_state.py +39 -0
  28. src/stackit/modelexperiments/py.typed +0 -0
  29. src/stackit/modelexperiments/rest.py +165 -0
  30. stackit_modelexperiments-0.1.0.dist-info/METADATA +48 -0
  31. stackit_modelexperiments-0.1.0.dist-info/RECORD +34 -0
  32. stackit_modelexperiments-0.1.0.dist-info/WHEEL +4 -0
  33. stackit_modelexperiments-0.1.0.dist-info/licenses/LICENSE.md +201 -0
  34. stackit_modelexperiments-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
@@ -0,0 +1,2913 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT AI Model Experiments API
5
+
6
+ This API provides endpoints for the STACKIT AI Model Experiments api
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: stackit-model-experiments@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from uuid import UUID
17
+
18
+ from pydantic import (
19
+ Field,
20
+ StrictFloat,
21
+ StrictInt,
22
+ StrictStr,
23
+ validate_call,
24
+ )
25
+ from stackit.core.configuration import Configuration
26
+ from typing_extensions import Annotated
27
+
28
+ from stackit.modelexperiments.api_client import ApiClient, RequestSerialized
29
+ from stackit.modelexperiments.api_response import ApiResponse
30
+ from stackit.modelexperiments.models.create_instance_payload import (
31
+ CreateInstancePayload,
32
+ )
33
+ from stackit.modelexperiments.models.create_instance_response import (
34
+ CreateInstanceResponse,
35
+ )
36
+ from stackit.modelexperiments.models.create_instance_token_payload import (
37
+ CreateInstanceTokenPayload,
38
+ )
39
+ from stackit.modelexperiments.models.create_instance_token_response import (
40
+ CreateInstanceTokenResponse,
41
+ )
42
+ from stackit.modelexperiments.models.delete_instance_response import (
43
+ DeleteInstanceResponse,
44
+ )
45
+ from stackit.modelexperiments.models.delete_instance_token_response import (
46
+ DeleteInstanceTokenResponse,
47
+ )
48
+ from stackit.modelexperiments.models.get_instance_response import GetInstanceResponse
49
+ from stackit.modelexperiments.models.get_instance_token_response import (
50
+ GetInstanceTokenResponse,
51
+ )
52
+ from stackit.modelexperiments.models.list_instance_tokens_response import (
53
+ ListInstanceTokensResponse,
54
+ )
55
+ from stackit.modelexperiments.models.list_instances_response import (
56
+ ListInstancesResponse,
57
+ )
58
+ from stackit.modelexperiments.models.partial_update_instance_payload import (
59
+ PartialUpdateInstancePayload,
60
+ )
61
+ from stackit.modelexperiments.models.partial_update_instance_response import (
62
+ PartialUpdateInstanceResponse,
63
+ )
64
+ from stackit.modelexperiments.models.partial_update_instance_token_payload import (
65
+ PartialUpdateInstanceTokenPayload,
66
+ )
67
+ from stackit.modelexperiments.models.partial_update_instance_token_response import (
68
+ PartialUpdateInstanceTokenResponse,
69
+ )
70
+ from stackit.modelexperiments.rest import RESTResponseType
71
+
72
+
73
+ class DefaultApi:
74
+ """NOTE: This class is auto generated by OpenAPI Generator
75
+ Ref: https://openapi-generator.tech
76
+
77
+ Do not edit the class manually.
78
+ """
79
+
80
+ def __init__(self, configuration: Configuration = None) -> None:
81
+ if configuration is None:
82
+ configuration = Configuration()
83
+ self.configuration = configuration
84
+ self.api_client = ApiClient(self.configuration)
85
+
86
+ @validate_call
87
+ def create_instance(
88
+ self,
89
+ project_id: Annotated[UUID, Field(description="portal project id")],
90
+ region_id: Annotated[StrictStr, Field(description="region id")],
91
+ create_instance_payload: Optional[CreateInstancePayload] = None,
92
+ _request_timeout: Union[
93
+ None,
94
+ Annotated[StrictFloat, Field(gt=0)],
95
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
96
+ ] = None,
97
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
98
+ _content_type: Optional[StrictStr] = None,
99
+ _headers: Optional[Dict[StrictStr, Any]] = None,
100
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
101
+ ) -> CreateInstanceResponse:
102
+ """create an instance in a project
103
+
104
+ create an instance in a project
105
+
106
+ :param project_id: portal project id (required)
107
+ :type project_id: UUID
108
+ :param region_id: region id (required)
109
+ :type region_id: str
110
+ :param create_instance_payload:
111
+ :type create_instance_payload: CreateInstancePayload
112
+ :param _request_timeout: timeout setting for this request. If one
113
+ number provided, it will be total request
114
+ timeout. It can also be a pair (tuple) of
115
+ (connection, read) timeouts.
116
+ :type _request_timeout: int, tuple(int, int), optional
117
+ :param _request_auth: set to override the auth_settings for an a single
118
+ request; this effectively ignores the
119
+ authentication in the spec for a single request.
120
+ :type _request_auth: dict, optional
121
+ :param _content_type: force content-type for the request.
122
+ :type _content_type: str, Optional
123
+ :param _headers: set to override the headers for a single
124
+ request; this effectively ignores the headers
125
+ in the spec for a single request.
126
+ :type _headers: dict, optional
127
+ :param _host_index: set to override the host_index for a single
128
+ request; this effectively ignores the host_index
129
+ in the spec for a single request.
130
+ :type _host_index: int, optional
131
+ :return: Returns the result object.
132
+ """ # noqa: E501
133
+
134
+ _param = self._create_instance_serialize(
135
+ project_id=project_id,
136
+ region_id=region_id,
137
+ create_instance_payload=create_instance_payload,
138
+ _request_auth=_request_auth,
139
+ _content_type=_content_type,
140
+ _headers=_headers,
141
+ _host_index=_host_index,
142
+ )
143
+
144
+ _response_types_map: Dict[str, Optional[str]] = {
145
+ "202": "CreateInstanceResponse",
146
+ "400": "ErrorResponse",
147
+ "401": "ErrorResponse",
148
+ "403": "ErrorResponse",
149
+ "404": "ErrorResponse",
150
+ "429": "ErrorResponse",
151
+ }
152
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
153
+ response_data.read()
154
+ return self.api_client.response_deserialize(
155
+ response_data=response_data,
156
+ response_types_map=_response_types_map,
157
+ ).data
158
+
159
+ @validate_call
160
+ def create_instance_with_http_info(
161
+ self,
162
+ project_id: Annotated[UUID, Field(description="portal project id")],
163
+ region_id: Annotated[StrictStr, Field(description="region id")],
164
+ create_instance_payload: Optional[CreateInstancePayload] = None,
165
+ _request_timeout: Union[
166
+ None,
167
+ Annotated[StrictFloat, Field(gt=0)],
168
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
169
+ ] = None,
170
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
171
+ _content_type: Optional[StrictStr] = None,
172
+ _headers: Optional[Dict[StrictStr, Any]] = None,
173
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
174
+ ) -> ApiResponse[CreateInstanceResponse]:
175
+ """create an instance in a project
176
+
177
+ create an instance in a project
178
+
179
+ :param project_id: portal project id (required)
180
+ :type project_id: UUID
181
+ :param region_id: region id (required)
182
+ :type region_id: str
183
+ :param create_instance_payload:
184
+ :type create_instance_payload: CreateInstancePayload
185
+ :param _request_timeout: timeout setting for this request. If one
186
+ number provided, it will be total request
187
+ timeout. It can also be a pair (tuple) of
188
+ (connection, read) timeouts.
189
+ :type _request_timeout: int, tuple(int, int), optional
190
+ :param _request_auth: set to override the auth_settings for an a single
191
+ request; this effectively ignores the
192
+ authentication in the spec for a single request.
193
+ :type _request_auth: dict, optional
194
+ :param _content_type: force content-type for the request.
195
+ :type _content_type: str, Optional
196
+ :param _headers: set to override the headers for a single
197
+ request; this effectively ignores the headers
198
+ in the spec for a single request.
199
+ :type _headers: dict, optional
200
+ :param _host_index: set to override the host_index for a single
201
+ request; this effectively ignores the host_index
202
+ in the spec for a single request.
203
+ :type _host_index: int, optional
204
+ :return: Returns the result object.
205
+ """ # noqa: E501
206
+
207
+ _param = self._create_instance_serialize(
208
+ project_id=project_id,
209
+ region_id=region_id,
210
+ create_instance_payload=create_instance_payload,
211
+ _request_auth=_request_auth,
212
+ _content_type=_content_type,
213
+ _headers=_headers,
214
+ _host_index=_host_index,
215
+ )
216
+
217
+ _response_types_map: Dict[str, Optional[str]] = {
218
+ "202": "CreateInstanceResponse",
219
+ "400": "ErrorResponse",
220
+ "401": "ErrorResponse",
221
+ "403": "ErrorResponse",
222
+ "404": "ErrorResponse",
223
+ "429": "ErrorResponse",
224
+ }
225
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
226
+ response_data.read()
227
+ return self.api_client.response_deserialize(
228
+ response_data=response_data,
229
+ response_types_map=_response_types_map,
230
+ )
231
+
232
+ @validate_call
233
+ def create_instance_without_preload_content(
234
+ self,
235
+ project_id: Annotated[UUID, Field(description="portal project id")],
236
+ region_id: Annotated[StrictStr, Field(description="region id")],
237
+ create_instance_payload: Optional[CreateInstancePayload] = None,
238
+ _request_timeout: Union[
239
+ None,
240
+ Annotated[StrictFloat, Field(gt=0)],
241
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
242
+ ] = None,
243
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
244
+ _content_type: Optional[StrictStr] = None,
245
+ _headers: Optional[Dict[StrictStr, Any]] = None,
246
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
247
+ ) -> RESTResponseType:
248
+ """create an instance in a project
249
+
250
+ create an instance in a project
251
+
252
+ :param project_id: portal project id (required)
253
+ :type project_id: UUID
254
+ :param region_id: region id (required)
255
+ :type region_id: str
256
+ :param create_instance_payload:
257
+ :type create_instance_payload: CreateInstancePayload
258
+ :param _request_timeout: timeout setting for this request. If one
259
+ number provided, it will be total request
260
+ timeout. It can also be a pair (tuple) of
261
+ (connection, read) timeouts.
262
+ :type _request_timeout: int, tuple(int, int), optional
263
+ :param _request_auth: set to override the auth_settings for an a single
264
+ request; this effectively ignores the
265
+ authentication in the spec for a single request.
266
+ :type _request_auth: dict, optional
267
+ :param _content_type: force content-type for the request.
268
+ :type _content_type: str, Optional
269
+ :param _headers: set to override the headers for a single
270
+ request; this effectively ignores the headers
271
+ in the spec for a single request.
272
+ :type _headers: dict, optional
273
+ :param _host_index: set to override the host_index for a single
274
+ request; this effectively ignores the host_index
275
+ in the spec for a single request.
276
+ :type _host_index: int, optional
277
+ :return: Returns the result object.
278
+ """ # noqa: E501
279
+
280
+ _param = self._create_instance_serialize(
281
+ project_id=project_id,
282
+ region_id=region_id,
283
+ create_instance_payload=create_instance_payload,
284
+ _request_auth=_request_auth,
285
+ _content_type=_content_type,
286
+ _headers=_headers,
287
+ _host_index=_host_index,
288
+ )
289
+
290
+ _response_types_map: Dict[str, Optional[str]] = {
291
+ "202": "CreateInstanceResponse",
292
+ "400": "ErrorResponse",
293
+ "401": "ErrorResponse",
294
+ "403": "ErrorResponse",
295
+ "404": "ErrorResponse",
296
+ "429": "ErrorResponse",
297
+ }
298
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
299
+ return response_data.response
300
+
301
+ def _create_instance_serialize(
302
+ self,
303
+ project_id,
304
+ region_id,
305
+ create_instance_payload,
306
+ _request_auth,
307
+ _content_type,
308
+ _headers,
309
+ _host_index,
310
+ ) -> RequestSerialized:
311
+
312
+ _host = None
313
+
314
+ _collection_formats: Dict[str, str] = {}
315
+
316
+ _path_params: Dict[str, str] = {}
317
+ _query_params: List[Tuple[str, str]] = []
318
+ _header_params: Dict[str, Optional[str]] = _headers or {}
319
+ _form_params: List[Tuple[str, str]] = []
320
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
321
+ _body_params: Optional[bytes] = None
322
+
323
+ # process the path parameters
324
+ if project_id is not None:
325
+ _path_params["projectId"] = project_id
326
+ if region_id is not None:
327
+ _path_params["regionId"] = region_id
328
+ # process the query parameters
329
+ # process the header parameters
330
+ # process the form parameters
331
+ # process the body parameter
332
+ if create_instance_payload is not None:
333
+ _body_params = create_instance_payload
334
+
335
+ # set the HTTP header `Accept`
336
+ if "Accept" not in _header_params:
337
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
338
+
339
+ # set the HTTP header `Content-Type`
340
+ if _content_type:
341
+ _header_params["Content-Type"] = _content_type
342
+ else:
343
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
344
+ if _default_content_type is not None:
345
+ _header_params["Content-Type"] = _default_content_type
346
+
347
+ # authentication setting
348
+ _auth_settings: List[str] = []
349
+
350
+ return self.api_client.param_serialize(
351
+ method="POST",
352
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances",
353
+ path_params=_path_params,
354
+ query_params=_query_params,
355
+ header_params=_header_params,
356
+ body=_body_params,
357
+ post_params=_form_params,
358
+ files=_files,
359
+ auth_settings=_auth_settings,
360
+ collection_formats=_collection_formats,
361
+ _host=_host,
362
+ _request_auth=_request_auth,
363
+ )
364
+
365
+ @validate_call
366
+ def create_instance_token(
367
+ self,
368
+ project_id: Annotated[UUID, Field(description="portal project id")],
369
+ region_id: Annotated[StrictStr, Field(description="region id")],
370
+ instance_id: Annotated[UUID, Field(description="instance id")],
371
+ create_instance_token_payload: Optional[CreateInstanceTokenPayload] = None,
372
+ _request_timeout: Union[
373
+ None,
374
+ Annotated[StrictFloat, Field(gt=0)],
375
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
376
+ ] = None,
377
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
378
+ _content_type: Optional[StrictStr] = None,
379
+ _headers: Optional[Dict[StrictStr, Any]] = None,
380
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
381
+ ) -> CreateInstanceTokenResponse:
382
+ """create an auth token for an instance
383
+
384
+ create an auth token for an instance
385
+
386
+ :param project_id: portal project id (required)
387
+ :type project_id: UUID
388
+ :param region_id: region id (required)
389
+ :type region_id: str
390
+ :param instance_id: instance id (required)
391
+ :type instance_id: UUID
392
+ :param create_instance_token_payload:
393
+ :type create_instance_token_payload: CreateInstanceTokenPayload
394
+ :param _request_timeout: timeout setting for this request. If one
395
+ number provided, it will be total request
396
+ timeout. It can also be a pair (tuple) of
397
+ (connection, read) timeouts.
398
+ :type _request_timeout: int, tuple(int, int), optional
399
+ :param _request_auth: set to override the auth_settings for an a single
400
+ request; this effectively ignores the
401
+ authentication in the spec for a single request.
402
+ :type _request_auth: dict, optional
403
+ :param _content_type: force content-type for the request.
404
+ :type _content_type: str, Optional
405
+ :param _headers: set to override the headers for a single
406
+ request; this effectively ignores the headers
407
+ in the spec for a single request.
408
+ :type _headers: dict, optional
409
+ :param _host_index: set to override the host_index for a single
410
+ request; this effectively ignores the host_index
411
+ in the spec for a single request.
412
+ :type _host_index: int, optional
413
+ :return: Returns the result object.
414
+ """ # noqa: E501
415
+
416
+ _param = self._create_instance_token_serialize(
417
+ project_id=project_id,
418
+ region_id=region_id,
419
+ instance_id=instance_id,
420
+ create_instance_token_payload=create_instance_token_payload,
421
+ _request_auth=_request_auth,
422
+ _content_type=_content_type,
423
+ _headers=_headers,
424
+ _host_index=_host_index,
425
+ )
426
+
427
+ _response_types_map: Dict[str, Optional[str]] = {
428
+ "202": "CreateInstanceTokenResponse",
429
+ "400": "ErrorResponse",
430
+ "401": "ErrorResponse",
431
+ "403": "ErrorResponse",
432
+ "404": "ErrorResponse",
433
+ "429": "ErrorResponse",
434
+ }
435
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
436
+ response_data.read()
437
+ return self.api_client.response_deserialize(
438
+ response_data=response_data,
439
+ response_types_map=_response_types_map,
440
+ ).data
441
+
442
+ @validate_call
443
+ def create_instance_token_with_http_info(
444
+ self,
445
+ project_id: Annotated[UUID, Field(description="portal project id")],
446
+ region_id: Annotated[StrictStr, Field(description="region id")],
447
+ instance_id: Annotated[UUID, Field(description="instance id")],
448
+ create_instance_token_payload: Optional[CreateInstanceTokenPayload] = None,
449
+ _request_timeout: Union[
450
+ None,
451
+ Annotated[StrictFloat, Field(gt=0)],
452
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
453
+ ] = None,
454
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
455
+ _content_type: Optional[StrictStr] = None,
456
+ _headers: Optional[Dict[StrictStr, Any]] = None,
457
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
458
+ ) -> ApiResponse[CreateInstanceTokenResponse]:
459
+ """create an auth token for an instance
460
+
461
+ create an auth token for an instance
462
+
463
+ :param project_id: portal project id (required)
464
+ :type project_id: UUID
465
+ :param region_id: region id (required)
466
+ :type region_id: str
467
+ :param instance_id: instance id (required)
468
+ :type instance_id: UUID
469
+ :param create_instance_token_payload:
470
+ :type create_instance_token_payload: CreateInstanceTokenPayload
471
+ :param _request_timeout: timeout setting for this request. If one
472
+ number provided, it will be total request
473
+ timeout. It can also be a pair (tuple) of
474
+ (connection, read) timeouts.
475
+ :type _request_timeout: int, tuple(int, int), optional
476
+ :param _request_auth: set to override the auth_settings for an a single
477
+ request; this effectively ignores the
478
+ authentication in the spec for a single request.
479
+ :type _request_auth: dict, optional
480
+ :param _content_type: force content-type for the request.
481
+ :type _content_type: str, Optional
482
+ :param _headers: set to override the headers for a single
483
+ request; this effectively ignores the headers
484
+ in the spec for a single request.
485
+ :type _headers: dict, optional
486
+ :param _host_index: set to override the host_index for a single
487
+ request; this effectively ignores the host_index
488
+ in the spec for a single request.
489
+ :type _host_index: int, optional
490
+ :return: Returns the result object.
491
+ """ # noqa: E501
492
+
493
+ _param = self._create_instance_token_serialize(
494
+ project_id=project_id,
495
+ region_id=region_id,
496
+ instance_id=instance_id,
497
+ create_instance_token_payload=create_instance_token_payload,
498
+ _request_auth=_request_auth,
499
+ _content_type=_content_type,
500
+ _headers=_headers,
501
+ _host_index=_host_index,
502
+ )
503
+
504
+ _response_types_map: Dict[str, Optional[str]] = {
505
+ "202": "CreateInstanceTokenResponse",
506
+ "400": "ErrorResponse",
507
+ "401": "ErrorResponse",
508
+ "403": "ErrorResponse",
509
+ "404": "ErrorResponse",
510
+ "429": "ErrorResponse",
511
+ }
512
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
513
+ response_data.read()
514
+ return self.api_client.response_deserialize(
515
+ response_data=response_data,
516
+ response_types_map=_response_types_map,
517
+ )
518
+
519
+ @validate_call
520
+ def create_instance_token_without_preload_content(
521
+ self,
522
+ project_id: Annotated[UUID, Field(description="portal project id")],
523
+ region_id: Annotated[StrictStr, Field(description="region id")],
524
+ instance_id: Annotated[UUID, Field(description="instance id")],
525
+ create_instance_token_payload: Optional[CreateInstanceTokenPayload] = None,
526
+ _request_timeout: Union[
527
+ None,
528
+ Annotated[StrictFloat, Field(gt=0)],
529
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
530
+ ] = None,
531
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
532
+ _content_type: Optional[StrictStr] = None,
533
+ _headers: Optional[Dict[StrictStr, Any]] = None,
534
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
535
+ ) -> RESTResponseType:
536
+ """create an auth token for an instance
537
+
538
+ create an auth token for an instance
539
+
540
+ :param project_id: portal project id (required)
541
+ :type project_id: UUID
542
+ :param region_id: region id (required)
543
+ :type region_id: str
544
+ :param instance_id: instance id (required)
545
+ :type instance_id: UUID
546
+ :param create_instance_token_payload:
547
+ :type create_instance_token_payload: CreateInstanceTokenPayload
548
+ :param _request_timeout: timeout setting for this request. If one
549
+ number provided, it will be total request
550
+ timeout. It can also be a pair (tuple) of
551
+ (connection, read) timeouts.
552
+ :type _request_timeout: int, tuple(int, int), optional
553
+ :param _request_auth: set to override the auth_settings for an a single
554
+ request; this effectively ignores the
555
+ authentication in the spec for a single request.
556
+ :type _request_auth: dict, optional
557
+ :param _content_type: force content-type for the request.
558
+ :type _content_type: str, Optional
559
+ :param _headers: set to override the headers for a single
560
+ request; this effectively ignores the headers
561
+ in the spec for a single request.
562
+ :type _headers: dict, optional
563
+ :param _host_index: set to override the host_index for a single
564
+ request; this effectively ignores the host_index
565
+ in the spec for a single request.
566
+ :type _host_index: int, optional
567
+ :return: Returns the result object.
568
+ """ # noqa: E501
569
+
570
+ _param = self._create_instance_token_serialize(
571
+ project_id=project_id,
572
+ region_id=region_id,
573
+ instance_id=instance_id,
574
+ create_instance_token_payload=create_instance_token_payload,
575
+ _request_auth=_request_auth,
576
+ _content_type=_content_type,
577
+ _headers=_headers,
578
+ _host_index=_host_index,
579
+ )
580
+
581
+ _response_types_map: Dict[str, Optional[str]] = {
582
+ "202": "CreateInstanceTokenResponse",
583
+ "400": "ErrorResponse",
584
+ "401": "ErrorResponse",
585
+ "403": "ErrorResponse",
586
+ "404": "ErrorResponse",
587
+ "429": "ErrorResponse",
588
+ }
589
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
590
+ return response_data.response
591
+
592
+ def _create_instance_token_serialize(
593
+ self,
594
+ project_id,
595
+ region_id,
596
+ instance_id,
597
+ create_instance_token_payload,
598
+ _request_auth,
599
+ _content_type,
600
+ _headers,
601
+ _host_index,
602
+ ) -> RequestSerialized:
603
+
604
+ _host = None
605
+
606
+ _collection_formats: Dict[str, str] = {}
607
+
608
+ _path_params: Dict[str, str] = {}
609
+ _query_params: List[Tuple[str, str]] = []
610
+ _header_params: Dict[str, Optional[str]] = _headers or {}
611
+ _form_params: List[Tuple[str, str]] = []
612
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
613
+ _body_params: Optional[bytes] = None
614
+
615
+ # process the path parameters
616
+ if project_id is not None:
617
+ _path_params["projectId"] = project_id
618
+ if region_id is not None:
619
+ _path_params["regionId"] = region_id
620
+ if instance_id is not None:
621
+ _path_params["instanceId"] = instance_id
622
+ # process the query parameters
623
+ # process the header parameters
624
+ # process the form parameters
625
+ # process the body parameter
626
+ if create_instance_token_payload is not None:
627
+ _body_params = create_instance_token_payload
628
+
629
+ # set the HTTP header `Accept`
630
+ if "Accept" not in _header_params:
631
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
632
+
633
+ # set the HTTP header `Content-Type`
634
+ if _content_type:
635
+ _header_params["Content-Type"] = _content_type
636
+ else:
637
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
638
+ if _default_content_type is not None:
639
+ _header_params["Content-Type"] = _default_content_type
640
+
641
+ # authentication setting
642
+ _auth_settings: List[str] = []
643
+
644
+ return self.api_client.param_serialize(
645
+ method="POST",
646
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/tokens",
647
+ path_params=_path_params,
648
+ query_params=_query_params,
649
+ header_params=_header_params,
650
+ body=_body_params,
651
+ post_params=_form_params,
652
+ files=_files,
653
+ auth_settings=_auth_settings,
654
+ collection_formats=_collection_formats,
655
+ _host=_host,
656
+ _request_auth=_request_auth,
657
+ )
658
+
659
+ @validate_call
660
+ def delete_instance(
661
+ self,
662
+ project_id: Annotated[UUID, Field(description="portal project id")],
663
+ region_id: Annotated[StrictStr, Field(description="region id")],
664
+ instance_id: Annotated[UUID, Field(description="instance id")],
665
+ _request_timeout: Union[
666
+ None,
667
+ Annotated[StrictFloat, Field(gt=0)],
668
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
669
+ ] = None,
670
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
671
+ _content_type: Optional[StrictStr] = None,
672
+ _headers: Optional[Dict[StrictStr, Any]] = None,
673
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
674
+ ) -> DeleteInstanceResponse:
675
+ """delete an instance in a project
676
+
677
+ delete an instance in a project
678
+
679
+ :param project_id: portal project id (required)
680
+ :type project_id: UUID
681
+ :param region_id: region id (required)
682
+ :type region_id: str
683
+ :param instance_id: instance id (required)
684
+ :type instance_id: UUID
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
706
+
707
+ _param = self._delete_instance_serialize(
708
+ project_id=project_id,
709
+ region_id=region_id,
710
+ instance_id=instance_id,
711
+ _request_auth=_request_auth,
712
+ _content_type=_content_type,
713
+ _headers=_headers,
714
+ _host_index=_host_index,
715
+ )
716
+
717
+ _response_types_map: Dict[str, Optional[str]] = {
718
+ "202": "DeleteInstanceResponse",
719
+ "400": "ErrorResponse",
720
+ "401": "ErrorResponse",
721
+ "403": "ErrorResponse",
722
+ "404": "ErrorResponse",
723
+ "409": "ErrorResponse",
724
+ "429": "ErrorResponse",
725
+ }
726
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
727
+ response_data.read()
728
+ return self.api_client.response_deserialize(
729
+ response_data=response_data,
730
+ response_types_map=_response_types_map,
731
+ ).data
732
+
733
+ @validate_call
734
+ def delete_instance_with_http_info(
735
+ self,
736
+ project_id: Annotated[UUID, Field(description="portal project id")],
737
+ region_id: Annotated[StrictStr, Field(description="region id")],
738
+ instance_id: Annotated[UUID, Field(description="instance id")],
739
+ _request_timeout: Union[
740
+ None,
741
+ Annotated[StrictFloat, Field(gt=0)],
742
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
743
+ ] = None,
744
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
745
+ _content_type: Optional[StrictStr] = None,
746
+ _headers: Optional[Dict[StrictStr, Any]] = None,
747
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
748
+ ) -> ApiResponse[DeleteInstanceResponse]:
749
+ """delete an instance in a project
750
+
751
+ delete an instance in a project
752
+
753
+ :param project_id: portal project id (required)
754
+ :type project_id: UUID
755
+ :param region_id: region id (required)
756
+ :type region_id: str
757
+ :param instance_id: instance id (required)
758
+ :type instance_id: UUID
759
+ :param _request_timeout: timeout setting for this request. If one
760
+ number provided, it will be total request
761
+ timeout. It can also be a pair (tuple) of
762
+ (connection, read) timeouts.
763
+ :type _request_timeout: int, tuple(int, int), optional
764
+ :param _request_auth: set to override the auth_settings for an a single
765
+ request; this effectively ignores the
766
+ authentication in the spec for a single request.
767
+ :type _request_auth: dict, optional
768
+ :param _content_type: force content-type for the request.
769
+ :type _content_type: str, Optional
770
+ :param _headers: set to override the headers for a single
771
+ request; this effectively ignores the headers
772
+ in the spec for a single request.
773
+ :type _headers: dict, optional
774
+ :param _host_index: set to override the host_index for a single
775
+ request; this effectively ignores the host_index
776
+ in the spec for a single request.
777
+ :type _host_index: int, optional
778
+ :return: Returns the result object.
779
+ """ # noqa: E501
780
+
781
+ _param = self._delete_instance_serialize(
782
+ project_id=project_id,
783
+ region_id=region_id,
784
+ instance_id=instance_id,
785
+ _request_auth=_request_auth,
786
+ _content_type=_content_type,
787
+ _headers=_headers,
788
+ _host_index=_host_index,
789
+ )
790
+
791
+ _response_types_map: Dict[str, Optional[str]] = {
792
+ "202": "DeleteInstanceResponse",
793
+ "400": "ErrorResponse",
794
+ "401": "ErrorResponse",
795
+ "403": "ErrorResponse",
796
+ "404": "ErrorResponse",
797
+ "409": "ErrorResponse",
798
+ "429": "ErrorResponse",
799
+ }
800
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
801
+ response_data.read()
802
+ return self.api_client.response_deserialize(
803
+ response_data=response_data,
804
+ response_types_map=_response_types_map,
805
+ )
806
+
807
+ @validate_call
808
+ def delete_instance_without_preload_content(
809
+ self,
810
+ project_id: Annotated[UUID, Field(description="portal project id")],
811
+ region_id: Annotated[StrictStr, Field(description="region id")],
812
+ instance_id: Annotated[UUID, Field(description="instance id")],
813
+ _request_timeout: Union[
814
+ None,
815
+ Annotated[StrictFloat, Field(gt=0)],
816
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
817
+ ] = None,
818
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
819
+ _content_type: Optional[StrictStr] = None,
820
+ _headers: Optional[Dict[StrictStr, Any]] = None,
821
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
822
+ ) -> RESTResponseType:
823
+ """delete an instance in a project
824
+
825
+ delete an instance in a project
826
+
827
+ :param project_id: portal project id (required)
828
+ :type project_id: UUID
829
+ :param region_id: region id (required)
830
+ :type region_id: str
831
+ :param instance_id: instance id (required)
832
+ :type instance_id: UUID
833
+ :param _request_timeout: timeout setting for this request. If one
834
+ number provided, it will be total request
835
+ timeout. It can also be a pair (tuple) of
836
+ (connection, read) timeouts.
837
+ :type _request_timeout: int, tuple(int, int), optional
838
+ :param _request_auth: set to override the auth_settings for an a single
839
+ request; this effectively ignores the
840
+ authentication in the spec for a single request.
841
+ :type _request_auth: dict, optional
842
+ :param _content_type: force content-type for the request.
843
+ :type _content_type: str, Optional
844
+ :param _headers: set to override the headers for a single
845
+ request; this effectively ignores the headers
846
+ in the spec for a single request.
847
+ :type _headers: dict, optional
848
+ :param _host_index: set to override the host_index for a single
849
+ request; this effectively ignores the host_index
850
+ in the spec for a single request.
851
+ :type _host_index: int, optional
852
+ :return: Returns the result object.
853
+ """ # noqa: E501
854
+
855
+ _param = self._delete_instance_serialize(
856
+ project_id=project_id,
857
+ region_id=region_id,
858
+ instance_id=instance_id,
859
+ _request_auth=_request_auth,
860
+ _content_type=_content_type,
861
+ _headers=_headers,
862
+ _host_index=_host_index,
863
+ )
864
+
865
+ _response_types_map: Dict[str, Optional[str]] = {
866
+ "202": "DeleteInstanceResponse",
867
+ "400": "ErrorResponse",
868
+ "401": "ErrorResponse",
869
+ "403": "ErrorResponse",
870
+ "404": "ErrorResponse",
871
+ "409": "ErrorResponse",
872
+ "429": "ErrorResponse",
873
+ }
874
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
875
+ return response_data.response
876
+
877
+ def _delete_instance_serialize(
878
+ self,
879
+ project_id,
880
+ region_id,
881
+ instance_id,
882
+ _request_auth,
883
+ _content_type,
884
+ _headers,
885
+ _host_index,
886
+ ) -> RequestSerialized:
887
+
888
+ _host = None
889
+
890
+ _collection_formats: Dict[str, str] = {}
891
+
892
+ _path_params: Dict[str, str] = {}
893
+ _query_params: List[Tuple[str, str]] = []
894
+ _header_params: Dict[str, Optional[str]] = _headers or {}
895
+ _form_params: List[Tuple[str, str]] = []
896
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
897
+ _body_params: Optional[bytes] = None
898
+
899
+ # process the path parameters
900
+ if project_id is not None:
901
+ _path_params["projectId"] = project_id
902
+ if region_id is not None:
903
+ _path_params["regionId"] = region_id
904
+ if instance_id is not None:
905
+ _path_params["instanceId"] = instance_id
906
+ # process the query parameters
907
+ # process the header parameters
908
+ # process the form parameters
909
+ # process the body parameter
910
+
911
+ # set the HTTP header `Accept`
912
+ if "Accept" not in _header_params:
913
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
914
+
915
+ # authentication setting
916
+ _auth_settings: List[str] = []
917
+
918
+ return self.api_client.param_serialize(
919
+ method="DELETE",
920
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}",
921
+ path_params=_path_params,
922
+ query_params=_query_params,
923
+ header_params=_header_params,
924
+ body=_body_params,
925
+ post_params=_form_params,
926
+ files=_files,
927
+ auth_settings=_auth_settings,
928
+ collection_formats=_collection_formats,
929
+ _host=_host,
930
+ _request_auth=_request_auth,
931
+ )
932
+
933
+ @validate_call
934
+ def delete_instance_token(
935
+ self,
936
+ project_id: Annotated[UUID, Field(description="portal project id")],
937
+ region_id: Annotated[StrictStr, Field(description="region id")],
938
+ token_id: Annotated[UUID, Field(description="token id")],
939
+ instance_id: Annotated[UUID, Field(description="instance id")],
940
+ _request_timeout: Union[
941
+ None,
942
+ Annotated[StrictFloat, Field(gt=0)],
943
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
944
+ ] = None,
945
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
946
+ _content_type: Optional[StrictStr] = None,
947
+ _headers: Optional[Dict[StrictStr, Any]] = None,
948
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
949
+ ) -> DeleteInstanceTokenResponse:
950
+ """delete an auth token in an instance
951
+
952
+ delete an auth token in an instance
953
+
954
+ :param project_id: portal project id (required)
955
+ :type project_id: UUID
956
+ :param region_id: region id (required)
957
+ :type region_id: str
958
+ :param token_id: token id (required)
959
+ :type token_id: UUID
960
+ :param instance_id: instance id (required)
961
+ :type instance_id: UUID
962
+ :param _request_timeout: timeout setting for this request. If one
963
+ number provided, it will be total request
964
+ timeout. It can also be a pair (tuple) of
965
+ (connection, read) timeouts.
966
+ :type _request_timeout: int, tuple(int, int), optional
967
+ :param _request_auth: set to override the auth_settings for an a single
968
+ request; this effectively ignores the
969
+ authentication in the spec for a single request.
970
+ :type _request_auth: dict, optional
971
+ :param _content_type: force content-type for the request.
972
+ :type _content_type: str, Optional
973
+ :param _headers: set to override the headers for a single
974
+ request; this effectively ignores the headers
975
+ in the spec for a single request.
976
+ :type _headers: dict, optional
977
+ :param _host_index: set to override the host_index for a single
978
+ request; this effectively ignores the host_index
979
+ in the spec for a single request.
980
+ :type _host_index: int, optional
981
+ :return: Returns the result object.
982
+ """ # noqa: E501
983
+
984
+ _param = self._delete_instance_token_serialize(
985
+ project_id=project_id,
986
+ region_id=region_id,
987
+ token_id=token_id,
988
+ instance_id=instance_id,
989
+ _request_auth=_request_auth,
990
+ _content_type=_content_type,
991
+ _headers=_headers,
992
+ _host_index=_host_index,
993
+ )
994
+
995
+ _response_types_map: Dict[str, Optional[str]] = {
996
+ "202": "DeleteInstanceTokenResponse",
997
+ "400": "ErrorResponse",
998
+ "401": "ErrorResponse",
999
+ "403": "ErrorResponse",
1000
+ "404": "ErrorResponse",
1001
+ "409": "ErrorResponse",
1002
+ "429": "ErrorResponse",
1003
+ }
1004
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1005
+ response_data.read()
1006
+ return self.api_client.response_deserialize(
1007
+ response_data=response_data,
1008
+ response_types_map=_response_types_map,
1009
+ ).data
1010
+
1011
+ @validate_call
1012
+ def delete_instance_token_with_http_info(
1013
+ self,
1014
+ project_id: Annotated[UUID, Field(description="portal project id")],
1015
+ region_id: Annotated[StrictStr, Field(description="region id")],
1016
+ token_id: Annotated[UUID, Field(description="token id")],
1017
+ instance_id: Annotated[UUID, Field(description="instance id")],
1018
+ _request_timeout: Union[
1019
+ None,
1020
+ Annotated[StrictFloat, Field(gt=0)],
1021
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1022
+ ] = None,
1023
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1024
+ _content_type: Optional[StrictStr] = None,
1025
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1026
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1027
+ ) -> ApiResponse[DeleteInstanceTokenResponse]:
1028
+ """delete an auth token in an instance
1029
+
1030
+ delete an auth token in an instance
1031
+
1032
+ :param project_id: portal project id (required)
1033
+ :type project_id: UUID
1034
+ :param region_id: region id (required)
1035
+ :type region_id: str
1036
+ :param token_id: token id (required)
1037
+ :type token_id: UUID
1038
+ :param instance_id: instance id (required)
1039
+ :type instance_id: UUID
1040
+ :param _request_timeout: timeout setting for this request. If one
1041
+ number provided, it will be total request
1042
+ timeout. It can also be a pair (tuple) of
1043
+ (connection, read) timeouts.
1044
+ :type _request_timeout: int, tuple(int, int), optional
1045
+ :param _request_auth: set to override the auth_settings for an a single
1046
+ request; this effectively ignores the
1047
+ authentication in the spec for a single request.
1048
+ :type _request_auth: dict, optional
1049
+ :param _content_type: force content-type for the request.
1050
+ :type _content_type: str, Optional
1051
+ :param _headers: set to override the headers for a single
1052
+ request; this effectively ignores the headers
1053
+ in the spec for a single request.
1054
+ :type _headers: dict, optional
1055
+ :param _host_index: set to override the host_index for a single
1056
+ request; this effectively ignores the host_index
1057
+ in the spec for a single request.
1058
+ :type _host_index: int, optional
1059
+ :return: Returns the result object.
1060
+ """ # noqa: E501
1061
+
1062
+ _param = self._delete_instance_token_serialize(
1063
+ project_id=project_id,
1064
+ region_id=region_id,
1065
+ token_id=token_id,
1066
+ instance_id=instance_id,
1067
+ _request_auth=_request_auth,
1068
+ _content_type=_content_type,
1069
+ _headers=_headers,
1070
+ _host_index=_host_index,
1071
+ )
1072
+
1073
+ _response_types_map: Dict[str, Optional[str]] = {
1074
+ "202": "DeleteInstanceTokenResponse",
1075
+ "400": "ErrorResponse",
1076
+ "401": "ErrorResponse",
1077
+ "403": "ErrorResponse",
1078
+ "404": "ErrorResponse",
1079
+ "409": "ErrorResponse",
1080
+ "429": "ErrorResponse",
1081
+ }
1082
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1083
+ response_data.read()
1084
+ return self.api_client.response_deserialize(
1085
+ response_data=response_data,
1086
+ response_types_map=_response_types_map,
1087
+ )
1088
+
1089
+ @validate_call
1090
+ def delete_instance_token_without_preload_content(
1091
+ self,
1092
+ project_id: Annotated[UUID, Field(description="portal project id")],
1093
+ region_id: Annotated[StrictStr, Field(description="region id")],
1094
+ token_id: Annotated[UUID, Field(description="token id")],
1095
+ instance_id: Annotated[UUID, Field(description="instance id")],
1096
+ _request_timeout: Union[
1097
+ None,
1098
+ Annotated[StrictFloat, Field(gt=0)],
1099
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1100
+ ] = None,
1101
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1102
+ _content_type: Optional[StrictStr] = None,
1103
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1104
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1105
+ ) -> RESTResponseType:
1106
+ """delete an auth token in an instance
1107
+
1108
+ delete an auth token in an instance
1109
+
1110
+ :param project_id: portal project id (required)
1111
+ :type project_id: UUID
1112
+ :param region_id: region id (required)
1113
+ :type region_id: str
1114
+ :param token_id: token id (required)
1115
+ :type token_id: UUID
1116
+ :param instance_id: instance id (required)
1117
+ :type instance_id: UUID
1118
+ :param _request_timeout: timeout setting for this request. If one
1119
+ number provided, it will be total request
1120
+ timeout. It can also be a pair (tuple) of
1121
+ (connection, read) timeouts.
1122
+ :type _request_timeout: int, tuple(int, int), optional
1123
+ :param _request_auth: set to override the auth_settings for an a single
1124
+ request; this effectively ignores the
1125
+ authentication in the spec for a single request.
1126
+ :type _request_auth: dict, optional
1127
+ :param _content_type: force content-type for the request.
1128
+ :type _content_type: str, Optional
1129
+ :param _headers: set to override the headers for a single
1130
+ request; this effectively ignores the headers
1131
+ in the spec for a single request.
1132
+ :type _headers: dict, optional
1133
+ :param _host_index: set to override the host_index for a single
1134
+ request; this effectively ignores the host_index
1135
+ in the spec for a single request.
1136
+ :type _host_index: int, optional
1137
+ :return: Returns the result object.
1138
+ """ # noqa: E501
1139
+
1140
+ _param = self._delete_instance_token_serialize(
1141
+ project_id=project_id,
1142
+ region_id=region_id,
1143
+ token_id=token_id,
1144
+ instance_id=instance_id,
1145
+ _request_auth=_request_auth,
1146
+ _content_type=_content_type,
1147
+ _headers=_headers,
1148
+ _host_index=_host_index,
1149
+ )
1150
+
1151
+ _response_types_map: Dict[str, Optional[str]] = {
1152
+ "202": "DeleteInstanceTokenResponse",
1153
+ "400": "ErrorResponse",
1154
+ "401": "ErrorResponse",
1155
+ "403": "ErrorResponse",
1156
+ "404": "ErrorResponse",
1157
+ "409": "ErrorResponse",
1158
+ "429": "ErrorResponse",
1159
+ }
1160
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1161
+ return response_data.response
1162
+
1163
+ def _delete_instance_token_serialize(
1164
+ self,
1165
+ project_id,
1166
+ region_id,
1167
+ token_id,
1168
+ instance_id,
1169
+ _request_auth,
1170
+ _content_type,
1171
+ _headers,
1172
+ _host_index,
1173
+ ) -> RequestSerialized:
1174
+
1175
+ _host = None
1176
+
1177
+ _collection_formats: Dict[str, str] = {}
1178
+
1179
+ _path_params: Dict[str, str] = {}
1180
+ _query_params: List[Tuple[str, str]] = []
1181
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1182
+ _form_params: List[Tuple[str, str]] = []
1183
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1184
+ _body_params: Optional[bytes] = None
1185
+
1186
+ # process the path parameters
1187
+ if project_id is not None:
1188
+ _path_params["projectId"] = project_id
1189
+ if region_id is not None:
1190
+ _path_params["regionId"] = region_id
1191
+ if token_id is not None:
1192
+ _path_params["tokenId"] = token_id
1193
+ if instance_id is not None:
1194
+ _path_params["instanceId"] = instance_id
1195
+ # process the query parameters
1196
+ # process the header parameters
1197
+ # process the form parameters
1198
+ # process the body parameter
1199
+
1200
+ # set the HTTP header `Accept`
1201
+ if "Accept" not in _header_params:
1202
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1203
+
1204
+ # authentication setting
1205
+ _auth_settings: List[str] = []
1206
+
1207
+ return self.api_client.param_serialize(
1208
+ method="DELETE",
1209
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/tokens/{tokenId}",
1210
+ path_params=_path_params,
1211
+ query_params=_query_params,
1212
+ header_params=_header_params,
1213
+ body=_body_params,
1214
+ post_params=_form_params,
1215
+ files=_files,
1216
+ auth_settings=_auth_settings,
1217
+ collection_formats=_collection_formats,
1218
+ _host=_host,
1219
+ _request_auth=_request_auth,
1220
+ )
1221
+
1222
+ @validate_call
1223
+ def get_instance(
1224
+ self,
1225
+ project_id: Annotated[UUID, Field(description="portal project id")],
1226
+ region_id: Annotated[StrictStr, Field(description="region id")],
1227
+ instance_id: Annotated[UUID, Field(description="instance id")],
1228
+ _request_timeout: Union[
1229
+ None,
1230
+ Annotated[StrictFloat, Field(gt=0)],
1231
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1232
+ ] = None,
1233
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1234
+ _content_type: Optional[StrictStr] = None,
1235
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1236
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1237
+ ) -> GetInstanceResponse:
1238
+ """get an instance in a project
1239
+
1240
+ get an instance in a project
1241
+
1242
+ :param project_id: portal project id (required)
1243
+ :type project_id: UUID
1244
+ :param region_id: region id (required)
1245
+ :type region_id: str
1246
+ :param instance_id: instance id (required)
1247
+ :type instance_id: UUID
1248
+ :param _request_timeout: timeout setting for this request. If one
1249
+ number provided, it will be total request
1250
+ timeout. It can also be a pair (tuple) of
1251
+ (connection, read) timeouts.
1252
+ :type _request_timeout: int, tuple(int, int), optional
1253
+ :param _request_auth: set to override the auth_settings for an a single
1254
+ request; this effectively ignores the
1255
+ authentication in the spec for a single request.
1256
+ :type _request_auth: dict, optional
1257
+ :param _content_type: force content-type for the request.
1258
+ :type _content_type: str, Optional
1259
+ :param _headers: set to override the headers for a single
1260
+ request; this effectively ignores the headers
1261
+ in the spec for a single request.
1262
+ :type _headers: dict, optional
1263
+ :param _host_index: set to override the host_index for a single
1264
+ request; this effectively ignores the host_index
1265
+ in the spec for a single request.
1266
+ :type _host_index: int, optional
1267
+ :return: Returns the result object.
1268
+ """ # noqa: E501
1269
+
1270
+ _param = self._get_instance_serialize(
1271
+ project_id=project_id,
1272
+ region_id=region_id,
1273
+ instance_id=instance_id,
1274
+ _request_auth=_request_auth,
1275
+ _content_type=_content_type,
1276
+ _headers=_headers,
1277
+ _host_index=_host_index,
1278
+ )
1279
+
1280
+ _response_types_map: Dict[str, Optional[str]] = {
1281
+ "200": "GetInstanceResponse",
1282
+ "400": "ErrorResponse",
1283
+ "401": "ErrorResponse",
1284
+ "403": "ErrorResponse",
1285
+ "404": "ErrorResponse",
1286
+ "429": "ErrorResponse",
1287
+ }
1288
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1289
+ response_data.read()
1290
+ return self.api_client.response_deserialize(
1291
+ response_data=response_data,
1292
+ response_types_map=_response_types_map,
1293
+ ).data
1294
+
1295
+ @validate_call
1296
+ def get_instance_with_http_info(
1297
+ self,
1298
+ project_id: Annotated[UUID, Field(description="portal project id")],
1299
+ region_id: Annotated[StrictStr, Field(description="region id")],
1300
+ instance_id: Annotated[UUID, Field(description="instance id")],
1301
+ _request_timeout: Union[
1302
+ None,
1303
+ Annotated[StrictFloat, Field(gt=0)],
1304
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1305
+ ] = None,
1306
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1307
+ _content_type: Optional[StrictStr] = None,
1308
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1309
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1310
+ ) -> ApiResponse[GetInstanceResponse]:
1311
+ """get an instance in a project
1312
+
1313
+ get an instance in a project
1314
+
1315
+ :param project_id: portal project id (required)
1316
+ :type project_id: UUID
1317
+ :param region_id: region id (required)
1318
+ :type region_id: str
1319
+ :param instance_id: instance id (required)
1320
+ :type instance_id: UUID
1321
+ :param _request_timeout: timeout setting for this request. If one
1322
+ number provided, it will be total request
1323
+ timeout. It can also be a pair (tuple) of
1324
+ (connection, read) timeouts.
1325
+ :type _request_timeout: int, tuple(int, int), optional
1326
+ :param _request_auth: set to override the auth_settings for an a single
1327
+ request; this effectively ignores the
1328
+ authentication in the spec for a single request.
1329
+ :type _request_auth: dict, optional
1330
+ :param _content_type: force content-type for the request.
1331
+ :type _content_type: str, Optional
1332
+ :param _headers: set to override the headers for a single
1333
+ request; this effectively ignores the headers
1334
+ in the spec for a single request.
1335
+ :type _headers: dict, optional
1336
+ :param _host_index: set to override the host_index for a single
1337
+ request; this effectively ignores the host_index
1338
+ in the spec for a single request.
1339
+ :type _host_index: int, optional
1340
+ :return: Returns the result object.
1341
+ """ # noqa: E501
1342
+
1343
+ _param = self._get_instance_serialize(
1344
+ project_id=project_id,
1345
+ region_id=region_id,
1346
+ instance_id=instance_id,
1347
+ _request_auth=_request_auth,
1348
+ _content_type=_content_type,
1349
+ _headers=_headers,
1350
+ _host_index=_host_index,
1351
+ )
1352
+
1353
+ _response_types_map: Dict[str, Optional[str]] = {
1354
+ "200": "GetInstanceResponse",
1355
+ "400": "ErrorResponse",
1356
+ "401": "ErrorResponse",
1357
+ "403": "ErrorResponse",
1358
+ "404": "ErrorResponse",
1359
+ "429": "ErrorResponse",
1360
+ }
1361
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1362
+ response_data.read()
1363
+ return self.api_client.response_deserialize(
1364
+ response_data=response_data,
1365
+ response_types_map=_response_types_map,
1366
+ )
1367
+
1368
+ @validate_call
1369
+ def get_instance_without_preload_content(
1370
+ self,
1371
+ project_id: Annotated[UUID, Field(description="portal project id")],
1372
+ region_id: Annotated[StrictStr, Field(description="region id")],
1373
+ instance_id: Annotated[UUID, Field(description="instance id")],
1374
+ _request_timeout: Union[
1375
+ None,
1376
+ Annotated[StrictFloat, Field(gt=0)],
1377
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1378
+ ] = None,
1379
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1380
+ _content_type: Optional[StrictStr] = None,
1381
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1382
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1383
+ ) -> RESTResponseType:
1384
+ """get an instance in a project
1385
+
1386
+ get an instance in a project
1387
+
1388
+ :param project_id: portal project id (required)
1389
+ :type project_id: UUID
1390
+ :param region_id: region id (required)
1391
+ :type region_id: str
1392
+ :param instance_id: instance id (required)
1393
+ :type instance_id: UUID
1394
+ :param _request_timeout: timeout setting for this request. If one
1395
+ number provided, it will be total request
1396
+ timeout. It can also be a pair (tuple) of
1397
+ (connection, read) timeouts.
1398
+ :type _request_timeout: int, tuple(int, int), optional
1399
+ :param _request_auth: set to override the auth_settings for an a single
1400
+ request; this effectively ignores the
1401
+ authentication in the spec for a single request.
1402
+ :type _request_auth: dict, optional
1403
+ :param _content_type: force content-type for the request.
1404
+ :type _content_type: str, Optional
1405
+ :param _headers: set to override the headers for a single
1406
+ request; this effectively ignores the headers
1407
+ in the spec for a single request.
1408
+ :type _headers: dict, optional
1409
+ :param _host_index: set to override the host_index for a single
1410
+ request; this effectively ignores the host_index
1411
+ in the spec for a single request.
1412
+ :type _host_index: int, optional
1413
+ :return: Returns the result object.
1414
+ """ # noqa: E501
1415
+
1416
+ _param = self._get_instance_serialize(
1417
+ project_id=project_id,
1418
+ region_id=region_id,
1419
+ instance_id=instance_id,
1420
+ _request_auth=_request_auth,
1421
+ _content_type=_content_type,
1422
+ _headers=_headers,
1423
+ _host_index=_host_index,
1424
+ )
1425
+
1426
+ _response_types_map: Dict[str, Optional[str]] = {
1427
+ "200": "GetInstanceResponse",
1428
+ "400": "ErrorResponse",
1429
+ "401": "ErrorResponse",
1430
+ "403": "ErrorResponse",
1431
+ "404": "ErrorResponse",
1432
+ "429": "ErrorResponse",
1433
+ }
1434
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1435
+ return response_data.response
1436
+
1437
+ def _get_instance_serialize(
1438
+ self,
1439
+ project_id,
1440
+ region_id,
1441
+ instance_id,
1442
+ _request_auth,
1443
+ _content_type,
1444
+ _headers,
1445
+ _host_index,
1446
+ ) -> RequestSerialized:
1447
+
1448
+ _host = None
1449
+
1450
+ _collection_formats: Dict[str, str] = {}
1451
+
1452
+ _path_params: Dict[str, str] = {}
1453
+ _query_params: List[Tuple[str, str]] = []
1454
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1455
+ _form_params: List[Tuple[str, str]] = []
1456
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1457
+ _body_params: Optional[bytes] = None
1458
+
1459
+ # process the path parameters
1460
+ if project_id is not None:
1461
+ _path_params["projectId"] = project_id
1462
+ if region_id is not None:
1463
+ _path_params["regionId"] = region_id
1464
+ if instance_id is not None:
1465
+ _path_params["instanceId"] = instance_id
1466
+ # process the query parameters
1467
+ # process the header parameters
1468
+ # process the form parameters
1469
+ # process the body parameter
1470
+
1471
+ # set the HTTP header `Accept`
1472
+ if "Accept" not in _header_params:
1473
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1474
+
1475
+ # authentication setting
1476
+ _auth_settings: List[str] = []
1477
+
1478
+ return self.api_client.param_serialize(
1479
+ method="GET",
1480
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}",
1481
+ path_params=_path_params,
1482
+ query_params=_query_params,
1483
+ header_params=_header_params,
1484
+ body=_body_params,
1485
+ post_params=_form_params,
1486
+ files=_files,
1487
+ auth_settings=_auth_settings,
1488
+ collection_formats=_collection_formats,
1489
+ _host=_host,
1490
+ _request_auth=_request_auth,
1491
+ )
1492
+
1493
+ @validate_call
1494
+ def get_instance_token(
1495
+ self,
1496
+ project_id: Annotated[UUID, Field(description="portal project id")],
1497
+ region_id: Annotated[StrictStr, Field(description="region id")],
1498
+ token_id: Annotated[UUID, Field(description="token id")],
1499
+ instance_id: Annotated[UUID, Field(description="instance id")],
1500
+ _request_timeout: Union[
1501
+ None,
1502
+ Annotated[StrictFloat, Field(gt=0)],
1503
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1504
+ ] = None,
1505
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1506
+ _content_type: Optional[StrictStr] = None,
1507
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1508
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1509
+ ) -> GetInstanceTokenResponse:
1510
+ """get an auth token for an instance
1511
+
1512
+ get an auth token for an instance
1513
+
1514
+ :param project_id: portal project id (required)
1515
+ :type project_id: UUID
1516
+ :param region_id: region id (required)
1517
+ :type region_id: str
1518
+ :param token_id: token id (required)
1519
+ :type token_id: UUID
1520
+ :param instance_id: instance id (required)
1521
+ :type instance_id: UUID
1522
+ :param _request_timeout: timeout setting for this request. If one
1523
+ number provided, it will be total request
1524
+ timeout. It can also be a pair (tuple) of
1525
+ (connection, read) timeouts.
1526
+ :type _request_timeout: int, tuple(int, int), optional
1527
+ :param _request_auth: set to override the auth_settings for an a single
1528
+ request; this effectively ignores the
1529
+ authentication in the spec for a single request.
1530
+ :type _request_auth: dict, optional
1531
+ :param _content_type: force content-type for the request.
1532
+ :type _content_type: str, Optional
1533
+ :param _headers: set to override the headers for a single
1534
+ request; this effectively ignores the headers
1535
+ in the spec for a single request.
1536
+ :type _headers: dict, optional
1537
+ :param _host_index: set to override the host_index for a single
1538
+ request; this effectively ignores the host_index
1539
+ in the spec for a single request.
1540
+ :type _host_index: int, optional
1541
+ :return: Returns the result object.
1542
+ """ # noqa: E501
1543
+
1544
+ _param = self._get_instance_token_serialize(
1545
+ project_id=project_id,
1546
+ region_id=region_id,
1547
+ token_id=token_id,
1548
+ instance_id=instance_id,
1549
+ _request_auth=_request_auth,
1550
+ _content_type=_content_type,
1551
+ _headers=_headers,
1552
+ _host_index=_host_index,
1553
+ )
1554
+
1555
+ _response_types_map: Dict[str, Optional[str]] = {
1556
+ "200": "GetInstanceTokenResponse",
1557
+ "400": "ErrorResponse",
1558
+ "401": "ErrorResponse",
1559
+ "403": "ErrorResponse",
1560
+ "404": "ErrorResponse",
1561
+ "429": "ErrorResponse",
1562
+ }
1563
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1564
+ response_data.read()
1565
+ return self.api_client.response_deserialize(
1566
+ response_data=response_data,
1567
+ response_types_map=_response_types_map,
1568
+ ).data
1569
+
1570
+ @validate_call
1571
+ def get_instance_token_with_http_info(
1572
+ self,
1573
+ project_id: Annotated[UUID, Field(description="portal project id")],
1574
+ region_id: Annotated[StrictStr, Field(description="region id")],
1575
+ token_id: Annotated[UUID, Field(description="token id")],
1576
+ instance_id: Annotated[UUID, Field(description="instance id")],
1577
+ _request_timeout: Union[
1578
+ None,
1579
+ Annotated[StrictFloat, Field(gt=0)],
1580
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1581
+ ] = None,
1582
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1583
+ _content_type: Optional[StrictStr] = None,
1584
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1585
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1586
+ ) -> ApiResponse[GetInstanceTokenResponse]:
1587
+ """get an auth token for an instance
1588
+
1589
+ get an auth token for an instance
1590
+
1591
+ :param project_id: portal project id (required)
1592
+ :type project_id: UUID
1593
+ :param region_id: region id (required)
1594
+ :type region_id: str
1595
+ :param token_id: token id (required)
1596
+ :type token_id: UUID
1597
+ :param instance_id: instance id (required)
1598
+ :type instance_id: UUID
1599
+ :param _request_timeout: timeout setting for this request. If one
1600
+ number provided, it will be total request
1601
+ timeout. It can also be a pair (tuple) of
1602
+ (connection, read) timeouts.
1603
+ :type _request_timeout: int, tuple(int, int), optional
1604
+ :param _request_auth: set to override the auth_settings for an a single
1605
+ request; this effectively ignores the
1606
+ authentication in the spec for a single request.
1607
+ :type _request_auth: dict, optional
1608
+ :param _content_type: force content-type for the request.
1609
+ :type _content_type: str, Optional
1610
+ :param _headers: set to override the headers for a single
1611
+ request; this effectively ignores the headers
1612
+ in the spec for a single request.
1613
+ :type _headers: dict, optional
1614
+ :param _host_index: set to override the host_index for a single
1615
+ request; this effectively ignores the host_index
1616
+ in the spec for a single request.
1617
+ :type _host_index: int, optional
1618
+ :return: Returns the result object.
1619
+ """ # noqa: E501
1620
+
1621
+ _param = self._get_instance_token_serialize(
1622
+ project_id=project_id,
1623
+ region_id=region_id,
1624
+ token_id=token_id,
1625
+ instance_id=instance_id,
1626
+ _request_auth=_request_auth,
1627
+ _content_type=_content_type,
1628
+ _headers=_headers,
1629
+ _host_index=_host_index,
1630
+ )
1631
+
1632
+ _response_types_map: Dict[str, Optional[str]] = {
1633
+ "200": "GetInstanceTokenResponse",
1634
+ "400": "ErrorResponse",
1635
+ "401": "ErrorResponse",
1636
+ "403": "ErrorResponse",
1637
+ "404": "ErrorResponse",
1638
+ "429": "ErrorResponse",
1639
+ }
1640
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1641
+ response_data.read()
1642
+ return self.api_client.response_deserialize(
1643
+ response_data=response_data,
1644
+ response_types_map=_response_types_map,
1645
+ )
1646
+
1647
+ @validate_call
1648
+ def get_instance_token_without_preload_content(
1649
+ self,
1650
+ project_id: Annotated[UUID, Field(description="portal project id")],
1651
+ region_id: Annotated[StrictStr, Field(description="region id")],
1652
+ token_id: Annotated[UUID, Field(description="token id")],
1653
+ instance_id: Annotated[UUID, Field(description="instance id")],
1654
+ _request_timeout: Union[
1655
+ None,
1656
+ Annotated[StrictFloat, Field(gt=0)],
1657
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1658
+ ] = None,
1659
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1660
+ _content_type: Optional[StrictStr] = None,
1661
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1662
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1663
+ ) -> RESTResponseType:
1664
+ """get an auth token for an instance
1665
+
1666
+ get an auth token for an instance
1667
+
1668
+ :param project_id: portal project id (required)
1669
+ :type project_id: UUID
1670
+ :param region_id: region id (required)
1671
+ :type region_id: str
1672
+ :param token_id: token id (required)
1673
+ :type token_id: UUID
1674
+ :param instance_id: instance id (required)
1675
+ :type instance_id: UUID
1676
+ :param _request_timeout: timeout setting for this request. If one
1677
+ number provided, it will be total request
1678
+ timeout. It can also be a pair (tuple) of
1679
+ (connection, read) timeouts.
1680
+ :type _request_timeout: int, tuple(int, int), optional
1681
+ :param _request_auth: set to override the auth_settings for an a single
1682
+ request; this effectively ignores the
1683
+ authentication in the spec for a single request.
1684
+ :type _request_auth: dict, optional
1685
+ :param _content_type: force content-type for the request.
1686
+ :type _content_type: str, Optional
1687
+ :param _headers: set to override the headers for a single
1688
+ request; this effectively ignores the headers
1689
+ in the spec for a single request.
1690
+ :type _headers: dict, optional
1691
+ :param _host_index: set to override the host_index for a single
1692
+ request; this effectively ignores the host_index
1693
+ in the spec for a single request.
1694
+ :type _host_index: int, optional
1695
+ :return: Returns the result object.
1696
+ """ # noqa: E501
1697
+
1698
+ _param = self._get_instance_token_serialize(
1699
+ project_id=project_id,
1700
+ region_id=region_id,
1701
+ token_id=token_id,
1702
+ instance_id=instance_id,
1703
+ _request_auth=_request_auth,
1704
+ _content_type=_content_type,
1705
+ _headers=_headers,
1706
+ _host_index=_host_index,
1707
+ )
1708
+
1709
+ _response_types_map: Dict[str, Optional[str]] = {
1710
+ "200": "GetInstanceTokenResponse",
1711
+ "400": "ErrorResponse",
1712
+ "401": "ErrorResponse",
1713
+ "403": "ErrorResponse",
1714
+ "404": "ErrorResponse",
1715
+ "429": "ErrorResponse",
1716
+ }
1717
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1718
+ return response_data.response
1719
+
1720
+ def _get_instance_token_serialize(
1721
+ self,
1722
+ project_id,
1723
+ region_id,
1724
+ token_id,
1725
+ instance_id,
1726
+ _request_auth,
1727
+ _content_type,
1728
+ _headers,
1729
+ _host_index,
1730
+ ) -> RequestSerialized:
1731
+
1732
+ _host = None
1733
+
1734
+ _collection_formats: Dict[str, str] = {}
1735
+
1736
+ _path_params: Dict[str, str] = {}
1737
+ _query_params: List[Tuple[str, str]] = []
1738
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1739
+ _form_params: List[Tuple[str, str]] = []
1740
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1741
+ _body_params: Optional[bytes] = None
1742
+
1743
+ # process the path parameters
1744
+ if project_id is not None:
1745
+ _path_params["projectId"] = project_id
1746
+ if region_id is not None:
1747
+ _path_params["regionId"] = region_id
1748
+ if token_id is not None:
1749
+ _path_params["tokenId"] = token_id
1750
+ if instance_id is not None:
1751
+ _path_params["instanceId"] = instance_id
1752
+ # process the query parameters
1753
+ # process the header parameters
1754
+ # process the form parameters
1755
+ # process the body parameter
1756
+
1757
+ # set the HTTP header `Accept`
1758
+ if "Accept" not in _header_params:
1759
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1760
+
1761
+ # authentication setting
1762
+ _auth_settings: List[str] = []
1763
+
1764
+ return self.api_client.param_serialize(
1765
+ method="GET",
1766
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/tokens/{tokenId}",
1767
+ path_params=_path_params,
1768
+ query_params=_query_params,
1769
+ header_params=_header_params,
1770
+ body=_body_params,
1771
+ post_params=_form_params,
1772
+ files=_files,
1773
+ auth_settings=_auth_settings,
1774
+ collection_formats=_collection_formats,
1775
+ _host=_host,
1776
+ _request_auth=_request_auth,
1777
+ )
1778
+
1779
+ @validate_call
1780
+ def list_instance_tokens(
1781
+ self,
1782
+ project_id: Annotated[UUID, Field(description="portal project id")],
1783
+ region_id: Annotated[StrictStr, Field(description="region id")],
1784
+ instance_id: Annotated[UUID, Field(description="instance id")],
1785
+ _request_timeout: Union[
1786
+ None,
1787
+ Annotated[StrictFloat, Field(gt=0)],
1788
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1789
+ ] = None,
1790
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1791
+ _content_type: Optional[StrictStr] = None,
1792
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1793
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1794
+ ) -> ListInstanceTokensResponse:
1795
+ """list all auth tokens for an instance
1796
+
1797
+ list all auth tokens for an instance
1798
+
1799
+ :param project_id: portal project id (required)
1800
+ :type project_id: UUID
1801
+ :param region_id: region id (required)
1802
+ :type region_id: str
1803
+ :param instance_id: instance id (required)
1804
+ :type instance_id: UUID
1805
+ :param _request_timeout: timeout setting for this request. If one
1806
+ number provided, it will be total request
1807
+ timeout. It can also be a pair (tuple) of
1808
+ (connection, read) timeouts.
1809
+ :type _request_timeout: int, tuple(int, int), optional
1810
+ :param _request_auth: set to override the auth_settings for an a single
1811
+ request; this effectively ignores the
1812
+ authentication in the spec for a single request.
1813
+ :type _request_auth: dict, optional
1814
+ :param _content_type: force content-type for the request.
1815
+ :type _content_type: str, Optional
1816
+ :param _headers: set to override the headers for a single
1817
+ request; this effectively ignores the headers
1818
+ in the spec for a single request.
1819
+ :type _headers: dict, optional
1820
+ :param _host_index: set to override the host_index for a single
1821
+ request; this effectively ignores the host_index
1822
+ in the spec for a single request.
1823
+ :type _host_index: int, optional
1824
+ :return: Returns the result object.
1825
+ """ # noqa: E501
1826
+
1827
+ _param = self._list_instance_tokens_serialize(
1828
+ project_id=project_id,
1829
+ region_id=region_id,
1830
+ instance_id=instance_id,
1831
+ _request_auth=_request_auth,
1832
+ _content_type=_content_type,
1833
+ _headers=_headers,
1834
+ _host_index=_host_index,
1835
+ )
1836
+
1837
+ _response_types_map: Dict[str, Optional[str]] = {
1838
+ "200": "ListInstanceTokensResponse",
1839
+ "400": "ErrorResponse",
1840
+ "401": "ErrorResponse",
1841
+ "403": "ErrorResponse",
1842
+ "404": "ErrorResponse",
1843
+ "429": "ErrorResponse",
1844
+ }
1845
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1846
+ response_data.read()
1847
+ return self.api_client.response_deserialize(
1848
+ response_data=response_data,
1849
+ response_types_map=_response_types_map,
1850
+ ).data
1851
+
1852
+ @validate_call
1853
+ def list_instance_tokens_with_http_info(
1854
+ self,
1855
+ project_id: Annotated[UUID, Field(description="portal project id")],
1856
+ region_id: Annotated[StrictStr, Field(description="region id")],
1857
+ instance_id: Annotated[UUID, Field(description="instance id")],
1858
+ _request_timeout: Union[
1859
+ None,
1860
+ Annotated[StrictFloat, Field(gt=0)],
1861
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1862
+ ] = None,
1863
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1864
+ _content_type: Optional[StrictStr] = None,
1865
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1866
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1867
+ ) -> ApiResponse[ListInstanceTokensResponse]:
1868
+ """list all auth tokens for an instance
1869
+
1870
+ list all auth tokens for an instance
1871
+
1872
+ :param project_id: portal project id (required)
1873
+ :type project_id: UUID
1874
+ :param region_id: region id (required)
1875
+ :type region_id: str
1876
+ :param instance_id: instance id (required)
1877
+ :type instance_id: UUID
1878
+ :param _request_timeout: timeout setting for this request. If one
1879
+ number provided, it will be total request
1880
+ timeout. It can also be a pair (tuple) of
1881
+ (connection, read) timeouts.
1882
+ :type _request_timeout: int, tuple(int, int), optional
1883
+ :param _request_auth: set to override the auth_settings for an a single
1884
+ request; this effectively ignores the
1885
+ authentication in the spec for a single request.
1886
+ :type _request_auth: dict, optional
1887
+ :param _content_type: force content-type for the request.
1888
+ :type _content_type: str, Optional
1889
+ :param _headers: set to override the headers for a single
1890
+ request; this effectively ignores the headers
1891
+ in the spec for a single request.
1892
+ :type _headers: dict, optional
1893
+ :param _host_index: set to override the host_index for a single
1894
+ request; this effectively ignores the host_index
1895
+ in the spec for a single request.
1896
+ :type _host_index: int, optional
1897
+ :return: Returns the result object.
1898
+ """ # noqa: E501
1899
+
1900
+ _param = self._list_instance_tokens_serialize(
1901
+ project_id=project_id,
1902
+ region_id=region_id,
1903
+ instance_id=instance_id,
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
+ "200": "ListInstanceTokensResponse",
1912
+ "400": "ErrorResponse",
1913
+ "401": "ErrorResponse",
1914
+ "403": "ErrorResponse",
1915
+ "404": "ErrorResponse",
1916
+ "429": "ErrorResponse",
1917
+ }
1918
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1919
+ response_data.read()
1920
+ return self.api_client.response_deserialize(
1921
+ response_data=response_data,
1922
+ response_types_map=_response_types_map,
1923
+ )
1924
+
1925
+ @validate_call
1926
+ def list_instance_tokens_without_preload_content(
1927
+ self,
1928
+ project_id: Annotated[UUID, Field(description="portal project id")],
1929
+ region_id: Annotated[StrictStr, Field(description="region id")],
1930
+ instance_id: Annotated[UUID, Field(description="instance id")],
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
+ ) -> RESTResponseType:
1941
+ """list all auth tokens for an instance
1942
+
1943
+ list all auth tokens for an instance
1944
+
1945
+ :param project_id: portal project id (required)
1946
+ :type project_id: UUID
1947
+ :param region_id: region id (required)
1948
+ :type region_id: str
1949
+ :param instance_id: instance id (required)
1950
+ :type instance_id: UUID
1951
+ :param _request_timeout: timeout setting for this request. If one
1952
+ number provided, it will be total request
1953
+ timeout. It can also be a pair (tuple) of
1954
+ (connection, read) timeouts.
1955
+ :type _request_timeout: int, tuple(int, int), optional
1956
+ :param _request_auth: set to override the auth_settings for an a single
1957
+ request; this effectively ignores the
1958
+ authentication in the spec for a single request.
1959
+ :type _request_auth: dict, optional
1960
+ :param _content_type: force content-type for the request.
1961
+ :type _content_type: str, Optional
1962
+ :param _headers: set to override the headers for a single
1963
+ request; this effectively ignores the headers
1964
+ in the spec for a single request.
1965
+ :type _headers: dict, optional
1966
+ :param _host_index: set to override the host_index for a single
1967
+ request; this effectively ignores the host_index
1968
+ in the spec for a single request.
1969
+ :type _host_index: int, optional
1970
+ :return: Returns the result object.
1971
+ """ # noqa: E501
1972
+
1973
+ _param = self._list_instance_tokens_serialize(
1974
+ project_id=project_id,
1975
+ region_id=region_id,
1976
+ instance_id=instance_id,
1977
+ _request_auth=_request_auth,
1978
+ _content_type=_content_type,
1979
+ _headers=_headers,
1980
+ _host_index=_host_index,
1981
+ )
1982
+
1983
+ _response_types_map: Dict[str, Optional[str]] = {
1984
+ "200": "ListInstanceTokensResponse",
1985
+ "400": "ErrorResponse",
1986
+ "401": "ErrorResponse",
1987
+ "403": "ErrorResponse",
1988
+ "404": "ErrorResponse",
1989
+ "429": "ErrorResponse",
1990
+ }
1991
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1992
+ return response_data.response
1993
+
1994
+ def _list_instance_tokens_serialize(
1995
+ self,
1996
+ project_id,
1997
+ region_id,
1998
+ instance_id,
1999
+ _request_auth,
2000
+ _content_type,
2001
+ _headers,
2002
+ _host_index,
2003
+ ) -> RequestSerialized:
2004
+
2005
+ _host = None
2006
+
2007
+ _collection_formats: Dict[str, str] = {}
2008
+
2009
+ _path_params: Dict[str, str] = {}
2010
+ _query_params: List[Tuple[str, str]] = []
2011
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2012
+ _form_params: List[Tuple[str, str]] = []
2013
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2014
+ _body_params: Optional[bytes] = None
2015
+
2016
+ # process the path parameters
2017
+ if project_id is not None:
2018
+ _path_params["projectId"] = project_id
2019
+ if region_id is not None:
2020
+ _path_params["regionId"] = region_id
2021
+ if instance_id is not None:
2022
+ _path_params["instanceId"] = instance_id
2023
+ # process the query parameters
2024
+ # process the header parameters
2025
+ # process the form parameters
2026
+ # process the body parameter
2027
+
2028
+ # set the HTTP header `Accept`
2029
+ if "Accept" not in _header_params:
2030
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2031
+
2032
+ # authentication setting
2033
+ _auth_settings: List[str] = []
2034
+
2035
+ return self.api_client.param_serialize(
2036
+ method="GET",
2037
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/tokens",
2038
+ path_params=_path_params,
2039
+ query_params=_query_params,
2040
+ header_params=_header_params,
2041
+ body=_body_params,
2042
+ post_params=_form_params,
2043
+ files=_files,
2044
+ auth_settings=_auth_settings,
2045
+ collection_formats=_collection_formats,
2046
+ _host=_host,
2047
+ _request_auth=_request_auth,
2048
+ )
2049
+
2050
+ @validate_call
2051
+ def list_instances(
2052
+ self,
2053
+ project_id: Annotated[UUID, Field(description="portal project id")],
2054
+ region_id: Annotated[StrictStr, Field(description="region id")],
2055
+ _request_timeout: Union[
2056
+ None,
2057
+ Annotated[StrictFloat, Field(gt=0)],
2058
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2059
+ ] = None,
2060
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2061
+ _content_type: Optional[StrictStr] = None,
2062
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2063
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2064
+ ) -> ListInstancesResponse:
2065
+ """list instances in a project
2066
+
2067
+ list instances in a project
2068
+
2069
+ :param project_id: portal project id (required)
2070
+ :type project_id: UUID
2071
+ :param region_id: region id (required)
2072
+ :type region_id: str
2073
+ :param _request_timeout: timeout setting for this request. If one
2074
+ number provided, it will be total request
2075
+ timeout. It can also be a pair (tuple) of
2076
+ (connection, read) timeouts.
2077
+ :type _request_timeout: int, tuple(int, int), optional
2078
+ :param _request_auth: set to override the auth_settings for an a single
2079
+ request; this effectively ignores the
2080
+ authentication in the spec for a single request.
2081
+ :type _request_auth: dict, optional
2082
+ :param _content_type: force content-type for the request.
2083
+ :type _content_type: str, Optional
2084
+ :param _headers: set to override the headers for a single
2085
+ request; this effectively ignores the headers
2086
+ in the spec for a single request.
2087
+ :type _headers: dict, optional
2088
+ :param _host_index: set to override the host_index for a single
2089
+ request; this effectively ignores the host_index
2090
+ in the spec for a single request.
2091
+ :type _host_index: int, optional
2092
+ :return: Returns the result object.
2093
+ """ # noqa: E501
2094
+
2095
+ _param = self._list_instances_serialize(
2096
+ project_id=project_id,
2097
+ region_id=region_id,
2098
+ _request_auth=_request_auth,
2099
+ _content_type=_content_type,
2100
+ _headers=_headers,
2101
+ _host_index=_host_index,
2102
+ )
2103
+
2104
+ _response_types_map: Dict[str, Optional[str]] = {
2105
+ "200": "ListInstancesResponse",
2106
+ "400": "ErrorResponse",
2107
+ "401": "ErrorResponse",
2108
+ "403": "ErrorResponse",
2109
+ "404": "ErrorResponse",
2110
+ "429": "ErrorResponse",
2111
+ }
2112
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2113
+ response_data.read()
2114
+ return self.api_client.response_deserialize(
2115
+ response_data=response_data,
2116
+ response_types_map=_response_types_map,
2117
+ ).data
2118
+
2119
+ @validate_call
2120
+ def list_instances_with_http_info(
2121
+ self,
2122
+ project_id: Annotated[UUID, Field(description="portal project id")],
2123
+ region_id: Annotated[StrictStr, Field(description="region id")],
2124
+ _request_timeout: Union[
2125
+ None,
2126
+ Annotated[StrictFloat, Field(gt=0)],
2127
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2128
+ ] = None,
2129
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2130
+ _content_type: Optional[StrictStr] = None,
2131
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2132
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2133
+ ) -> ApiResponse[ListInstancesResponse]:
2134
+ """list instances in a project
2135
+
2136
+ list instances in a project
2137
+
2138
+ :param project_id: portal project id (required)
2139
+ :type project_id: UUID
2140
+ :param region_id: region id (required)
2141
+ :type region_id: str
2142
+ :param _request_timeout: timeout setting for this request. If one
2143
+ number provided, it will be total request
2144
+ timeout. It can also be a pair (tuple) of
2145
+ (connection, read) timeouts.
2146
+ :type _request_timeout: int, tuple(int, int), optional
2147
+ :param _request_auth: set to override the auth_settings for an a single
2148
+ request; this effectively ignores the
2149
+ authentication in the spec for a single request.
2150
+ :type _request_auth: dict, optional
2151
+ :param _content_type: force content-type for the request.
2152
+ :type _content_type: str, Optional
2153
+ :param _headers: set to override the headers for a single
2154
+ request; this effectively ignores the headers
2155
+ in the spec for a single request.
2156
+ :type _headers: dict, optional
2157
+ :param _host_index: set to override the host_index for a single
2158
+ request; this effectively ignores the host_index
2159
+ in the spec for a single request.
2160
+ :type _host_index: int, optional
2161
+ :return: Returns the result object.
2162
+ """ # noqa: E501
2163
+
2164
+ _param = self._list_instances_serialize(
2165
+ project_id=project_id,
2166
+ region_id=region_id,
2167
+ _request_auth=_request_auth,
2168
+ _content_type=_content_type,
2169
+ _headers=_headers,
2170
+ _host_index=_host_index,
2171
+ )
2172
+
2173
+ _response_types_map: Dict[str, Optional[str]] = {
2174
+ "200": "ListInstancesResponse",
2175
+ "400": "ErrorResponse",
2176
+ "401": "ErrorResponse",
2177
+ "403": "ErrorResponse",
2178
+ "404": "ErrorResponse",
2179
+ "429": "ErrorResponse",
2180
+ }
2181
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2182
+ response_data.read()
2183
+ return self.api_client.response_deserialize(
2184
+ response_data=response_data,
2185
+ response_types_map=_response_types_map,
2186
+ )
2187
+
2188
+ @validate_call
2189
+ def list_instances_without_preload_content(
2190
+ self,
2191
+ project_id: Annotated[UUID, Field(description="portal project id")],
2192
+ region_id: Annotated[StrictStr, Field(description="region id")],
2193
+ _request_timeout: Union[
2194
+ None,
2195
+ Annotated[StrictFloat, Field(gt=0)],
2196
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2197
+ ] = None,
2198
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2199
+ _content_type: Optional[StrictStr] = None,
2200
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2201
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2202
+ ) -> RESTResponseType:
2203
+ """list instances in a project
2204
+
2205
+ list instances in a project
2206
+
2207
+ :param project_id: portal project id (required)
2208
+ :type project_id: UUID
2209
+ :param region_id: region id (required)
2210
+ :type region_id: str
2211
+ :param _request_timeout: timeout setting for this request. If one
2212
+ number provided, it will be total request
2213
+ timeout. It can also be a pair (tuple) of
2214
+ (connection, read) timeouts.
2215
+ :type _request_timeout: int, tuple(int, int), optional
2216
+ :param _request_auth: set to override the auth_settings for an a single
2217
+ request; this effectively ignores the
2218
+ authentication in the spec for a single request.
2219
+ :type _request_auth: dict, optional
2220
+ :param _content_type: force content-type for the request.
2221
+ :type _content_type: str, Optional
2222
+ :param _headers: set to override the headers for a single
2223
+ request; this effectively ignores the headers
2224
+ in the spec for a single request.
2225
+ :type _headers: dict, optional
2226
+ :param _host_index: set to override the host_index for a single
2227
+ request; this effectively ignores the host_index
2228
+ in the spec for a single request.
2229
+ :type _host_index: int, optional
2230
+ :return: Returns the result object.
2231
+ """ # noqa: E501
2232
+
2233
+ _param = self._list_instances_serialize(
2234
+ project_id=project_id,
2235
+ region_id=region_id,
2236
+ _request_auth=_request_auth,
2237
+ _content_type=_content_type,
2238
+ _headers=_headers,
2239
+ _host_index=_host_index,
2240
+ )
2241
+
2242
+ _response_types_map: Dict[str, Optional[str]] = {
2243
+ "200": "ListInstancesResponse",
2244
+ "400": "ErrorResponse",
2245
+ "401": "ErrorResponse",
2246
+ "403": "ErrorResponse",
2247
+ "404": "ErrorResponse",
2248
+ "429": "ErrorResponse",
2249
+ }
2250
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2251
+ return response_data.response
2252
+
2253
+ def _list_instances_serialize(
2254
+ self,
2255
+ project_id,
2256
+ region_id,
2257
+ _request_auth,
2258
+ _content_type,
2259
+ _headers,
2260
+ _host_index,
2261
+ ) -> RequestSerialized:
2262
+
2263
+ _host = None
2264
+
2265
+ _collection_formats: Dict[str, str] = {}
2266
+
2267
+ _path_params: Dict[str, str] = {}
2268
+ _query_params: List[Tuple[str, str]] = []
2269
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2270
+ _form_params: List[Tuple[str, str]] = []
2271
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2272
+ _body_params: Optional[bytes] = None
2273
+
2274
+ # process the path parameters
2275
+ if project_id is not None:
2276
+ _path_params["projectId"] = project_id
2277
+ if region_id is not None:
2278
+ _path_params["regionId"] = region_id
2279
+ # process the query parameters
2280
+ # process the header parameters
2281
+ # process the form parameters
2282
+ # process the body parameter
2283
+
2284
+ # set the HTTP header `Accept`
2285
+ if "Accept" not in _header_params:
2286
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2287
+
2288
+ # authentication setting
2289
+ _auth_settings: List[str] = []
2290
+
2291
+ return self.api_client.param_serialize(
2292
+ method="GET",
2293
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances",
2294
+ path_params=_path_params,
2295
+ query_params=_query_params,
2296
+ header_params=_header_params,
2297
+ body=_body_params,
2298
+ post_params=_form_params,
2299
+ files=_files,
2300
+ auth_settings=_auth_settings,
2301
+ collection_formats=_collection_formats,
2302
+ _host=_host,
2303
+ _request_auth=_request_auth,
2304
+ )
2305
+
2306
+ @validate_call
2307
+ def partial_update_instance(
2308
+ self,
2309
+ project_id: Annotated[UUID, Field(description="portal project id")],
2310
+ region_id: Annotated[StrictStr, Field(description="region id")],
2311
+ instance_id: Annotated[UUID, Field(description="instance id")],
2312
+ partial_update_instance_payload: Optional[PartialUpdateInstancePayload] = None,
2313
+ _request_timeout: Union[
2314
+ None,
2315
+ Annotated[StrictFloat, Field(gt=0)],
2316
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2317
+ ] = None,
2318
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2319
+ _content_type: Optional[StrictStr] = None,
2320
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2321
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2322
+ ) -> PartialUpdateInstanceResponse:
2323
+ """partial update an instance in a project
2324
+
2325
+ partial update an instance in a project
2326
+
2327
+ :param project_id: portal project id (required)
2328
+ :type project_id: UUID
2329
+ :param region_id: region id (required)
2330
+ :type region_id: str
2331
+ :param instance_id: instance id (required)
2332
+ :type instance_id: UUID
2333
+ :param partial_update_instance_payload:
2334
+ :type partial_update_instance_payload: PartialUpdateInstancePayload
2335
+ :param _request_timeout: timeout setting for this request. If one
2336
+ number provided, it will be total request
2337
+ timeout. It can also be a pair (tuple) of
2338
+ (connection, read) timeouts.
2339
+ :type _request_timeout: int, tuple(int, int), optional
2340
+ :param _request_auth: set to override the auth_settings for an a single
2341
+ request; this effectively ignores the
2342
+ authentication in the spec for a single request.
2343
+ :type _request_auth: dict, optional
2344
+ :param _content_type: force content-type for the request.
2345
+ :type _content_type: str, Optional
2346
+ :param _headers: set to override the headers for a single
2347
+ request; this effectively ignores the headers
2348
+ in the spec for a single request.
2349
+ :type _headers: dict, optional
2350
+ :param _host_index: set to override the host_index for a single
2351
+ request; this effectively ignores the host_index
2352
+ in the spec for a single request.
2353
+ :type _host_index: int, optional
2354
+ :return: Returns the result object.
2355
+ """ # noqa: E501
2356
+
2357
+ _param = self._partial_update_instance_serialize(
2358
+ project_id=project_id,
2359
+ region_id=region_id,
2360
+ instance_id=instance_id,
2361
+ partial_update_instance_payload=partial_update_instance_payload,
2362
+ _request_auth=_request_auth,
2363
+ _content_type=_content_type,
2364
+ _headers=_headers,
2365
+ _host_index=_host_index,
2366
+ )
2367
+
2368
+ _response_types_map: Dict[str, Optional[str]] = {
2369
+ "202": "PartialUpdateInstanceResponse",
2370
+ "400": "ErrorResponse",
2371
+ "401": "ErrorResponse",
2372
+ "403": "ErrorResponse",
2373
+ "404": "ErrorResponse",
2374
+ "409": "ErrorResponse",
2375
+ "429": "ErrorResponse",
2376
+ }
2377
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2378
+ response_data.read()
2379
+ return self.api_client.response_deserialize(
2380
+ response_data=response_data,
2381
+ response_types_map=_response_types_map,
2382
+ ).data
2383
+
2384
+ @validate_call
2385
+ def partial_update_instance_with_http_info(
2386
+ self,
2387
+ project_id: Annotated[UUID, Field(description="portal project id")],
2388
+ region_id: Annotated[StrictStr, Field(description="region id")],
2389
+ instance_id: Annotated[UUID, Field(description="instance id")],
2390
+ partial_update_instance_payload: Optional[PartialUpdateInstancePayload] = None,
2391
+ _request_timeout: Union[
2392
+ None,
2393
+ Annotated[StrictFloat, Field(gt=0)],
2394
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2395
+ ] = None,
2396
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2397
+ _content_type: Optional[StrictStr] = None,
2398
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2399
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2400
+ ) -> ApiResponse[PartialUpdateInstanceResponse]:
2401
+ """partial update an instance in a project
2402
+
2403
+ partial update an instance in a project
2404
+
2405
+ :param project_id: portal project id (required)
2406
+ :type project_id: UUID
2407
+ :param region_id: region id (required)
2408
+ :type region_id: str
2409
+ :param instance_id: instance id (required)
2410
+ :type instance_id: UUID
2411
+ :param partial_update_instance_payload:
2412
+ :type partial_update_instance_payload: PartialUpdateInstancePayload
2413
+ :param _request_timeout: timeout setting for this request. If one
2414
+ number provided, it will be total request
2415
+ timeout. It can also be a pair (tuple) of
2416
+ (connection, read) timeouts.
2417
+ :type _request_timeout: int, tuple(int, int), optional
2418
+ :param _request_auth: set to override the auth_settings for an a single
2419
+ request; this effectively ignores the
2420
+ authentication in the spec for a single request.
2421
+ :type _request_auth: dict, optional
2422
+ :param _content_type: force content-type for the request.
2423
+ :type _content_type: str, Optional
2424
+ :param _headers: set to override the headers for a single
2425
+ request; this effectively ignores the headers
2426
+ in the spec for a single request.
2427
+ :type _headers: dict, optional
2428
+ :param _host_index: set to override the host_index for a single
2429
+ request; this effectively ignores the host_index
2430
+ in the spec for a single request.
2431
+ :type _host_index: int, optional
2432
+ :return: Returns the result object.
2433
+ """ # noqa: E501
2434
+
2435
+ _param = self._partial_update_instance_serialize(
2436
+ project_id=project_id,
2437
+ region_id=region_id,
2438
+ instance_id=instance_id,
2439
+ partial_update_instance_payload=partial_update_instance_payload,
2440
+ _request_auth=_request_auth,
2441
+ _content_type=_content_type,
2442
+ _headers=_headers,
2443
+ _host_index=_host_index,
2444
+ )
2445
+
2446
+ _response_types_map: Dict[str, Optional[str]] = {
2447
+ "202": "PartialUpdateInstanceResponse",
2448
+ "400": "ErrorResponse",
2449
+ "401": "ErrorResponse",
2450
+ "403": "ErrorResponse",
2451
+ "404": "ErrorResponse",
2452
+ "409": "ErrorResponse",
2453
+ "429": "ErrorResponse",
2454
+ }
2455
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2456
+ response_data.read()
2457
+ return self.api_client.response_deserialize(
2458
+ response_data=response_data,
2459
+ response_types_map=_response_types_map,
2460
+ )
2461
+
2462
+ @validate_call
2463
+ def partial_update_instance_without_preload_content(
2464
+ self,
2465
+ project_id: Annotated[UUID, Field(description="portal project id")],
2466
+ region_id: Annotated[StrictStr, Field(description="region id")],
2467
+ instance_id: Annotated[UUID, Field(description="instance id")],
2468
+ partial_update_instance_payload: Optional[PartialUpdateInstancePayload] = None,
2469
+ _request_timeout: Union[
2470
+ None,
2471
+ Annotated[StrictFloat, Field(gt=0)],
2472
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2473
+ ] = None,
2474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2475
+ _content_type: Optional[StrictStr] = None,
2476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2478
+ ) -> RESTResponseType:
2479
+ """partial update an instance in a project
2480
+
2481
+ partial update an instance in a project
2482
+
2483
+ :param project_id: portal project id (required)
2484
+ :type project_id: UUID
2485
+ :param region_id: region id (required)
2486
+ :type region_id: str
2487
+ :param instance_id: instance id (required)
2488
+ :type instance_id: UUID
2489
+ :param partial_update_instance_payload:
2490
+ :type partial_update_instance_payload: PartialUpdateInstancePayload
2491
+ :param _request_timeout: timeout setting for this request. If one
2492
+ number provided, it will be total request
2493
+ timeout. It can also be a pair (tuple) of
2494
+ (connection, read) timeouts.
2495
+ :type _request_timeout: int, tuple(int, int), optional
2496
+ :param _request_auth: set to override the auth_settings for an a single
2497
+ request; this effectively ignores the
2498
+ authentication in the spec for a single request.
2499
+ :type _request_auth: dict, optional
2500
+ :param _content_type: force content-type for the request.
2501
+ :type _content_type: str, Optional
2502
+ :param _headers: set to override the headers for a single
2503
+ request; this effectively ignores the headers
2504
+ in the spec for a single request.
2505
+ :type _headers: dict, optional
2506
+ :param _host_index: set to override the host_index for a single
2507
+ request; this effectively ignores the host_index
2508
+ in the spec for a single request.
2509
+ :type _host_index: int, optional
2510
+ :return: Returns the result object.
2511
+ """ # noqa: E501
2512
+
2513
+ _param = self._partial_update_instance_serialize(
2514
+ project_id=project_id,
2515
+ region_id=region_id,
2516
+ instance_id=instance_id,
2517
+ partial_update_instance_payload=partial_update_instance_payload,
2518
+ _request_auth=_request_auth,
2519
+ _content_type=_content_type,
2520
+ _headers=_headers,
2521
+ _host_index=_host_index,
2522
+ )
2523
+
2524
+ _response_types_map: Dict[str, Optional[str]] = {
2525
+ "202": "PartialUpdateInstanceResponse",
2526
+ "400": "ErrorResponse",
2527
+ "401": "ErrorResponse",
2528
+ "403": "ErrorResponse",
2529
+ "404": "ErrorResponse",
2530
+ "409": "ErrorResponse",
2531
+ "429": "ErrorResponse",
2532
+ }
2533
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2534
+ return response_data.response
2535
+
2536
+ def _partial_update_instance_serialize(
2537
+ self,
2538
+ project_id,
2539
+ region_id,
2540
+ instance_id,
2541
+ partial_update_instance_payload,
2542
+ _request_auth,
2543
+ _content_type,
2544
+ _headers,
2545
+ _host_index,
2546
+ ) -> RequestSerialized:
2547
+
2548
+ _host = None
2549
+
2550
+ _collection_formats: Dict[str, str] = {}
2551
+
2552
+ _path_params: Dict[str, str] = {}
2553
+ _query_params: List[Tuple[str, str]] = []
2554
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2555
+ _form_params: List[Tuple[str, str]] = []
2556
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2557
+ _body_params: Optional[bytes] = None
2558
+
2559
+ # process the path parameters
2560
+ if project_id is not None:
2561
+ _path_params["projectId"] = project_id
2562
+ if region_id is not None:
2563
+ _path_params["regionId"] = region_id
2564
+ if instance_id is not None:
2565
+ _path_params["instanceId"] = instance_id
2566
+ # process the query parameters
2567
+ # process the header parameters
2568
+ # process the form parameters
2569
+ # process the body parameter
2570
+ if partial_update_instance_payload is not None:
2571
+ _body_params = partial_update_instance_payload
2572
+
2573
+ # set the HTTP header `Accept`
2574
+ if "Accept" not in _header_params:
2575
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2576
+
2577
+ # set the HTTP header `Content-Type`
2578
+ if _content_type:
2579
+ _header_params["Content-Type"] = _content_type
2580
+ else:
2581
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
2582
+ if _default_content_type is not None:
2583
+ _header_params["Content-Type"] = _default_content_type
2584
+
2585
+ # authentication setting
2586
+ _auth_settings: List[str] = []
2587
+
2588
+ return self.api_client.param_serialize(
2589
+ method="PATCH",
2590
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}",
2591
+ path_params=_path_params,
2592
+ query_params=_query_params,
2593
+ header_params=_header_params,
2594
+ body=_body_params,
2595
+ post_params=_form_params,
2596
+ files=_files,
2597
+ auth_settings=_auth_settings,
2598
+ collection_formats=_collection_formats,
2599
+ _host=_host,
2600
+ _request_auth=_request_auth,
2601
+ )
2602
+
2603
+ @validate_call
2604
+ def partial_update_instance_token(
2605
+ self,
2606
+ project_id: Annotated[UUID, Field(description="portal project id")],
2607
+ region_id: Annotated[StrictStr, Field(description="region id")],
2608
+ token_id: Annotated[UUID, Field(description="token id")],
2609
+ instance_id: Annotated[UUID, Field(description="instance id")],
2610
+ partial_update_instance_token_payload: Optional[PartialUpdateInstanceTokenPayload] = None,
2611
+ _request_timeout: Union[
2612
+ None,
2613
+ Annotated[StrictFloat, Field(gt=0)],
2614
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2615
+ ] = None,
2616
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2617
+ _content_type: Optional[StrictStr] = None,
2618
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2619
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2620
+ ) -> PartialUpdateInstanceTokenResponse:
2621
+ """partial update an auth token for an instance
2622
+
2623
+ partial update an auth token for an instance
2624
+
2625
+ :param project_id: portal project id (required)
2626
+ :type project_id: UUID
2627
+ :param region_id: region id (required)
2628
+ :type region_id: str
2629
+ :param token_id: token id (required)
2630
+ :type token_id: UUID
2631
+ :param instance_id: instance id (required)
2632
+ :type instance_id: UUID
2633
+ :param partial_update_instance_token_payload:
2634
+ :type partial_update_instance_token_payload: PartialUpdateInstanceTokenPayload
2635
+ :param _request_timeout: timeout setting for this request. If one
2636
+ number provided, it will be total request
2637
+ timeout. It can also be a pair (tuple) of
2638
+ (connection, read) timeouts.
2639
+ :type _request_timeout: int, tuple(int, int), optional
2640
+ :param _request_auth: set to override the auth_settings for an a single
2641
+ request; this effectively ignores the
2642
+ authentication in the spec for a single request.
2643
+ :type _request_auth: dict, optional
2644
+ :param _content_type: force content-type for the request.
2645
+ :type _content_type: str, Optional
2646
+ :param _headers: set to override the headers for a single
2647
+ request; this effectively ignores the headers
2648
+ in the spec for a single request.
2649
+ :type _headers: dict, optional
2650
+ :param _host_index: set to override the host_index for a single
2651
+ request; this effectively ignores the host_index
2652
+ in the spec for a single request.
2653
+ :type _host_index: int, optional
2654
+ :return: Returns the result object.
2655
+ """ # noqa: E501
2656
+
2657
+ _param = self._partial_update_instance_token_serialize(
2658
+ project_id=project_id,
2659
+ region_id=region_id,
2660
+ token_id=token_id,
2661
+ instance_id=instance_id,
2662
+ partial_update_instance_token_payload=partial_update_instance_token_payload,
2663
+ _request_auth=_request_auth,
2664
+ _content_type=_content_type,
2665
+ _headers=_headers,
2666
+ _host_index=_host_index,
2667
+ )
2668
+
2669
+ _response_types_map: Dict[str, Optional[str]] = {
2670
+ "202": "PartialUpdateInstanceTokenResponse",
2671
+ "400": "ErrorResponse",
2672
+ "401": "ErrorResponse",
2673
+ "403": "ErrorResponse",
2674
+ "404": "ErrorResponse",
2675
+ "409": "ErrorResponse",
2676
+ "429": "ErrorResponse",
2677
+ }
2678
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2679
+ response_data.read()
2680
+ return self.api_client.response_deserialize(
2681
+ response_data=response_data,
2682
+ response_types_map=_response_types_map,
2683
+ ).data
2684
+
2685
+ @validate_call
2686
+ def partial_update_instance_token_with_http_info(
2687
+ self,
2688
+ project_id: Annotated[UUID, Field(description="portal project id")],
2689
+ region_id: Annotated[StrictStr, Field(description="region id")],
2690
+ token_id: Annotated[UUID, Field(description="token id")],
2691
+ instance_id: Annotated[UUID, Field(description="instance id")],
2692
+ partial_update_instance_token_payload: Optional[PartialUpdateInstanceTokenPayload] = None,
2693
+ _request_timeout: Union[
2694
+ None,
2695
+ Annotated[StrictFloat, Field(gt=0)],
2696
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2697
+ ] = None,
2698
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2699
+ _content_type: Optional[StrictStr] = None,
2700
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2701
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2702
+ ) -> ApiResponse[PartialUpdateInstanceTokenResponse]:
2703
+ """partial update an auth token for an instance
2704
+
2705
+ partial update an auth token for an instance
2706
+
2707
+ :param project_id: portal project id (required)
2708
+ :type project_id: UUID
2709
+ :param region_id: region id (required)
2710
+ :type region_id: str
2711
+ :param token_id: token id (required)
2712
+ :type token_id: UUID
2713
+ :param instance_id: instance id (required)
2714
+ :type instance_id: UUID
2715
+ :param partial_update_instance_token_payload:
2716
+ :type partial_update_instance_token_payload: PartialUpdateInstanceTokenPayload
2717
+ :param _request_timeout: timeout setting for this request. If one
2718
+ number provided, it will be total request
2719
+ timeout. It can also be a pair (tuple) of
2720
+ (connection, read) timeouts.
2721
+ :type _request_timeout: int, tuple(int, int), optional
2722
+ :param _request_auth: set to override the auth_settings for an a single
2723
+ request; this effectively ignores the
2724
+ authentication in the spec for a single request.
2725
+ :type _request_auth: dict, optional
2726
+ :param _content_type: force content-type for the request.
2727
+ :type _content_type: str, Optional
2728
+ :param _headers: set to override the headers for a single
2729
+ request; this effectively ignores the headers
2730
+ in the spec for a single request.
2731
+ :type _headers: dict, optional
2732
+ :param _host_index: set to override the host_index for a single
2733
+ request; this effectively ignores the host_index
2734
+ in the spec for a single request.
2735
+ :type _host_index: int, optional
2736
+ :return: Returns the result object.
2737
+ """ # noqa: E501
2738
+
2739
+ _param = self._partial_update_instance_token_serialize(
2740
+ project_id=project_id,
2741
+ region_id=region_id,
2742
+ token_id=token_id,
2743
+ instance_id=instance_id,
2744
+ partial_update_instance_token_payload=partial_update_instance_token_payload,
2745
+ _request_auth=_request_auth,
2746
+ _content_type=_content_type,
2747
+ _headers=_headers,
2748
+ _host_index=_host_index,
2749
+ )
2750
+
2751
+ _response_types_map: Dict[str, Optional[str]] = {
2752
+ "202": "PartialUpdateInstanceTokenResponse",
2753
+ "400": "ErrorResponse",
2754
+ "401": "ErrorResponse",
2755
+ "403": "ErrorResponse",
2756
+ "404": "ErrorResponse",
2757
+ "409": "ErrorResponse",
2758
+ "429": "ErrorResponse",
2759
+ }
2760
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2761
+ response_data.read()
2762
+ return self.api_client.response_deserialize(
2763
+ response_data=response_data,
2764
+ response_types_map=_response_types_map,
2765
+ )
2766
+
2767
+ @validate_call
2768
+ def partial_update_instance_token_without_preload_content(
2769
+ self,
2770
+ project_id: Annotated[UUID, Field(description="portal project id")],
2771
+ region_id: Annotated[StrictStr, Field(description="region id")],
2772
+ token_id: Annotated[UUID, Field(description="token id")],
2773
+ instance_id: Annotated[UUID, Field(description="instance id")],
2774
+ partial_update_instance_token_payload: Optional[PartialUpdateInstanceTokenPayload] = None,
2775
+ _request_timeout: Union[
2776
+ None,
2777
+ Annotated[StrictFloat, Field(gt=0)],
2778
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2779
+ ] = None,
2780
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2781
+ _content_type: Optional[StrictStr] = None,
2782
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2783
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2784
+ ) -> RESTResponseType:
2785
+ """partial update an auth token for an instance
2786
+
2787
+ partial update an auth token for an instance
2788
+
2789
+ :param project_id: portal project id (required)
2790
+ :type project_id: UUID
2791
+ :param region_id: region id (required)
2792
+ :type region_id: str
2793
+ :param token_id: token id (required)
2794
+ :type token_id: UUID
2795
+ :param instance_id: instance id (required)
2796
+ :type instance_id: UUID
2797
+ :param partial_update_instance_token_payload:
2798
+ :type partial_update_instance_token_payload: PartialUpdateInstanceTokenPayload
2799
+ :param _request_timeout: timeout setting for this request. If one
2800
+ number provided, it will be total request
2801
+ timeout. It can also be a pair (tuple) of
2802
+ (connection, read) timeouts.
2803
+ :type _request_timeout: int, tuple(int, int), optional
2804
+ :param _request_auth: set to override the auth_settings for an a single
2805
+ request; this effectively ignores the
2806
+ authentication in the spec for a single request.
2807
+ :type _request_auth: dict, optional
2808
+ :param _content_type: force content-type for the request.
2809
+ :type _content_type: str, Optional
2810
+ :param _headers: set to override the headers for a single
2811
+ request; this effectively ignores the headers
2812
+ in the spec for a single request.
2813
+ :type _headers: dict, optional
2814
+ :param _host_index: set to override the host_index for a single
2815
+ request; this effectively ignores the host_index
2816
+ in the spec for a single request.
2817
+ :type _host_index: int, optional
2818
+ :return: Returns the result object.
2819
+ """ # noqa: E501
2820
+
2821
+ _param = self._partial_update_instance_token_serialize(
2822
+ project_id=project_id,
2823
+ region_id=region_id,
2824
+ token_id=token_id,
2825
+ instance_id=instance_id,
2826
+ partial_update_instance_token_payload=partial_update_instance_token_payload,
2827
+ _request_auth=_request_auth,
2828
+ _content_type=_content_type,
2829
+ _headers=_headers,
2830
+ _host_index=_host_index,
2831
+ )
2832
+
2833
+ _response_types_map: Dict[str, Optional[str]] = {
2834
+ "202": "PartialUpdateInstanceTokenResponse",
2835
+ "400": "ErrorResponse",
2836
+ "401": "ErrorResponse",
2837
+ "403": "ErrorResponse",
2838
+ "404": "ErrorResponse",
2839
+ "409": "ErrorResponse",
2840
+ "429": "ErrorResponse",
2841
+ }
2842
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2843
+ return response_data.response
2844
+
2845
+ def _partial_update_instance_token_serialize(
2846
+ self,
2847
+ project_id,
2848
+ region_id,
2849
+ token_id,
2850
+ instance_id,
2851
+ partial_update_instance_token_payload,
2852
+ _request_auth,
2853
+ _content_type,
2854
+ _headers,
2855
+ _host_index,
2856
+ ) -> RequestSerialized:
2857
+
2858
+ _host = None
2859
+
2860
+ _collection_formats: Dict[str, str] = {}
2861
+
2862
+ _path_params: Dict[str, str] = {}
2863
+ _query_params: List[Tuple[str, str]] = []
2864
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2865
+ _form_params: List[Tuple[str, str]] = []
2866
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2867
+ _body_params: Optional[bytes] = None
2868
+
2869
+ # process the path parameters
2870
+ if project_id is not None:
2871
+ _path_params["projectId"] = project_id
2872
+ if region_id is not None:
2873
+ _path_params["regionId"] = region_id
2874
+ if token_id is not None:
2875
+ _path_params["tokenId"] = token_id
2876
+ if instance_id is not None:
2877
+ _path_params["instanceId"] = instance_id
2878
+ # process the query parameters
2879
+ # process the header parameters
2880
+ # process the form parameters
2881
+ # process the body parameter
2882
+ if partial_update_instance_token_payload is not None:
2883
+ _body_params = partial_update_instance_token_payload
2884
+
2885
+ # set the HTTP header `Accept`
2886
+ if "Accept" not in _header_params:
2887
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2888
+
2889
+ # set the HTTP header `Content-Type`
2890
+ if _content_type:
2891
+ _header_params["Content-Type"] = _content_type
2892
+ else:
2893
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
2894
+ if _default_content_type is not None:
2895
+ _header_params["Content-Type"] = _default_content_type
2896
+
2897
+ # authentication setting
2898
+ _auth_settings: List[str] = []
2899
+
2900
+ return self.api_client.param_serialize(
2901
+ method="PATCH",
2902
+ resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/tokens/{tokenId}",
2903
+ path_params=_path_params,
2904
+ query_params=_query_params,
2905
+ header_params=_header_params,
2906
+ body=_body_params,
2907
+ post_params=_form_params,
2908
+ files=_files,
2909
+ auth_settings=_auth_settings,
2910
+ collection_formats=_collection_formats,
2911
+ _host=_host,
2912
+ _request_auth=_request_auth,
2913
+ )