capo-lambda-web 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. capo_lambda_web/__init__.py +71 -0
  2. capo_lambda_web/_async.py +25 -0
  3. capo_lambda_web/_auth/_identity.py +16 -0
  4. capo_lambda_web/_auth/_providers.py +886 -0
  5. capo_lambda_web/_auth/_signers.py +121 -0
  6. capo_lambda_web/_auth/_sigv4.py +579 -0
  7. capo_lambda_web/_auth/_zapros_handler.py +80 -0
  8. capo_lambda_web/_body.py +221 -0
  9. capo_lambda_web/_iter.py +113 -0
  10. capo_lambda_web/_operations/lambda_web/create_web_function.py +184 -0
  11. capo_lambda_web/_operations/lambda_web/create_web_function_endpoint.py +194 -0
  12. capo_lambda_web/_operations/lambda_web/create_web_function_revision.py +188 -0
  13. capo_lambda_web/_operations/lambda_web/delete_resource_policy.py +147 -0
  14. capo_lambda_web/_operations/lambda_web/delete_web_function.py +145 -0
  15. capo_lambda_web/_operations/lambda_web/delete_web_function_endpoint.py +149 -0
  16. capo_lambda_web/_operations/lambda_web/delete_web_function_revision.py +149 -0
  17. capo_lambda_web/_operations/lambda_web/get_resource_policy.py +165 -0
  18. capo_lambda_web/_operations/lambda_web/get_web_account_settings.py +155 -0
  19. capo_lambda_web/_operations/lambda_web/get_web_function.py +171 -0
  20. capo_lambda_web/_operations/lambda_web/get_web_function_endpoint.py +180 -0
  21. capo_lambda_web/_operations/lambda_web/get_web_function_revision.py +174 -0
  22. capo_lambda_web/_operations/lambda_web/list_tags.py +164 -0
  23. capo_lambda_web/_operations/lambda_web/list_web_function_endpoints.py +176 -0
  24. capo_lambda_web/_operations/lambda_web/list_web_function_revisions.py +176 -0
  25. capo_lambda_web/_operations/lambda_web/list_web_functions.py +168 -0
  26. capo_lambda_web/_operations/lambda_web/put_resource_policy.py +179 -0
  27. capo_lambda_web/_operations/lambda_web/tag_resource.py +155 -0
  28. capo_lambda_web/_operations/lambda_web/untag_resource.py +148 -0
  29. capo_lambda_web/_operations/lambda_web/update_web_function_endpoint.py +196 -0
  30. capo_lambda_web/_pagination.py +21 -0
  31. capo_lambda_web/_protocol/__init__.py +1 -0
  32. capo_lambda_web/_protocol/errors.py +93 -0
  33. capo_lambda_web/_protocol/eventstream.py +240 -0
  34. capo_lambda_web/_protocol/serialize.py +47 -0
  35. capo_lambda_web/_protocol/xml.py +33 -0
  36. capo_lambda_web/_resources/lambda_web/web_function.py +477 -0
  37. capo_lambda_web/_rule_engine/__init__.py +0 -0
  38. capo_lambda_web/_rule_engine/_aws_partition.py +160 -0
  39. capo_lambda_web/_rule_engine/_endpoint_rule_set.py +135 -0
  40. capo_lambda_web/_rule_engine/_endpoint_runtime.py +389 -0
  41. capo_lambda_web/_services/_aws_config.py +160 -0
  42. capo_lambda_web/_services/_pipeline.py +264 -0
  43. capo_lambda_web/_services/async_lambda_web.py +1394 -0
  44. capo_lambda_web/_services/lambda_web.py +1374 -0
  45. capo_lambda_web/errors/__init__.py +36 -0
  46. capo_lambda_web/errors/_base.py +94 -0
  47. capo_lambda_web/errors/access_denied_exception.py +48 -0
  48. capo_lambda_web/errors/conflict_exception.py +58 -0
  49. capo_lambda_web/errors/internal_server_exception.py +47 -0
  50. capo_lambda_web/errors/resource_not_found_exception.py +60 -0
  51. capo_lambda_web/errors/service_quota_exceeded_exception.py +74 -0
  52. capo_lambda_web/errors/throttling_exception.py +60 -0
  53. capo_lambda_web/errors/validation_exception.py +46 -0
  54. capo_lambda_web/py.typed +0 -0
  55. capo_lambda_web/types/_prelude/blob.py +12 -0
  56. capo_lambda_web/types/_prelude/timestamp.py +17 -0
  57. capo_lambda_web/types/account_quotas.py +47 -0
  58. capo_lambda_web/types/account_usage.py +26 -0
  59. capo_lambda_web/types/application_log_level.py +22 -0
  60. capo_lambda_web/types/auth_type.py +18 -0
  61. capo_lambda_web/types/auto_deployment_mode.py +18 -0
  62. capo_lambda_web/types/build_config.py +55 -0
  63. capo_lambda_web/types/code_config.py +37 -0
  64. capo_lambda_web/types/create_web_function_endpoint_request.py +164 -0
  65. capo_lambda_web/types/create_web_function_endpoint_response.py +291 -0
  66. capo_lambda_web/types/create_web_function_request.py +72 -0
  67. capo_lambda_web/types/create_web_function_response.py +144 -0
  68. capo_lambda_web/types/create_web_function_revision_request.py +76 -0
  69. capo_lambda_web/types/create_web_function_revision_response.py +157 -0
  70. capo_lambda_web/types/date_time.py +20 -0
  71. capo_lambda_web/types/delete_resource_policy_request.py +29 -0
  72. capo_lambda_web/types/delete_web_function_endpoint_request.py +27 -0
  73. capo_lambda_web/types/delete_web_function_request.py +24 -0
  74. capo_lambda_web/types/delete_web_function_revision_request.py +27 -0
  75. capo_lambda_web/types/description.py +5 -0
  76. capo_lambda_web/types/domain_name.py +5 -0
  77. capo_lambda_web/types/endpoint_arn.py +5 -0
  78. capo_lambda_web/types/endpoint_config.py +134 -0
  79. capo_lambda_web/types/endpoint_name.py +5 -0
  80. capo_lambda_web/types/endpoint_state.py +20 -0
  81. capo_lambda_web/types/endpoint_type.py +19 -0
  82. capo_lambda_web/types/endpoint_update_status.py +19 -0
  83. capo_lambda_web/types/environment_variables.py +22 -0
  84. capo_lambda_web/types/filter.py +46 -0
  85. capo_lambda_web/types/filter_list.py +29 -0
  86. capo_lambda_web/types/filter_value_list.py +14 -0
  87. capo_lambda_web/types/function_arn.py +5 -0
  88. capo_lambda_web/types/function_endpoint_summary.py +249 -0
  89. capo_lambda_web/types/function_endpoint_summary_list.py +33 -0
  90. capo_lambda_web/types/function_name.py +5 -0
  91. capo_lambda_web/types/function_revision_summary.py +83 -0
  92. capo_lambda_web/types/function_revision_summary_list.py +33 -0
  93. capo_lambda_web/types/function_state.py +20 -0
  94. capo_lambda_web/types/function_summary.py +91 -0
  95. capo_lambda_web/types/function_summary_list.py +31 -0
  96. capo_lambda_web/types/get_resource_policy_request.py +24 -0
  97. capo_lambda_web/types/get_resource_policy_response.py +39 -0
  98. capo_lambda_web/types/get_web_account_settings_request.py +18 -0
  99. capo_lambda_web/types/get_web_account_settings_response.py +59 -0
  100. capo_lambda_web/types/get_web_function_endpoint_request.py +27 -0
  101. capo_lambda_web/types/get_web_function_endpoint_response.py +285 -0
  102. capo_lambda_web/types/get_web_function_request.py +24 -0
  103. capo_lambda_web/types/get_web_function_response.py +91 -0
  104. capo_lambda_web/types/get_web_function_revision_request.py +27 -0
  105. capo_lambda_web/types/get_web_function_revision_response.py +155 -0
  106. capo_lambda_web/types/kms_key_arn.py +5 -0
  107. capo_lambda_web/types/list_tags_request.py +24 -0
  108. capo_lambda_web/types/list_tags_response.py +32 -0
  109. capo_lambda_web/types/list_web_function_endpoints_request.py +54 -0
  110. capo_lambda_web/types/list_web_function_endpoints_response.py +52 -0
  111. capo_lambda_web/types/list_web_function_revisions_request.py +54 -0
  112. capo_lambda_web/types/list_web_function_revisions_response.py +52 -0
  113. capo_lambda_web/types/list_web_functions_request.py +51 -0
  114. capo_lambda_web/types/list_web_functions_response.py +46 -0
  115. capo_lambda_web/types/logging_config.py +67 -0
  116. capo_lambda_web/types/max_results.py +5 -0
  117. capo_lambda_web/types/next_token.py +5 -0
  118. capo_lambda_web/types/policy_revision_id.py +5 -0
  119. capo_lambda_web/types/put_resource_policy_request.py +43 -0
  120. capo_lambda_web/types/put_resource_policy_response.py +39 -0
  121. capo_lambda_web/types/region.py +5 -0
  122. capo_lambda_web/types/region_list.py +17 -0
  123. capo_lambda_web/types/regional_endpoint.py +140 -0
  124. capo_lambda_web/types/regional_endpoints.py +33 -0
  125. capo_lambda_web/types/resource_arn.py +5 -0
  126. capo_lambda_web/types/resource_policy.py +5 -0
  127. capo_lambda_web/types/revision_arn.py +5 -0
  128. capo_lambda_web/types/revision_config.py +69 -0
  129. capo_lambda_web/types/revision_error.py +40 -0
  130. capo_lambda_web/types/revision_errors.py +29 -0
  131. capo_lambda_web/types/revision_id.py +5 -0
  132. capo_lambda_web/types/revision_state.py +19 -0
  133. capo_lambda_web/types/revision_weight.py +38 -0
  134. capo_lambda_web/types/revision_weight_list.py +31 -0
  135. capo_lambda_web/types/role_arn.py +5 -0
  136. capo_lambda_web/types/runtime_config.py +26 -0
  137. capo_lambda_web/types/s3_object.py +39 -0
  138. capo_lambda_web/types/scaling_config.py +23 -0
  139. capo_lambda_web/types/service_config.py +87 -0
  140. capo_lambda_web/types/system_log_level.py +19 -0
  141. capo_lambda_web/types/tag_key.py +5 -0
  142. capo_lambda_web/types/tag_key_list.py +17 -0
  143. capo_lambda_web/types/tag_resource_request.py +38 -0
  144. capo_lambda_web/types/tags.py +25 -0
  145. capo_lambda_web/types/telemetry_config.py +36 -0
  146. capo_lambda_web/types/throttle_config.py +23 -0
  147. capo_lambda_web/types/untag_resource_request.py +27 -0
  148. capo_lambda_web/types/update_web_function_endpoint_request.py +121 -0
  149. capo_lambda_web/types/update_web_function_endpoint_response.py +291 -0
  150. capo_lambda_web-0.2.0.dist-info/METADATA +104 -0
  151. capo_lambda_web-0.2.0.dist-info/RECORD +154 -0
  152. capo_lambda_web-0.2.0.dist-info/WHEEL +5 -0
  153. capo_lambda_web-0.2.0.dist-info/licenses/LICENSE +21 -0
  154. capo_lambda_web-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,36 @@
