method-security-sdk 0.35.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.
- method_sdk/__init__.py +0 -0
- method_sdk/configuration.py +654 -0
- method_sdk/errors.py +55 -0
- method_sdk/exceptions.py +220 -0
- method_sdk/inventory/__init__.py +94 -0
- method_sdk/inventory/api/__init__.py +5 -0
- method_sdk/inventory/api/inventory_api.py +1508 -0
- method_sdk/inventory/api_client.py +833 -0
- method_sdk/inventory/api_response.py +21 -0
- method_sdk/inventory/configuration.py +654 -0
- method_sdk/inventory/exceptions.py +1 -0
- method_sdk/inventory/models/__init__.py +39 -0
- method_sdk/inventory/models/access_denied_response_content.py +90 -0
- method_sdk/inventory/models/create_environment400_error_response_content.py +151 -0
- method_sdk/inventory/models/create_environment_request_content.py +88 -0
- method_sdk/inventory/models/create_environment_response_content.py +92 -0
- method_sdk/inventory/models/delete_environment400_error_response_content.py +151 -0
- method_sdk/inventory/models/delete_environment_response_content.py +92 -0
- method_sdk/inventory/models/environment.py +101 -0
- method_sdk/inventory/models/environment_not_found_response_content.py +90 -0
- method_sdk/inventory/models/environment_state.py +38 -0
- method_sdk/inventory/models/get_environment400_error_response_content.py +151 -0
- method_sdk/inventory/models/get_environment_response_content.py +92 -0
- method_sdk/inventory/models/internal_server_response_content.py +90 -0
- method_sdk/inventory/models/invalid_parameter.py +90 -0
- method_sdk/inventory/models/list_environments400_error_response_content.py +151 -0
- method_sdk/inventory/models/list_environments_response_content.py +97 -0
- method_sdk/inventory/models/malformed_request.py +90 -0
- method_sdk/inventory/models/missing_parameter.py +90 -0
- method_sdk/inventory/models/service_unavailable_response_content.py +90 -0
- method_sdk/inventory/models/throttling_response_content.py +90 -0
- method_sdk/inventory/models/unauthenticated_response_content.py +90 -0
- method_sdk/inventory/models/update_environment400_error_response_content.py +151 -0
- method_sdk/inventory/models/update_environment_request_content.py +88 -0
- method_sdk/inventory/models/update_environment_response_content.py +92 -0
- method_sdk/inventory/paginators.py +12 -0
- method_sdk/inventory/py.typed +0 -0
- method_sdk/inventory/rest.py +334 -0
- method_sdk/method_auth.py +116 -0
- method_sdk/method_error.py +36 -0
- method_sdk/pagination.py +20 -0
- method_sdk/py.typed +0 -0
- method_security_sdk-0.35.0.dist-info/METADATA +23 -0
- method_security_sdk-0.35.0.dist-info/RECORD +46 -0
- method_security_sdk-0.35.0.dist-info/WHEEL +5 -0
- method_security_sdk-0.35.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1508 @@
|
|
|
1
|
+
"""
|
|
2
|
+
InventoryService
|
|
3
|
+
|
|
4
|
+
Attack surface, assets, and environments
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3
|
|
7
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
8
|
+
|
|
9
|
+
Do not edit the class manually.
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
import warnings
|
|
14
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from typing_extensions import Annotated
|
|
17
|
+
|
|
18
|
+
from pydantic import Field, StrictStr, field_validator
|
|
19
|
+
from typing import Optional, Union
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from method_sdk.inventory.models.create_environment_request_content import CreateEnvironmentRequestContent
|
|
22
|
+
from method_sdk.inventory.models.create_environment_response_content import CreateEnvironmentResponseContent
|
|
23
|
+
from method_sdk.inventory.models.delete_environment_response_content import DeleteEnvironmentResponseContent
|
|
24
|
+
from method_sdk.inventory.models.get_environment_response_content import GetEnvironmentResponseContent
|
|
25
|
+
from method_sdk.inventory.models.list_environments_response_content import ListEnvironmentsResponseContent
|
|
26
|
+
from method_sdk.inventory.models.update_environment_request_content import UpdateEnvironmentRequestContent
|
|
27
|
+
from method_sdk.inventory.models.update_environment_response_content import UpdateEnvironmentResponseContent
|
|
28
|
+
|
|
29
|
+
from method_sdk.inventory.api_client import ApiClient, RequestSerialized
|
|
30
|
+
from method_sdk.inventory.api_response import ApiResponse
|
|
31
|
+
from method_sdk.inventory.rest import RESTResponseType
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class InventoryApi:
|
|
35
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
36
|
+
Ref: https://openapi-generator.tech
|
|
37
|
+
|
|
38
|
+
Do not edit the class manually.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, api_client=None) -> None:
|
|
42
|
+
if api_client is None:
|
|
43
|
+
api_client = ApiClient.get_default()
|
|
44
|
+
self.api_client = api_client
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@validate_call
|
|
48
|
+
def create_environment(
|
|
49
|
+
self,
|
|
50
|
+
create_environment_request_content: CreateEnvironmentRequestContent,
|
|
51
|
+
_request_timeout: Union[
|
|
52
|
+
None,
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
54
|
+
Tuple[
|
|
55
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
57
|
+
]
|
|
58
|
+
] = None,
|
|
59
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_content_type: Optional[StrictStr] = None,
|
|
61
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
62
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
63
|
+
) -> CreateEnvironmentResponseContent:
|
|
64
|
+
"""create_environment
|
|
65
|
+
|
|
66
|
+
Creates an environment. Creation is asynchronous: the environment is CREATING until it's ACTIVE.
|
|
67
|
+
|
|
68
|
+
:param create_environment_request_content: (required)
|
|
69
|
+
:type create_environment_request_content: CreateEnvironmentRequestContent
|
|
70
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
71
|
+
number provided, it will be total request
|
|
72
|
+
timeout. It can also be a pair (tuple) of
|
|
73
|
+
(connection, read) timeouts.
|
|
74
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
75
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
76
|
+
request; this effectively ignores the
|
|
77
|
+
authentication in the spec for a single request.
|
|
78
|
+
:type _request_auth: dict, optional
|
|
79
|
+
:param _content_type: force content-type for the request.
|
|
80
|
+
:type _content_type: str, Optional
|
|
81
|
+
:param _headers: set to override the headers for a single
|
|
82
|
+
request; this effectively ignores the headers
|
|
83
|
+
in the spec for a single request.
|
|
84
|
+
:type _headers: dict, optional
|
|
85
|
+
:param _host_index: set to override the host_index for a single
|
|
86
|
+
request; this effectively ignores the host_index
|
|
87
|
+
in the spec for a single request.
|
|
88
|
+
:type _host_index: int, optional
|
|
89
|
+
:return: Returns the result object.
|
|
90
|
+
""" # noqa: E501
|
|
91
|
+
|
|
92
|
+
_param = self._create_environment_serialize(
|
|
93
|
+
create_environment_request_content=create_environment_request_content,
|
|
94
|
+
_request_auth=_request_auth,
|
|
95
|
+
_content_type=_content_type,
|
|
96
|
+
_headers=_headers,
|
|
97
|
+
_host_index=_host_index
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
101
|
+
'200': "CreateEnvironmentResponseContent",
|
|
102
|
+
'400': "CreateEnvironment400ErrorResponseContent",
|
|
103
|
+
'401': "UnauthenticatedResponseContent",
|
|
104
|
+
'403': "AccessDeniedResponseContent",
|
|
105
|
+
'429': "ThrottlingResponseContent",
|
|
106
|
+
'500': "InternalServerResponseContent",
|
|
107
|
+
'503': "ServiceUnavailableResponseContent",
|
|
108
|
+
}
|
|
109
|
+
response_data = self.api_client.call_api(
|
|
110
|
+
*_param,
|
|
111
|
+
_request_timeout=_request_timeout
|
|
112
|
+
)
|
|
113
|
+
response_data.read()
|
|
114
|
+
return self.api_client.response_deserialize(
|
|
115
|
+
response_data=response_data,
|
|
116
|
+
response_types_map=_response_types_map,
|
|
117
|
+
).data
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@validate_call
|
|
121
|
+
def create_environment_with_http_info(
|
|
122
|
+
self,
|
|
123
|
+
create_environment_request_content: CreateEnvironmentRequestContent,
|
|
124
|
+
_request_timeout: Union[
|
|
125
|
+
None,
|
|
126
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
127
|
+
Tuple[
|
|
128
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
129
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
130
|
+
]
|
|
131
|
+
] = None,
|
|
132
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
133
|
+
_content_type: Optional[StrictStr] = None,
|
|
134
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
135
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
136
|
+
) -> ApiResponse[CreateEnvironmentResponseContent]:
|
|
137
|
+
"""create_environment
|
|
138
|
+
|
|
139
|
+
Creates an environment. Creation is asynchronous: the environment is CREATING until it's ACTIVE.
|
|
140
|
+
|
|
141
|
+
:param create_environment_request_content: (required)
|
|
142
|
+
:type create_environment_request_content: CreateEnvironmentRequestContent
|
|
143
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
144
|
+
number provided, it will be total request
|
|
145
|
+
timeout. It can also be a pair (tuple) of
|
|
146
|
+
(connection, read) timeouts.
|
|
147
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
148
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
149
|
+
request; this effectively ignores the
|
|
150
|
+
authentication in the spec for a single request.
|
|
151
|
+
:type _request_auth: dict, optional
|
|
152
|
+
:param _content_type: force content-type for the request.
|
|
153
|
+
:type _content_type: str, Optional
|
|
154
|
+
:param _headers: set to override the headers for a single
|
|
155
|
+
request; this effectively ignores the headers
|
|
156
|
+
in the spec for a single request.
|
|
157
|
+
:type _headers: dict, optional
|
|
158
|
+
:param _host_index: set to override the host_index for a single
|
|
159
|
+
request; this effectively ignores the host_index
|
|
160
|
+
in the spec for a single request.
|
|
161
|
+
:type _host_index: int, optional
|
|
162
|
+
:return: Returns the result object.
|
|
163
|
+
""" # noqa: E501
|
|
164
|
+
|
|
165
|
+
_param = self._create_environment_serialize(
|
|
166
|
+
create_environment_request_content=create_environment_request_content,
|
|
167
|
+
_request_auth=_request_auth,
|
|
168
|
+
_content_type=_content_type,
|
|
169
|
+
_headers=_headers,
|
|
170
|
+
_host_index=_host_index
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
174
|
+
'200': "CreateEnvironmentResponseContent",
|
|
175
|
+
'400': "CreateEnvironment400ErrorResponseContent",
|
|
176
|
+
'401': "UnauthenticatedResponseContent",
|
|
177
|
+
'403': "AccessDeniedResponseContent",
|
|
178
|
+
'429': "ThrottlingResponseContent",
|
|
179
|
+
'500': "InternalServerResponseContent",
|
|
180
|
+
'503': "ServiceUnavailableResponseContent",
|
|
181
|
+
}
|
|
182
|
+
response_data = self.api_client.call_api(
|
|
183
|
+
*_param,
|
|
184
|
+
_request_timeout=_request_timeout
|
|
185
|
+
)
|
|
186
|
+
response_data.read()
|
|
187
|
+
return self.api_client.response_deserialize(
|
|
188
|
+
response_data=response_data,
|
|
189
|
+
response_types_map=_response_types_map,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@validate_call
|
|
194
|
+
def create_environment_without_preload_content(
|
|
195
|
+
self,
|
|
196
|
+
create_environment_request_content: CreateEnvironmentRequestContent,
|
|
197
|
+
_request_timeout: Union[
|
|
198
|
+
None,
|
|
199
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
200
|
+
Tuple[
|
|
201
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
202
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
203
|
+
]
|
|
204
|
+
] = None,
|
|
205
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
206
|
+
_content_type: Optional[StrictStr] = None,
|
|
207
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
208
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
209
|
+
) -> RESTResponseType:
|
|
210
|
+
"""create_environment
|
|
211
|
+
|
|
212
|
+
Creates an environment. Creation is asynchronous: the environment is CREATING until it's ACTIVE.
|
|
213
|
+
|
|
214
|
+
:param create_environment_request_content: (required)
|
|
215
|
+
:type create_environment_request_content: CreateEnvironmentRequestContent
|
|
216
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
217
|
+
number provided, it will be total request
|
|
218
|
+
timeout. It can also be a pair (tuple) of
|
|
219
|
+
(connection, read) timeouts.
|
|
220
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
221
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
222
|
+
request; this effectively ignores the
|
|
223
|
+
authentication in the spec for a single request.
|
|
224
|
+
:type _request_auth: dict, optional
|
|
225
|
+
:param _content_type: force content-type for the request.
|
|
226
|
+
:type _content_type: str, Optional
|
|
227
|
+
:param _headers: set to override the headers for a single
|
|
228
|
+
request; this effectively ignores the headers
|
|
229
|
+
in the spec for a single request.
|
|
230
|
+
:type _headers: dict, optional
|
|
231
|
+
:param _host_index: set to override the host_index for a single
|
|
232
|
+
request; this effectively ignores the host_index
|
|
233
|
+
in the spec for a single request.
|
|
234
|
+
:type _host_index: int, optional
|
|
235
|
+
:return: Returns the result object.
|
|
236
|
+
""" # noqa: E501
|
|
237
|
+
|
|
238
|
+
_param = self._create_environment_serialize(
|
|
239
|
+
create_environment_request_content=create_environment_request_content,
|
|
240
|
+
_request_auth=_request_auth,
|
|
241
|
+
_content_type=_content_type,
|
|
242
|
+
_headers=_headers,
|
|
243
|
+
_host_index=_host_index
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
247
|
+
'200': "CreateEnvironmentResponseContent",
|
|
248
|
+
'400': "CreateEnvironment400ErrorResponseContent",
|
|
249
|
+
'401': "UnauthenticatedResponseContent",
|
|
250
|
+
'403': "AccessDeniedResponseContent",
|
|
251
|
+
'429': "ThrottlingResponseContent",
|
|
252
|
+
'500': "InternalServerResponseContent",
|
|
253
|
+
'503': "ServiceUnavailableResponseContent",
|
|
254
|
+
}
|
|
255
|
+
response_data = self.api_client.call_api(
|
|
256
|
+
*_param,
|
|
257
|
+
_request_timeout=_request_timeout
|
|
258
|
+
)
|
|
259
|
+
return response_data.response
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def _create_environment_serialize(
|
|
263
|
+
self,
|
|
264
|
+
create_environment_request_content,
|
|
265
|
+
_request_auth,
|
|
266
|
+
_content_type,
|
|
267
|
+
_headers,
|
|
268
|
+
_host_index,
|
|
269
|
+
) -> RequestSerialized:
|
|
270
|
+
|
|
271
|
+
_host = None
|
|
272
|
+
|
|
273
|
+
_collection_formats: Dict[str, str] = {
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
_path_params: Dict[str, str] = {}
|
|
277
|
+
_query_params: List[Tuple[str, str]] = []
|
|
278
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
279
|
+
_form_params: List[Tuple[str, str]] = []
|
|
280
|
+
_files: Dict[
|
|
281
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
282
|
+
] = {}
|
|
283
|
+
_body_params: Optional[bytes] = None
|
|
284
|
+
|
|
285
|
+
# process the path parameters
|
|
286
|
+
# process the query parameters
|
|
287
|
+
# process the header parameters
|
|
288
|
+
# process the form parameters
|
|
289
|
+
# process the body parameter
|
|
290
|
+
if create_environment_request_content is not None:
|
|
291
|
+
_body_params = create_environment_request_content
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
# set the HTTP header `Accept`
|
|
295
|
+
if 'Accept' not in _header_params:
|
|
296
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
297
|
+
[
|
|
298
|
+
'application/json'
|
|
299
|
+
]
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
# set the HTTP header `Content-Type`
|
|
303
|
+
if _content_type:
|
|
304
|
+
_header_params['Content-Type'] = _content_type
|
|
305
|
+
else:
|
|
306
|
+
_default_content_type = (
|
|
307
|
+
self.api_client.select_header_content_type(
|
|
308
|
+
[
|
|
309
|
+
'application/json'
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
)
|
|
313
|
+
if _default_content_type is not None:
|
|
314
|
+
_header_params['Content-Type'] = _default_content_type
|
|
315
|
+
|
|
316
|
+
# authentication setting
|
|
317
|
+
_auth_settings: List[str] = [
|
|
318
|
+
'smithy.api.httpBearerAuth'
|
|
319
|
+
]
|
|
320
|
+
|
|
321
|
+
return self.api_client.param_serialize(
|
|
322
|
+
method='POST',
|
|
323
|
+
resource_path='/v3/inventory/environments',
|
|
324
|
+
path_params=_path_params,
|
|
325
|
+
query_params=_query_params,
|
|
326
|
+
header_params=_header_params,
|
|
327
|
+
body=_body_params,
|
|
328
|
+
post_params=_form_params,
|
|
329
|
+
files=_files,
|
|
330
|
+
auth_settings=_auth_settings,
|
|
331
|
+
collection_formats=_collection_formats,
|
|
332
|
+
_host=_host,
|
|
333
|
+
_request_auth=_request_auth
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
@validate_call
|
|
340
|
+
def delete_environment(
|
|
341
|
+
self,
|
|
342
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to delete.")],
|
|
343
|
+
_request_timeout: Union[
|
|
344
|
+
None,
|
|
345
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
346
|
+
Tuple[
|
|
347
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
348
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
349
|
+
]
|
|
350
|
+
] = None,
|
|
351
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
352
|
+
_content_type: Optional[StrictStr] = None,
|
|
353
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
354
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
355
|
+
) -> DeleteEnvironmentResponseContent:
|
|
356
|
+
"""delete_environment
|
|
357
|
+
|
|
358
|
+
Deletes an environment and everything in it. Deletion is asynchronous: the environment is DELETING until it's gone.
|
|
359
|
+
|
|
360
|
+
:param environment_id: The environment to delete. (required)
|
|
361
|
+
:type environment_id: str
|
|
362
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
363
|
+
number provided, it will be total request
|
|
364
|
+
timeout. It can also be a pair (tuple) of
|
|
365
|
+
(connection, read) timeouts.
|
|
366
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
367
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
368
|
+
request; this effectively ignores the
|
|
369
|
+
authentication in the spec for a single request.
|
|
370
|
+
:type _request_auth: dict, optional
|
|
371
|
+
:param _content_type: force content-type for the request.
|
|
372
|
+
:type _content_type: str, Optional
|
|
373
|
+
:param _headers: set to override the headers for a single
|
|
374
|
+
request; this effectively ignores the headers
|
|
375
|
+
in the spec for a single request.
|
|
376
|
+
:type _headers: dict, optional
|
|
377
|
+
:param _host_index: set to override the host_index for a single
|
|
378
|
+
request; this effectively ignores the host_index
|
|
379
|
+
in the spec for a single request.
|
|
380
|
+
:type _host_index: int, optional
|
|
381
|
+
:return: Returns the result object.
|
|
382
|
+
""" # noqa: E501
|
|
383
|
+
|
|
384
|
+
_param = self._delete_environment_serialize(
|
|
385
|
+
environment_id=environment_id,
|
|
386
|
+
_request_auth=_request_auth,
|
|
387
|
+
_content_type=_content_type,
|
|
388
|
+
_headers=_headers,
|
|
389
|
+
_host_index=_host_index
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
393
|
+
'200': "DeleteEnvironmentResponseContent",
|
|
394
|
+
'400': "DeleteEnvironment400ErrorResponseContent",
|
|
395
|
+
'401': "UnauthenticatedResponseContent",
|
|
396
|
+
'403': "AccessDeniedResponseContent",
|
|
397
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
398
|
+
'429': "ThrottlingResponseContent",
|
|
399
|
+
'500': "InternalServerResponseContent",
|
|
400
|
+
'503': "ServiceUnavailableResponseContent",
|
|
401
|
+
}
|
|
402
|
+
response_data = self.api_client.call_api(
|
|
403
|
+
*_param,
|
|
404
|
+
_request_timeout=_request_timeout
|
|
405
|
+
)
|
|
406
|
+
response_data.read()
|
|
407
|
+
return self.api_client.response_deserialize(
|
|
408
|
+
response_data=response_data,
|
|
409
|
+
response_types_map=_response_types_map,
|
|
410
|
+
).data
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
@validate_call
|
|
414
|
+
def delete_environment_with_http_info(
|
|
415
|
+
self,
|
|
416
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to delete.")],
|
|
417
|
+
_request_timeout: Union[
|
|
418
|
+
None,
|
|
419
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
420
|
+
Tuple[
|
|
421
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
422
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
423
|
+
]
|
|
424
|
+
] = None,
|
|
425
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
426
|
+
_content_type: Optional[StrictStr] = None,
|
|
427
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
428
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
429
|
+
) -> ApiResponse[DeleteEnvironmentResponseContent]:
|
|
430
|
+
"""delete_environment
|
|
431
|
+
|
|
432
|
+
Deletes an environment and everything in it. Deletion is asynchronous: the environment is DELETING until it's gone.
|
|
433
|
+
|
|
434
|
+
:param environment_id: The environment to delete. (required)
|
|
435
|
+
:type environment_id: str
|
|
436
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
437
|
+
number provided, it will be total request
|
|
438
|
+
timeout. It can also be a pair (tuple) of
|
|
439
|
+
(connection, read) timeouts.
|
|
440
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
441
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
442
|
+
request; this effectively ignores the
|
|
443
|
+
authentication in the spec for a single request.
|
|
444
|
+
:type _request_auth: dict, optional
|
|
445
|
+
:param _content_type: force content-type for the request.
|
|
446
|
+
:type _content_type: str, Optional
|
|
447
|
+
:param _headers: set to override the headers for a single
|
|
448
|
+
request; this effectively ignores the headers
|
|
449
|
+
in the spec for a single request.
|
|
450
|
+
:type _headers: dict, optional
|
|
451
|
+
:param _host_index: set to override the host_index for a single
|
|
452
|
+
request; this effectively ignores the host_index
|
|
453
|
+
in the spec for a single request.
|
|
454
|
+
:type _host_index: int, optional
|
|
455
|
+
:return: Returns the result object.
|
|
456
|
+
""" # noqa: E501
|
|
457
|
+
|
|
458
|
+
_param = self._delete_environment_serialize(
|
|
459
|
+
environment_id=environment_id,
|
|
460
|
+
_request_auth=_request_auth,
|
|
461
|
+
_content_type=_content_type,
|
|
462
|
+
_headers=_headers,
|
|
463
|
+
_host_index=_host_index
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
467
|
+
'200': "DeleteEnvironmentResponseContent",
|
|
468
|
+
'400': "DeleteEnvironment400ErrorResponseContent",
|
|
469
|
+
'401': "UnauthenticatedResponseContent",
|
|
470
|
+
'403': "AccessDeniedResponseContent",
|
|
471
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
472
|
+
'429': "ThrottlingResponseContent",
|
|
473
|
+
'500': "InternalServerResponseContent",
|
|
474
|
+
'503': "ServiceUnavailableResponseContent",
|
|
475
|
+
}
|
|
476
|
+
response_data = self.api_client.call_api(
|
|
477
|
+
*_param,
|
|
478
|
+
_request_timeout=_request_timeout
|
|
479
|
+
)
|
|
480
|
+
response_data.read()
|
|
481
|
+
return self.api_client.response_deserialize(
|
|
482
|
+
response_data=response_data,
|
|
483
|
+
response_types_map=_response_types_map,
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
@validate_call
|
|
488
|
+
def delete_environment_without_preload_content(
|
|
489
|
+
self,
|
|
490
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to delete.")],
|
|
491
|
+
_request_timeout: Union[
|
|
492
|
+
None,
|
|
493
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
494
|
+
Tuple[
|
|
495
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
496
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
497
|
+
]
|
|
498
|
+
] = None,
|
|
499
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
500
|
+
_content_type: Optional[StrictStr] = None,
|
|
501
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
502
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
503
|
+
) -> RESTResponseType:
|
|
504
|
+
"""delete_environment
|
|
505
|
+
|
|
506
|
+
Deletes an environment and everything in it. Deletion is asynchronous: the environment is DELETING until it's gone.
|
|
507
|
+
|
|
508
|
+
:param environment_id: The environment to delete. (required)
|
|
509
|
+
:type environment_id: str
|
|
510
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
511
|
+
number provided, it will be total request
|
|
512
|
+
timeout. It can also be a pair (tuple) of
|
|
513
|
+
(connection, read) timeouts.
|
|
514
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
515
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
516
|
+
request; this effectively ignores the
|
|
517
|
+
authentication in the spec for a single request.
|
|
518
|
+
:type _request_auth: dict, optional
|
|
519
|
+
:param _content_type: force content-type for the request.
|
|
520
|
+
:type _content_type: str, Optional
|
|
521
|
+
:param _headers: set to override the headers for a single
|
|
522
|
+
request; this effectively ignores the headers
|
|
523
|
+
in the spec for a single request.
|
|
524
|
+
:type _headers: dict, optional
|
|
525
|
+
:param _host_index: set to override the host_index for a single
|
|
526
|
+
request; this effectively ignores the host_index
|
|
527
|
+
in the spec for a single request.
|
|
528
|
+
:type _host_index: int, optional
|
|
529
|
+
:return: Returns the result object.
|
|
530
|
+
""" # noqa: E501
|
|
531
|
+
|
|
532
|
+
_param = self._delete_environment_serialize(
|
|
533
|
+
environment_id=environment_id,
|
|
534
|
+
_request_auth=_request_auth,
|
|
535
|
+
_content_type=_content_type,
|
|
536
|
+
_headers=_headers,
|
|
537
|
+
_host_index=_host_index
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
541
|
+
'200': "DeleteEnvironmentResponseContent",
|
|
542
|
+
'400': "DeleteEnvironment400ErrorResponseContent",
|
|
543
|
+
'401': "UnauthenticatedResponseContent",
|
|
544
|
+
'403': "AccessDeniedResponseContent",
|
|
545
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
546
|
+
'429': "ThrottlingResponseContent",
|
|
547
|
+
'500': "InternalServerResponseContent",
|
|
548
|
+
'503': "ServiceUnavailableResponseContent",
|
|
549
|
+
}
|
|
550
|
+
response_data = self.api_client.call_api(
|
|
551
|
+
*_param,
|
|
552
|
+
_request_timeout=_request_timeout
|
|
553
|
+
)
|
|
554
|
+
return response_data.response
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
def _delete_environment_serialize(
|
|
558
|
+
self,
|
|
559
|
+
environment_id,
|
|
560
|
+
_request_auth,
|
|
561
|
+
_content_type,
|
|
562
|
+
_headers,
|
|
563
|
+
_host_index,
|
|
564
|
+
) -> RequestSerialized:
|
|
565
|
+
|
|
566
|
+
_host = None
|
|
567
|
+
|
|
568
|
+
_collection_formats: Dict[str, str] = {
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
_path_params: Dict[str, str] = {}
|
|
572
|
+
_query_params: List[Tuple[str, str]] = []
|
|
573
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
574
|
+
_form_params: List[Tuple[str, str]] = []
|
|
575
|
+
_files: Dict[
|
|
576
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
577
|
+
] = {}
|
|
578
|
+
_body_params: Optional[bytes] = None
|
|
579
|
+
|
|
580
|
+
# process the path parameters
|
|
581
|
+
if environment_id is not None:
|
|
582
|
+
_path_params['environmentId'] = environment_id
|
|
583
|
+
# process the query parameters
|
|
584
|
+
# process the header parameters
|
|
585
|
+
# process the form parameters
|
|
586
|
+
# process the body parameter
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
# set the HTTP header `Accept`
|
|
590
|
+
if 'Accept' not in _header_params:
|
|
591
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
592
|
+
[
|
|
593
|
+
'application/json'
|
|
594
|
+
]
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
# authentication setting
|
|
599
|
+
_auth_settings: List[str] = [
|
|
600
|
+
'smithy.api.httpBearerAuth'
|
|
601
|
+
]
|
|
602
|
+
|
|
603
|
+
return self.api_client.param_serialize(
|
|
604
|
+
method='DELETE',
|
|
605
|
+
resource_path='/v3/inventory/environments/{environmentId}',
|
|
606
|
+
path_params=_path_params,
|
|
607
|
+
query_params=_query_params,
|
|
608
|
+
header_params=_header_params,
|
|
609
|
+
body=_body_params,
|
|
610
|
+
post_params=_form_params,
|
|
611
|
+
files=_files,
|
|
612
|
+
auth_settings=_auth_settings,
|
|
613
|
+
collection_formats=_collection_formats,
|
|
614
|
+
_host=_host,
|
|
615
|
+
_request_auth=_request_auth
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
@validate_call
|
|
622
|
+
def get_environment(
|
|
623
|
+
self,
|
|
624
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to get.")],
|
|
625
|
+
_request_timeout: Union[
|
|
626
|
+
None,
|
|
627
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
628
|
+
Tuple[
|
|
629
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
630
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
631
|
+
]
|
|
632
|
+
] = None,
|
|
633
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
634
|
+
_content_type: Optional[StrictStr] = None,
|
|
635
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
636
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
637
|
+
) -> GetEnvironmentResponseContent:
|
|
638
|
+
"""get_environment
|
|
639
|
+
|
|
640
|
+
Gets an environment.
|
|
641
|
+
|
|
642
|
+
:param environment_id: The environment to get. (required)
|
|
643
|
+
:type environment_id: str
|
|
644
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
645
|
+
number provided, it will be total request
|
|
646
|
+
timeout. It can also be a pair (tuple) of
|
|
647
|
+
(connection, read) timeouts.
|
|
648
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
649
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
650
|
+
request; this effectively ignores the
|
|
651
|
+
authentication in the spec for a single request.
|
|
652
|
+
:type _request_auth: dict, optional
|
|
653
|
+
:param _content_type: force content-type for the request.
|
|
654
|
+
:type _content_type: str, Optional
|
|
655
|
+
:param _headers: set to override the headers for a single
|
|
656
|
+
request; this effectively ignores the headers
|
|
657
|
+
in the spec for a single request.
|
|
658
|
+
:type _headers: dict, optional
|
|
659
|
+
:param _host_index: set to override the host_index for a single
|
|
660
|
+
request; this effectively ignores the host_index
|
|
661
|
+
in the spec for a single request.
|
|
662
|
+
:type _host_index: int, optional
|
|
663
|
+
:return: Returns the result object.
|
|
664
|
+
""" # noqa: E501
|
|
665
|
+
|
|
666
|
+
_param = self._get_environment_serialize(
|
|
667
|
+
environment_id=environment_id,
|
|
668
|
+
_request_auth=_request_auth,
|
|
669
|
+
_content_type=_content_type,
|
|
670
|
+
_headers=_headers,
|
|
671
|
+
_host_index=_host_index
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
675
|
+
'200': "GetEnvironmentResponseContent",
|
|
676
|
+
'400': "GetEnvironment400ErrorResponseContent",
|
|
677
|
+
'401': "UnauthenticatedResponseContent",
|
|
678
|
+
'403': "AccessDeniedResponseContent",
|
|
679
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
680
|
+
'429': "ThrottlingResponseContent",
|
|
681
|
+
'500': "InternalServerResponseContent",
|
|
682
|
+
'503': "ServiceUnavailableResponseContent",
|
|
683
|
+
}
|
|
684
|
+
response_data = self.api_client.call_api(
|
|
685
|
+
*_param,
|
|
686
|
+
_request_timeout=_request_timeout
|
|
687
|
+
)
|
|
688
|
+
response_data.read()
|
|
689
|
+
return self.api_client.response_deserialize(
|
|
690
|
+
response_data=response_data,
|
|
691
|
+
response_types_map=_response_types_map,
|
|
692
|
+
).data
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
@validate_call
|
|
696
|
+
def get_environment_with_http_info(
|
|
697
|
+
self,
|
|
698
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to get.")],
|
|
699
|
+
_request_timeout: Union[
|
|
700
|
+
None,
|
|
701
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
702
|
+
Tuple[
|
|
703
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
704
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
705
|
+
]
|
|
706
|
+
] = None,
|
|
707
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
708
|
+
_content_type: Optional[StrictStr] = None,
|
|
709
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
710
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
711
|
+
) -> ApiResponse[GetEnvironmentResponseContent]:
|
|
712
|
+
"""get_environment
|
|
713
|
+
|
|
714
|
+
Gets an environment.
|
|
715
|
+
|
|
716
|
+
:param environment_id: The environment to get. (required)
|
|
717
|
+
:type environment_id: str
|
|
718
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
719
|
+
number provided, it will be total request
|
|
720
|
+
timeout. It can also be a pair (tuple) of
|
|
721
|
+
(connection, read) timeouts.
|
|
722
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
723
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
724
|
+
request; this effectively ignores the
|
|
725
|
+
authentication in the spec for a single request.
|
|
726
|
+
:type _request_auth: dict, optional
|
|
727
|
+
:param _content_type: force content-type for the request.
|
|
728
|
+
:type _content_type: str, Optional
|
|
729
|
+
:param _headers: set to override the headers for a single
|
|
730
|
+
request; this effectively ignores the headers
|
|
731
|
+
in the spec for a single request.
|
|
732
|
+
:type _headers: dict, optional
|
|
733
|
+
:param _host_index: set to override the host_index for a single
|
|
734
|
+
request; this effectively ignores the host_index
|
|
735
|
+
in the spec for a single request.
|
|
736
|
+
:type _host_index: int, optional
|
|
737
|
+
:return: Returns the result object.
|
|
738
|
+
""" # noqa: E501
|
|
739
|
+
|
|
740
|
+
_param = self._get_environment_serialize(
|
|
741
|
+
environment_id=environment_id,
|
|
742
|
+
_request_auth=_request_auth,
|
|
743
|
+
_content_type=_content_type,
|
|
744
|
+
_headers=_headers,
|
|
745
|
+
_host_index=_host_index
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
749
|
+
'200': "GetEnvironmentResponseContent",
|
|
750
|
+
'400': "GetEnvironment400ErrorResponseContent",
|
|
751
|
+
'401': "UnauthenticatedResponseContent",
|
|
752
|
+
'403': "AccessDeniedResponseContent",
|
|
753
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
754
|
+
'429': "ThrottlingResponseContent",
|
|
755
|
+
'500': "InternalServerResponseContent",
|
|
756
|
+
'503': "ServiceUnavailableResponseContent",
|
|
757
|
+
}
|
|
758
|
+
response_data = self.api_client.call_api(
|
|
759
|
+
*_param,
|
|
760
|
+
_request_timeout=_request_timeout
|
|
761
|
+
)
|
|
762
|
+
response_data.read()
|
|
763
|
+
return self.api_client.response_deserialize(
|
|
764
|
+
response_data=response_data,
|
|
765
|
+
response_types_map=_response_types_map,
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
@validate_call
|
|
770
|
+
def get_environment_without_preload_content(
|
|
771
|
+
self,
|
|
772
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to get.")],
|
|
773
|
+
_request_timeout: Union[
|
|
774
|
+
None,
|
|
775
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
776
|
+
Tuple[
|
|
777
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
778
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
779
|
+
]
|
|
780
|
+
] = None,
|
|
781
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
782
|
+
_content_type: Optional[StrictStr] = None,
|
|
783
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
784
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
785
|
+
) -> RESTResponseType:
|
|
786
|
+
"""get_environment
|
|
787
|
+
|
|
788
|
+
Gets an environment.
|
|
789
|
+
|
|
790
|
+
:param environment_id: The environment to get. (required)
|
|
791
|
+
:type environment_id: str
|
|
792
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
793
|
+
number provided, it will be total request
|
|
794
|
+
timeout. It can also be a pair (tuple) of
|
|
795
|
+
(connection, read) timeouts.
|
|
796
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
797
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
798
|
+
request; this effectively ignores the
|
|
799
|
+
authentication in the spec for a single request.
|
|
800
|
+
:type _request_auth: dict, optional
|
|
801
|
+
:param _content_type: force content-type for the request.
|
|
802
|
+
:type _content_type: str, Optional
|
|
803
|
+
:param _headers: set to override the headers for a single
|
|
804
|
+
request; this effectively ignores the headers
|
|
805
|
+
in the spec for a single request.
|
|
806
|
+
:type _headers: dict, optional
|
|
807
|
+
:param _host_index: set to override the host_index for a single
|
|
808
|
+
request; this effectively ignores the host_index
|
|
809
|
+
in the spec for a single request.
|
|
810
|
+
:type _host_index: int, optional
|
|
811
|
+
:return: Returns the result object.
|
|
812
|
+
""" # noqa: E501
|
|
813
|
+
|
|
814
|
+
_param = self._get_environment_serialize(
|
|
815
|
+
environment_id=environment_id,
|
|
816
|
+
_request_auth=_request_auth,
|
|
817
|
+
_content_type=_content_type,
|
|
818
|
+
_headers=_headers,
|
|
819
|
+
_host_index=_host_index
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
823
|
+
'200': "GetEnvironmentResponseContent",
|
|
824
|
+
'400': "GetEnvironment400ErrorResponseContent",
|
|
825
|
+
'401': "UnauthenticatedResponseContent",
|
|
826
|
+
'403': "AccessDeniedResponseContent",
|
|
827
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
828
|
+
'429': "ThrottlingResponseContent",
|
|
829
|
+
'500': "InternalServerResponseContent",
|
|
830
|
+
'503': "ServiceUnavailableResponseContent",
|
|
831
|
+
}
|
|
832
|
+
response_data = self.api_client.call_api(
|
|
833
|
+
*_param,
|
|
834
|
+
_request_timeout=_request_timeout
|
|
835
|
+
)
|
|
836
|
+
return response_data.response
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
def _get_environment_serialize(
|
|
840
|
+
self,
|
|
841
|
+
environment_id,
|
|
842
|
+
_request_auth,
|
|
843
|
+
_content_type,
|
|
844
|
+
_headers,
|
|
845
|
+
_host_index,
|
|
846
|
+
) -> RequestSerialized:
|
|
847
|
+
|
|
848
|
+
_host = None
|
|
849
|
+
|
|
850
|
+
_collection_formats: Dict[str, str] = {
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
_path_params: Dict[str, str] = {}
|
|
854
|
+
_query_params: List[Tuple[str, str]] = []
|
|
855
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
856
|
+
_form_params: List[Tuple[str, str]] = []
|
|
857
|
+
_files: Dict[
|
|
858
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
859
|
+
] = {}
|
|
860
|
+
_body_params: Optional[bytes] = None
|
|
861
|
+
|
|
862
|
+
# process the path parameters
|
|
863
|
+
if environment_id is not None:
|
|
864
|
+
_path_params['environmentId'] = environment_id
|
|
865
|
+
# process the query parameters
|
|
866
|
+
# process the header parameters
|
|
867
|
+
# process the form parameters
|
|
868
|
+
# process the body parameter
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
# set the HTTP header `Accept`
|
|
872
|
+
if 'Accept' not in _header_params:
|
|
873
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
874
|
+
[
|
|
875
|
+
'application/json'
|
|
876
|
+
]
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
# authentication setting
|
|
881
|
+
_auth_settings: List[str] = [
|
|
882
|
+
'smithy.api.httpBearerAuth'
|
|
883
|
+
]
|
|
884
|
+
|
|
885
|
+
return self.api_client.param_serialize(
|
|
886
|
+
method='GET',
|
|
887
|
+
resource_path='/v3/inventory/environments/{environmentId}',
|
|
888
|
+
path_params=_path_params,
|
|
889
|
+
query_params=_query_params,
|
|
890
|
+
header_params=_header_params,
|
|
891
|
+
body=_body_params,
|
|
892
|
+
post_params=_form_params,
|
|
893
|
+
files=_files,
|
|
894
|
+
auth_settings=_auth_settings,
|
|
895
|
+
collection_formats=_collection_formats,
|
|
896
|
+
_host=_host,
|
|
897
|
+
_request_auth=_request_auth
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
@validate_call
|
|
904
|
+
def list_environments(
|
|
905
|
+
self,
|
|
906
|
+
page_size: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Maximum environments per page. Defaults to 100.")] = None,
|
|
907
|
+
next_token: Annotated[Optional[StrictStr], Field(description="The `nextToken` from the previous page.")] = None,
|
|
908
|
+
_request_timeout: Union[
|
|
909
|
+
None,
|
|
910
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
911
|
+
Tuple[
|
|
912
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
913
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
914
|
+
]
|
|
915
|
+
] = None,
|
|
916
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
917
|
+
_content_type: Optional[StrictStr] = None,
|
|
918
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
919
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
920
|
+
) -> ListEnvironmentsResponseContent:
|
|
921
|
+
"""list_environments
|
|
922
|
+
|
|
923
|
+
Lists the environments the caller can see.
|
|
924
|
+
|
|
925
|
+
:param page_size: Maximum environments per page. Defaults to 100.
|
|
926
|
+
:type page_size: float
|
|
927
|
+
:param next_token: The `nextToken` from the previous page.
|
|
928
|
+
:type next_token: str
|
|
929
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
930
|
+
number provided, it will be total request
|
|
931
|
+
timeout. It can also be a pair (tuple) of
|
|
932
|
+
(connection, read) timeouts.
|
|
933
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
934
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
935
|
+
request; this effectively ignores the
|
|
936
|
+
authentication in the spec for a single request.
|
|
937
|
+
:type _request_auth: dict, optional
|
|
938
|
+
:param _content_type: force content-type for the request.
|
|
939
|
+
:type _content_type: str, Optional
|
|
940
|
+
:param _headers: set to override the headers for a single
|
|
941
|
+
request; this effectively ignores the headers
|
|
942
|
+
in the spec for a single request.
|
|
943
|
+
:type _headers: dict, optional
|
|
944
|
+
:param _host_index: set to override the host_index for a single
|
|
945
|
+
request; this effectively ignores the host_index
|
|
946
|
+
in the spec for a single request.
|
|
947
|
+
:type _host_index: int, optional
|
|
948
|
+
:return: Returns the result object.
|
|
949
|
+
""" # noqa: E501
|
|
950
|
+
|
|
951
|
+
_param = self._list_environments_serialize(
|
|
952
|
+
page_size=page_size,
|
|
953
|
+
next_token=next_token,
|
|
954
|
+
_request_auth=_request_auth,
|
|
955
|
+
_content_type=_content_type,
|
|
956
|
+
_headers=_headers,
|
|
957
|
+
_host_index=_host_index
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
961
|
+
'200': "ListEnvironmentsResponseContent",
|
|
962
|
+
'400': "ListEnvironments400ErrorResponseContent",
|
|
963
|
+
'401': "UnauthenticatedResponseContent",
|
|
964
|
+
'403': "AccessDeniedResponseContent",
|
|
965
|
+
'429': "ThrottlingResponseContent",
|
|
966
|
+
'500': "InternalServerResponseContent",
|
|
967
|
+
'503': "ServiceUnavailableResponseContent",
|
|
968
|
+
}
|
|
969
|
+
response_data = self.api_client.call_api(
|
|
970
|
+
*_param,
|
|
971
|
+
_request_timeout=_request_timeout
|
|
972
|
+
)
|
|
973
|
+
response_data.read()
|
|
974
|
+
return self.api_client.response_deserialize(
|
|
975
|
+
response_data=response_data,
|
|
976
|
+
response_types_map=_response_types_map,
|
|
977
|
+
).data
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
@validate_call
|
|
981
|
+
def list_environments_with_http_info(
|
|
982
|
+
self,
|
|
983
|
+
page_size: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Maximum environments per page. Defaults to 100.")] = None,
|
|
984
|
+
next_token: Annotated[Optional[StrictStr], Field(description="The `nextToken` from the previous page.")] = None,
|
|
985
|
+
_request_timeout: Union[
|
|
986
|
+
None,
|
|
987
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
988
|
+
Tuple[
|
|
989
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
990
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
991
|
+
]
|
|
992
|
+
] = None,
|
|
993
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
994
|
+
_content_type: Optional[StrictStr] = None,
|
|
995
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
996
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
997
|
+
) -> ApiResponse[ListEnvironmentsResponseContent]:
|
|
998
|
+
"""list_environments
|
|
999
|
+
|
|
1000
|
+
Lists the environments the caller can see.
|
|
1001
|
+
|
|
1002
|
+
:param page_size: Maximum environments per page. Defaults to 100.
|
|
1003
|
+
:type page_size: float
|
|
1004
|
+
:param next_token: The `nextToken` from the previous page.
|
|
1005
|
+
:type next_token: str
|
|
1006
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1007
|
+
number provided, it will be total request
|
|
1008
|
+
timeout. It can also be a pair (tuple) of
|
|
1009
|
+
(connection, read) timeouts.
|
|
1010
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1011
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1012
|
+
request; this effectively ignores the
|
|
1013
|
+
authentication in the spec for a single request.
|
|
1014
|
+
:type _request_auth: dict, optional
|
|
1015
|
+
:param _content_type: force content-type for the request.
|
|
1016
|
+
:type _content_type: str, Optional
|
|
1017
|
+
:param _headers: set to override the headers for a single
|
|
1018
|
+
request; this effectively ignores the headers
|
|
1019
|
+
in the spec for a single request.
|
|
1020
|
+
:type _headers: dict, optional
|
|
1021
|
+
:param _host_index: set to override the host_index for a single
|
|
1022
|
+
request; this effectively ignores the host_index
|
|
1023
|
+
in the spec for a single request.
|
|
1024
|
+
:type _host_index: int, optional
|
|
1025
|
+
:return: Returns the result object.
|
|
1026
|
+
""" # noqa: E501
|
|
1027
|
+
|
|
1028
|
+
_param = self._list_environments_serialize(
|
|
1029
|
+
page_size=page_size,
|
|
1030
|
+
next_token=next_token,
|
|
1031
|
+
_request_auth=_request_auth,
|
|
1032
|
+
_content_type=_content_type,
|
|
1033
|
+
_headers=_headers,
|
|
1034
|
+
_host_index=_host_index
|
|
1035
|
+
)
|
|
1036
|
+
|
|
1037
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1038
|
+
'200': "ListEnvironmentsResponseContent",
|
|
1039
|
+
'400': "ListEnvironments400ErrorResponseContent",
|
|
1040
|
+
'401': "UnauthenticatedResponseContent",
|
|
1041
|
+
'403': "AccessDeniedResponseContent",
|
|
1042
|
+
'429': "ThrottlingResponseContent",
|
|
1043
|
+
'500': "InternalServerResponseContent",
|
|
1044
|
+
'503': "ServiceUnavailableResponseContent",
|
|
1045
|
+
}
|
|
1046
|
+
response_data = self.api_client.call_api(
|
|
1047
|
+
*_param,
|
|
1048
|
+
_request_timeout=_request_timeout
|
|
1049
|
+
)
|
|
1050
|
+
response_data.read()
|
|
1051
|
+
return self.api_client.response_deserialize(
|
|
1052
|
+
response_data=response_data,
|
|
1053
|
+
response_types_map=_response_types_map,
|
|
1054
|
+
)
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
@validate_call
|
|
1058
|
+
def list_environments_without_preload_content(
|
|
1059
|
+
self,
|
|
1060
|
+
page_size: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Maximum environments per page. Defaults to 100.")] = None,
|
|
1061
|
+
next_token: Annotated[Optional[StrictStr], Field(description="The `nextToken` from the previous page.")] = None,
|
|
1062
|
+
_request_timeout: Union[
|
|
1063
|
+
None,
|
|
1064
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1065
|
+
Tuple[
|
|
1066
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1067
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1068
|
+
]
|
|
1069
|
+
] = None,
|
|
1070
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1071
|
+
_content_type: Optional[StrictStr] = None,
|
|
1072
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1073
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1074
|
+
) -> RESTResponseType:
|
|
1075
|
+
"""list_environments
|
|
1076
|
+
|
|
1077
|
+
Lists the environments the caller can see.
|
|
1078
|
+
|
|
1079
|
+
:param page_size: Maximum environments per page. Defaults to 100.
|
|
1080
|
+
:type page_size: float
|
|
1081
|
+
:param next_token: The `nextToken` from the previous page.
|
|
1082
|
+
:type next_token: str
|
|
1083
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1084
|
+
number provided, it will be total request
|
|
1085
|
+
timeout. It can also be a pair (tuple) of
|
|
1086
|
+
(connection, read) timeouts.
|
|
1087
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1088
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1089
|
+
request; this effectively ignores the
|
|
1090
|
+
authentication in the spec for a single request.
|
|
1091
|
+
:type _request_auth: dict, optional
|
|
1092
|
+
:param _content_type: force content-type for the request.
|
|
1093
|
+
:type _content_type: str, Optional
|
|
1094
|
+
:param _headers: set to override the headers for a single
|
|
1095
|
+
request; this effectively ignores the headers
|
|
1096
|
+
in the spec for a single request.
|
|
1097
|
+
:type _headers: dict, optional
|
|
1098
|
+
:param _host_index: set to override the host_index for a single
|
|
1099
|
+
request; this effectively ignores the host_index
|
|
1100
|
+
in the spec for a single request.
|
|
1101
|
+
:type _host_index: int, optional
|
|
1102
|
+
:return: Returns the result object.
|
|
1103
|
+
""" # noqa: E501
|
|
1104
|
+
|
|
1105
|
+
_param = self._list_environments_serialize(
|
|
1106
|
+
page_size=page_size,
|
|
1107
|
+
next_token=next_token,
|
|
1108
|
+
_request_auth=_request_auth,
|
|
1109
|
+
_content_type=_content_type,
|
|
1110
|
+
_headers=_headers,
|
|
1111
|
+
_host_index=_host_index
|
|
1112
|
+
)
|
|
1113
|
+
|
|
1114
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1115
|
+
'200': "ListEnvironmentsResponseContent",
|
|
1116
|
+
'400': "ListEnvironments400ErrorResponseContent",
|
|
1117
|
+
'401': "UnauthenticatedResponseContent",
|
|
1118
|
+
'403': "AccessDeniedResponseContent",
|
|
1119
|
+
'429': "ThrottlingResponseContent",
|
|
1120
|
+
'500': "InternalServerResponseContent",
|
|
1121
|
+
'503': "ServiceUnavailableResponseContent",
|
|
1122
|
+
}
|
|
1123
|
+
response_data = self.api_client.call_api(
|
|
1124
|
+
*_param,
|
|
1125
|
+
_request_timeout=_request_timeout
|
|
1126
|
+
)
|
|
1127
|
+
return response_data.response
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
def _list_environments_serialize(
|
|
1131
|
+
self,
|
|
1132
|
+
page_size,
|
|
1133
|
+
next_token,
|
|
1134
|
+
_request_auth,
|
|
1135
|
+
_content_type,
|
|
1136
|
+
_headers,
|
|
1137
|
+
_host_index,
|
|
1138
|
+
) -> RequestSerialized:
|
|
1139
|
+
|
|
1140
|
+
_host = None
|
|
1141
|
+
|
|
1142
|
+
_collection_formats: Dict[str, str] = {
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
_path_params: Dict[str, str] = {}
|
|
1146
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1147
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1148
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1149
|
+
_files: Dict[
|
|
1150
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1151
|
+
] = {}
|
|
1152
|
+
_body_params: Optional[bytes] = None
|
|
1153
|
+
|
|
1154
|
+
# process the path parameters
|
|
1155
|
+
# process the query parameters
|
|
1156
|
+
if page_size is not None:
|
|
1157
|
+
|
|
1158
|
+
_query_params.append(('pageSize', page_size))
|
|
1159
|
+
|
|
1160
|
+
if next_token is not None:
|
|
1161
|
+
|
|
1162
|
+
_query_params.append(('nextToken', next_token))
|
|
1163
|
+
|
|
1164
|
+
# process the header parameters
|
|
1165
|
+
# process the form parameters
|
|
1166
|
+
# process the body parameter
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
# set the HTTP header `Accept`
|
|
1170
|
+
if 'Accept' not in _header_params:
|
|
1171
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1172
|
+
[
|
|
1173
|
+
'application/json'
|
|
1174
|
+
]
|
|
1175
|
+
)
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
# authentication setting
|
|
1179
|
+
_auth_settings: List[str] = [
|
|
1180
|
+
'smithy.api.httpBearerAuth'
|
|
1181
|
+
]
|
|
1182
|
+
|
|
1183
|
+
return self.api_client.param_serialize(
|
|
1184
|
+
method='GET',
|
|
1185
|
+
resource_path='/v3/inventory/environments',
|
|
1186
|
+
path_params=_path_params,
|
|
1187
|
+
query_params=_query_params,
|
|
1188
|
+
header_params=_header_params,
|
|
1189
|
+
body=_body_params,
|
|
1190
|
+
post_params=_form_params,
|
|
1191
|
+
files=_files,
|
|
1192
|
+
auth_settings=_auth_settings,
|
|
1193
|
+
collection_formats=_collection_formats,
|
|
1194
|
+
_host=_host,
|
|
1195
|
+
_request_auth=_request_auth
|
|
1196
|
+
)
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
@validate_call
|
|
1202
|
+
def update_environment(
|
|
1203
|
+
self,
|
|
1204
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to update.")],
|
|
1205
|
+
update_environment_request_content: Optional[UpdateEnvironmentRequestContent] = None,
|
|
1206
|
+
_request_timeout: Union[
|
|
1207
|
+
None,
|
|
1208
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1209
|
+
Tuple[
|
|
1210
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1211
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1212
|
+
]
|
|
1213
|
+
] = None,
|
|
1214
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1215
|
+
_content_type: Optional[StrictStr] = None,
|
|
1216
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1217
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1218
|
+
) -> UpdateEnvironmentResponseContent:
|
|
1219
|
+
"""update_environment
|
|
1220
|
+
|
|
1221
|
+
Updates an environment. Omitted fields are unchanged.
|
|
1222
|
+
|
|
1223
|
+
:param environment_id: The environment to update. (required)
|
|
1224
|
+
:type environment_id: str
|
|
1225
|
+
:param update_environment_request_content:
|
|
1226
|
+
:type update_environment_request_content: UpdateEnvironmentRequestContent
|
|
1227
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1228
|
+
number provided, it will be total request
|
|
1229
|
+
timeout. It can also be a pair (tuple) of
|
|
1230
|
+
(connection, read) timeouts.
|
|
1231
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1232
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1233
|
+
request; this effectively ignores the
|
|
1234
|
+
authentication in the spec for a single request.
|
|
1235
|
+
:type _request_auth: dict, optional
|
|
1236
|
+
:param _content_type: force content-type for the request.
|
|
1237
|
+
:type _content_type: str, Optional
|
|
1238
|
+
:param _headers: set to override the headers for a single
|
|
1239
|
+
request; this effectively ignores the headers
|
|
1240
|
+
in the spec for a single request.
|
|
1241
|
+
:type _headers: dict, optional
|
|
1242
|
+
:param _host_index: set to override the host_index for a single
|
|
1243
|
+
request; this effectively ignores the host_index
|
|
1244
|
+
in the spec for a single request.
|
|
1245
|
+
:type _host_index: int, optional
|
|
1246
|
+
:return: Returns the result object.
|
|
1247
|
+
""" # noqa: E501
|
|
1248
|
+
|
|
1249
|
+
_param = self._update_environment_serialize(
|
|
1250
|
+
environment_id=environment_id,
|
|
1251
|
+
update_environment_request_content=update_environment_request_content,
|
|
1252
|
+
_request_auth=_request_auth,
|
|
1253
|
+
_content_type=_content_type,
|
|
1254
|
+
_headers=_headers,
|
|
1255
|
+
_host_index=_host_index
|
|
1256
|
+
)
|
|
1257
|
+
|
|
1258
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1259
|
+
'200': "UpdateEnvironmentResponseContent",
|
|
1260
|
+
'400': "UpdateEnvironment400ErrorResponseContent",
|
|
1261
|
+
'401': "UnauthenticatedResponseContent",
|
|
1262
|
+
'403': "AccessDeniedResponseContent",
|
|
1263
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
1264
|
+
'429': "ThrottlingResponseContent",
|
|
1265
|
+
'500': "InternalServerResponseContent",
|
|
1266
|
+
'503': "ServiceUnavailableResponseContent",
|
|
1267
|
+
}
|
|
1268
|
+
response_data = self.api_client.call_api(
|
|
1269
|
+
*_param,
|
|
1270
|
+
_request_timeout=_request_timeout
|
|
1271
|
+
)
|
|
1272
|
+
response_data.read()
|
|
1273
|
+
return self.api_client.response_deserialize(
|
|
1274
|
+
response_data=response_data,
|
|
1275
|
+
response_types_map=_response_types_map,
|
|
1276
|
+
).data
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
@validate_call
|
|
1280
|
+
def update_environment_with_http_info(
|
|
1281
|
+
self,
|
|
1282
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to update.")],
|
|
1283
|
+
update_environment_request_content: Optional[UpdateEnvironmentRequestContent] = None,
|
|
1284
|
+
_request_timeout: Union[
|
|
1285
|
+
None,
|
|
1286
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1287
|
+
Tuple[
|
|
1288
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1289
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1290
|
+
]
|
|
1291
|
+
] = None,
|
|
1292
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1293
|
+
_content_type: Optional[StrictStr] = None,
|
|
1294
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1295
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1296
|
+
) -> ApiResponse[UpdateEnvironmentResponseContent]:
|
|
1297
|
+
"""update_environment
|
|
1298
|
+
|
|
1299
|
+
Updates an environment. Omitted fields are unchanged.
|
|
1300
|
+
|
|
1301
|
+
:param environment_id: The environment to update. (required)
|
|
1302
|
+
:type environment_id: str
|
|
1303
|
+
:param update_environment_request_content:
|
|
1304
|
+
:type update_environment_request_content: UpdateEnvironmentRequestContent
|
|
1305
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1306
|
+
number provided, it will be total request
|
|
1307
|
+
timeout. It can also be a pair (tuple) of
|
|
1308
|
+
(connection, read) timeouts.
|
|
1309
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1310
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1311
|
+
request; this effectively ignores the
|
|
1312
|
+
authentication in the spec for a single request.
|
|
1313
|
+
:type _request_auth: dict, optional
|
|
1314
|
+
:param _content_type: force content-type for the request.
|
|
1315
|
+
:type _content_type: str, Optional
|
|
1316
|
+
:param _headers: set to override the headers for a single
|
|
1317
|
+
request; this effectively ignores the headers
|
|
1318
|
+
in the spec for a single request.
|
|
1319
|
+
:type _headers: dict, optional
|
|
1320
|
+
:param _host_index: set to override the host_index for a single
|
|
1321
|
+
request; this effectively ignores the host_index
|
|
1322
|
+
in the spec for a single request.
|
|
1323
|
+
:type _host_index: int, optional
|
|
1324
|
+
:return: Returns the result object.
|
|
1325
|
+
""" # noqa: E501
|
|
1326
|
+
|
|
1327
|
+
_param = self._update_environment_serialize(
|
|
1328
|
+
environment_id=environment_id,
|
|
1329
|
+
update_environment_request_content=update_environment_request_content,
|
|
1330
|
+
_request_auth=_request_auth,
|
|
1331
|
+
_content_type=_content_type,
|
|
1332
|
+
_headers=_headers,
|
|
1333
|
+
_host_index=_host_index
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1336
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1337
|
+
'200': "UpdateEnvironmentResponseContent",
|
|
1338
|
+
'400': "UpdateEnvironment400ErrorResponseContent",
|
|
1339
|
+
'401': "UnauthenticatedResponseContent",
|
|
1340
|
+
'403': "AccessDeniedResponseContent",
|
|
1341
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
1342
|
+
'429': "ThrottlingResponseContent",
|
|
1343
|
+
'500': "InternalServerResponseContent",
|
|
1344
|
+
'503': "ServiceUnavailableResponseContent",
|
|
1345
|
+
}
|
|
1346
|
+
response_data = self.api_client.call_api(
|
|
1347
|
+
*_param,
|
|
1348
|
+
_request_timeout=_request_timeout
|
|
1349
|
+
)
|
|
1350
|
+
response_data.read()
|
|
1351
|
+
return self.api_client.response_deserialize(
|
|
1352
|
+
response_data=response_data,
|
|
1353
|
+
response_types_map=_response_types_map,
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
@validate_call
|
|
1358
|
+
def update_environment_without_preload_content(
|
|
1359
|
+
self,
|
|
1360
|
+
environment_id: Annotated[str, Field(strict=True, description="The environment to update.")],
|
|
1361
|
+
update_environment_request_content: Optional[UpdateEnvironmentRequestContent] = None,
|
|
1362
|
+
_request_timeout: Union[
|
|
1363
|
+
None,
|
|
1364
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1365
|
+
Tuple[
|
|
1366
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1367
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1368
|
+
]
|
|
1369
|
+
] = None,
|
|
1370
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1371
|
+
_content_type: Optional[StrictStr] = None,
|
|
1372
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1373
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1374
|
+
) -> RESTResponseType:
|
|
1375
|
+
"""update_environment
|
|
1376
|
+
|
|
1377
|
+
Updates an environment. Omitted fields are unchanged.
|
|
1378
|
+
|
|
1379
|
+
:param environment_id: The environment to update. (required)
|
|
1380
|
+
:type environment_id: str
|
|
1381
|
+
:param update_environment_request_content:
|
|
1382
|
+
:type update_environment_request_content: UpdateEnvironmentRequestContent
|
|
1383
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1384
|
+
number provided, it will be total request
|
|
1385
|
+
timeout. It can also be a pair (tuple) of
|
|
1386
|
+
(connection, read) timeouts.
|
|
1387
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1388
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1389
|
+
request; this effectively ignores the
|
|
1390
|
+
authentication in the spec for a single request.
|
|
1391
|
+
:type _request_auth: dict, optional
|
|
1392
|
+
:param _content_type: force content-type for the request.
|
|
1393
|
+
:type _content_type: str, Optional
|
|
1394
|
+
:param _headers: set to override the headers for a single
|
|
1395
|
+
request; this effectively ignores the headers
|
|
1396
|
+
in the spec for a single request.
|
|
1397
|
+
:type _headers: dict, optional
|
|
1398
|
+
:param _host_index: set to override the host_index for a single
|
|
1399
|
+
request; this effectively ignores the host_index
|
|
1400
|
+
in the spec for a single request.
|
|
1401
|
+
:type _host_index: int, optional
|
|
1402
|
+
:return: Returns the result object.
|
|
1403
|
+
""" # noqa: E501
|
|
1404
|
+
|
|
1405
|
+
_param = self._update_environment_serialize(
|
|
1406
|
+
environment_id=environment_id,
|
|
1407
|
+
update_environment_request_content=update_environment_request_content,
|
|
1408
|
+
_request_auth=_request_auth,
|
|
1409
|
+
_content_type=_content_type,
|
|
1410
|
+
_headers=_headers,
|
|
1411
|
+
_host_index=_host_index
|
|
1412
|
+
)
|
|
1413
|
+
|
|
1414
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1415
|
+
'200': "UpdateEnvironmentResponseContent",
|
|
1416
|
+
'400': "UpdateEnvironment400ErrorResponseContent",
|
|
1417
|
+
'401': "UnauthenticatedResponseContent",
|
|
1418
|
+
'403': "AccessDeniedResponseContent",
|
|
1419
|
+
'404': "EnvironmentNotFoundResponseContent",
|
|
1420
|
+
'429': "ThrottlingResponseContent",
|
|
1421
|
+
'500': "InternalServerResponseContent",
|
|
1422
|
+
'503': "ServiceUnavailableResponseContent",
|
|
1423
|
+
}
|
|
1424
|
+
response_data = self.api_client.call_api(
|
|
1425
|
+
*_param,
|
|
1426
|
+
_request_timeout=_request_timeout
|
|
1427
|
+
)
|
|
1428
|
+
return response_data.response
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
def _update_environment_serialize(
|
|
1432
|
+
self,
|
|
1433
|
+
environment_id,
|
|
1434
|
+
update_environment_request_content,
|
|
1435
|
+
_request_auth,
|
|
1436
|
+
_content_type,
|
|
1437
|
+
_headers,
|
|
1438
|
+
_host_index,
|
|
1439
|
+
) -> RequestSerialized:
|
|
1440
|
+
|
|
1441
|
+
_host = None
|
|
1442
|
+
|
|
1443
|
+
_collection_formats: Dict[str, str] = {
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
_path_params: Dict[str, str] = {}
|
|
1447
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1448
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1449
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1450
|
+
_files: Dict[
|
|
1451
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1452
|
+
] = {}
|
|
1453
|
+
_body_params: Optional[bytes] = None
|
|
1454
|
+
|
|
1455
|
+
# process the path parameters
|
|
1456
|
+
if environment_id is not None:
|
|
1457
|
+
_path_params['environmentId'] = environment_id
|
|
1458
|
+
# process the query parameters
|
|
1459
|
+
# process the header parameters
|
|
1460
|
+
# process the form parameters
|
|
1461
|
+
# process the body parameter
|
|
1462
|
+
if update_environment_request_content is not None:
|
|
1463
|
+
_body_params = update_environment_request_content
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
# set the HTTP header `Accept`
|
|
1467
|
+
if 'Accept' not in _header_params:
|
|
1468
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1469
|
+
[
|
|
1470
|
+
'application/json'
|
|
1471
|
+
]
|
|
1472
|
+
)
|
|
1473
|
+
|
|
1474
|
+
# set the HTTP header `Content-Type`
|
|
1475
|
+
if _content_type:
|
|
1476
|
+
_header_params['Content-Type'] = _content_type
|
|
1477
|
+
else:
|
|
1478
|
+
_default_content_type = (
|
|
1479
|
+
self.api_client.select_header_content_type(
|
|
1480
|
+
[
|
|
1481
|
+
'application/json'
|
|
1482
|
+
]
|
|
1483
|
+
)
|
|
1484
|
+
)
|
|
1485
|
+
if _default_content_type is not None:
|
|
1486
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1487
|
+
|
|
1488
|
+
# authentication setting
|
|
1489
|
+
_auth_settings: List[str] = [
|
|
1490
|
+
'smithy.api.httpBearerAuth'
|
|
1491
|
+
]
|
|
1492
|
+
|
|
1493
|
+
return self.api_client.param_serialize(
|
|
1494
|
+
method='PATCH',
|
|
1495
|
+
resource_path='/v3/inventory/environments/{environmentId}',
|
|
1496
|
+
path_params=_path_params,
|
|
1497
|
+
query_params=_query_params,
|
|
1498
|
+
header_params=_header_params,
|
|
1499
|
+
body=_body_params,
|
|
1500
|
+
post_params=_form_params,
|
|
1501
|
+
files=_files,
|
|
1502
|
+
auth_settings=_auth_settings,
|
|
1503
|
+
collection_formats=_collection_formats,
|
|
1504
|
+
_host=_host,
|
|
1505
|
+
_request_auth=_request_auth
|
|
1506
|
+
)
|
|
1507
|
+
|
|
1508
|
+
|