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,1448 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#KeyspacesService``."""
2
+
3
+ import warnings
4
+ from collections.abc import Iterator
5
+ from typing import TYPE_CHECKING, Any, Iterable, Optional
6
+
7
+ from typing_extensions import Self, TypedDict
8
+ from zapros import BaseHandler, Client
9
+
10
+ import capo_keyspaces._auth._signers
11
+ import capo_keyspaces._auth._sigv4
12
+ from capo_keyspaces._auth._identity import Credentials
13
+ from capo_keyspaces._auth._providers import (
14
+ CredentialsProvider,
15
+ IdentityProvider,
16
+ StaticAwsCredentialsProvider,
17
+ default_aws_credentials_chain,
18
+ )
19
+ from capo_keyspaces._auth._zapros_handler import AuthMiddleware
20
+ from capo_keyspaces._pagination import resolve_path as _resolve_path
21
+ from capo_keyspaces._services._aws_config import aws_config
22
+ from capo_keyspaces._services._pipeline import (
23
+ Interceptor,
24
+ OperationOptions,
25
+ OperationRequest,
26
+ OperationResponse,
27
+ execute_pipeline,
28
+ retry,
29
+ )
30
+
31
+ if TYPE_CHECKING:
32
+ import capo_keyspaces.types.arn
33
+ import capo_keyspaces.types.auto_scaling_specification
34
+ import capo_keyspaces.types.capacity_specification
35
+ import capo_keyspaces.types.cdc_specification
36
+ import capo_keyspaces.types.client_side_timestamps
37
+ import capo_keyspaces.types.column_definition_list
38
+ import capo_keyspaces.types.comment
39
+ import capo_keyspaces.types.create_keyspace_request
40
+ import capo_keyspaces.types.create_keyspace_response
41
+ import capo_keyspaces.types.create_table_request
42
+ import capo_keyspaces.types.create_table_response
43
+ import capo_keyspaces.types.create_type_request
44
+ import capo_keyspaces.types.create_type_response
45
+ import capo_keyspaces.types.default_time_to_live
46
+ import capo_keyspaces.types.delete_keyspace_request
47
+ import capo_keyspaces.types.delete_keyspace_response
48
+ import capo_keyspaces.types.delete_table_request
49
+ import capo_keyspaces.types.delete_table_response
50
+ import capo_keyspaces.types.delete_type_request
51
+ import capo_keyspaces.types.delete_type_response
52
+ import capo_keyspaces.types.encryption_specification
53
+ import capo_keyspaces.types.field_list
54
+ import capo_keyspaces.types.get_keyspace_request
55
+ import capo_keyspaces.types.get_keyspace_response
56
+ import capo_keyspaces.types.get_table_auto_scaling_settings_request
57
+ import capo_keyspaces.types.get_table_auto_scaling_settings_response
58
+ import capo_keyspaces.types.get_table_request
59
+ import capo_keyspaces.types.get_table_response
60
+ import capo_keyspaces.types.get_type_request
61
+ import capo_keyspaces.types.get_type_response
62
+ import capo_keyspaces.types.keyspace_name
63
+ import capo_keyspaces.types.keyspace_summary
64
+ import capo_keyspaces.types.list_keyspaces_request
65
+ import capo_keyspaces.types.list_keyspaces_response
66
+ import capo_keyspaces.types.list_tables_request
67
+ import capo_keyspaces.types.list_tables_response
68
+ import capo_keyspaces.types.list_tags_for_resource_request
69
+ import capo_keyspaces.types.list_tags_for_resource_response
70
+ import capo_keyspaces.types.list_types_request
71
+ import capo_keyspaces.types.list_types_response
72
+ import capo_keyspaces.types.max_results
73
+ import capo_keyspaces.types.next_token
74
+ import capo_keyspaces.types.point_in_time_recovery
75
+ import capo_keyspaces.types.replica_specification_list
76
+ import capo_keyspaces.types.replication_specification
77
+ import capo_keyspaces.types.restore_table_request
78
+ import capo_keyspaces.types.restore_table_response
79
+ import capo_keyspaces.types.schema_definition
80
+ import capo_keyspaces.types.table_name
81
+ import capo_keyspaces.types.table_summary
82
+ import capo_keyspaces.types.tag
83
+ import capo_keyspaces.types.tag_list
84
+ import capo_keyspaces.types.tag_resource_request
85
+ import capo_keyspaces.types.tag_resource_response
86
+ import capo_keyspaces.types.time_to_live
87
+ import capo_keyspaces.types.timestamp
88
+ import capo_keyspaces.types.type_name
89
+ import capo_keyspaces.types.untag_resource_request
90
+ import capo_keyspaces.types.untag_resource_response
91
+ import capo_keyspaces.types.update_keyspace_request
92
+ import capo_keyspaces.types.update_keyspace_response
93
+ import capo_keyspaces.types.update_table_request
94
+ import capo_keyspaces.types.update_table_response
95
+ import capo_keyspaces.types.warm_throughput_specification
96
+
97
+
98
+ class KeyspacesClientConfig(TypedDict, total=False, closed=True):
99
+ operation_interceptors: Iterable[Interceptor[Any, Any]]
100
+ retry_max_attempts: int | None
101
+ region: str | None
102
+ use_dual_stack: bool | None
103
+ use_fips: bool | None
104
+ endpoint: str | None
105
+ credentials_provider: IdentityProvider[Credentials] | None
106
+
107
+
108
+ class KeyspacesClient:
109
+ """A client for the ``Keyspaces`` service.
110
+
111
+ Args:
112
+ http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
113
+ operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
114
+ retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
115
+ region: The value of the ``AWS::Region`` endpoint parameter.
116
+ use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
117
+ use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
118
+ endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
119
+ credentials: AWS credentials for request signing.
120
+ credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
121
+ """
122
+
123
+ def __init__(
124
+ self,
125
+ http_handler: BaseHandler | None = None,
126
+ operation_interceptors: Iterable[Interceptor[Any, Any]] | None = None,
127
+ retry_max_attempts: int | None = None,
128
+ region: str | None = None,
129
+ use_dual_stack: bool | None = None,
130
+ use_fips: bool | None = None,
131
+ endpoint: str | None = None,
132
+ credentials: Credentials | None = None,
133
+ credentials_provider: CredentialsProvider | None = None,
134
+ ):
135
+ self._client = Client(http_handler).wrap_with_middleware(
136
+ lambda next: AuthMiddleware(next)
137
+ )
138
+ if credentials is not None and credentials_provider is not None:
139
+ warnings.warn(
140
+ "Both credentials and credentials_provider given; provider takes precedence"
141
+ )
142
+ resolved_credentials_provider: IdentityProvider[Credentials] | None = (
143
+ credentials_provider
144
+ )
145
+ if resolved_credentials_provider is None and credentials is not None:
146
+ resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
147
+ if resolved_credentials_provider is None and credentials is None:
148
+ resolved_credentials_provider = default_aws_credentials_chain(
149
+ Client(http_handler)
150
+ )
151
+ self._config = KeyspacesClientConfig(
152
+ {
153
+ "operation_interceptors": operation_interceptors or [],
154
+ "retry_max_attempts": retry_max_attempts,
155
+ "region": region,
156
+ "use_dual_stack": use_dual_stack,
157
+ "use_fips": use_fips,
158
+ "endpoint": endpoint,
159
+ "credentials_provider": resolved_credentials_provider,
160
+ }
161
+ )
162
+
163
+ def operation_options(
164
+ self, config_overrides: Optional[KeyspacesClientConfig] = None
165
+ ) -> tuple[Iterable[Interceptor[Any, Any]], OperationOptions]:
166
+ overrides: KeyspacesClientConfig = config_overrides or {}
167
+ interceptors_: list[Interceptor[Any, Any]] = [
168
+ *overrides.get(
169
+ "operation_interceptors", self._config.get("operation_interceptors", [])
170
+ ),
171
+ aws_config(),
172
+ retry(),
173
+ ]
174
+ options_: OperationOptions = OperationOptions(
175
+ client=self._client,
176
+ retry_max_attempts=overrides.get(
177
+ "retry_max_attempts", self._config.get("retry_max_attempts")
178
+ ),
179
+ region=overrides.get("region", self._config.get("region")),
180
+ use_dual_stack=overrides.get(
181
+ "use_dual_stack", self._config.get("use_dual_stack")
182
+ ),
183
+ use_fips=overrides.get("use_fips", self._config.get("use_fips")),
184
+ endpoint=overrides.get("endpoint", self._config.get("endpoint")),
185
+ credentials_provider=overrides.get(
186
+ "credentials_provider", self._config.get("credentials_provider")
187
+ ),
188
+ )
189
+ return interceptors_, options_
190
+
191
+ def create_keyspace(
192
+ self,
193
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
194
+ *,
195
+ config_overrides: Optional[KeyspacesClientConfig] = None,
196
+ tags: Optional["capo_keyspaces.types.tag_list.TagList"] = None,
197
+ replication_specification: Optional[
198
+ "capo_keyspaces.types.replication_specification.ReplicationSpecification"
199
+ ] = None,
200
+ ) -> "capo_keyspaces.types.create_keyspace_response.CreateKeyspaceResponse":
201
+ r"""<p>The <code>CreateKeyspace</code> operation adds a new keyspace to your account. In an Amazon Web Services account, keyspace names must be unique within each Region.</p> <p> <code>CreateKeyspace</code> is an asynchronous operation. You can monitor the creation status of the new keyspace by using the <code>GetKeyspace</code> operation.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.keyspaces.html\">Create a keyspace</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
202
+
203
+ Args:
204
+ keyspace_name: <p>The name of the keyspace to be created.</p>
205
+ tags: <p>A list of key-value pair tags to be attached to the keyspace.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html\">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
206
+ replication_specification: <p> The replication specification of the keyspace includes:</p> <ul> <li> <p> <code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p> </li> <li> <p> <code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p> </li> </ul>
207
+
208
+ Raises:
209
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
210
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
211
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
212
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
213
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
214
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
215
+ """
216
+
217
+ def _handler(
218
+ req: "OperationRequest[capo_keyspaces.types.create_keyspace_request.CreateKeyspaceRequest]",
219
+ ) -> OperationResponse[
220
+ "capo_keyspaces.types.create_keyspace_response.CreateKeyspaceResponse"
221
+ ]:
222
+ import capo_keyspaces._operations.keyspaces_service.create_keyspace
223
+
224
+ output, http_response = (
225
+ capo_keyspaces._operations.keyspaces_service.create_keyspace.create_keyspace(
226
+ req.options, req.input
227
+ )
228
+ )
229
+ return OperationResponse(output=output, response=http_response)
230
+
231
+ interceptors_, options_ = self.operation_options(config_overrides)
232
+ input_: capo_keyspaces.types.create_keyspace_request.CreateKeyspaceRequest = {
233
+ "keyspace_name": keyspace_name
234
+ }
235
+ if tags is not None:
236
+ input_["tags"] = tags
237
+ if replication_specification is not None:
238
+ input_["replication_specification"] = replication_specification
239
+
240
+ response = execute_pipeline(
241
+ OperationRequest(input=input_, options=options_),
242
+ handler=_handler,
243
+ interceptors=list(interceptors_),
244
+ )
245
+ response.response.close()
246
+ return response.output
247
+
248
+ def create_table(
249
+ self,
250
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
251
+ table_name: "capo_keyspaces.types.table_name.TableName",
252
+ schema_definition: "capo_keyspaces.types.schema_definition.SchemaDefinition",
253
+ *,
254
+ config_overrides: Optional[KeyspacesClientConfig] = None,
255
+ comment: Optional["capo_keyspaces.types.comment.Comment"] = None,
256
+ capacity_specification: Optional[
257
+ "capo_keyspaces.types.capacity_specification.CapacitySpecification"
258
+ ] = None,
259
+ encryption_specification: Optional[
260
+ "capo_keyspaces.types.encryption_specification.EncryptionSpecification"
261
+ ] = None,
262
+ point_in_time_recovery: Optional[
263
+ "capo_keyspaces.types.point_in_time_recovery.PointInTimeRecovery"
264
+ ] = None,
265
+ ttl: Optional["capo_keyspaces.types.time_to_live.TimeToLive"] = None,
266
+ default_time_to_live: Optional[
267
+ "capo_keyspaces.types.default_time_to_live.DefaultTimeToLive"
268
+ ] = None,
269
+ tags: Optional["capo_keyspaces.types.tag_list.TagList"] = None,
270
+ client_side_timestamps: Optional[
271
+ "capo_keyspaces.types.client_side_timestamps.ClientSideTimestamps"
272
+ ] = None,
273
+ auto_scaling_specification: Optional[
274
+ "capo_keyspaces.types.auto_scaling_specification.AutoScalingSpecification"
275
+ ] = None,
276
+ replica_specifications: Optional[
277
+ "capo_keyspaces.types.replica_specification_list.ReplicaSpecificationList"
278
+ ] = None,
279
+ cdc_specification: Optional[
280
+ "capo_keyspaces.types.cdc_specification.CdcSpecification"
281
+ ] = None,
282
+ warm_throughput_specification: Optional[
283
+ "capo_keyspaces.types.warm_throughput_specification.WarmThroughputSpecification"
284
+ ] = None,
285
+ ) -> "capo_keyspaces.types.create_table_response.CreateTableResponse":
286
+ r"""<p>The <code>CreateTable</code> operation adds a new table to the specified keyspace. Within a keyspace, table names must be unique.</p> <p> <code>CreateTable</code> is an asynchronous operation. When the request is received, the status of the table is set to <code>CREATING</code>. You can monitor the creation status of the new table by using the <code>GetTable</code> operation, which returns the current <code>status</code> of the table. You can start using a table when the status is <code>ACTIVE</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.tables.html\">Create a table</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
287
+
288
+ Args:
289
+ keyspace_name: <p>The name of the keyspace that the table is going to be created in.</p>
290
+ table_name: <p>The name of the table.</p>
291
+ schema_definition: <p>The <code>schemaDefinition</code> consists of the following parameters.</p> <p>For each column to be created:</p> <ul> <li> <p> <code>name</code> - The name of the column.</p> </li> <li> <p> <code>type</code> - An Amazon Keyspaces data type. For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types\">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> </li> </ul> <p>The primary key of the table consists of the following columns:</p> <ul> <li> <p> <code>partitionKeys</code> - The partition key can be a single column, or it can be a compound value composed of two or more columns. The partition key portion of the primary key is required and determines how Amazon Keyspaces stores your data.</p> </li> <li> <p> <code>name</code> - The name of each partition key column.</p> </li> <li> <p> <code>clusteringKeys</code> - The optional clustering column portion of your primary key determines how the data is clustered and sorted within each partition.</p> </li> <li> <p> <code>name</code> - The name of the clustering column. </p> </li> <li> <p> <code>orderBy</code> - Sets the ascendant (<code>ASC</code>) or descendant (<code>DESC</code>) order modifier.</p> <p>To define a column as static use <code>staticColumns</code> - Static columns store values that are shared by all rows in the same partition:</p> </li> <li> <p> <code>name</code> - The name of the column.</p> </li> <li> <p> <code>type</code> - An Amazon Keyspaces data type.</p> </li> </ul>
292
+ comment: <p>This parameter allows to enter a description of the table.</p>
293
+ capacity_specification: <p>Specifies the read/write throughput capacity mode for the table. The options are:</p> <ul> <li> <p> <code>throughputMode:PAY_PER_REQUEST</code> and </p> </li> <li> <p> <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p> </li> </ul> <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html\">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
294
+ encryption_specification: <p>Specifies how the encryption key for encryption at rest is managed for the table. You can choose one of the following KMS key (KMS key):</p> <ul> <li> <p> <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p> </li> <li> <p> <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input.</p> </li> </ul> <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html\">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
295
+ point_in_time_recovery: <p>Specifies if <code>pointInTimeRecovery</code> is enabled or disabled for the table. The options are:</p> <ul> <li> <p> <code>status=ENABLED</code> </p> </li> <li> <p> <code>status=DISABLED</code> </p> </li> </ul> <p>If it's not specified, the default is <code>status=DISABLED</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html\">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
296
+ ttl: <p>Enables Time to Live custom settings for the table. The options are:</p> <ul> <li> <p> <code>status:enabled</code> </p> </li> <li> <p> <code>status:disabled</code> </p> </li> </ul> <p>The default is <code>status:disabled</code>. After <code>ttl</code> is enabled, you can't disable it for the table.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/TTL.html\">Expiring data by using Amazon Keyspaces Time to Live (TTL)</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
297
+ default_time_to_live: <p>The default Time to Live setting in seconds for the table.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/TTL-how-it-works.html#ttl-howitworks_default_ttl\">Setting the default TTL value for a table</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
298
+ tags: <p>A list of key-value pair tags to be attached to the resource. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html\">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
299
+ client_side_timestamps: <p> Enables client-side timestamps for the table. By default, the setting is disabled. You can enable client-side timestamps with the following option:</p> <ul> <li> <p> <code>status: \"enabled\"</code> </p> </li> </ul> <p>Once client-side timestamps are enabled for a table, this setting cannot be disabled.</p>
300
+ auto_scaling_specification: <p>The optional auto scaling settings for a table in provisioned capacity mode. Specifies if the service can manage throughput capacity automatically on your behalf.</p> <p>Auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic. For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html\">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>By default, auto scaling is disabled for a table. </p>
301
+ replica_specifications: <p>The optional Amazon Web Services Region specific settings of a multi-Region table. These settings overwrite the general settings of the table for the specified Region. </p> <p>For a multi-Region table in provisioned capacity mode, you can configure the table's read capacity differently for each Region's replica. The write capacity, however, remains synchronized between all replicas to ensure that there's enough capacity to replicate writes across all Regions. To define the read capacity for a table replica in a specific Region, you can do so by configuring the following parameters.</p> <ul> <li> <p> <code>region</code>: The Region where these settings are applied. (Required)</p> </li> <li> <p> <code>readCapacityUnits</code>: The provisioned read capacity units. (Optional)</p> </li> <li> <p> <code>readCapacityAutoScaling</code>: The read capacity auto scaling settings for the table. (Optional) </p> </li> </ul>
302
+ cdc_specification: <p>The CDC stream settings of the table.</p>
303
+ warm_throughput_specification: <p>Specifies the warm throughput settings for the table. Pre-warming a table helps you avoid capacity exceeded exceptions by pre-provisioning read and write capacity units to reduce cold start latency when your table receives traffic.</p> <p>For more information about pre-warming in Amazon Keyspaces, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/warm-throughput.html\">Pre-warm a table in Amazon Keyspaces</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
304
+
305
+ Raises:
306
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
307
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
308
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
309
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
310
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
311
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
312
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
313
+ """
314
+
315
+ def _handler(
316
+ req: "OperationRequest[capo_keyspaces.types.create_table_request.CreateTableRequest]",
317
+ ) -> OperationResponse[
318
+ "capo_keyspaces.types.create_table_response.CreateTableResponse"
319
+ ]:
320
+ import capo_keyspaces._operations.keyspaces_service.create_table
321
+
322
+ output, http_response = (
323
+ capo_keyspaces._operations.keyspaces_service.create_table.create_table(
324
+ req.options, req.input
325
+ )
326
+ )
327
+ return OperationResponse(output=output, response=http_response)
328
+
329
+ interceptors_, options_ = self.operation_options(config_overrides)
330
+ input_: capo_keyspaces.types.create_table_request.CreateTableRequest = {
331
+ "keyspace_name": keyspace_name,
332
+ "table_name": table_name,
333
+ "schema_definition": schema_definition,
334
+ }
335
+ if comment is not None:
336
+ input_["comment"] = comment
337
+ if capacity_specification is not None:
338
+ input_["capacity_specification"] = capacity_specification
339
+ if encryption_specification is not None:
340
+ input_["encryption_specification"] = encryption_specification
341
+ if point_in_time_recovery is not None:
342
+ input_["point_in_time_recovery"] = point_in_time_recovery
343
+ if ttl is not None:
344
+ input_["ttl"] = ttl
345
+ if default_time_to_live is not None:
346
+ input_["default_time_to_live"] = default_time_to_live
347
+ if tags is not None:
348
+ input_["tags"] = tags
349
+ if client_side_timestamps is not None:
350
+ input_["client_side_timestamps"] = client_side_timestamps
351
+ if auto_scaling_specification is not None:
352
+ input_["auto_scaling_specification"] = auto_scaling_specification
353
+ if replica_specifications is not None:
354
+ input_["replica_specifications"] = replica_specifications
355
+ if cdc_specification is not None:
356
+ input_["cdc_specification"] = cdc_specification
357
+ if warm_throughput_specification is not None:
358
+ input_["warm_throughput_specification"] = warm_throughput_specification
359
+
360
+ response = execute_pipeline(
361
+ OperationRequest(input=input_, options=options_),
362
+ handler=_handler,
363
+ interceptors=list(interceptors_),
364
+ )
365
+ response.response.close()
366
+ return response.output
367
+
368
+ def create_type(
369
+ self,
370
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
371
+ type_name: "capo_keyspaces.types.type_name.TypeName",
372
+ field_definitions: "capo_keyspaces.types.field_list.FieldList",
373
+ *,
374
+ config_overrides: Optional[KeyspacesClientConfig] = None,
375
+ ) -> "capo_keyspaces.types.create_type_response.CreateTypeResponse":
376
+ r"""<p> The <code>CreateType</code> operation creates a new user-defined type in the specified keyspace. </p> <p>To configure the required permissions, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-create\">Permissions to create a UDT</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/udts.html\">User-defined types (UDTs)</a> in the <i>Amazon Keyspaces Developer Guide</i>. </p>
377
+
378
+ Args:
379
+ keyspace_name: <p> The name of the keyspace. </p>
380
+ type_name: <p> The name of the user-defined type. </p> <p>UDT names must contain 48 characters or less, must begin with an alphabetic character, and can only contain alpha-numeric characters and underscores. Amazon Keyspaces converts upper case characters automatically into lower case characters. </p> <p>Alternatively, you can declare a UDT name in double quotes. When declaring a UDT name inside double quotes, Amazon Keyspaces preserves upper casing and allows special characters.</p> <p>You can also use double quotes as part of the name when you create the UDT, but you must escape each double quote character with an additional double quote character.</p>
381
+ field_definitions: <p> The field definitions, consisting of names and types, that define this type. </p>
382
+
383
+ Raises:
384
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
385
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
386
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
387
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
388
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
389
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
390
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
391
+ """
392
+
393
+ def _handler(
394
+ req: "OperationRequest[capo_keyspaces.types.create_type_request.CreateTypeRequest]",
395
+ ) -> OperationResponse[
396
+ "capo_keyspaces.types.create_type_response.CreateTypeResponse"
397
+ ]:
398
+ import capo_keyspaces._operations.keyspaces_service.create_type
399
+
400
+ output, http_response = (
401
+ capo_keyspaces._operations.keyspaces_service.create_type.create_type(
402
+ req.options, req.input
403
+ )
404
+ )
405
+ return OperationResponse(output=output, response=http_response)
406
+
407
+ interceptors_, options_ = self.operation_options(config_overrides)
408
+ input_: capo_keyspaces.types.create_type_request.CreateTypeRequest = {
409
+ "keyspace_name": keyspace_name,
410
+ "type_name": type_name,
411
+ "field_definitions": field_definitions,
412
+ }
413
+
414
+ response = execute_pipeline(
415
+ OperationRequest(input=input_, options=options_),
416
+ handler=_handler,
417
+ interceptors=list(interceptors_),
418
+ )
419
+ response.response.close()
420
+ return response.output
421
+
422
+ def delete_keyspace(
423
+ self,
424
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
425
+ *,
426
+ config_overrides: Optional[KeyspacesClientConfig] = None,
427
+ ) -> "capo_keyspaces.types.delete_keyspace_response.DeleteKeyspaceResponse":
428
+ """<p>The <code>DeleteKeyspace</code> operation deletes a keyspace and all of its tables. </p>
429
+
430
+ Args:
431
+ keyspace_name: <p>The name of the keyspace to be deleted.</p>
432
+
433
+ Raises:
434
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
435
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
436
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
437
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
438
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
439
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
440
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
441
+ """
442
+
443
+ def _handler(
444
+ req: "OperationRequest[capo_keyspaces.types.delete_keyspace_request.DeleteKeyspaceRequest]",
445
+ ) -> OperationResponse[
446
+ "capo_keyspaces.types.delete_keyspace_response.DeleteKeyspaceResponse"
447
+ ]:
448
+ import capo_keyspaces._operations.keyspaces_service.delete_keyspace
449
+
450
+ output, http_response = (
451
+ capo_keyspaces._operations.keyspaces_service.delete_keyspace.delete_keyspace(
452
+ req.options, req.input
453
+ )
454
+ )
455
+ return OperationResponse(output=output, response=http_response)
456
+
457
+ interceptors_, options_ = self.operation_options(config_overrides)
458
+ input_: capo_keyspaces.types.delete_keyspace_request.DeleteKeyspaceRequest = {
459
+ "keyspace_name": keyspace_name
460
+ }
461
+
462
+ response = execute_pipeline(
463
+ OperationRequest(input=input_, options=options_),
464
+ handler=_handler,
465
+ interceptors=list(interceptors_),
466
+ )
467
+ response.response.close()
468
+ return response.output
469
+
470
+ def delete_table(
471
+ self,
472
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
473
+ table_name: "capo_keyspaces.types.table_name.TableName",
474
+ *,
475
+ config_overrides: Optional[KeyspacesClientConfig] = None,
476
+ ) -> "capo_keyspaces.types.delete_table_response.DeleteTableResponse":
477
+ """<p>The <code>DeleteTable</code> operation deletes a table and all of its data. After a <code>DeleteTable</code> request is received, the specified table is in the <code>DELETING</code> state until Amazon Keyspaces completes the deletion. If the table is in the <code>ACTIVE</code> state, you can delete it. If a table is either in the <code>CREATING</code> or <code>UPDATING</code> states, then Amazon Keyspaces returns a <code>ResourceInUseException</code>. If the specified table does not exist, Amazon Keyspaces returns a <code>ResourceNotFoundException</code>. If the table is already in the <code>DELETING</code> state, no error is returned.</p>
478
+
479
+ Args:
480
+ keyspace_name: <p>The name of the keyspace of the to be deleted table.</p>
481
+ table_name: <p>The name of the table to be deleted.</p>
482
+
483
+ Raises:
484
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
485
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
486
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
487
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
488
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
489
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
490
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
491
+ """
492
+
493
+ def _handler(
494
+ req: "OperationRequest[capo_keyspaces.types.delete_table_request.DeleteTableRequest]",
495
+ ) -> OperationResponse[
496
+ "capo_keyspaces.types.delete_table_response.DeleteTableResponse"
497
+ ]:
498
+ import capo_keyspaces._operations.keyspaces_service.delete_table
499
+
500
+ output, http_response = (
501
+ capo_keyspaces._operations.keyspaces_service.delete_table.delete_table(
502
+ req.options, req.input
503
+ )
504
+ )
505
+ return OperationResponse(output=output, response=http_response)
506
+
507
+ interceptors_, options_ = self.operation_options(config_overrides)
508
+ input_: capo_keyspaces.types.delete_table_request.DeleteTableRequest = {
509
+ "keyspace_name": keyspace_name,
510
+ "table_name": table_name,
511
+ }
512
+
513
+ response = execute_pipeline(
514
+ OperationRequest(input=input_, options=options_),
515
+ handler=_handler,
516
+ interceptors=list(interceptors_),
517
+ )
518
+ response.response.close()
519
+ return response.output
520
+
521
+ def delete_type(
522
+ self,
523
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
524
+ type_name: "capo_keyspaces.types.type_name.TypeName",
525
+ *,
526
+ config_overrides: Optional[KeyspacesClientConfig] = None,
527
+ ) -> "capo_keyspaces.types.delete_type_response.DeleteTypeResponse":
528
+ r"""<p> The <code>DeleteType</code> operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table or another UDT. </p> <p>To configure the required permissions, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-drop\">Permissions to delete a UDT</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
529
+
530
+ Args:
531
+ keyspace_name: <p> The name of the keyspace of the to be deleted type. </p>
532
+ type_name: <p> The name of the type to be deleted. </p>
533
+
534
+ Raises:
535
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
536
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
537
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
538
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
539
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
540
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
541
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
542
+ """
543
+
544
+ def _handler(
545
+ req: "OperationRequest[capo_keyspaces.types.delete_type_request.DeleteTypeRequest]",
546
+ ) -> OperationResponse[
547
+ "capo_keyspaces.types.delete_type_response.DeleteTypeResponse"
548
+ ]:
549
+ import capo_keyspaces._operations.keyspaces_service.delete_type
550
+
551
+ output, http_response = (
552
+ capo_keyspaces._operations.keyspaces_service.delete_type.delete_type(
553
+ req.options, req.input
554
+ )
555
+ )
556
+ return OperationResponse(output=output, response=http_response)
557
+
558
+ interceptors_, options_ = self.operation_options(config_overrides)
559
+ input_: capo_keyspaces.types.delete_type_request.DeleteTypeRequest = {
560
+ "keyspace_name": keyspace_name,
561
+ "type_name": type_name,
562
+ }
563
+
564
+ response = execute_pipeline(
565
+ OperationRequest(input=input_, options=options_),
566
+ handler=_handler,
567
+ interceptors=list(interceptors_),
568
+ )
569
+ response.response.close()
570
+ return response.output
571
+
572
+ def get_keyspace(
573
+ self,
574
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
575
+ *,
576
+ config_overrides: Optional[KeyspacesClientConfig] = None,
577
+ ) -> "capo_keyspaces.types.get_keyspace_response.GetKeyspaceResponse":
578
+ """<p>Returns the name of the specified keyspace, the Amazon Resource Name (ARN), the replication strategy, the Amazon Web Services Regions of a multi-Region keyspace, and the status of newly added Regions after an <code>UpdateKeyspace</code> operation.</p>
579
+
580
+ Args:
581
+ keyspace_name: <p>The name of the keyspace.</p>
582
+
583
+ Raises:
584
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
585
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
586
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
587
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
588
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
589
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
590
+ """
591
+
592
+ def _handler(
593
+ req: "OperationRequest[capo_keyspaces.types.get_keyspace_request.GetKeyspaceRequest]",
594
+ ) -> OperationResponse[
595
+ "capo_keyspaces.types.get_keyspace_response.GetKeyspaceResponse"
596
+ ]:
597
+ import capo_keyspaces._operations.keyspaces_service.get_keyspace
598
+
599
+ output, http_response = (
600
+ capo_keyspaces._operations.keyspaces_service.get_keyspace.get_keyspace(
601
+ req.options, req.input
602
+ )
603
+ )
604
+ return OperationResponse(output=output, response=http_response)
605
+
606
+ interceptors_, options_ = self.operation_options(config_overrides)
607
+ input_: capo_keyspaces.types.get_keyspace_request.GetKeyspaceRequest = {
608
+ "keyspace_name": keyspace_name
609
+ }
610
+
611
+ response = execute_pipeline(
612
+ OperationRequest(input=input_, options=options_),
613
+ handler=_handler,
614
+ interceptors=list(interceptors_),
615
+ )
616
+ response.response.close()
617
+ return response.output
618
+
619
+ def get_table(
620
+ self,
621
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
622
+ table_name: "capo_keyspaces.types.table_name.TableName",
623
+ *,
624
+ config_overrides: Optional[KeyspacesClientConfig] = None,
625
+ ) -> "capo_keyspaces.types.get_table_response.GetTableResponse":
626
+ """<p>Returns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata.</p> <p>To read table metadata using <code>GetTable</code>, the IAM principal needs <code>Select</code> action permissions for the table and the system keyspace.</p>
627
+
628
+ Args:
629
+ keyspace_name: <p>The name of the keyspace that the table is stored in.</p>
630
+ table_name: <p>The name of the table.</p>
631
+
632
+ Raises:
633
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
634
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
635
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
636
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
637
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
638
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
639
+ """
640
+
641
+ def _handler(
642
+ req: "OperationRequest[capo_keyspaces.types.get_table_request.GetTableRequest]",
643
+ ) -> OperationResponse[
644
+ "capo_keyspaces.types.get_table_response.GetTableResponse"
645
+ ]:
646
+ import capo_keyspaces._operations.keyspaces_service.get_table
647
+
648
+ output, http_response = (
649
+ capo_keyspaces._operations.keyspaces_service.get_table.get_table(
650
+ req.options, req.input
651
+ )
652
+ )
653
+ return OperationResponse(output=output, response=http_response)
654
+
655
+ interceptors_, options_ = self.operation_options(config_overrides)
656
+ input_: capo_keyspaces.types.get_table_request.GetTableRequest = {
657
+ "keyspace_name": keyspace_name,
658
+ "table_name": table_name,
659
+ }
660
+
661
+ response = execute_pipeline(
662
+ OperationRequest(input=input_, options=options_),
663
+ handler=_handler,
664
+ interceptors=list(interceptors_),
665
+ )
666
+ response.response.close()
667
+ return response.output
668
+
669
+ def get_table_auto_scaling_settings(
670
+ self,
671
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
672
+ table_name: "capo_keyspaces.types.table_name.TableName",
673
+ *,
674
+ config_overrides: Optional[KeyspacesClientConfig] = None,
675
+ ) -> "capo_keyspaces.types.get_table_auto_scaling_settings_response.GetTableAutoScalingSettingsResponse":
676
+ r"""<p>Returns auto scaling related settings of the specified table in JSON format. If the table is a multi-Region table, the Amazon Web Services Region specific auto scaling settings of the table are included.</p> <p>Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic. For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html\">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <important> <p> <code>GetTableAutoScalingSettings</code> can't be used as an action in an IAM policy.</p> </important> <p>To define permissions for <code>GetTableAutoScalingSettings</code>, you must allow the following two actions in the IAM policy statement's <code>Action</code> element:</p> <ul> <li> <p> <code>application-autoscaling:DescribeScalableTargets</code> </p> </li> <li> <p> <code>application-autoscaling:DescribeScalingPolicies</code> </p> </li> </ul>
677
+
678
+ Args:
679
+ keyspace_name: <p>The name of the keyspace.</p>
680
+ table_name: <p>The name of the table.</p>
681
+
682
+ Raises:
683
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
684
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
685
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
686
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
687
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
688
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
689
+ """
690
+
691
+ def _handler(
692
+ req: "OperationRequest[capo_keyspaces.types.get_table_auto_scaling_settings_request.GetTableAutoScalingSettingsRequest]",
693
+ ) -> OperationResponse[
694
+ "capo_keyspaces.types.get_table_auto_scaling_settings_response.GetTableAutoScalingSettingsResponse"
695
+ ]:
696
+ import capo_keyspaces._operations.keyspaces_service.get_table_auto_scaling_settings
697
+
698
+ output, http_response = (
699
+ capo_keyspaces._operations.keyspaces_service.get_table_auto_scaling_settings.get_table_auto_scaling_settings(
700
+ req.options, req.input
701
+ )
702
+ )
703
+ return OperationResponse(output=output, response=http_response)
704
+
705
+ interceptors_, options_ = self.operation_options(config_overrides)
706
+ input_: capo_keyspaces.types.get_table_auto_scaling_settings_request.GetTableAutoScalingSettingsRequest = {
707
+ "keyspace_name": keyspace_name,
708
+ "table_name": table_name,
709
+ }
710
+
711
+ response = execute_pipeline(
712
+ OperationRequest(input=input_, options=options_),
713
+ handler=_handler,
714
+ interceptors=list(interceptors_),
715
+ )
716
+ response.response.close()
717
+ return response.output
718
+
719
+ def get_type(
720
+ self,
721
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
722
+ type_name: "capo_keyspaces.types.type_name.TypeName",
723
+ *,
724
+ config_overrides: Optional[KeyspacesClientConfig] = None,
725
+ ) -> "capo_keyspaces.types.get_type_response.GetTypeResponse":
726
+ r"""<p> The <code>GetType</code> operation returns information about the type, for example the field definitions, the timestamp when the type was last modified, the level of nesting, the status, and details about if the type is used in other types and tables. </p> <p>To read keyspace metadata using <code>GetType</code>, the IAM principal needs <code>Select</code> action permissions for the system keyspace. To configure the required permissions, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view\">Permissions to view a UDT</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
727
+
728
+ Args:
729
+ keyspace_name: <p> The name of the keyspace that contains this type. </p>
730
+ type_name: <p>The formatted name of the type. For example, if the name of the type was created without double quotes, Amazon Keyspaces saved the name in lower-case characters. If the name was created in double quotes, you must use double quotes to specify the type name. </p>
731
+
732
+ Raises:
733
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
734
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
735
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
736
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
737
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
738
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
739
+ """
740
+
741
+ def _handler(
742
+ req: "OperationRequest[capo_keyspaces.types.get_type_request.GetTypeRequest]",
743
+ ) -> OperationResponse[
744
+ "capo_keyspaces.types.get_type_response.GetTypeResponse"
745
+ ]:
746
+ import capo_keyspaces._operations.keyspaces_service.get_type
747
+
748
+ output, http_response = (
749
+ capo_keyspaces._operations.keyspaces_service.get_type.get_type(
750
+ req.options, req.input
751
+ )
752
+ )
753
+ return OperationResponse(output=output, response=http_response)
754
+
755
+ interceptors_, options_ = self.operation_options(config_overrides)
756
+ input_: capo_keyspaces.types.get_type_request.GetTypeRequest = {
757
+ "keyspace_name": keyspace_name,
758
+ "type_name": type_name,
759
+ }
760
+
761
+ response = execute_pipeline(
762
+ OperationRequest(input=input_, options=options_),
763
+ handler=_handler,
764
+ interceptors=list(interceptors_),
765
+ )
766
+ response.response.close()
767
+ return response.output
768
+
769
+ def list_keyspaces(
770
+ self,
771
+ *,
772
+ config_overrides: Optional[KeyspacesClientConfig] = None,
773
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
774
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
775
+ ) -> "capo_keyspaces.types.list_keyspaces_response.ListKeyspacesResponse":
776
+ """<p>The <code>ListKeyspaces</code> operation returns a list of keyspaces.</p>
777
+
778
+ Args:
779
+ next_token: <p>The pagination token. To resume pagination, provide the <code>NextToken</code> value as argument of a subsequent API invocation.</p>
780
+ max_results: <p>The total number of keyspaces to return in the output. If the total number of keyspaces available is more than the value specified, a <code>NextToken</code> is provided in the output. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation.</p>
781
+
782
+ Raises:
783
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
784
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
785
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
786
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
787
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
788
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
789
+ """
790
+
791
+ def _handler(
792
+ req: "OperationRequest[capo_keyspaces.types.list_keyspaces_request.ListKeyspacesRequest]",
793
+ ) -> OperationResponse[
794
+ "capo_keyspaces.types.list_keyspaces_response.ListKeyspacesResponse"
795
+ ]:
796
+ import capo_keyspaces._operations.keyspaces_service.list_keyspaces
797
+
798
+ output, http_response = (
799
+ capo_keyspaces._operations.keyspaces_service.list_keyspaces.list_keyspaces(
800
+ req.options, req.input
801
+ )
802
+ )
803
+ return OperationResponse(output=output, response=http_response)
804
+
805
+ interceptors_, options_ = self.operation_options(config_overrides)
806
+ input_: capo_keyspaces.types.list_keyspaces_request.ListKeyspacesRequest = {}
807
+ if next_token is not None:
808
+ input_["next_token"] = next_token
809
+ if max_results is not None:
810
+ input_["max_results"] = max_results
811
+
812
+ response = execute_pipeline(
813
+ OperationRequest(input=input_, options=options_),
814
+ handler=_handler,
815
+ interceptors=list(interceptors_),
816
+ )
817
+ response.response.close()
818
+ return response.output
819
+
820
+ def iter_list_keyspaces(
821
+ self,
822
+ *,
823
+ config_overrides: Optional[KeyspacesClientConfig] = None,
824
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
825
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
826
+ ) -> "Iterator[capo_keyspaces.types.keyspace_summary.KeyspaceSummary]":
827
+ _token = next_token
828
+ while True:
829
+ _response = self.list_keyspaces(
830
+ config_overrides=config_overrides,
831
+ next_token=_token,
832
+ max_results=max_results,
833
+ )
834
+ _page = _resolve_path(_response, ("keyspaces",))
835
+ for _item in _page or []:
836
+ yield _item
837
+ _token = _resolve_path(_response, ("next_token",))
838
+ if not _token:
839
+ break
840
+
841
+ def list_tables(
842
+ self,
843
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
844
+ *,
845
+ config_overrides: Optional[KeyspacesClientConfig] = None,
846
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
847
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
848
+ ) -> "capo_keyspaces.types.list_tables_response.ListTablesResponse":
849
+ """<p>The <code>ListTables</code> operation returns a list of tables for a specified keyspace.</p> <p>To read keyspace metadata using <code>ListTables</code>, the IAM principal needs <code>Select</code> action permissions for the system keyspace.</p>
850
+
851
+ Args:
852
+ next_token: <p>The pagination token. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation.</p>
853
+ max_results: <p>The total number of tables to return in the output. If the total number of tables available is more than the value specified, a <code>NextToken</code> is provided in the output. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation.</p>
854
+ keyspace_name: <p>The name of the keyspace.</p>
855
+
856
+ Raises:
857
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
858
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
859
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
860
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
861
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
862
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
863
+ """
864
+
865
+ def _handler(
866
+ req: "OperationRequest[capo_keyspaces.types.list_tables_request.ListTablesRequest]",
867
+ ) -> OperationResponse[
868
+ "capo_keyspaces.types.list_tables_response.ListTablesResponse"
869
+ ]:
870
+ import capo_keyspaces._operations.keyspaces_service.list_tables
871
+
872
+ output, http_response = (
873
+ capo_keyspaces._operations.keyspaces_service.list_tables.list_tables(
874
+ req.options, req.input
875
+ )
876
+ )
877
+ return OperationResponse(output=output, response=http_response)
878
+
879
+ interceptors_, options_ = self.operation_options(config_overrides)
880
+ input_: capo_keyspaces.types.list_tables_request.ListTablesRequest = {
881
+ "keyspace_name": keyspace_name
882
+ }
883
+ if next_token is not None:
884
+ input_["next_token"] = next_token
885
+ if max_results is not None:
886
+ input_["max_results"] = max_results
887
+
888
+ response = execute_pipeline(
889
+ OperationRequest(input=input_, options=options_),
890
+ handler=_handler,
891
+ interceptors=list(interceptors_),
892
+ )
893
+ response.response.close()
894
+ return response.output
895
+
896
+ def iter_list_tables(
897
+ self,
898
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
899
+ *,
900
+ config_overrides: Optional[KeyspacesClientConfig] = None,
901
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
902
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
903
+ ) -> "Iterator[capo_keyspaces.types.table_summary.TableSummary]":
904
+ _token = next_token
905
+ while True:
906
+ _response = self.list_tables(
907
+ keyspace_name,
908
+ config_overrides=config_overrides,
909
+ next_token=_token,
910
+ max_results=max_results,
911
+ )
912
+ _page = _resolve_path(_response, ("tables",))
913
+ for _item in _page or []:
914
+ yield _item
915
+ _token = _resolve_path(_response, ("next_token",))
916
+ if not _token:
917
+ break
918
+
919
+ def list_tags_for_resource(
920
+ self,
921
+ resource_arn: "capo_keyspaces.types.arn.ARN",
922
+ *,
923
+ config_overrides: Optional[KeyspacesClientConfig] = None,
924
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
925
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
926
+ ) -> "capo_keyspaces.types.list_tags_for_resource_response.ListTagsForResourceResponse":
927
+ """<p>Returns a list of all tags associated with the specified Amazon Keyspaces resource.</p> <p>To read keyspace metadata using <code>ListTagsForResource</code>, the IAM principal needs <code>Select</code> action permissions for the specified resource and the system keyspace.</p>
928
+
929
+ Args:
930
+ resource_arn: <p>The Amazon Resource Name (ARN) of the Amazon Keyspaces resource.</p>
931
+ next_token: <p>The pagination token. To resume pagination, provide the <code>NextToken</code> value as argument of a subsequent API invocation.</p>
932
+ max_results: <p>The total number of tags to return in the output. If the total number of tags available is more than the value specified, a <code>NextToken</code> is provided in the output. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation.</p>
933
+
934
+ Raises:
935
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
936
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
937
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
938
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
939
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
940
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
941
+ """
942
+
943
+ def _handler(
944
+ req: "OperationRequest[capo_keyspaces.types.list_tags_for_resource_request.ListTagsForResourceRequest]",
945
+ ) -> OperationResponse[
946
+ "capo_keyspaces.types.list_tags_for_resource_response.ListTagsForResourceResponse"
947
+ ]:
948
+ import capo_keyspaces._operations.keyspaces_service.list_tags_for_resource
949
+
950
+ output, http_response = (
951
+ capo_keyspaces._operations.keyspaces_service.list_tags_for_resource.list_tags_for_resource(
952
+ req.options, req.input
953
+ )
954
+ )
955
+ return OperationResponse(output=output, response=http_response)
956
+
957
+ interceptors_, options_ = self.operation_options(config_overrides)
958
+ input_: capo_keyspaces.types.list_tags_for_resource_request.ListTagsForResourceRequest = {
959
+ "resource_arn": resource_arn
960
+ }
961
+ if next_token is not None:
962
+ input_["next_token"] = next_token
963
+ if max_results is not None:
964
+ input_["max_results"] = max_results
965
+
966
+ response = execute_pipeline(
967
+ OperationRequest(input=input_, options=options_),
968
+ handler=_handler,
969
+ interceptors=list(interceptors_),
970
+ )
971
+ response.response.close()
972
+ return response.output
973
+
974
+ def iter_list_tags_for_resource(
975
+ self,
976
+ resource_arn: "capo_keyspaces.types.arn.ARN",
977
+ *,
978
+ config_overrides: Optional[KeyspacesClientConfig] = None,
979
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
980
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
981
+ ) -> "Iterator[capo_keyspaces.types.tag.Tag]":
982
+ _token = next_token
983
+ while True:
984
+ _response = self.list_tags_for_resource(
985
+ resource_arn,
986
+ config_overrides=config_overrides,
987
+ next_token=_token,
988
+ max_results=max_results,
989
+ )
990
+ _page = _resolve_path(_response, ("tags",))
991
+ for _item in _page or []:
992
+ yield _item
993
+ _token = _resolve_path(_response, ("next_token",))
994
+ if not _token:
995
+ break
996
+
997
+ def list_types(
998
+ self,
999
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1000
+ *,
1001
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1002
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
1003
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
1004
+ ) -> "capo_keyspaces.types.list_types_response.ListTypesResponse":
1005
+ r"""<p> The <code>ListTypes</code> operation returns a list of types for a specified keyspace. </p> <p>To read keyspace metadata using <code>ListTypes</code>, the IAM principal needs <code>Select</code> action permissions for the system keyspace. To configure the required permissions, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view\">Permissions to view a UDT</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1006
+
1007
+ Args:
1008
+ next_token: <p> The pagination token. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation. </p>
1009
+ max_results: <p> The total number of types to return in the output. If the total number of types available is more than the value specified, a <code>NextToken</code> is provided in the output. To resume pagination, provide the <code>NextToken</code> value as an argument of a subsequent API invocation. </p>
1010
+ keyspace_name: <p> The name of the keyspace that contains the listed types. </p>
1011
+
1012
+ Raises:
1013
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1014
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1015
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1016
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1017
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1018
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1019
+ """
1020
+
1021
+ def _handler(
1022
+ req: "OperationRequest[capo_keyspaces.types.list_types_request.ListTypesRequest]",
1023
+ ) -> OperationResponse[
1024
+ "capo_keyspaces.types.list_types_response.ListTypesResponse"
1025
+ ]:
1026
+ import capo_keyspaces._operations.keyspaces_service.list_types
1027
+
1028
+ output, http_response = (
1029
+ capo_keyspaces._operations.keyspaces_service.list_types.list_types(
1030
+ req.options, req.input
1031
+ )
1032
+ )
1033
+ return OperationResponse(output=output, response=http_response)
1034
+
1035
+ interceptors_, options_ = self.operation_options(config_overrides)
1036
+ input_: capo_keyspaces.types.list_types_request.ListTypesRequest = {
1037
+ "keyspace_name": keyspace_name
1038
+ }
1039
+ if next_token is not None:
1040
+ input_["next_token"] = next_token
1041
+ if max_results is not None:
1042
+ input_["max_results"] = max_results
1043
+
1044
+ response = execute_pipeline(
1045
+ OperationRequest(input=input_, options=options_),
1046
+ handler=_handler,
1047
+ interceptors=list(interceptors_),
1048
+ )
1049
+ response.response.close()
1050
+ return response.output
1051
+
1052
+ def iter_list_types(
1053
+ self,
1054
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1055
+ *,
1056
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1057
+ next_token: Optional["capo_keyspaces.types.next_token.NextToken"] = None,
1058
+ max_results: Optional["capo_keyspaces.types.max_results.MaxResults"] = None,
1059
+ ) -> "Iterator[capo_keyspaces.types.type_name.TypeName]":
1060
+ _token = next_token
1061
+ while True:
1062
+ _response = self.list_types(
1063
+ keyspace_name,
1064
+ config_overrides=config_overrides,
1065
+ next_token=_token,
1066
+ max_results=max_results,
1067
+ )
1068
+ _page = _resolve_path(_response, ("types",))
1069
+ for _item in _page or []:
1070
+ yield _item
1071
+ _token = _resolve_path(_response, ("next_token",))
1072
+ if not _token:
1073
+ break
1074
+
1075
+ def restore_table(
1076
+ self,
1077
+ source_keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1078
+ source_table_name: "capo_keyspaces.types.table_name.TableName",
1079
+ target_keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1080
+ target_table_name: "capo_keyspaces.types.table_name.TableName",
1081
+ *,
1082
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1083
+ restore_timestamp: Optional["capo_keyspaces.types.timestamp.Timestamp"] = None,
1084
+ capacity_specification_override: Optional[
1085
+ "capo_keyspaces.types.capacity_specification.CapacitySpecification"
1086
+ ] = None,
1087
+ encryption_specification_override: Optional[
1088
+ "capo_keyspaces.types.encryption_specification.EncryptionSpecification"
1089
+ ] = None,
1090
+ point_in_time_recovery_override: Optional[
1091
+ "capo_keyspaces.types.point_in_time_recovery.PointInTimeRecovery"
1092
+ ] = None,
1093
+ tags_override: Optional["capo_keyspaces.types.tag_list.TagList"] = None,
1094
+ auto_scaling_specification: Optional[
1095
+ "capo_keyspaces.types.auto_scaling_specification.AutoScalingSpecification"
1096
+ ] = None,
1097
+ replica_specifications: Optional[
1098
+ "capo_keyspaces.types.replica_specification_list.ReplicaSpecificationList"
1099
+ ] = None,
1100
+ ) -> "capo_keyspaces.types.restore_table_response.RestoreTableResponse":
1101
+ r"""<p>Restores the table to the specified point in time within the <code>earliest_restorable_timestamp</code> and the current time. For more information about restore points, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_window\"> Time window for PITR continuous backups</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.</p> <p>When you restore using point in time recovery, Amazon Keyspaces restores your source table's schema and data to the state based on the selected timestamp <code>(day:hour:minute:second)</code> to a new table. The Time to Live (TTL) settings are also restored to the state based on the selected timestamp.</p> <p>In addition to the table's schema, data, and TTL settings, <code>RestoreTable</code> restores the capacity mode, auto scaling settings, encryption settings, and point-in-time recovery settings from the source table. Unlike the table's schema data and TTL settings, which are restored based on the selected timestamp, these settings are always restored based on the table's settings as of the current time or when the table was deleted.</p> <p>You can also overwrite these settings during restore:</p> <ul> <li> <p>Read/write capacity mode</p> </li> <li> <p>Provisioned throughput capacity units</p> </li> <li> <p>Auto scaling settings</p> </li> <li> <p>Point-in-time (PITR) settings</p> </li> <li> <p>Tags</p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_settings\">PITR restore settings</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>Note that the following settings are not restored, and you must configure them manually for the new table:</p> <ul> <li> <p>Identity and Access Management (IAM) policies</p> </li> <li> <p>Amazon CloudWatch metrics and alarms</p> </li> </ul>
1102
+
1103
+ Args:
1104
+ source_keyspace_name: <p>The keyspace name of the source table.</p>
1105
+ source_table_name: <p>The name of the source table.</p>
1106
+ target_keyspace_name: <p>The name of the target keyspace.</p>
1107
+ target_table_name: <p>The name of the target table.</p>
1108
+ restore_timestamp: <p>The restore timestamp in ISO 8601 format.</p>
1109
+ capacity_specification_override: <p>Specifies the read/write throughput capacity mode for the target table. The options are:</p> <ul> <li> <p> <code>throughputMode:PAY_PER_REQUEST</code> </p> </li> <li> <p> <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p> </li> </ul> <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html\">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1110
+ encryption_specification_override: <p>Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):</p> <ul> <li> <p> <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p> </li> <li> <p> <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p> </li> </ul> <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html\">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1111
+ point_in_time_recovery_override: <p>Specifies the <code>pointInTimeRecovery</code> settings for the target table. The options are:</p> <ul> <li> <p> <code>status=ENABLED</code> </p> </li> <li> <p> <code>status=DISABLED</code> </p> </li> </ul> <p>If it's not specified, the default is <code>status=DISABLED</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html\">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1112
+ tags_override: <p>A list of key-value pair tags to be attached to the restored table. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html\">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1113
+ auto_scaling_specification: <p>The optional auto scaling settings for the restored table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html\">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1114
+ replica_specifications: <p>The optional Region specific settings of a multi-Regional table.</p>
1115
+
1116
+ Raises:
1117
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1118
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
1119
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1120
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1121
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1122
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1123
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1124
+ """
1125
+
1126
+ def _handler(
1127
+ req: "OperationRequest[capo_keyspaces.types.restore_table_request.RestoreTableRequest]",
1128
+ ) -> OperationResponse[
1129
+ "capo_keyspaces.types.restore_table_response.RestoreTableResponse"
1130
+ ]:
1131
+ import capo_keyspaces._operations.keyspaces_service.restore_table
1132
+
1133
+ output, http_response = (
1134
+ capo_keyspaces._operations.keyspaces_service.restore_table.restore_table(
1135
+ req.options, req.input
1136
+ )
1137
+ )
1138
+ return OperationResponse(output=output, response=http_response)
1139
+
1140
+ interceptors_, options_ = self.operation_options(config_overrides)
1141
+ input_: capo_keyspaces.types.restore_table_request.RestoreTableRequest = {
1142
+ "source_keyspace_name": source_keyspace_name,
1143
+ "source_table_name": source_table_name,
1144
+ "target_keyspace_name": target_keyspace_name,
1145
+ "target_table_name": target_table_name,
1146
+ }
1147
+ if restore_timestamp is not None:
1148
+ input_["restore_timestamp"] = restore_timestamp
1149
+ if capacity_specification_override is not None:
1150
+ input_["capacity_specification_override"] = capacity_specification_override
1151
+ if encryption_specification_override is not None:
1152
+ input_["encryption_specification_override"] = (
1153
+ encryption_specification_override
1154
+ )
1155
+ if point_in_time_recovery_override is not None:
1156
+ input_["point_in_time_recovery_override"] = point_in_time_recovery_override
1157
+ if tags_override is not None:
1158
+ input_["tags_override"] = tags_override
1159
+ if auto_scaling_specification is not None:
1160
+ input_["auto_scaling_specification"] = auto_scaling_specification
1161
+ if replica_specifications is not None:
1162
+ input_["replica_specifications"] = replica_specifications
1163
+
1164
+ response = execute_pipeline(
1165
+ OperationRequest(input=input_, options=options_),
1166
+ handler=_handler,
1167
+ interceptors=list(interceptors_),
1168
+ )
1169
+ response.response.close()
1170
+ return response.output
1171
+
1172
+ def tag_resource(
1173
+ self,
1174
+ resource_arn: "capo_keyspaces.types.arn.ARN",
1175
+ tags: "capo_keyspaces.types.tag_list.TagList",
1176
+ *,
1177
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1178
+ ) -> "capo_keyspaces.types.tag_resource_response.TagResourceResponse":
1179
+ r"""<p>Associates a set of tags with a Amazon Keyspaces resource. You can then activate these user-defined tags so that they appear on the Cost Management Console for cost allocation tracking. For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html\">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>For IAM policy examples that show how to control access to Amazon Keyspaces resources based on tags, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-tags\">Amazon Keyspaces resource access based on tags</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1180
+
1181
+ Args:
1182
+ resource_arn: <p>The Amazon Resource Name (ARN) of the Amazon Keyspaces resource to which to add tags.</p>
1183
+ tags: <p>The tags to be assigned to the Amazon Keyspaces resource.</p>
1184
+
1185
+ Raises:
1186
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1187
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
1188
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1189
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1190
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1191
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1192
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1193
+ """
1194
+
1195
+ def _handler(
1196
+ req: "OperationRequest[capo_keyspaces.types.tag_resource_request.TagResourceRequest]",
1197
+ ) -> OperationResponse[
1198
+ "capo_keyspaces.types.tag_resource_response.TagResourceResponse"
1199
+ ]:
1200
+ import capo_keyspaces._operations.keyspaces_service.tag_resource
1201
+
1202
+ output, http_response = (
1203
+ capo_keyspaces._operations.keyspaces_service.tag_resource.tag_resource(
1204
+ req.options, req.input
1205
+ )
1206
+ )
1207
+ return OperationResponse(output=output, response=http_response)
1208
+
1209
+ interceptors_, options_ = self.operation_options(config_overrides)
1210
+ input_: capo_keyspaces.types.tag_resource_request.TagResourceRequest = {
1211
+ "resource_arn": resource_arn,
1212
+ "tags": tags,
1213
+ }
1214
+
1215
+ response = execute_pipeline(
1216
+ OperationRequest(input=input_, options=options_),
1217
+ handler=_handler,
1218
+ interceptors=list(interceptors_),
1219
+ )
1220
+ response.response.close()
1221
+ return response.output
1222
+
1223
+ def untag_resource(
1224
+ self,
1225
+ resource_arn: "capo_keyspaces.types.arn.ARN",
1226
+ tags: "capo_keyspaces.types.tag_list.TagList",
1227
+ *,
1228
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1229
+ ) -> "capo_keyspaces.types.untag_resource_response.UntagResourceResponse":
1230
+ """<p>Removes the association of tags from a Amazon Keyspaces resource.</p>
1231
+
1232
+ Args:
1233
+ resource_arn: <p>The Amazon Keyspaces resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).</p>
1234
+ tags: <p>A list of existing tags to be removed from the Amazon Keyspaces resource.</p>
1235
+
1236
+ Raises:
1237
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1238
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
1239
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1240
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1241
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1242
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1243
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1244
+ """
1245
+
1246
+ def _handler(
1247
+ req: "OperationRequest[capo_keyspaces.types.untag_resource_request.UntagResourceRequest]",
1248
+ ) -> OperationResponse[
1249
+ "capo_keyspaces.types.untag_resource_response.UntagResourceResponse"
1250
+ ]:
1251
+ import capo_keyspaces._operations.keyspaces_service.untag_resource
1252
+
1253
+ output, http_response = (
1254
+ capo_keyspaces._operations.keyspaces_service.untag_resource.untag_resource(
1255
+ req.options, req.input
1256
+ )
1257
+ )
1258
+ return OperationResponse(output=output, response=http_response)
1259
+
1260
+ interceptors_, options_ = self.operation_options(config_overrides)
1261
+ input_: capo_keyspaces.types.untag_resource_request.UntagResourceRequest = {
1262
+ "resource_arn": resource_arn,
1263
+ "tags": tags,
1264
+ }
1265
+
1266
+ response = execute_pipeline(
1267
+ OperationRequest(input=input_, options=options_),
1268
+ handler=_handler,
1269
+ interceptors=list(interceptors_),
1270
+ )
1271
+ response.response.close()
1272
+ return response.output
1273
+
1274
+ def update_keyspace(
1275
+ self,
1276
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1277
+ replication_specification: "capo_keyspaces.types.replication_specification.ReplicationSpecification",
1278
+ *,
1279
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1280
+ client_side_timestamps: Optional[
1281
+ "capo_keyspaces.types.client_side_timestamps.ClientSideTimestamps"
1282
+ ] = None,
1283
+ ) -> "capo_keyspaces.types.update_keyspace_response.UpdateKeyspaceResponse":
1284
+ r"""<p> Adds a new Amazon Web Services Region to the keyspace. You can add a new Region to a keyspace that is either a single or a multi-Region keyspace. Amazon Keyspaces is going to replicate all tables in the keyspace to the new Region. To successfully replicate all tables to the new Region, they must use client-side timestamps for conflict resolution. To enable client-side timestamps, specify <code>clientSideTimestamps.status = enabled</code> when invoking the API. For more information about client-side timestamps, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/client-side-timestamps.html\">Client-side timestamps in Amazon Keyspaces</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>To add a Region to a keyspace using the <code>UpdateKeyspace</code> API, the IAM principal needs permissions for the following IAM actions:</p> <ul> <li> <p> <code>cassandra:Alter</code> </p> </li> <li> <p> <code>cassandra:AlterMultiRegionResource</code> </p> </li> <li> <p> <code>cassandra:Create</code> </p> </li> <li> <p> <code>cassandra:CreateMultiRegionResource</code> </p> </li> <li> <p> <code>cassandra:Select</code> </p> </li> <li> <p> <code>cassandra:SelectMultiRegionResource</code> </p> </li> <li> <p> <code>cassandra:Modify</code> </p> </li> <li> <p> <code>cassandra:ModifyMultiRegionResource</code> </p> </li> </ul> <p>If the keyspace contains a table that is configured in provisioned mode with auto scaling enabled, the following additional IAM actions need to be allowed.</p> <ul> <li> <p> <code>application-autoscaling:RegisterScalableTarget</code> </p> </li> <li> <p> <code>application-autoscaling:DeregisterScalableTarget</code> </p> </li> <li> <p> <code>application-autoscaling:DescribeScalableTargets</code> </p> </li> <li> <p> <code>application-autoscaling:PutScalingPolicy</code> </p> </li> <li> <p> <code>application-autoscaling:DescribeScalingPolicies</code> </p> </li> </ul> <p>To use the <code>UpdateKeyspace</code> API, the IAM principal also needs permissions to create a service-linked role with the following elements:</p> <ul> <li> <p> <code>iam:CreateServiceLinkedRole</code> - The <b>action</b> the principal can perform.</p> </li> <li> <p> <code>arn:aws:iam::*:role/aws-service-role/replication.cassandra.amazonaws.com/AWSServiceRoleForKeyspacesReplication</code> - The <b>resource</b> that the action can be performed on. </p> </li> <li> <p> <code>iam:AWSServiceName: replication.cassandra.amazonaws.com</code> - The only Amazon Web Services service that this role can be attached to is Amazon Keyspaces.</p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/howitworks_replication_permissions_addReplica.html\">Configure the IAM permissions required to add an Amazon Web Services Region to a keyspace</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1285
+
1286
+ Args:
1287
+ keyspace_name: <p> The name of the keyspace. </p>
1288
+
1289
+ Raises:
1290
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1291
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
1292
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1293
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1294
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1295
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1296
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1297
+ """
1298
+
1299
+ def _handler(
1300
+ req: "OperationRequest[capo_keyspaces.types.update_keyspace_request.UpdateKeyspaceRequest]",
1301
+ ) -> OperationResponse[
1302
+ "capo_keyspaces.types.update_keyspace_response.UpdateKeyspaceResponse"
1303
+ ]:
1304
+ import capo_keyspaces._operations.keyspaces_service.update_keyspace
1305
+
1306
+ output, http_response = (
1307
+ capo_keyspaces._operations.keyspaces_service.update_keyspace.update_keyspace(
1308
+ req.options, req.input
1309
+ )
1310
+ )
1311
+ return OperationResponse(output=output, response=http_response)
1312
+
1313
+ interceptors_, options_ = self.operation_options(config_overrides)
1314
+ input_: capo_keyspaces.types.update_keyspace_request.UpdateKeyspaceRequest = {
1315
+ "keyspace_name": keyspace_name,
1316
+ "replication_specification": replication_specification,
1317
+ }
1318
+ if client_side_timestamps is not None:
1319
+ input_["client_side_timestamps"] = client_side_timestamps
1320
+
1321
+ response = execute_pipeline(
1322
+ OperationRequest(input=input_, options=options_),
1323
+ handler=_handler,
1324
+ interceptors=list(interceptors_),
1325
+ )
1326
+ response.response.close()
1327
+ return response.output
1328
+
1329
+ def update_table(
1330
+ self,
1331
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
1332
+ table_name: "capo_keyspaces.types.table_name.TableName",
1333
+ *,
1334
+ config_overrides: Optional[KeyspacesClientConfig] = None,
1335
+ add_columns: Optional[
1336
+ "capo_keyspaces.types.column_definition_list.ColumnDefinitionList"
1337
+ ] = None,
1338
+ capacity_specification: Optional[
1339
+ "capo_keyspaces.types.capacity_specification.CapacitySpecification"
1340
+ ] = None,
1341
+ encryption_specification: Optional[
1342
+ "capo_keyspaces.types.encryption_specification.EncryptionSpecification"
1343
+ ] = None,
1344
+ point_in_time_recovery: Optional[
1345
+ "capo_keyspaces.types.point_in_time_recovery.PointInTimeRecovery"
1346
+ ] = None,
1347
+ ttl: Optional["capo_keyspaces.types.time_to_live.TimeToLive"] = None,
1348
+ default_time_to_live: Optional[
1349
+ "capo_keyspaces.types.default_time_to_live.DefaultTimeToLive"
1350
+ ] = None,
1351
+ client_side_timestamps: Optional[
1352
+ "capo_keyspaces.types.client_side_timestamps.ClientSideTimestamps"
1353
+ ] = None,
1354
+ auto_scaling_specification: Optional[
1355
+ "capo_keyspaces.types.auto_scaling_specification.AutoScalingSpecification"
1356
+ ] = None,
1357
+ replica_specifications: Optional[
1358
+ "capo_keyspaces.types.replica_specification_list.ReplicaSpecificationList"
1359
+ ] = None,
1360
+ cdc_specification: Optional[
1361
+ "capo_keyspaces.types.cdc_specification.CdcSpecification"
1362
+ ] = None,
1363
+ warm_throughput_specification: Optional[
1364
+ "capo_keyspaces.types.warm_throughput_specification.WarmThroughputSpecification"
1365
+ ] = None,
1366
+ ) -> "capo_keyspaces.types.update_table_response.UpdateTableResponse":
1367
+ r"""<p>Adds new columns to the table or updates one of the table's settings, for example capacity mode, auto scaling, encryption, point-in-time recovery, or ttl settings. Note that you can only update one specific table setting per update operation.</p>
1368
+
1369
+ Args:
1370
+ keyspace_name: <p>The name of the keyspace the specified table is stored in.</p>
1371
+ table_name: <p>The name of the table.</p>
1372
+ add_columns: <p>For each column to be added to the specified table:</p> <ul> <li> <p> <code>name</code> - The name of the column.</p> </li> <li> <p> <code>type</code> - An Amazon Keyspaces data type. For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types\">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> </li> </ul>
1373
+ capacity_specification: <p>Modifies the read/write throughput capacity mode for the table. The options are:</p> <ul> <li> <p> <code>throughputMode:PAY_PER_REQUEST</code> and </p> </li> <li> <p> <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p> </li> </ul> <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html\">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1374
+ encryption_specification: <p>Modifies the encryption settings of the table. You can choose one of the following KMS key (KMS key):</p> <ul> <li> <p> <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p> </li> <li> <p> <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p> </li> </ul> <p>The default is <code>AWS_OWNED_KMS_KEY</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html\">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1375
+ point_in_time_recovery: <p>Modifies the <code>pointInTimeRecovery</code> settings of the table. The options are:</p> <ul> <li> <p> <code>status=ENABLED</code> </p> </li> <li> <p> <code>status=DISABLED</code> </p> </li> </ul> <p>If it's not specified, the default is <code>status=DISABLED</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html\">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1376
+ ttl: <p>Modifies Time to Live custom settings for the table. The options are:</p> <ul> <li> <p> <code>status:enabled</code> </p> </li> <li> <p> <code>status:disabled</code> </p> </li> </ul> <p>The default is <code>status:disabled</code>. After <code>ttl</code> is enabled, you can't disable it for the table.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/TTL.html\">Expiring data by using Amazon Keyspaces Time to Live (TTL)</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1377
+ default_time_to_live: <p>The default Time to Live setting in seconds for the table.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/TTL-how-it-works.html#ttl-howitworks_default_ttl\">Setting the default TTL value for a table</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1378
+ client_side_timestamps: <p>Enables client-side timestamps for the table. By default, the setting is disabled. You can enable client-side timestamps with the following option:</p> <ul> <li> <p> <code>status: \"enabled\"</code> </p> </li> </ul> <p>Once client-side timestamps are enabled for a table, this setting cannot be disabled.</p>
1379
+ auto_scaling_specification: <p>The optional auto scaling settings to update for a table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.</p> <p>If auto scaling is already enabled for the table, you can use <code>UpdateTable</code> to update the minimum and maximum values or the auto scaling policy settings independently.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html\">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1380
+ replica_specifications: <p>The Region specific settings of a multi-Regional table.</p>
1381
+ cdc_specification: <p>The CDC stream settings of the table.</p>
1382
+ warm_throughput_specification: <p>Modifies the warm throughput settings for the table. You can update the read and write capacity units to adjust the pre-provisioned throughput.</p>
1383
+
1384
+ Raises:
1385
+ capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
1386
+ capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
1387
+ capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
1388
+ capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
1389
+ capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href=\"https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html\">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
1390
+ capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
1391
+ capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
1392
+ """
1393
+
1394
+ def _handler(
1395
+ req: "OperationRequest[capo_keyspaces.types.update_table_request.UpdateTableRequest]",
1396
+ ) -> OperationResponse[
1397
+ "capo_keyspaces.types.update_table_response.UpdateTableResponse"
1398
+ ]:
1399
+ import capo_keyspaces._operations.keyspaces_service.update_table
1400
+
1401
+ output, http_response = (
1402
+ capo_keyspaces._operations.keyspaces_service.update_table.update_table(
1403
+ req.options, req.input
1404
+ )
1405
+ )
1406
+ return OperationResponse(output=output, response=http_response)
1407
+
1408
+ interceptors_, options_ = self.operation_options(config_overrides)
1409
+ input_: capo_keyspaces.types.update_table_request.UpdateTableRequest = {
1410
+ "keyspace_name": keyspace_name,
1411
+ "table_name": table_name,
1412
+ }
1413
+ if add_columns is not None:
1414
+ input_["add_columns"] = add_columns
1415
+ if capacity_specification is not None:
1416
+ input_["capacity_specification"] = capacity_specification
1417
+ if encryption_specification is not None:
1418
+ input_["encryption_specification"] = encryption_specification
1419
+ if point_in_time_recovery is not None:
1420
+ input_["point_in_time_recovery"] = point_in_time_recovery
1421
+ if ttl is not None:
1422
+ input_["ttl"] = ttl
1423
+ if default_time_to_live is not None:
1424
+ input_["default_time_to_live"] = default_time_to_live
1425
+ if client_side_timestamps is not None:
1426
+ input_["client_side_timestamps"] = client_side_timestamps
1427
+ if auto_scaling_specification is not None:
1428
+ input_["auto_scaling_specification"] = auto_scaling_specification
1429
+ if replica_specifications is not None:
1430
+ input_["replica_specifications"] = replica_specifications
1431
+ if cdc_specification is not None:
1432
+ input_["cdc_specification"] = cdc_specification
1433
+ if warm_throughput_specification is not None:
1434
+ input_["warm_throughput_specification"] = warm_throughput_specification
1435
+
1436
+ response = execute_pipeline(
1437
+ OperationRequest(input=input_, options=options_),
1438
+ handler=_handler,
1439
+ interceptors=list(interceptors_),
1440
+ )
1441
+ response.response.close()
1442
+ return response.output
1443
+
1444
+ def __enter__(self) -> Self:
1445
+ return self
1446
+
1447
+ def __exit__(self, exc_type: Any, exc: Any, tb: Any):
1448
+ self._client.close()