1
+ from __future__ import annotations
2
+
3
+ from ._base import (
4
+ DeserializationError as DeserializationError,
5
+ )
6
+ from ._base import (
7
+ LambdaWebError as LambdaWebError,
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 .internal_server_exception import (
27
+ InternalServerException as InternalServerException,
28
+ )
29
+ from .resource_not_found_exception import (
30
+ ResourceNotFoundException as ResourceNotFoundException,
31
+ )
32
+ from .service_quota_exceeded_exception import (
33
+ ServiceQuotaExceededException as ServiceQuotaExceededException,
34
+ )
35
+ from .throttling_exception import ThrottlingException as ThrottlingException
36
+ from .validation_exception import ValidationException as ValidationException
@@ -0,0 +1,94 @@
1
+ from typing import Literal
2
+
3
+
4
+ class LambdaWebError(Exception):
5
+ """Base class for all LambdaWeb service errors."""
6
+
7
+
8
+ class ServiceError(LambdaWebError):
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(LambdaWebError):
39
+ """Raised when a value cannot be serialized."""
40
+
41
+
42
+ class DeserializationError(LambdaWebError):
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(LambdaWebError):
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(LambdaWebError):
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,48 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#AccessDeniedException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class AccessDeniedException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the access denied error.</p>"""
11
+
12
+
13
+ # --- restJson1 ser/de ---
14
+ def serialize_json(value: AccessDeniedException_) -> dict:
15
+ out: dict = {}
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
+ else:
25
+ raise DeserializationError("AccessDeniedException_.message required")
26
+ return out
27
+
28
+
29
+ class AccessDeniedException(ServiceError):
30
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#AccessDeniedException``."""
31
+
32
+ code: str | None = "AccessDeniedException"
33
+
34
+ def __init__(self, data: AccessDeniedException_, message: str | None = None):
35
+ super().__init__(
36
+ "client",
37
+ is_throttling_error=False,
38
+ is_retryable=False,
39
+ code="AccessDeniedException",
40
+ message=message,
41
+ )
42
+ self.data = data
43
+
44
+ @classmethod
45
+ def from_json(
46
+ cls, data: dict, message: str | None = None
47
+ ) -> "AccessDeniedException":
48
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,58 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ConflictException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ConflictException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the conflict.</p>"""
11
+ resource_id: NotRequired["str"]
12
+ """<p>The identifier of the resource in conflict.</p>"""
13
+ resource_type: NotRequired["str"]
14
+ """<p>The type of the resource in conflict.</p>"""
15
+
16
+
17
+ # --- restJson1 ser/de ---
18
+ def serialize_json(value: ConflictException_) -> dict:
19
+ out: dict = {}
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
+ else:
33
+ raise DeserializationError("ConflictException_.message required")
34
+ if data.get("resourceId") is not None:
35
+ out["resource_id"] = data["resourceId"]
36
+ if data.get("resourceType") is not None:
37
+ out["resource_type"] = data["resourceType"]
38
+ return out
39
+
40
+
41
+ class ConflictException(ServiceError):
42
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#ConflictException``."""
43
+
44
+ code: str | None = "ConflictException"
45
+
46
+ def __init__(self, data: ConflictException_, message: str | None = None):
47
+ super().__init__(
48
+ "client",
49
+ is_throttling_error=False,
50
+ is_retryable=False,
51
+ code="ConflictException",
52
+ message=message,
53
+ )
54
+ self.data = data
55
+
56
+ @classmethod
57
+ def from_json(cls, data: dict, message: str | None = None) -> "ConflictException":
58
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#InternalServerException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_lambda_web.errors import ServiceError
6
+
7
+
8
+ class InternalServerException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>A message describing the internal error.</p>"""
11
+
12
+
13
+ # --- restJson1 ser/de ---
14
+ def serialize_json(value: InternalServerException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_json(data: dict) -> InternalServerException_:
22
+ out: InternalServerException_ = {} # type: ignore[typeddict-item]
23
+ if data.get("message") is not None:
24
+ out["message"] = data["message"]
25
+ return out
26
+
27
+
28
+ class InternalServerException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#InternalServerException``."""
30
+
31
+ code: str | None = "InternalServerException"
32
+
33
+ def __init__(self, data: InternalServerException_, message: str | None = None):
34
+ super().__init__(
35
+ "server",
36
+ is_throttling_error=False,
37
+ is_retryable=True,
38
+ code="InternalServerException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "InternalServerException":
47
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,60 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ResourceNotFoundException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ResourceNotFoundException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the resource not found error.</p>"""
11
+ resource_id: NotRequired["str"]
12
+ """<p>The identifier of the resource that was not found.</p>"""
13
+ resource_type: NotRequired["str"]
14
+ """<p>The type of the resource that was not found.</p>"""
15
+
16
+
17
+ # --- restJson1 ser/de ---
18
+ def serialize_json(value: ResourceNotFoundException_) -> dict:
19
+ out: dict = {}
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) -> ResourceNotFoundException_:
29
+ out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
30
+ if data.get("message") is not None:
31
+ out["message"] = data["message"]
32
+ else:
33
+ raise DeserializationError("ResourceNotFoundException_.message required")
34
+ if data.get("resourceId") is not None:
35
+ out["resource_id"] = data["resourceId"]
36
+ if data.get("resourceType") is not None:
37
+ out["resource_type"] = data["resourceType"]
38
+ return out
39
+
40
+
41
+ class ResourceNotFoundException(ServiceError):
42
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#ResourceNotFoundException``."""
43
+
44
+ code: str | None = "ResourceNotFoundException"
45
+
46
+ def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
47
+ super().__init__(
48
+ "client",
49
+ is_throttling_error=False,
50
+ is_retryable=False,
51
+ code="ResourceNotFoundException",
52
+ message=message,
53
+ )
54
+ self.data = data
55
+
56
+ @classmethod
57
+ def from_json(
58
+ cls, data: dict, message: str | None = None
59
+ ) -> "ResourceNotFoundException":
60
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,74 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ServiceQuotaExceededException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ServiceQuotaExceededException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the quota that was exceeded.</p>"""
11
+ resource_id: NotRequired["str"]
12
+ """<p>The identifier of the resource that exceeded the quota.</p>"""
13
+ resource_type: NotRequired["str"]
14
+ """<p>The type of resource that exceeded the quota.</p>"""
15
+ service_code: NotRequired["str"]
16
+ """<p>The service code of the service that owns the quota.</p>"""
17
+ quota_code: NotRequired["str"]
18
+ """<p>The quota code of the exceeded quota.</p>"""
19
+
20
+
21
+ # --- restJson1 ser/de ---
22
+ def serialize_json(value: ServiceQuotaExceededException_) -> dict:
23
+ out: dict = {}
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
+ else:
41
+ raise DeserializationError("ServiceQuotaExceededException_.message required")
42
+ if data.get("resourceId") is not None:
43
+ out["resource_id"] = data["resourceId"]
44
+ if data.get("resourceType") is not None:
45
+ out["resource_type"] = data["resourceType"]
46
+ if data.get("serviceCode") is not None:
47
+ out["service_code"] = data["serviceCode"]
48
+ if data.get("quotaCode") is not None:
49
+ out["quota_code"] = data["quotaCode"]
50
+ return out
51
+
52
+
53
+ class ServiceQuotaExceededException(ServiceError):
54
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#ServiceQuotaExceededException``."""
55
+
56
+ code: str | None = "ServiceQuotaExceededException"
57
+
58
+ def __init__(
59
+ self, data: ServiceQuotaExceededException_, message: str | None = None
60
+ ):
61
+ super().__init__(
62
+ "client",
63
+ is_throttling_error=False,
64
+ is_retryable=False,
65
+ code="ServiceQuotaExceededException",
66
+ message=message,
67
+ )
68
+ self.data = data
69
+
70
+ @classmethod
71
+ def from_json(
72
+ cls, data: dict, message: str | None = None
73
+ ) -> "ServiceQuotaExceededException":
74
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,60 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ThrottlingException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ThrottlingException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the throttling error.</p>"""
11
+ retry_after_seconds: NotRequired["int"]
12
+ """<p>The number of seconds to wait before retrying the request.</p>"""
13
+ service_code: NotRequired["str"]
14
+ """<p>The service code of the throttled service.</p>"""
15
+ quota_code: NotRequired["str"]
16
+ """<p>The quota code that was exceeded, if applicable.</p>"""
17
+
18
+
19
+ # --- restJson1 ser/de ---
20
+ def serialize_json(value: ThrottlingException_) -> dict:
21
+ out: dict = {}
22
+ out["message"] = value["message"]
23
+ if "service_code" in value:
24
+ out["serviceCode"] = value["service_code"]
25
+ if "quota_code" in value:
26
+ out["quotaCode"] = value["quota_code"]
27
+ return out
28
+
29
+
30
+ def deserialize_json(data: dict) -> ThrottlingException_:
31
+ out: ThrottlingException_ = {} # type: ignore[typeddict-item]
32
+ if data.get("message") is not None:
33
+ out["message"] = data["message"]
34
+ else:
35
+ raise DeserializationError("ThrottlingException_.message required")
36
+ if data.get("serviceCode") is not None:
37
+ out["service_code"] = data["serviceCode"]
38
+ if data.get("quotaCode") is not None:
39
+ out["quota_code"] = data["quotaCode"]
40
+ return out
41
+
42
+
43
+ class ThrottlingException(ServiceError):
44
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#ThrottlingException``."""
45
+
46
+ code: str | None = "ThrottlingException"
47
+
48
+ def __init__(self, data: ThrottlingException_, message: str | None = None):
49
+ super().__init__(
50
+ "client",
51
+ is_throttling_error=True,
52
+ is_retryable=True,
53
+ code="ThrottlingException",
54
+ message=message,
55
+ )
56
+ self.data = data
57
+
58
+ @classmethod
59
+ def from_json(cls, data: dict, message: str | None = None) -> "ThrottlingException":
60
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,46 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ValidationException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ValidationException_(TypedDict, closed=True):
9
+ message: "str"
10
+ """<p>A message describing the validation error.</p>"""
11
+
12
+
13
+ # --- restJson1 ser/de ---
14
+ def serialize_json(value: ValidationException_) -> dict:
15
+ out: dict = {}
16
+ out["message"] = value["message"]
17
+ return out
18
+
19
+
20
+ def deserialize_json(data: dict) -> ValidationException_:
21
+ out: ValidationException_ = {} # type: ignore[typeddict-item]
22
+ if data.get("message") is not None:
23
+ out["message"] = data["message"]
24
+ else:
25
+ raise DeserializationError("ValidationException_.message required")
26
+ return out
27
+
28
+
29
+ class ValidationException(ServiceError):
30
+ """Modeled error for Smithy shape ``com.amazonaws.lambdaweb#ValidationException``."""
31
+
32
+ code: str | None = "ValidationException"
33
+
34
+ def __init__(self, data: ValidationException_, message: str | None = None):
35
+ super().__init__(
36
+ "client",
37
+ is_throttling_error=False,
38
+ is_retryable=False,
39
+ code="ValidationException",
40
+ message=message,
41
+ )
42
+ self.data = data
43
+
44
+ @classmethod
45
+ def from_json(cls, data: dict, message: str | None = None) -> "ValidationException":
46
+ return cls(deserialize_json(data), message)
File without changes
@@ -0,0 +1,12 @@
1
+ """Generated from Smithy prelude shape ``smithy.api#Blob``."""
2
+
3
+ import base64
4
+
5
+
6
+ # --- restJson1 ser/de ---
7
+ def serialize_json(value: bytes) -> str:
8
+ return base64.b64encode(value).decode("ascii")
9
+
10
+
11
+ def deserialize_json(data: str) -> bytes:
12
+ return base64.b64decode(data)
@@ -0,0 +1,17 @@
1
+ """Generated from Smithy prelude shape ``smithy.api#Timestamp``."""
2
+
3
+ import datetime
4
+
5
+
6
+ # --- restJson1 ser/de ---
7
+ def serialize_json(value: datetime.datetime) -> float:
8
+ value = (
9
+ value.astimezone(datetime.timezone.utc)
10
+ if value.tzinfo
11
+ else value.replace(tzinfo=datetime.timezone.utc)
12
+ )
13
+ return value.timestamp()
14
+
15
+
16
+ def deserialize_json(data: float) -> datetime.datetime:
17
+ return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#AccountQuotas``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError
6
+
7
+
8
+ class AccountQuotas(TypedDict, closed=True):
9
+ max_total_arm_v_cpus: "int"
10
+ """<p>The maximum total number of Arm vCPUs that you can allocate across all of your web functions in the current AWS Region.</p>"""
11
+ max_total_rate_limit: "int"
12
+ """<p>The maximum number of requests per second allowed across all of your web function endpoints in your account in the current AWS Region.</p>"""
13
+ max_revisions_per_function: "int"
14
+ """<p>The maximum number of revisions that a single web function can have.</p>"""
15
+ max_endpoints_per_function: "int"
16
+ """<p>The maximum number of endpoints that a single web function can have.</p>"""
17
+
18
+
19
+ # --- restJson1 ser/de ---
20
+ def serialize_json(value: AccountQuotas) -> dict:
21
+ out: dict = {}
22
+ out["maxTotalArmVCpus"] = value["max_total_arm_v_cpus"]
23
+ out["maxTotalRateLimit"] = value["max_total_rate_limit"]
24
+ out["maxRevisionsPerFunction"] = value["max_revisions_per_function"]
25
+ out["maxEndpointsPerFunction"] = value["max_endpoints_per_function"]
26
+ return out
27
+
28
+
29
+ def deserialize_json(data: dict) -> AccountQuotas:
30
+ out: AccountQuotas = {} # type: ignore[typeddict-item]
31
+ if data.get("maxTotalArmVCpus") is not None:
32
+ out["max_total_arm_v_cpus"] = data["maxTotalArmVCpus"]
33
+ else:
34
+ raise DeserializationError("AccountQuotas.max_total_arm_v_cpus required")
35
+ if data.get("maxTotalRateLimit") is not None:
36
+ out["max_total_rate_limit"] = data["maxTotalRateLimit"]
37
+ else:
38
+ raise DeserializationError("AccountQuotas.max_total_rate_limit required")
39
+ if data.get("maxRevisionsPerFunction") is not None:
40
+ out["max_revisions_per_function"] = data["maxRevisionsPerFunction"]
41
+ else:
42
+ raise DeserializationError("AccountQuotas.max_revisions_per_function required")
43
+ if data.get("maxEndpointsPerFunction") is not None:
44
+ out["max_endpoints_per_function"] = data["maxEndpointsPerFunction"]
45
+ else:
46
+ raise DeserializationError("AccountQuotas.max_endpoints_per_function required")
47
+ return out
@@ -0,0 +1,26 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#AccountUsage``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_lambda_web.errors import DeserializationError
6
+
7
+
8
+ class AccountUsage(TypedDict, closed=True):
9
+ function_count: "int"
10
+ """<p>The number of web functions in your account in the current AWS Region.</p>"""
11
+
12
+
13
+ # --- restJson1 ser/de ---
14
+ def serialize_json(value: AccountUsage) -> dict:
15
+ out: dict = {}
16
+ out["functionCount"] = value["function_count"]
17
+ return out
18
+
19
+
20
+ def deserialize_json(data: dict) -> AccountUsage:
21
+ out: AccountUsage = {} # type: ignore[typeddict-item]
22
+ if data.get("functionCount") is not None:
23
+ out["function_count"] = data["functionCount"]
24
+ else:
25
+ raise DeserializationError("AccountUsage.function_count required")
26
+ return out
@@ -0,0 +1,22 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdaweb#ApplicationLogLevel``."""
2
+
3
+ from typing import Literal, TypeAlias, cast
4
+
5
+ """<p>The log level for application logs. Possible values: <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, <code>FATAL</code>.</p>"""
6
+ ApplicationLogLevel: TypeAlias = Literal[
7
+ "TRACE",
8
+ "DEBUG",
9
+ "INFO",
10
+ "WARN",
11
+ "ERROR",
12
+ "FATAL",
13
+ ]
14
+
15
+
16
+ # --- restJson1 ser/de ---
17
+ def serialize_json(value: ApplicationLogLevel) -> str:
18
+ return value
19
+
20
+
21
+ def deserialize_json(data: str) -> ApplicationLogLevel:
22
+ return cast(ApplicationLogLevel, data)