capo-keyspaces 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. capo_keyspaces/__init__.py +70 -0
  2. capo_keyspaces/_async.py +25 -0
  3. capo_keyspaces/_auth/_identity.py +16 -0
  4. capo_keyspaces/_auth/_providers.py +886 -0
  5. capo_keyspaces/_auth/_signers.py +88 -0
  6. capo_keyspaces/_auth/_sigv4.py +434 -0
  7. capo_keyspaces/_auth/_zapros_handler.py +80 -0
  8. capo_keyspaces/_iter.py +113 -0
  9. capo_keyspaces/_operations/keyspaces_service/create_keyspace.py +170 -0
  10. capo_keyspaces/_operations/keyspaces_service/create_table.py +183 -0
  11. capo_keyspaces/_operations/keyspaces_service/create_type.py +172 -0
  12. capo_keyspaces/_operations/keyspaces_service/delete_keyspace.py +165 -0
  13. capo_keyspaces/_operations/keyspaces_service/delete_table.py +163 -0
  14. capo_keyspaces/_operations/keyspaces_service/delete_type.py +171 -0
  15. capo_keyspaces/_operations/keyspaces_service/get_keyspace.py +168 -0
  16. capo_keyspaces/_operations/keyspaces_service/get_table.py +173 -0
  17. capo_keyspaces/_operations/keyspaces_service/get_table_auto_scaling_settings.py +168 -0
  18. capo_keyspaces/_operations/keyspaces_service/get_type.py +166 -0
  19. capo_keyspaces/_operations/keyspaces_service/list_keyspaces.py +167 -0
  20. capo_keyspaces/_operations/keyspaces_service/list_tables.py +167 -0
  21. capo_keyspaces/_operations/keyspaces_service/list_tags_for_resource.py +167 -0
  22. capo_keyspaces/_operations/keyspaces_service/list_types.py +163 -0
  23. capo_keyspaces/_operations/keyspaces_service/restore_table.py +178 -0
  24. capo_keyspaces/_operations/keyspaces_service/tag_resource.py +164 -0
  25. capo_keyspaces/_operations/keyspaces_service/untag_resource.py +164 -0
  26. capo_keyspaces/_operations/keyspaces_service/update_keyspace.py +175 -0
  27. capo_keyspaces/_operations/keyspaces_service/update_table.py +181 -0
  28. capo_keyspaces/_pagination.py +21 -0
  29. capo_keyspaces/_protocol/__init__.py +1 -0
  30. capo_keyspaces/_protocol/errors.py +93 -0
  31. capo_keyspaces/_protocol/eventstream.py +238 -0
  32. capo_keyspaces/_protocol/serialize.py +47 -0
  33. capo_keyspaces/_protocol/xml.py +33 -0
  34. capo_keyspaces/_rule_engine/__init__.py +0 -0
  35. capo_keyspaces/_rule_engine/_aws_partition.py +160 -0
  36. capo_keyspaces/_rule_engine/_endpoint_rule_set.py +150 -0
  37. capo_keyspaces/_rule_engine/_endpoint_runtime.py +389 -0
  38. capo_keyspaces/_services/_aws_config.py +160 -0
  39. capo_keyspaces/_services/_pipeline.py +198 -0
  40. capo_keyspaces/_services/async_keyspaces.py +1467 -0
  41. capo_keyspaces/_services/keyspaces.py +1448 -0
  42. capo_keyspaces/errors/__init__.py +35 -0
  43. capo_keyspaces/errors/_base.py +94 -0
  44. capo_keyspaces/errors/access_denied_exception.py +47 -0
  45. capo_keyspaces/errors/conflict_exception.py +47 -0
  46. capo_keyspaces/errors/internal_server_exception.py +47 -0
  47. capo_keyspaces/errors/resource_not_found_exception.py +58 -0
  48. capo_keyspaces/errors/service_quota_exceeded_exception.py +49 -0
  49. capo_keyspaces/errors/validation_exception.py +47 -0
  50. capo_keyspaces/py.typed +0 -0
  51. capo_keyspaces/types/_prelude/blob.py +12 -0
  52. capo_keyspaces/types/_prelude/timestamp.py +17 -0
  53. capo_keyspaces/types/arn.py +5 -0
  54. capo_keyspaces/types/auto_scaling_policy.py +42 -0
  55. capo_keyspaces/types/auto_scaling_settings.py +63 -0
  56. capo_keyspaces/types/auto_scaling_specification.py +62 -0
  57. capo_keyspaces/types/boolean_object.py +5 -0
  58. capo_keyspaces/types/capacity_specification.py +48 -0
  59. capo_keyspaces/types/capacity_specification_summary.py +71 -0
  60. capo_keyspaces/types/capacity_units.py +5 -0
  61. capo_keyspaces/types/cdc_propagate_tags.py +5 -0
  62. capo_keyspaces/types/cdc_specification.py +62 -0
  63. capo_keyspaces/types/cdc_specification_summary.py +38 -0
  64. capo_keyspaces/types/cdc_status.py +5 -0
  65. capo_keyspaces/types/client_side_timestamps.py +33 -0
  66. capo_keyspaces/types/client_side_timestamps_status.py +5 -0
  67. capo_keyspaces/types/clustering_key.py +39 -0
  68. capo_keyspaces/types/clustering_key_list.py +29 -0
  69. capo_keyspaces/types/column_definition.py +38 -0
  70. capo_keyspaces/types/column_definition_list.py +33 -0
  71. capo_keyspaces/types/comment.py +26 -0
  72. capo_keyspaces/types/create_keyspace_request.py +67 -0
  73. capo_keyspaces/types/create_keyspace_response.py +31 -0
  74. capo_keyspaces/types/create_table_request.py +281 -0
  75. capo_keyspaces/types/create_table_response.py +31 -0
  76. capo_keyspaces/types/create_type_request.py +57 -0
  77. capo_keyspaces/types/create_type_response.py +39 -0
  78. capo_keyspaces/types/default_time_to_live.py +5 -0
  79. capo_keyspaces/types/delete_keyspace_request.py +31 -0
  80. capo_keyspaces/types/delete_keyspace_response.py +18 -0
  81. capo_keyspaces/types/delete_table_request.py +39 -0
  82. capo_keyspaces/types/delete_table_response.py +18 -0
  83. capo_keyspaces/types/delete_type_request.py +39 -0
  84. capo_keyspaces/types/delete_type_response.py +39 -0
  85. capo_keyspaces/types/depth.py +5 -0
  86. capo_keyspaces/types/double_object.py +5 -0
  87. capo_keyspaces/types/encryption_specification.py +38 -0
  88. capo_keyspaces/types/encryption_type.py +5 -0
  89. capo_keyspaces/types/field_definition.py +38 -0
  90. capo_keyspaces/types/field_list.py +29 -0
  91. capo_keyspaces/types/generic_string.py +5 -0
  92. capo_keyspaces/types/get_keyspace_request.py +31 -0
  93. capo_keyspaces/types/get_keyspace_response.py +87 -0
  94. capo_keyspaces/types/get_table_auto_scaling_settings_request.py +43 -0
  95. capo_keyspaces/types/get_table_auto_scaling_settings_response.py +95 -0
  96. capo_keyspaces/types/get_table_request.py +39 -0
  97. capo_keyspaces/types/get_table_response.py +287 -0
  98. capo_keyspaces/types/get_type_request.py +39 -0
  99. capo_keyspaces/types/get_type_response.py +140 -0
  100. capo_keyspaces/types/integer_object.py +5 -0
  101. capo_keyspaces/types/keyspace_name.py +5 -0
  102. capo_keyspaces/types/keyspace_status.py +5 -0
  103. capo_keyspaces/types/keyspace_summary.py +66 -0
  104. capo_keyspaces/types/keyspace_summary_list.py +31 -0
  105. capo_keyspaces/types/kms_key_arn.py +5 -0
  106. capo_keyspaces/types/list_keyspaces_request.py +35 -0
  107. capo_keyspaces/types/list_keyspaces_response.py +50 -0
  108. capo_keyspaces/types/list_tables_request.py +45 -0
  109. capo_keyspaces/types/list_tables_response.py +45 -0
  110. capo_keyspaces/types/list_tags_for_resource_request.py +45 -0
  111. capo_keyspaces/types/list_tags_for_resource_response.py +43 -0
  112. capo_keyspaces/types/list_types_request.py +45 -0
  113. capo_keyspaces/types/list_types_response.py +46 -0
  114. capo_keyspaces/types/max_results.py +5 -0
  115. capo_keyspaces/types/next_token.py +5 -0
  116. capo_keyspaces/types/partition_key.py +31 -0
  117. capo_keyspaces/types/partition_key_list.py +29 -0
  118. capo_keyspaces/types/point_in_time_recovery.py +33 -0
  119. capo_keyspaces/types/point_in_time_recovery_status.py +5 -0
  120. capo_keyspaces/types/point_in_time_recovery_summary.py +54 -0
  121. capo_keyspaces/types/region.py +5 -0
  122. capo_keyspaces/types/region_list.py +17 -0
  123. capo_keyspaces/types/replica_auto_scaling_specification.py +49 -0
  124. capo_keyspaces/types/replica_auto_scaling_specification_list.py +39 -0
  125. capo_keyspaces/types/replica_specification.py +61 -0
  126. capo_keyspaces/types/replica_specification_list.py +35 -0
  127. capo_keyspaces/types/replica_specification_summary.py +76 -0
  128. capo_keyspaces/types/replica_specification_summary_list.py +39 -0
  129. capo_keyspaces/types/replication_group_status.py +48 -0
  130. capo_keyspaces/types/replication_group_status_list.py +35 -0
  131. capo_keyspaces/types/replication_specification.py +48 -0
  132. capo_keyspaces/types/restore_table_request.py +190 -0
  133. capo_keyspaces/types/restore_table_response.py +31 -0
  134. capo_keyspaces/types/rs.py +5 -0
  135. capo_keyspaces/types/schema_definition.py +105 -0
  136. capo_keyspaces/types/sort_order.py +5 -0
  137. capo_keyspaces/types/static_column.py +31 -0
  138. capo_keyspaces/types/static_column_list.py +29 -0
  139. capo_keyspaces/types/stream_arn.py +5 -0
  140. capo_keyspaces/types/table_name.py +5 -0
  141. capo_keyspaces/types/table_name_list.py +17 -0
  142. capo_keyspaces/types/table_status.py +5 -0
  143. capo_keyspaces/types/table_summary.py +47 -0
  144. capo_keyspaces/types/table_summary_list.py +29 -0
  145. capo_keyspaces/types/tables_replication_progress.py +5 -0
  146. capo_keyspaces/types/tag.py +39 -0
  147. capo_keyspaces/types/tag_key.py +5 -0
  148. capo_keyspaces/types/tag_list.py +29 -0
  149. capo_keyspaces/types/tag_resource_request.py +45 -0
  150. capo_keyspaces/types/tag_resource_response.py +18 -0
  151. capo_keyspaces/types/tag_value.py +5 -0
  152. capo_keyspaces/types/target_tracking_scaling_policy_configuration.py +60 -0
  153. capo_keyspaces/types/throughput_mode.py +5 -0
  154. capo_keyspaces/types/time_to_live.py +31 -0
  155. capo_keyspaces/types/time_to_live_status.py +5 -0
  156. capo_keyspaces/types/timestamp.py +20 -0
  157. capo_keyspaces/types/type_name.py +5 -0
  158. capo_keyspaces/types/type_name_list.py +17 -0
  159. capo_keyspaces/types/type_status.py +5 -0
  160. capo_keyspaces/types/untag_resource_request.py +45 -0
  161. capo_keyspaces/types/untag_resource_response.py +18 -0
  162. capo_keyspaces/types/update_keyspace_request.py +74 -0
  163. capo_keyspaces/types/update_keyspace_response.py +31 -0
  164. capo_keyspaces/types/update_table_request.py +252 -0
  165. capo_keyspaces/types/update_table_response.py +31 -0
  166. capo_keyspaces/types/view_type.py +5 -0
  167. capo_keyspaces/types/warm_throughput_specification.py +29 -0
  168. capo_keyspaces/types/warm_throughput_specification_summary.py +49 -0
  169. capo_keyspaces/types/warm_throughput_status.py +5 -0
  170. capo_keyspaces-0.1.0.dist-info/METADATA +101 -0
  171. capo_keyspaces-0.1.0.dist-info/RECORD +174 -0
  172. capo_keyspaces-0.1.0.dist-info/WHEEL +5 -0
  173. capo_keyspaces-0.1.0.dist-info/licenses/LICENSE +21 -0
  174. capo_keyspaces-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ from ._base import (
4
+ DeserializationError as DeserializationError,
5
+ )
6
+ from ._base import (
7
+ KeyspacesError as KeyspacesError,
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 .validation_exception import ValidationException as ValidationException
@@ -0,0 +1,94 @@
1
+ from typing import Literal
2
+
3
+
4
+ class KeyspacesError(Exception):
5
+ """Base class for all Keyspaces service errors."""
6
+
7
+
8
+ class ServiceError(KeyspacesError):
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(KeyspacesError):
39
+ """Raised when a value cannot be serialized."""
40
+
41
+
42
+ class DeserializationError(KeyspacesError):
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(KeyspacesError):
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(KeyspacesError):
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,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#AccessDeniedException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_keyspaces.errors import ServiceError
6
+
7
+
8
+ class AccessDeniedException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>You don't have the required permissions to perform this operation. Verify your IAM permissions and try again.</p>"""
11
+
12
+
13
+ # --- awsJson1_0 ser/de ---
14
+ def serialize_aws_json_1_0(value: AccessDeniedException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: dict) -> AccessDeniedException_:
22
+ out: AccessDeniedException_ = {} # type: ignore[typeddict-item]
23
+ if data.get("message") is not None:
24
+ out["message"] = data["message"]
25
+ return out
26
+
27
+
28
+ class AccessDeniedException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.keyspaces#AccessDeniedException``."""
30
+
31
+ code: str | None = "AccessDeniedException"
32
+
33
+ def __init__(self, data: AccessDeniedException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="AccessDeniedException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_aws_json_1_0(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "AccessDeniedException":
47
+ return cls(deserialize_aws_json_1_0(data), message)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ConflictException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_keyspaces.errors import ServiceError
6
+
7
+
8
+ class ConflictException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>The requested operation conflicts with the current state of the resource or another concurrent operation.</p>"""
11
+
12
+
13
+ # --- awsJson1_0 ser/de ---
14
+ def serialize_aws_json_1_0(value: ConflictException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: dict) -> ConflictException_:
22
+ out: ConflictException_ = {} # type: ignore[typeddict-item]
23
+ if data.get("message") is not None:
24
+ out["message"] = data["message"]
25
+ return out
26
+
27
+
28
+ class ConflictException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.keyspaces#ConflictException``."""
30
+
31
+ code: str | None = "ConflictException"
32
+
33
+ def __init__(self, data: ConflictException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="ConflictException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_aws_json_1_0(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "ConflictException":
47
+ return cls(deserialize_aws_json_1_0(data), message)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#InternalServerException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_keyspaces.errors import ServiceError
6
+
7
+
8
+ class InternalServerException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>An internal service error occurred. Retry your request. If the problem persists, contact Amazon Web Services Support.</p>"""
11
+
12
+
13
+ # --- awsJson1_0 ser/de ---
14
+ def serialize_aws_json_1_0(value: InternalServerException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(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.keyspaces#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=False,
38
+ code="InternalServerException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_aws_json_1_0(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "InternalServerException":
47
+ return cls(deserialize_aws_json_1_0(data), message)
@@ -0,0 +1,58 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ResourceNotFoundException``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ from capo_keyspaces.errors import ServiceError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.arn
11
+
12
+
13
+ class ResourceNotFoundException_(TypedDict, closed=True):
14
+ message: NotRequired["str"]
15
+ """<p>The specified resource was not found. Verify the resource identifier and ensure the resource exists and is in an ACTIVE state.</p>"""
16
+ resource_arn: NotRequired["capo_keyspaces.types.arn.ARN"]
17
+ """<p>The unique identifier in the format of Amazon Resource Name (ARN) for the resource couldn't be found.</p>"""
18
+
19
+
20
+ # --- awsJson1_0 ser/de ---
21
+ def serialize_aws_json_1_0(value: ResourceNotFoundException_) -> dict:
22
+ out: dict = {}
23
+ if "message" in value:
24
+ out["message"] = value["message"]
25
+ if "resource_arn" in value:
26
+ out["resourceArn"] = value["resource_arn"]
27
+ return out
28
+
29
+
30
+ def deserialize_aws_json_1_0(data: dict) -> ResourceNotFoundException_:
31
+ out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
32
+ if data.get("message") is not None:
33
+ out["message"] = data["message"]
34
+ if data.get("resourceArn") is not None:
35
+ out["resource_arn"] = data["resourceArn"]
36
+ return out
37
+
38
+
39
+ class ResourceNotFoundException(ServiceError):
40
+ """Modeled error for Smithy shape ``com.amazonaws.keyspaces#ResourceNotFoundException``."""
41
+
42
+ code: str | None = "ResourceNotFoundException"
43
+
44
+ def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
45
+ super().__init__(
46
+ "client",
47
+ is_throttling_error=False,
48
+ is_retryable=False,
49
+ code="ResourceNotFoundException",
50
+ message=message,
51
+ )
52
+ self.data = data
53
+
54
+ @classmethod
55
+ def from_aws_json_1_0(
56
+ cls, data: dict, message: str | None = None
57
+ ) -> "ResourceNotFoundException":
58
+ return cls(deserialize_aws_json_1_0(data), message)
@@ -0,0 +1,49 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ServiceQuotaExceededException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_keyspaces.errors import ServiceError
6
+
7
+
8
+ class ServiceQuotaExceededException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>The requested operation would exceed the service quota for this resource. Review the service quotas and adjust your request accordingly.</p>"""
11
+
12
+
13
+ # --- awsJson1_0 ser/de ---
14
+ def serialize_aws_json_1_0(value: ServiceQuotaExceededException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: dict) -> ServiceQuotaExceededException_:
22
+ out: ServiceQuotaExceededException_ = {} # type: ignore[typeddict-item]
23
+ if data.get("message") is not None:
24
+ out["message"] = data["message"]
25
+ return out
26
+
27
+
28
+ class ServiceQuotaExceededException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.keyspaces#ServiceQuotaExceededException``."""
30
+
31
+ code: str | None = "ServiceQuotaExceededException"
32
+
33
+ def __init__(
34
+ self, data: ServiceQuotaExceededException_, message: str | None = None
35
+ ):
36
+ super().__init__(
37
+ "client",
38
+ is_throttling_error=False,
39
+ is_retryable=False,
40
+ code="ServiceQuotaExceededException",
41
+ message=message,
42
+ )
43
+ self.data = data
44
+
45
+ @classmethod
46
+ def from_aws_json_1_0(
47
+ cls, data: dict, message: str | None = None
48
+ ) -> "ServiceQuotaExceededException":
49
+ return cls(deserialize_aws_json_1_0(data), message)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ValidationException``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from capo_keyspaces.errors import ServiceError
6
+
7
+
8
+ class ValidationException_(TypedDict, closed=True):
9
+ message: NotRequired["str"]
10
+ """<p>The request parameters are invalid or malformed. Review the API documentation and correct the request format.</p>"""
11
+
12
+
13
+ # --- awsJson1_0 ser/de ---
14
+ def serialize_aws_json_1_0(value: ValidationException_) -> dict:
15
+ out: dict = {}
16
+ if "message" in value:
17
+ out["message"] = value["message"]
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: dict) -> ValidationException_:
22
+ out: ValidationException_ = {} # type: ignore[typeddict-item]
23
+ if data.get("message") is not None:
24
+ out["message"] = data["message"]
25
+ return out
26
+
27
+
28
+ class ValidationException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.keyspaces#ValidationException``."""
30
+
31
+ code: str | None = "ValidationException"
32
+
33
+ def __init__(self, data: ValidationException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="ValidationException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_aws_json_1_0(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "ValidationException":
47
+ return cls(deserialize_aws_json_1_0(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
+ # --- awsJson1_0 ser/de ---
7
+ def serialize_aws_json_1_0(value: bytes) -> str:
8
+ return base64.b64encode(value).decode("ascii")
9
+
10
+
11
+ def deserialize_aws_json_1_0(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
+ # --- awsJson1_0 ser/de ---
7
+ def serialize_aws_json_1_0(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_aws_json_1_0(data: float) -> datetime.datetime:
17
+ return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ARN``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ ARN: TypeAlias = str
@@ -0,0 +1,42 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#AutoScalingPolicy``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_keyspaces.types.target_tracking_scaling_policy_configuration
9
+
10
+
11
+ class AutoScalingPolicy(TypedDict, closed=True):
12
+ target_tracking_scaling_policy_configuration: NotRequired[
13
+ "capo_keyspaces.types.target_tracking_scaling_policy_configuration.TargetTrackingScalingPolicyConfiguration"
14
+ ]
15
+ """<p>Auto scaling scales up capacity automatically when traffic exceeds this target utilization rate, and then back down when it falls below the target. A <code>double</code> between 20 and 90.</p>"""
16
+
17
+
18
+ # --- awsJson1_0 ser/de ---
19
+ def serialize_aws_json_1_0(value: AutoScalingPolicy) -> dict:
20
+ out: dict = {}
21
+ if "target_tracking_scaling_policy_configuration" in value:
22
+ import capo_keyspaces.types.target_tracking_scaling_policy_configuration
23
+
24
+ out["targetTrackingScalingPolicyConfiguration"] = (
25
+ capo_keyspaces.types.target_tracking_scaling_policy_configuration.serialize_aws_json_1_0(
26
+ value["target_tracking_scaling_policy_configuration"]
27
+ )
28
+ )
29
+ return out
30
+
31
+
32
+ def deserialize_aws_json_1_0(data: dict) -> AutoScalingPolicy:
33
+ out: AutoScalingPolicy = {} # type: ignore[typeddict-item]
34
+ if data.get("targetTrackingScalingPolicyConfiguration") is not None:
35
+ import capo_keyspaces.types.target_tracking_scaling_policy_configuration
36
+
37
+ out["target_tracking_scaling_policy_configuration"] = (
38
+ capo_keyspaces.types.target_tracking_scaling_policy_configuration.deserialize_aws_json_1_0(
39
+ data["targetTrackingScalingPolicyConfiguration"]
40
+ )
41
+ )
42
+ return out
@@ -0,0 +1,63 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#AutoScalingSettings``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_keyspaces.types.auto_scaling_policy
9
+ import capo_keyspaces.types.boolean_object
10
+ import capo_keyspaces.types.capacity_units
11
+
12
+
13
+ class AutoScalingSettings(TypedDict, closed=True):
14
+ auto_scaling_disabled: "capo_keyspaces.types.boolean_object.BooleanObject"
15
+ """<p>This optional parameter enables auto scaling for the table if set to <code>false</code>.</p>"""
16
+ minimum_units: NotRequired["capo_keyspaces.types.capacity_units.CapacityUnits"]
17
+ """<p>The minimum level of throughput the table should always be ready to support. The value must be between 1 and the max throughput per second quota for your account (40,000 by default).</p>"""
18
+ maximum_units: NotRequired["capo_keyspaces.types.capacity_units.CapacityUnits"]
19
+ """<p>Manage costs by specifying the maximum amount of throughput to provision. The value must be between 1 and the max throughput per second quota for your account (40,000 by default).</p>"""
20
+ scaling_policy: NotRequired[
21
+ "capo_keyspaces.types.auto_scaling_policy.AutoScalingPolicy"
22
+ ]
23
+ """<p>Amazon Keyspaces supports the <code>target tracking</code> auto scaling policy. With this policy, Amazon Keyspaces auto scaling ensures that the table's ratio of consumed to provisioned capacity stays at or near the target value that you specify. You define the target value as a percentage between 20 and 90.</p>"""
24
+
25
+
26
+ # --- awsJson1_0 ser/de ---
27
+ def serialize_aws_json_1_0(value: AutoScalingSettings) -> dict:
28
+ out: dict = {}
29
+ out["autoScalingDisabled"] = value.get("auto_scaling_disabled", False)
30
+ if "minimum_units" in value:
31
+ out["minimumUnits"] = value["minimum_units"]
32
+ if "maximum_units" in value:
33
+ out["maximumUnits"] = value["maximum_units"]
34
+ if "scaling_policy" in value:
35
+ import capo_keyspaces.types.auto_scaling_policy
36
+
37
+ out["scalingPolicy"] = (
38
+ capo_keyspaces.types.auto_scaling_policy.serialize_aws_json_1_0(
39
+ value["scaling_policy"]
40
+ )
41
+ )
42
+ return out
43
+
44
+
45
+ def deserialize_aws_json_1_0(data: dict) -> AutoScalingSettings:
46
+ out: AutoScalingSettings = {} # type: ignore[typeddict-item]
47
+ if data.get("autoScalingDisabled") is not None:
48
+ out["auto_scaling_disabled"] = data["autoScalingDisabled"]
49
+ else:
50
+ out["auto_scaling_disabled"] = False
51
+ if data.get("minimumUnits") is not None:
52
+ out["minimum_units"] = data["minimumUnits"]
53
+ if data.get("maximumUnits") is not None:
54
+ out["maximum_units"] = data["maximumUnits"]
55
+ if data.get("scalingPolicy") is not None:
56
+ import capo_keyspaces.types.auto_scaling_policy
57
+
58
+ out["scaling_policy"] = (
59
+ capo_keyspaces.types.auto_scaling_policy.deserialize_aws_json_1_0(
60
+ data["scalingPolicy"]
61
+ )
62
+ )
63
+ return out
@@ -0,0 +1,62 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#AutoScalingSpecification``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_keyspaces.types.auto_scaling_settings
9
+
10
+
11
+ class AutoScalingSpecification(TypedDict, closed=True):
12
+ write_capacity_auto_scaling: NotRequired[
13
+ "capo_keyspaces.types.auto_scaling_settings.AutoScalingSettings"
14
+ ]
15
+ """<p>The auto scaling settings for the table's write capacity.</p>"""
16
+ read_capacity_auto_scaling: NotRequired[
17
+ "capo_keyspaces.types.auto_scaling_settings.AutoScalingSettings"
18
+ ]
19
+ """<p>The auto scaling settings for the table's read capacity.</p>"""
20
+
21
+
22
+ # --- awsJson1_0 ser/de ---
23
+ def serialize_aws_json_1_0(value: AutoScalingSpecification) -> dict:
24
+ out: dict = {}
25
+ if "write_capacity_auto_scaling" in value:
26
+ import capo_keyspaces.types.auto_scaling_settings
27
+
28
+ out["writeCapacityAutoScaling"] = (
29
+ capo_keyspaces.types.auto_scaling_settings.serialize_aws_json_1_0(
30
+ value["write_capacity_auto_scaling"]
31
+ )
32
+ )
33
+ if "read_capacity_auto_scaling" in value:
34
+ import capo_keyspaces.types.auto_scaling_settings
35
+
36
+ out["readCapacityAutoScaling"] = (
37
+ capo_keyspaces.types.auto_scaling_settings.serialize_aws_json_1_0(
38
+ value["read_capacity_auto_scaling"]
39
+ )
40
+ )
41
+ return out
42
+
43
+
44
+ def deserialize_aws_json_1_0(data: dict) -> AutoScalingSpecification:
45
+ out: AutoScalingSpecification = {} # type: ignore[typeddict-item]
46
+ if data.get("writeCapacityAutoScaling") is not None:
47
+ import capo_keyspaces.types.auto_scaling_settings
48
+
49
+ out["write_capacity_auto_scaling"] = (
50
+ capo_keyspaces.types.auto_scaling_settings.deserialize_aws_json_1_0(
51
+ data["writeCapacityAutoScaling"]
52
+ )
53
+ )
54
+ if data.get("readCapacityAutoScaling") is not None:
55
+ import capo_keyspaces.types.auto_scaling_settings
56
+
57
+ out["read_capacity_auto_scaling"] = (
58
+ capo_keyspaces.types.auto_scaling_settings.deserialize_aws_json_1_0(
59
+ data["readCapacityAutoScaling"]
60
+ )
61
+ )
62
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#BooleanObject``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ BooleanObject: TypeAlias = bool