capo-lambda-microvms 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.
- capo_lambda_microvms/__init__.py +73 -0
- capo_lambda_microvms/_async.py +25 -0
- capo_lambda_microvms/_auth/_identity.py +16 -0
- capo_lambda_microvms/_auth/_providers.py +886 -0
- capo_lambda_microvms/_auth/_signers.py +125 -0
- capo_lambda_microvms/_auth/_sigv4.py +579 -0
- capo_lambda_microvms/_auth/_zapros_handler.py +80 -0
- capo_lambda_microvms/_body.py +221 -0
- capo_lambda_microvms/_iter.py +113 -0
- capo_lambda_microvms/_operations/lambda_microvms/create_microvm_auth_token.py +181 -0
- capo_lambda_microvms/_operations/lambda_microvms/create_microvm_image.py +190 -0
- capo_lambda_microvms/_operations/lambda_microvms/create_microvm_shell_auth_token.py +181 -0
- capo_lambda_microvms/_operations/lambda_microvms/delete_microvm_image.py +170 -0
- capo_lambda_microvms/_operations/lambda_microvms/delete_microvm_image_version.py +174 -0
- capo_lambda_microvms/_operations/lambda_microvms/get_microvm.py +171 -0
- capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image.py +170 -0
- capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image_build.py +177 -0
- capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image_version.py +179 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_managed_microvm_image_versions.py +172 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_managed_microvm_images.py +162 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_microvm_image_builds.py +196 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_microvm_image_versions.py +172 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_microvm_images.py +164 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_microvms.py +175 -0
- capo_lambda_microvms/_operations/lambda_microvms/list_tags.py +182 -0
- capo_lambda_microvms/_operations/lambda_microvms/resume_microvm.py +167 -0
- capo_lambda_microvms/_operations/lambda_microvms/run_microvm.py +187 -0
- capo_lambda_microvms/_operations/lambda_microvms/suspend_microvm.py +167 -0
- capo_lambda_microvms/_operations/lambda_microvms/tag_resource.py +164 -0
- capo_lambda_microvms/_operations/lambda_microvms/terminate_microvm.py +167 -0
- capo_lambda_microvms/_operations/lambda_microvms/untag_resource.py +162 -0
- capo_lambda_microvms/_operations/lambda_microvms/update_microvm_image.py +191 -0
- capo_lambda_microvms/_operations/lambda_microvms/update_microvm_image_version.py +190 -0
- capo_lambda_microvms/_pagination.py +21 -0
- capo_lambda_microvms/_protocol/__init__.py +1 -0
- capo_lambda_microvms/_protocol/errors.py +93 -0
- capo_lambda_microvms/_protocol/eventstream.py +240 -0
- capo_lambda_microvms/_protocol/serialize.py +47 -0
- capo_lambda_microvms/_protocol/xml.py +33 -0
- capo_lambda_microvms/_resources/lambda_microvms/microvm.py +983 -0
- capo_lambda_microvms/_resources/lambda_microvms/microvm_image.py +1394 -0
- capo_lambda_microvms/_rule_engine/__init__.py +0 -0
- capo_lambda_microvms/_rule_engine/_aws_partition.py +160 -0
- capo_lambda_microvms/_rule_engine/_endpoint_rule_set.py +135 -0
- capo_lambda_microvms/_rule_engine/_endpoint_runtime.py +389 -0
- capo_lambda_microvms/_services/_aws_config.py +160 -0
- capo_lambda_microvms/_services/_pipeline.py +247 -0
- capo_lambda_microvms/_services/async_lambda_microvms.py +1822 -0
- capo_lambda_microvms/_services/lambda_microvms.py +1798 -0
- capo_lambda_microvms/errors/__init__.py +49 -0
- capo_lambda_microvms/errors/_base.py +94 -0
- capo_lambda_microvms/errors/access_denied_exception.py +46 -0
- capo_lambda_microvms/errors/conflict_exception.py +56 -0
- capo_lambda_microvms/errors/insufficient_capacity_exception.py +49 -0
- capo_lambda_microvms/errors/internal_server_exception.py +48 -0
- capo_lambda_microvms/errors/invalid_parameter_value_exception.py +54 -0
- capo_lambda_microvms/errors/resource_conflict_exception.py +52 -0
- capo_lambda_microvms/errors/resource_not_found_exception.py +59 -0
- capo_lambda_microvms/errors/service_exception.py +50 -0
- capo_lambda_microvms/errors/service_quota_exceeded_exception.py +72 -0
- capo_lambda_microvms/errors/throttling_exception.py +58 -0
- capo_lambda_microvms/errors/too_many_requests_exception.py +52 -0
- capo_lambda_microvms/errors/validation_exception.py +44 -0
- capo_lambda_microvms/py.typed +0 -0
- capo_lambda_microvms/types/_prelude/blob.py +12 -0
- capo_lambda_microvms/types/_prelude/timestamp.py +17 -0
- capo_lambda_microvms/types/architecture.py +14 -0
- capo_lambda_microvms/types/auth_token_key.py +5 -0
- capo_lambda_microvms/types/auth_token_value.py +5 -0
- capo_lambda_microvms/types/build_state.py +19 -0
- capo_lambda_microvms/types/capability.py +15 -0
- capo_lambda_microvms/types/capability_list.py +29 -0
- capo_lambda_microvms/types/chipset.py +14 -0
- capo_lambda_microvms/types/cloud_watch_logging.py +34 -0
- capo_lambda_microvms/types/code_artifact.py +32 -0
- capo_lambda_microvms/types/cpu_configuration.py +39 -0
- capo_lambda_microvms/types/cpu_configuration_list.py +31 -0
- capo_lambda_microvms/types/create_microvm_auth_token_request.py +62 -0
- capo_lambda_microvms/types/create_microvm_auth_token_response.py +39 -0
- capo_lambda_microvms/types/create_microvm_image_request.py +219 -0
- capo_lambda_microvms/types/create_microvm_image_response.py +294 -0
- capo_lambda_microvms/types/create_microvm_shell_auth_token_request.py +38 -0
- capo_lambda_microvms/types/create_microvm_shell_auth_token_response.py +41 -0
- capo_lambda_microvms/types/delete_microvm_image_input.py +26 -0
- capo_lambda_microvms/types/delete_microvm_image_output.py +49 -0
- capo_lambda_microvms/types/delete_microvm_image_version_input.py +29 -0
- capo_lambda_microvms/types/delete_microvm_image_version_output.py +65 -0
- capo_lambda_microvms/types/environment_variable_key.py +5 -0
- capo_lambda_microvms/types/environment_variable_map.py +29 -0
- capo_lambda_microvms/types/environment_variable_value.py +5 -0
- capo_lambda_microvms/types/get_microvm_image_build_input.py +31 -0
- capo_lambda_microvms/types/get_microvm_image_build_output.py +144 -0
- capo_lambda_microvms/types/get_microvm_image_input.py +26 -0
- capo_lambda_microvms/types/get_microvm_image_output.py +117 -0
- capo_lambda_microvms/types/get_microvm_image_version_input.py +29 -0
- capo_lambda_microvms/types/get_microvm_image_version_output.py +308 -0
- capo_lambda_microvms/types/get_microvm_request.py +26 -0
- capo_lambda_microvms/types/get_microvm_response.py +188 -0
- capo_lambda_microvms/types/hook_state.py +18 -0
- capo_lambda_microvms/types/hooks.py +65 -0
- capo_lambda_microvms/types/idle_policy.py +40 -0
- capo_lambda_microvms/types/image_name.py +6 -0
- capo_lambda_microvms/types/list_managed_microvm_image_versions_input.py +31 -0
- capo_lambda_microvms/types/list_managed_microvm_image_versions_output.py +52 -0
- capo_lambda_microvms/types/list_managed_microvm_images_input.py +26 -0
- capo_lambda_microvms/types/list_managed_microvm_images_output.py +50 -0
- capo_lambda_microvms/types/list_microvm_image_builds_input.py +44 -0
- capo_lambda_microvms/types/list_microvm_image_builds_output.py +50 -0
- capo_lambda_microvms/types/list_microvm_image_versions_input.py +31 -0
- capo_lambda_microvms/types/list_microvm_image_versions_output.py +50 -0
- capo_lambda_microvms/types/list_microvm_images_request.py +31 -0
- capo_lambda_microvms/types/list_microvm_images_response.py +48 -0
- capo_lambda_microvms/types/list_microvms_request.py +33 -0
- capo_lambda_microvms/types/list_microvms_response.py +46 -0
- capo_lambda_microvms/types/list_of_port_specification.py +31 -0
- capo_lambda_microvms/types/list_tags_request.py +24 -0
- capo_lambda_microvms/types/list_tags_response.py +32 -0
- capo_lambda_microvms/types/logging.py +65 -0
- capo_lambda_microvms/types/logging_disabled.py +18 -0
- capo_lambda_microvms/types/managed_microvm_image_summary.py +66 -0
- capo_lambda_microvms/types/managed_microvm_image_summary_list.py +39 -0
- capo_lambda_microvms/types/managed_microvm_image_version.py +94 -0
- capo_lambda_microvms/types/managed_microvm_image_version_list.py +39 -0
- capo_lambda_microvms/types/managed_microvm_image_version_status.py +18 -0
- capo_lambda_microvms/types/microvm_hooks.py +108 -0
- capo_lambda_microvms/types/microvm_identifier.py +6 -0
- capo_lambda_microvms/types/microvm_image_arn.py +6 -0
- capo_lambda_microvms/types/microvm_image_build_summaries.py +37 -0
- capo_lambda_microvms/types/microvm_image_build_summary.py +125 -0
- capo_lambda_microvms/types/microvm_image_hooks.py +66 -0
- capo_lambda_microvms/types/microvm_image_identifier.py +6 -0
- capo_lambda_microvms/types/microvm_image_state.py +24 -0
- capo_lambda_microvms/types/microvm_image_summaries.py +35 -0
- capo_lambda_microvms/types/microvm_image_summary.py +90 -0
- capo_lambda_microvms/types/microvm_image_version_state.py +22 -0
- capo_lambda_microvms/types/microvm_image_version_status.py +17 -0
- capo_lambda_microvms/types/microvm_image_version_summary.py +300 -0
- capo_lambda_microvms/types/microvm_image_version_summary_list.py +39 -0
- capo_lambda_microvms/types/microvm_item.py +82 -0
- capo_lambda_microvms/types/microvm_item_list.py +29 -0
- capo_lambda_microvms/types/microvm_state.py +22 -0
- capo_lambda_microvms/types/network_connector.py +5 -0
- capo_lambda_microvms/types/network_connector_list.py +19 -0
- capo_lambda_microvms/types/non_blank_string.py +6 -0
- capo_lambda_microvms/types/port_number.py +6 -0
- capo_lambda_microvms/types/port_range.py +38 -0
- capo_lambda_microvms/types/port_specification.py +63 -0
- capo_lambda_microvms/types/positive_integer.py +5 -0
- capo_lambda_microvms/types/resources.py +26 -0
- capo_lambda_microvms/types/resources_list.py +29 -0
- capo_lambda_microvms/types/resume_microvm_request.py +26 -0
- capo_lambda_microvms/types/resume_microvm_response.py +18 -0
- capo_lambda_microvms/types/role_arn.py +6 -0
- capo_lambda_microvms/types/run_hook_payload.py +5 -0
- capo_lambda_microvms/types/run_microvm_request.py +139 -0
- capo_lambda_microvms/types/run_microvm_response.py +188 -0
- capo_lambda_microvms/types/snapshot_build.py +35 -0
- capo_lambda_microvms/types/string.py +5 -0
- capo_lambda_microvms/types/suspend_microvm_request.py +26 -0
- capo_lambda_microvms/types/suspend_microvm_response.py +18 -0
- capo_lambda_microvms/types/tag_key.py +5 -0
- capo_lambda_microvms/types/tag_key_list.py +17 -0
- capo_lambda_microvms/types/tag_resource_request.py +38 -0
- capo_lambda_microvms/types/tag_value.py +5 -0
- capo_lambda_microvms/types/taggable_resource.py +6 -0
- capo_lambda_microvms/types/tags.py +29 -0
- capo_lambda_microvms/types/terminate_microvm_request.py +26 -0
- capo_lambda_microvms/types/terminate_microvm_response.py +18 -0
- capo_lambda_microvms/types/token_parts.py +29 -0
- capo_lambda_microvms/types/untag_resource_request.py +27 -0
- capo_lambda_microvms/types/update_microvm_image_request.py +205 -0
- capo_lambda_microvms/types/update_microvm_image_response.py +284 -0
- capo_lambda_microvms/types/update_microvm_image_version_request.py +51 -0
- capo_lambda_microvms/types/update_microvm_image_version_response.py +312 -0
- capo_lambda_microvms/types/version.py +5 -0
- capo_lambda_microvms-0.1.0.dist-info/METADATA +103 -0
- capo_lambda_microvms-0.1.0.dist-info/RECORD +180 -0
- capo_lambda_microvms-0.1.0.dist-info/WHEEL +5 -0
- capo_lambda_microvms-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_lambda_microvms-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from ._base import (
|
|
4
|
+
DeserializationError as DeserializationError,
|
|
5
|
+
)
|
|
6
|
+
from ._base import (
|
|
7
|
+
LambdaMicrovmsError as LambdaMicrovmsError,
|
|
8
|
+
)
|
|
9
|
+
from ._base import (
|
|
10
|
+
SerializationError as SerializationError,
|
|
11
|
+
)
|
|
12
|
+
from ._base import (
|
|
13
|
+
ServiceError as ServiceError,
|
|
14
|
+
)
|
|
15
|
+
from ._base import (
|
|
16
|
+
UnknownServiceError as UnknownServiceError,
|
|
17
|
+
)
|
|
18
|
+
from ._base import (
|
|
19
|
+
WaiterFailedError as WaiterFailedError,
|
|
20
|
+
)
|
|
21
|
+
from ._base import (
|
|
22
|
+
WaiterTimeoutError as WaiterTimeoutError,
|
|
23
|
+
)
|
|
24
|
+
from .access_denied_exception import AccessDeniedException as AccessDeniedException
|
|
25
|
+
from .conflict_exception import ConflictException as ConflictException
|
|
26
|
+
from .insufficient_capacity_exception import (
|
|
27
|
+
InsufficientCapacityException as InsufficientCapacityException,
|
|
28
|
+
)
|
|
29
|
+
from .internal_server_exception import (
|
|
30
|
+
InternalServerException as InternalServerException,
|
|
31
|
+
)
|
|
32
|
+
from .invalid_parameter_value_exception import (
|
|
33
|
+
InvalidParameterValueException as InvalidParameterValueException,
|
|
34
|
+
)
|
|
35
|
+
from .resource_conflict_exception import (
|
|
36
|
+
ResourceConflictException as ResourceConflictException,
|
|
37
|
+
)
|
|
38
|
+
from .resource_not_found_exception import (
|
|
39
|
+
ResourceNotFoundException as ResourceNotFoundException,
|
|
40
|
+
)
|
|
41
|
+
from .service_exception import ServiceException as ServiceException
|
|
42
|
+
from .service_quota_exceeded_exception import (
|
|
43
|
+
ServiceQuotaExceededException as ServiceQuotaExceededException,
|
|
44
|
+
)
|
|
45
|
+
from .throttling_exception import ThrottlingException as ThrottlingException
|
|
46
|
+
from .too_many_requests_exception import (
|
|
47
|
+
TooManyRequestsException as TooManyRequestsException,
|
|
48
|
+
)
|
|
49
|
+
from .validation_exception import ValidationException as ValidationException
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class LambdaMicrovmsError(Exception):
|
|
5
|
+
"""Base class for all LambdaMicrovms service errors."""
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceError(LambdaMicrovmsError):
|
|
9
|
+
"""Base class for all modeled service errors.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
fault: ``"client"`` or ``"server"``.
|
|
13
|
+
is_throttling_error: Whether this error is a throttling error.
|
|
14
|
+
is_retryable: Whether this error is retryable.
|
|
15
|
+
code: The wire error code, or ``None``.
|
|
16
|
+
message: The error message, or ``None``.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
code: str | None = None
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
fault: Literal["client", "server"],
|
|
24
|
+
*,
|
|
25
|
+
is_throttling_error: bool,
|
|
26
|
+
is_retryable: bool,
|
|
27
|
+
code: str | None = None,
|
|
28
|
+
message: str | None = None,
|
|
29
|
+
) -> None:
|
|
30
|
+
super().__init__(f"{code or '<no code>'}: {message or '<no message>'}")
|
|
31
|
+
self.fault = fault
|
|
32
|
+
self.is_throttling_error = is_throttling_error
|
|
33
|
+
self.is_retryable = is_retryable
|
|
34
|
+
self.code = code
|
|
35
|
+
self.message = message
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class SerializationError(LambdaMicrovmsError):
|
|
39
|
+
"""Raised when a value cannot be serialized."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class DeserializationError(LambdaMicrovmsError):
|
|
43
|
+
"""Raised when a value cannot be deserialized or a required member is missing."""
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class UnknownServiceError(ServiceError):
|
|
47
|
+
"""Raised when the server returns an error code the client does not model.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
code: ``<Code>`` text from the response body, or ``None`` if absent.
|
|
51
|
+
message: ``<Message>`` text from the response body, or ``None``.
|
|
52
|
+
response: The original HTTP response object, for arbitrary inspection.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(
|
|
56
|
+
self, *, code: str | None, message: str | None, response: object
|
|
57
|
+
) -> None:
|
|
58
|
+
_status = getattr(response, "status", 500)
|
|
59
|
+
_fault: Literal["client", "server"] = "client" if _status < 500 else "server"
|
|
60
|
+
_throttling = _status == 429
|
|
61
|
+
_retryable = _throttling or _status >= 500
|
|
62
|
+
super().__init__(
|
|
63
|
+
_fault,
|
|
64
|
+
is_throttling_error=_throttling,
|
|
65
|
+
is_retryable=_retryable,
|
|
66
|
+
code=code,
|
|
67
|
+
message=message,
|
|
68
|
+
)
|
|
69
|
+
self.response = response
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class WaiterFailedError(LambdaMicrovmsError):
|
|
73
|
+
"""Raised when a waiter hits an acceptor with ``state="failure"``.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
waiter_name: snake_case waiter name (e.g. ``bucket_exists``).
|
|
77
|
+
reason: Short description of which acceptor fired.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
def __init__(self, waiter_name: str, reason: str) -> None:
|
|
81
|
+
super().__init__(f"waiter {waiter_name} failed: {reason}")
|
|
82
|
+
self.waiter_name = waiter_name
|
|
83
|
+
self.reason = reason
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class WaiterTimeoutError(LambdaMicrovmsError):
|
|
87
|
+
"""Raised when a waiter exhausts ``max_wait_time`` without a terminal acceptor."""
|
|
88
|
+
|
|
89
|
+
def __init__(self, waiter_name: str, max_wait_time: float) -> None:
|
|
90
|
+
super().__init__(
|
|
91
|
+
f"waiter {waiter_name} timed out after {max_wait_time} seconds"
|
|
92
|
+
)
|
|
93
|
+
self.waiter_name = waiter_name
|
|
94
|
+
self.max_wait_time = max_wait_time
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#AccessDeniedException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AccessDeniedException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# --- restJson1 ser/de ---
|
|
13
|
+
def serialize_json(value: AccessDeniedException_) -> dict:
|
|
14
|
+
out: dict = {}
|
|
15
|
+
if "message" in value:
|
|
16
|
+
out["message"] = value["message"]
|
|
17
|
+
return out
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def deserialize_json(data: dict) -> AccessDeniedException_:
|
|
21
|
+
out: AccessDeniedException_ = {} # type: ignore[typeddict-item]
|
|
22
|
+
if data.get("message") is not None:
|
|
23
|
+
out["message"] = data["message"]
|
|
24
|
+
return out
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class AccessDeniedException(ServiceError):
|
|
28
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#AccessDeniedException``."""
|
|
29
|
+
|
|
30
|
+
code: str | None = "AccessDeniedException"
|
|
31
|
+
|
|
32
|
+
def __init__(self, data: AccessDeniedException_, message: str | None = None):
|
|
33
|
+
super().__init__(
|
|
34
|
+
"client",
|
|
35
|
+
is_throttling_error=False,
|
|
36
|
+
is_retryable=False,
|
|
37
|
+
code="AccessDeniedException",
|
|
38
|
+
message=message,
|
|
39
|
+
)
|
|
40
|
+
self.data = data
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_json(
|
|
44
|
+
cls, data: dict, message: str | None = None
|
|
45
|
+
) -> "AccessDeniedException":
|
|
46
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#ConflictException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ConflictException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
resource_id: NotRequired["str"]
|
|
11
|
+
"""<p>The identifier of the resource that caused the conflict.</p>"""
|
|
12
|
+
resource_type: NotRequired["str"]
|
|
13
|
+
"""<p>The type of the resource that caused the conflict.</p>"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# --- restJson1 ser/de ---
|
|
17
|
+
def serialize_json(value: ConflictException_) -> dict:
|
|
18
|
+
out: dict = {}
|
|
19
|
+
if "message" in value:
|
|
20
|
+
out["message"] = value["message"]
|
|
21
|
+
if "resource_id" in value:
|
|
22
|
+
out["resourceId"] = value["resource_id"]
|
|
23
|
+
if "resource_type" in value:
|
|
24
|
+
out["resourceType"] = value["resource_type"]
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def deserialize_json(data: dict) -> ConflictException_:
|
|
29
|
+
out: ConflictException_ = {} # type: ignore[typeddict-item]
|
|
30
|
+
if data.get("message") is not None:
|
|
31
|
+
out["message"] = data["message"]
|
|
32
|
+
if data.get("resourceId") is not None:
|
|
33
|
+
out["resource_id"] = data["resourceId"]
|
|
34
|
+
if data.get("resourceType") is not None:
|
|
35
|
+
out["resource_type"] = data["resourceType"]
|
|
36
|
+
return out
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class ConflictException(ServiceError):
|
|
40
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#ConflictException``."""
|
|
41
|
+
|
|
42
|
+
code: str | None = "ConflictException"
|
|
43
|
+
|
|
44
|
+
def __init__(self, data: ConflictException_, message: str | None = None):
|
|
45
|
+
super().__init__(
|
|
46
|
+
"client",
|
|
47
|
+
is_throttling_error=False,
|
|
48
|
+
is_retryable=False,
|
|
49
|
+
code="ConflictException",
|
|
50
|
+
message=message,
|
|
51
|
+
)
|
|
52
|
+
self.data = data
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, data: dict, message: str | None = None) -> "ConflictException":
|
|
56
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#InsufficientCapacityException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import DeserializationError, ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InsufficientCapacityException_(TypedDict, closed=True):
|
|
9
|
+
message: "str"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# --- restJson1 ser/de ---
|
|
13
|
+
def serialize_json(value: InsufficientCapacityException_) -> dict:
|
|
14
|
+
out: dict = {}
|
|
15
|
+
out["message"] = value["message"]
|
|
16
|
+
return out
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def deserialize_json(data: dict) -> InsufficientCapacityException_:
|
|
20
|
+
out: InsufficientCapacityException_ = {} # type: ignore[typeddict-item]
|
|
21
|
+
if data.get("message") is not None:
|
|
22
|
+
out["message"] = data["message"]
|
|
23
|
+
else:
|
|
24
|
+
raise DeserializationError("InsufficientCapacityException_.message required")
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class InsufficientCapacityException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#InsufficientCapacityException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "InsufficientCapacityException"
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self, data: InsufficientCapacityException_, message: str | None = None
|
|
35
|
+
):
|
|
36
|
+
super().__init__(
|
|
37
|
+
"server",
|
|
38
|
+
is_throttling_error=False,
|
|
39
|
+
is_retryable=False,
|
|
40
|
+
code="InsufficientCapacityException",
|
|
41
|
+
message=message,
|
|
42
|
+
)
|
|
43
|
+
self.data = data
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_json(
|
|
47
|
+
cls, data: dict, message: str | None = None
|
|
48
|
+
) -> "InsufficientCapacityException":
|
|
49
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#InternalServerException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InternalServerException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
retry_after_seconds: NotRequired["int"]
|
|
11
|
+
"""<p>The number of seconds to wait before retrying the request.</p>"""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# --- restJson1 ser/de ---
|
|
15
|
+
def serialize_json(value: InternalServerException_) -> dict:
|
|
16
|
+
out: dict = {}
|
|
17
|
+
if "message" in value:
|
|
18
|
+
out["message"] = value["message"]
|
|
19
|
+
return out
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def deserialize_json(data: dict) -> InternalServerException_:
|
|
23
|
+
out: InternalServerException_ = {} # type: ignore[typeddict-item]
|
|
24
|
+
if data.get("message") is not None:
|
|
25
|
+
out["message"] = data["message"]
|
|
26
|
+
return out
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class InternalServerException(ServiceError):
|
|
30
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#InternalServerException``."""
|
|
31
|
+
|
|
32
|
+
code: str | None = "InternalServerException"
|
|
33
|
+
|
|
34
|
+
def __init__(self, data: InternalServerException_, message: str | None = None):
|
|
35
|
+
super().__init__(
|
|
36
|
+
"server",
|
|
37
|
+
is_throttling_error=False,
|
|
38
|
+
is_retryable=True,
|
|
39
|
+
code="InternalServerException",
|
|
40
|
+
message=message,
|
|
41
|
+
)
|
|
42
|
+
self.data = data
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_json(
|
|
46
|
+
cls, data: dict, message: str | None = None
|
|
47
|
+
) -> "InternalServerException":
|
|
48
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#InvalidParameterValueException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InvalidParameterValueException_(TypedDict, closed=True):
|
|
9
|
+
type: NotRequired["str"]
|
|
10
|
+
"""<p>The exception type.</p>"""
|
|
11
|
+
message: NotRequired["str"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# --- restJson1 ser/de ---
|
|
15
|
+
def serialize_json(value: InvalidParameterValueException_) -> dict:
|
|
16
|
+
out: dict = {}
|
|
17
|
+
if "type" in value:
|
|
18
|
+
out["Type"] = value["type"]
|
|
19
|
+
if "message" in value:
|
|
20
|
+
out["message"] = value["message"]
|
|
21
|
+
return out
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def deserialize_json(data: dict) -> InvalidParameterValueException_:
|
|
25
|
+
out: InvalidParameterValueException_ = {} # type: ignore[typeddict-item]
|
|
26
|
+
if data.get("Type") is not None:
|
|
27
|
+
out["type"] = data["Type"]
|
|
28
|
+
if data.get("message") is not None:
|
|
29
|
+
out["message"] = data["message"]
|
|
30
|
+
return out
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class InvalidParameterValueException(ServiceError):
|
|
34
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#InvalidParameterValueException``."""
|
|
35
|
+
|
|
36
|
+
code: str | None = "InvalidParameterValueException"
|
|
37
|
+
|
|
38
|
+
def __init__(
|
|
39
|
+
self, data: InvalidParameterValueException_, message: str | None = None
|
|
40
|
+
):
|
|
41
|
+
super().__init__(
|
|
42
|
+
"client",
|
|
43
|
+
is_throttling_error=False,
|
|
44
|
+
is_retryable=False,
|
|
45
|
+
code="InvalidParameterValueException",
|
|
46
|
+
message=message,
|
|
47
|
+
)
|
|
48
|
+
self.data = data
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(
|
|
52
|
+
cls, data: dict, message: str | None = None
|
|
53
|
+
) -> "InvalidParameterValueException":
|
|
54
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#ResourceConflictException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResourceConflictException_(TypedDict, closed=True):
|
|
9
|
+
type: NotRequired["str"]
|
|
10
|
+
"""<p>The exception type.</p>"""
|
|
11
|
+
message: NotRequired["str"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# --- restJson1 ser/de ---
|
|
15
|
+
def serialize_json(value: ResourceConflictException_) -> dict:
|
|
16
|
+
out: dict = {}
|
|
17
|
+
if "type" in value:
|
|
18
|
+
out["Type"] = value["type"]
|
|
19
|
+
if "message" in value:
|
|
20
|
+
out["message"] = value["message"]
|
|
21
|
+
return out
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def deserialize_json(data: dict) -> ResourceConflictException_:
|
|
25
|
+
out: ResourceConflictException_ = {} # type: ignore[typeddict-item]
|
|
26
|
+
if data.get("Type") is not None:
|
|
27
|
+
out["type"] = data["Type"]
|
|
28
|
+
if data.get("message") is not None:
|
|
29
|
+
out["message"] = data["message"]
|
|
30
|
+
return out
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ResourceConflictException(ServiceError):
|
|
34
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#ResourceConflictException``."""
|
|
35
|
+
|
|
36
|
+
code: str | None = "ResourceConflictException"
|
|
37
|
+
|
|
38
|
+
def __init__(self, data: ResourceConflictException_, message: str | None = None):
|
|
39
|
+
super().__init__(
|
|
40
|
+
"client",
|
|
41
|
+
is_throttling_error=False,
|
|
42
|
+
is_retryable=False,
|
|
43
|
+
code="ResourceConflictException",
|
|
44
|
+
message=message,
|
|
45
|
+
)
|
|
46
|
+
self.data = data
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(
|
|
50
|
+
cls, data: dict, message: str | None = None
|
|
51
|
+
) -> "ResourceConflictException":
|
|
52
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#ResourceNotFoundException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import DeserializationError, ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResourceNotFoundException_(TypedDict, closed=True):
|
|
9
|
+
message: "str"
|
|
10
|
+
resource_type: NotRequired["str"]
|
|
11
|
+
"""<p>The type of the resource that was not found.</p>"""
|
|
12
|
+
resource_id: NotRequired["str"]
|
|
13
|
+
"""<p>The identifier of the resource that was not found.</p>"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# --- restJson1 ser/de ---
|
|
17
|
+
def serialize_json(value: ResourceNotFoundException_) -> dict:
|
|
18
|
+
out: dict = {}
|
|
19
|
+
out["message"] = value["message"]
|
|
20
|
+
if "resource_type" in value:
|
|
21
|
+
out["resourceType"] = value["resource_type"]
|
|
22
|
+
if "resource_id" in value:
|
|
23
|
+
out["resourceId"] = value["resource_id"]
|
|
24
|
+
return out
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def deserialize_json(data: dict) -> ResourceNotFoundException_:
|
|
28
|
+
out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
|
|
29
|
+
if data.get("message") is not None:
|
|
30
|
+
out["message"] = data["message"]
|
|
31
|
+
else:
|
|
32
|
+
raise DeserializationError("ResourceNotFoundException_.message required")
|
|
33
|
+
if data.get("resourceType") is not None:
|
|
34
|
+
out["resource_type"] = data["resourceType"]
|
|
35
|
+
if data.get("resourceId") is not None:
|
|
36
|
+
out["resource_id"] = data["resourceId"]
|
|
37
|
+
return out
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ResourceNotFoundException(ServiceError):
|
|
41
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#ResourceNotFoundException``."""
|
|
42
|
+
|
|
43
|
+
code: str | None = "ResourceNotFoundException"
|
|
44
|
+
|
|
45
|
+
def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
|
|
46
|
+
super().__init__(
|
|
47
|
+
"client",
|
|
48
|
+
is_throttling_error=False,
|
|
49
|
+
is_retryable=False,
|
|
50
|
+
code="ResourceNotFoundException",
|
|
51
|
+
message=message,
|
|
52
|
+
)
|
|
53
|
+
self.data = data
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(
|
|
57
|
+
cls, data: dict, message: str | None = None
|
|
58
|
+
) -> "ResourceNotFoundException":
|
|
59
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#ServiceException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceException_(TypedDict, closed=True):
|
|
9
|
+
type: NotRequired["str"]
|
|
10
|
+
"""<p>The exception type.</p>"""
|
|
11
|
+
message: NotRequired["str"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# --- restJson1 ser/de ---
|
|
15
|
+
def serialize_json(value: ServiceException_) -> dict:
|
|
16
|
+
out: dict = {}
|
|
17
|
+
if "type" in value:
|
|
18
|
+
out["Type"] = value["type"]
|
|
19
|
+
if "message" in value:
|
|
20
|
+
out["message"] = value["message"]
|
|
21
|
+
return out
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def deserialize_json(data: dict) -> ServiceException_:
|
|
25
|
+
out: ServiceException_ = {} # type: ignore[typeddict-item]
|
|
26
|
+
if data.get("Type") is not None:
|
|
27
|
+
out["type"] = data["Type"]
|
|
28
|
+
if data.get("message") is not None:
|
|
29
|
+
out["message"] = data["message"]
|
|
30
|
+
return out
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ServiceException(ServiceError):
|
|
34
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#ServiceException``."""
|
|
35
|
+
|
|
36
|
+
code: str | None = "ServiceException"
|
|
37
|
+
|
|
38
|
+
def __init__(self, data: ServiceException_, message: str | None = None):
|
|
39
|
+
super().__init__(
|
|
40
|
+
"server",
|
|
41
|
+
is_throttling_error=False,
|
|
42
|
+
is_retryable=False,
|
|
43
|
+
code="ServiceException",
|
|
44
|
+
message=message,
|
|
45
|
+
)
|
|
46
|
+
self.data = data
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, data: dict, message: str | None = None) -> "ServiceException":
|
|
50
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdamicrovms#ServiceQuotaExceededException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_lambda_microvms.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceQuotaExceededException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
resource_id: NotRequired["str"]
|
|
11
|
+
"""<p>The identifier of the resource that exceeded the quota.</p>"""
|
|
12
|
+
resource_type: NotRequired["str"]
|
|
13
|
+
"""<p>The type of the resource that exceeded the quota.</p>"""
|
|
14
|
+
service_code: NotRequired["str"]
|
|
15
|
+
"""<p>The service code of the exceeded service quota.</p>"""
|
|
16
|
+
quota_code: NotRequired["str"]
|
|
17
|
+
"""<p>The quota code of the exceeded service quota.</p>"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# --- restJson1 ser/de ---
|
|
21
|
+
def serialize_json(value: ServiceQuotaExceededException_) -> dict:
|
|
22
|
+
out: dict = {}
|
|
23
|
+
if "message" in value:
|
|
24
|
+
out["message"] = value["message"]
|
|
25
|
+
if "resource_id" in value:
|
|
26
|
+
out["resourceId"] = value["resource_id"]
|
|
27
|
+
if "resource_type" in value:
|
|
28
|
+
out["resourceType"] = value["resource_type"]
|
|
29
|
+
if "service_code" in value:
|
|
30
|
+
out["serviceCode"] = value["service_code"]
|
|
31
|
+
if "quota_code" in value:
|
|
32
|
+
out["quotaCode"] = value["quota_code"]
|
|
33
|
+
return out
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def deserialize_json(data: dict) -> ServiceQuotaExceededException_:
|
|
37
|
+
out: ServiceQuotaExceededException_ = {} # type: ignore[typeddict-item]
|
|
38
|
+
if data.get("message") is not None:
|
|
39
|
+
out["message"] = data["message"]
|
|
40
|
+
if data.get("resourceId") is not None:
|
|
41
|
+
out["resource_id"] = data["resourceId"]
|
|
42
|
+
if data.get("resourceType") is not None:
|
|
43
|
+
out["resource_type"] = data["resourceType"]
|
|
44
|
+
if data.get("serviceCode") is not None:
|
|
45
|
+
out["service_code"] = data["serviceCode"]
|
|
46
|
+
if data.get("quotaCode") is not None:
|
|
47
|
+
out["quota_code"] = data["quotaCode"]
|
|
48
|
+
return out
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class ServiceQuotaExceededException(ServiceError):
|
|
52
|
+
"""Modeled error for Smithy shape ``com.amazonaws.lambdamicrovms#ServiceQuotaExceededException``."""
|
|
53
|
+
|
|
54
|
+
code: str | None = "ServiceQuotaExceededException"
|
|
55
|
+
|
|
56
|
+
def __init__(
|
|
57
|
+
self, data: ServiceQuotaExceededException_, message: str | None = None
|
|
58
|
+
):
|
|
59
|
+
super().__init__(
|
|
60
|
+
"client",
|
|
61
|
+
is_throttling_error=False,
|
|
62
|
+
is_retryable=False,
|
|
63
|
+
code="ServiceQuotaExceededException",
|
|
64
|
+
message=message,
|
|
65
|
+
)
|
|
66
|
+
self.data = data
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(
|
|
70
|
+
cls, data: dict, message: str | None = None
|
|
71
|
+
) -> "ServiceQuotaExceededException":
|
|
72
|
+
return cls(deserialize_json(data), message)
|