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,105 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#SchemaDefinition``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.clustering_key_list
11
+ import capo_keyspaces.types.column_definition_list
12
+ import capo_keyspaces.types.partition_key_list
13
+ import capo_keyspaces.types.static_column_list
14
+
15
+
16
+ class SchemaDefinition(TypedDict, closed=True):
17
+ all_columns: "capo_keyspaces.types.column_definition_list.ColumnDefinitionList"
18
+ """<p>The regular columns of the table.</p>"""
19
+ partition_keys: "capo_keyspaces.types.partition_key_list.PartitionKeyList"
20
+ """<p>The columns that are part of the partition key of the table .</p>"""
21
+ clustering_keys: NotRequired[
22
+ "capo_keyspaces.types.clustering_key_list.ClusteringKeyList"
23
+ ]
24
+ """<p>The columns that are part of the clustering key of the table.</p>"""
25
+ static_columns: NotRequired[
26
+ "capo_keyspaces.types.static_column_list.StaticColumnList"
27
+ ]
28
+ """<p>The columns that have been defined as <code>STATIC</code>. Static columns store values that are shared by all rows in the same partition.</p>"""
29
+
30
+
31
+ # --- awsJson1_0 ser/de ---
32
+ def serialize_aws_json_1_0(value: SchemaDefinition) -> dict:
33
+ out: dict = {}
34
+ import capo_keyspaces.types.column_definition_list
35
+
36
+ out["allColumns"] = (
37
+ capo_keyspaces.types.column_definition_list.serialize_aws_json_1_0(
38
+ value["all_columns"]
39
+ )
40
+ )
41
+ import capo_keyspaces.types.partition_key_list
42
+
43
+ out["partitionKeys"] = (
44
+ capo_keyspaces.types.partition_key_list.serialize_aws_json_1_0(
45
+ value["partition_keys"]
46
+ )
47
+ )
48
+ if "clustering_keys" in value:
49
+ import capo_keyspaces.types.clustering_key_list
50
+
51
+ out["clusteringKeys"] = (
52
+ capo_keyspaces.types.clustering_key_list.serialize_aws_json_1_0(
53
+ value["clustering_keys"]
54
+ )
55
+ )
56
+ if "static_columns" in value:
57
+ import capo_keyspaces.types.static_column_list
58
+
59
+ out["staticColumns"] = (
60
+ capo_keyspaces.types.static_column_list.serialize_aws_json_1_0(
61
+ value["static_columns"]
62
+ )
63
+ )
64
+ return out
65
+
66
+
67
+ def deserialize_aws_json_1_0(data: dict) -> SchemaDefinition:
68
+ out: SchemaDefinition = {} # type: ignore[typeddict-item]
69
+ if data.get("allColumns") is not None:
70
+ import capo_keyspaces.types.column_definition_list
71
+
72
+ out["all_columns"] = (
73
+ capo_keyspaces.types.column_definition_list.deserialize_aws_json_1_0(
74
+ data["allColumns"]
75
+ )
76
+ )
77
+ else:
78
+ raise DeserializationError("SchemaDefinition.all_columns required")
79
+ if data.get("partitionKeys") is not None:
80
+ import capo_keyspaces.types.partition_key_list
81
+
82
+ out["partition_keys"] = (
83
+ capo_keyspaces.types.partition_key_list.deserialize_aws_json_1_0(
84
+ data["partitionKeys"]
85
+ )
86
+ )
87
+ else:
88
+ raise DeserializationError("SchemaDefinition.partition_keys required")
89
+ if data.get("clusteringKeys") is not None:
90
+ import capo_keyspaces.types.clustering_key_list
91
+
92
+ out["clustering_keys"] = (
93
+ capo_keyspaces.types.clustering_key_list.deserialize_aws_json_1_0(
94
+ data["clusteringKeys"]
95
+ )
96
+ )
97
+ if data.get("staticColumns") is not None:
98
+ import capo_keyspaces.types.static_column_list
99
+
100
+ out["static_columns"] = (
101
+ capo_keyspaces.types.static_column_list.deserialize_aws_json_1_0(
102
+ data["staticColumns"]
103
+ )
104
+ )
105
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#SortOrder``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ SortOrder: TypeAlias = str
@@ -0,0 +1,31 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#StaticColumn``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.generic_string
11
+
12
+
13
+ class StaticColumn(TypedDict, closed=True):
14
+ name: "capo_keyspaces.types.generic_string.GenericString"
15
+ """<p>The name of the static column.</p>"""
16
+
17
+
18
+ # --- awsJson1_0 ser/de ---
19
+ def serialize_aws_json_1_0(value: StaticColumn) -> dict:
20
+ out: dict = {}
21
+ out["name"] = value["name"]
22
+ return out
23
+
24
+
25
+ def deserialize_aws_json_1_0(data: dict) -> StaticColumn:
26
+ out: StaticColumn = {} # type: ignore[typeddict-item]
27
+ if data.get("name") is not None:
28
+ out["name"] = data["name"]
29
+ else:
30
+ raise DeserializationError("StaticColumn.name required")
31
+ return out
@@ -0,0 +1,29 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#StaticColumnList``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_keyspaces.types.static_column
7
+
8
+ StaticColumnList: TypeAlias = list["capo_keyspaces.types.static_column.StaticColumn"]
9
+
10
+
11
+ # --- awsJson1_0 ser/de ---
12
+ def serialize_aws_json_1_0(value: StaticColumnList) -> list:
13
+ import capo_keyspaces.types.static_column
14
+
15
+ out: list = []
16
+ for item in value:
17
+ out.append(capo_keyspaces.types.static_column.serialize_aws_json_1_0(item))
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: list) -> StaticColumnList:
22
+ import capo_keyspaces.types.static_column
23
+
24
+ out: StaticColumnList = []
25
+ for item in data:
26
+ if item is None:
27
+ continue
28
+ out.append(capo_keyspaces.types.static_column.deserialize_aws_json_1_0(item))
29
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#StreamArn``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ StreamArn: TypeAlias = str
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TableName``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TableName: TypeAlias = str
@@ -0,0 +1,17 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TableNameList``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_keyspaces.types.table_name
7
+
8
+ TableNameList: TypeAlias = list["capo_keyspaces.types.table_name.TableName"]
9
+
10
+
11
+ # --- awsJson1_0 ser/de ---
12
+ def serialize_aws_json_1_0(value: TableNameList) -> list:
13
+ return list(value)
14
+
15
+
16
+ def deserialize_aws_json_1_0(data: list) -> TableNameList:
17
+ return [item for item in data if item is not None]
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TableStatus``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TableStatus: TypeAlias = str
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TableSummary``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.arn
11
+ import capo_keyspaces.types.keyspace_name
12
+ import capo_keyspaces.types.table_name
13
+
14
+
15
+ class TableSummary(TypedDict, closed=True):
16
+ keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName"
17
+ """<p>The name of the keyspace that the table is stored in.</p>"""
18
+ table_name: "capo_keyspaces.types.table_name.TableName"
19
+ """<p>The name of the table.</p>"""
20
+ resource_arn: "capo_keyspaces.types.arn.ARN"
21
+ """<p>The unique identifier of the table in the format of an Amazon Resource Name (ARN).</p>"""
22
+
23
+
24
+ # --- awsJson1_0 ser/de ---
25
+ def serialize_aws_json_1_0(value: TableSummary) -> dict:
26
+ out: dict = {}
27
+ out["keyspaceName"] = value["keyspace_name"]
28
+ out["tableName"] = value["table_name"]
29
+ out["resourceArn"] = value["resource_arn"]
30
+ return out
31
+
32
+
33
+ def deserialize_aws_json_1_0(data: dict) -> TableSummary:
34
+ out: TableSummary = {} # type: ignore[typeddict-item]
35
+ if data.get("keyspaceName") is not None:
36
+ out["keyspace_name"] = data["keyspaceName"]
37
+ else:
38
+ raise DeserializationError("TableSummary.keyspace_name required")
39
+ if data.get("tableName") is not None:
40
+ out["table_name"] = data["tableName"]
41
+ else:
42
+ raise DeserializationError("TableSummary.table_name required")
43
+ if data.get("resourceArn") is not None:
44
+ out["resource_arn"] = data["resourceArn"]
45
+ else:
46
+ raise DeserializationError("TableSummary.resource_arn required")
47
+ return out
@@ -0,0 +1,29 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TableSummaryList``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_keyspaces.types.table_summary
7
+
8
+ TableSummaryList: TypeAlias = list["capo_keyspaces.types.table_summary.TableSummary"]
9
+
10
+
11
+ # --- awsJson1_0 ser/de ---
12
+ def serialize_aws_json_1_0(value: TableSummaryList) -> list:
13
+ import capo_keyspaces.types.table_summary
14
+
15
+ out: list = []
16
+ for item in value:
17
+ out.append(capo_keyspaces.types.table_summary.serialize_aws_json_1_0(item))
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: list) -> TableSummaryList:
22
+ import capo_keyspaces.types.table_summary
23
+
24
+ out: TableSummaryList = []
25
+ for item in data:
26
+ if item is None:
27
+ continue
28
+ out.append(capo_keyspaces.types.table_summary.deserialize_aws_json_1_0(item))
29
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TablesReplicationProgress``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TablesReplicationProgress: TypeAlias = str
@@ -0,0 +1,39 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#Tag``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.tag_key
11
+ import capo_keyspaces.types.tag_value
12
+
13
+
14
+ class Tag(TypedDict, closed=True):
15
+ key: "capo_keyspaces.types.tag_key.TagKey"
16
+ """<p>The key of the tag. Tag keys are case sensitive. Each Amazon Keyspaces resource can only have up to one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value.</p>"""
17
+ value: "capo_keyspaces.types.tag_value.TagValue"
18
+ """<p>The value of the tag. Tag values are case-sensitive and can be null.</p>"""
19
+
20
+
21
+ # --- awsJson1_0 ser/de ---
22
+ def serialize_aws_json_1_0(value: Tag) -> dict:
23
+ out: dict = {}
24
+ out["key"] = value["key"]
25
+ out["value"] = value["value"]
26
+ return out
27
+
28
+
29
+ def deserialize_aws_json_1_0(data: dict) -> Tag:
30
+ out: Tag = {} # type: ignore[typeddict-item]
31
+ if data.get("key") is not None:
32
+ out["key"] = data["key"]
33
+ else:
34
+ raise DeserializationError("Tag.key required")
35
+ if data.get("value") is not None:
36
+ out["value"] = data["value"]
37
+ else:
38
+ raise DeserializationError("Tag.value required")
39
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TagKey``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TagKey: TypeAlias = str
@@ -0,0 +1,29 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TagList``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_keyspaces.types.tag
7
+
8
+ TagList: TypeAlias = list["capo_keyspaces.types.tag.Tag"]
9
+
10
+
11
+ # --- awsJson1_0 ser/de ---
12
+ def serialize_aws_json_1_0(value: TagList) -> list:
13
+ import capo_keyspaces.types.tag
14
+
15
+ out: list = []
16
+ for item in value:
17
+ out.append(capo_keyspaces.types.tag.serialize_aws_json_1_0(item))
18
+ return out
19
+
20
+
21
+ def deserialize_aws_json_1_0(data: list) -> TagList:
22
+ import capo_keyspaces.types.tag
23
+
24
+ out: TagList = []
25
+ for item in data:
26
+ if item is None:
27
+ continue
28
+ out.append(capo_keyspaces.types.tag.deserialize_aws_json_1_0(item))
29
+ return out
@@ -0,0 +1,45 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TagResourceRequest``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.arn
11
+ import capo_keyspaces.types.tag_list
12
+
13
+
14
+ class TagResourceRequest(TypedDict, closed=True):
15
+ resource_arn: "capo_keyspaces.types.arn.ARN"
16
+ """<p>The Amazon Resource Name (ARN) of the Amazon Keyspaces resource to which to add tags.</p>"""
17
+ tags: "capo_keyspaces.types.tag_list.TagList"
18
+ """<p>The tags to be assigned to the Amazon Keyspaces resource.</p>"""
19
+
20
+
21
+ # --- awsJson1_0 ser/de ---
22
+ def serialize_aws_json_1_0(value: TagResourceRequest) -> dict:
23
+ out: dict = {}
24
+ out["resourceArn"] = value["resource_arn"]
25
+ import capo_keyspaces.types.tag_list
26
+
27
+ out["tags"] = capo_keyspaces.types.tag_list.serialize_aws_json_1_0(value["tags"])
28
+ return out
29
+
30
+
31
+ def deserialize_aws_json_1_0(data: dict) -> TagResourceRequest:
32
+ out: TagResourceRequest = {} # type: ignore[typeddict-item]
33
+ if data.get("resourceArn") is not None:
34
+ out["resource_arn"] = data["resourceArn"]
35
+ else:
36
+ raise DeserializationError("TagResourceRequest.resource_arn required")
37
+ if data.get("tags") is not None:
38
+ import capo_keyspaces.types.tag_list
39
+
40
+ out["tags"] = capo_keyspaces.types.tag_list.deserialize_aws_json_1_0(
41
+ data["tags"]
42
+ )
43
+ else:
44
+ raise DeserializationError("TagResourceRequest.tags required")
45
+ return out
@@ -0,0 +1,18 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TagResourceResponse``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+
6
+ class TagResourceResponse(TypedDict, closed=True):
7
+ pass
8
+
9
+
10
+ # --- awsJson1_0 ser/de ---
11
+ def serialize_aws_json_1_0(value: TagResourceResponse) -> dict:
12
+ out: dict = {}
13
+ return out
14
+
15
+
16
+ def deserialize_aws_json_1_0(data: dict) -> TagResourceResponse:
17
+ out: TagResourceResponse = {} # type: ignore[typeddict-item]
18
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TagValue``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TagValue: TypeAlias = str
@@ -0,0 +1,60 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TargetTrackingScalingPolicyConfiguration``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_keyspaces.types.boolean_object
9
+ import capo_keyspaces.types.double_object
10
+ import capo_keyspaces.types.integer_object
11
+
12
+
13
+ class TargetTrackingScalingPolicyConfiguration(TypedDict, closed=True):
14
+ disable_scale_in: "capo_keyspaces.types.boolean_object.BooleanObject"
15
+ """<p>Specifies if <code>scale-in</code> is enabled.</p> <p>When auto scaling automatically decreases capacity for a table, the table <i>scales in</i>. When scaling policies are set, they can't scale in the table lower than its minimum capacity.</p>"""
16
+ scale_in_cooldown: "capo_keyspaces.types.integer_object.IntegerObject"
17
+ """<p>Specifies a <code>scale-in</code> cool down period.</p> <p>A cooldown period in seconds between scaling activities that lets the table stabilize before another scaling activity starts. </p>"""
18
+ scale_out_cooldown: "capo_keyspaces.types.integer_object.IntegerObject"
19
+ """<p>Specifies a scale out cool down period.</p> <p>A cooldown period in seconds between scaling activities that lets the table stabilize before another scaling activity starts. </p>"""
20
+ target_value: "capo_keyspaces.types.double_object.DoubleObject"
21
+ """<p>Specifies the target value for the target tracking auto scaling policy.</p> <p>Amazon Keyspaces auto scaling scales up capacity automatically when traffic exceeds this target utilization rate, and then back down when it falls below the target. This ensures that the ratio of consumed capacity to provisioned capacity stays at or near this value. You define <code>targetValue</code> as a percentage. A <code>double</code> between 20 and 90.</p>"""
22
+
23
+
24
+ # --- awsJson1_0 ser/de ---
25
+ def serialize_aws_json_1_0(value: TargetTrackingScalingPolicyConfiguration) -> dict:
26
+ out: dict = {}
27
+ out["disableScaleIn"] = value.get("disable_scale_in", False)
28
+ out["scaleInCooldown"] = value.get("scale_in_cooldown", 0)
29
+ out["scaleOutCooldown"] = value.get("scale_out_cooldown", 0)
30
+ out["targetValue"] = (
31
+ "NaN"
32
+ if value.get("target_value", 0) != value.get("target_value", 0)
33
+ else "Infinity"
34
+ if value.get("target_value", 0) == float("inf")
35
+ else "-Infinity"
36
+ if value.get("target_value", 0) == float("-inf")
37
+ else value.get("target_value", 0)
38
+ )
39
+ return out
40
+
41
+
42
+ def deserialize_aws_json_1_0(data: dict) -> TargetTrackingScalingPolicyConfiguration:
43
+ out: TargetTrackingScalingPolicyConfiguration = {} # type: ignore[typeddict-item]
44
+ if data.get("disableScaleIn") is not None:
45
+ out["disable_scale_in"] = data["disableScaleIn"]
46
+ else:
47
+ out["disable_scale_in"] = False
48
+ if data.get("scaleInCooldown") is not None:
49
+ out["scale_in_cooldown"] = data["scaleInCooldown"]
50
+ else:
51
+ out["scale_in_cooldown"] = 0
52
+ if data.get("scaleOutCooldown") is not None:
53
+ out["scale_out_cooldown"] = data["scaleOutCooldown"]
54
+ else:
55
+ out["scale_out_cooldown"] = 0
56
+ if data.get("targetValue") is not None:
57
+ out["target_value"] = float(data["targetValue"])
58
+ else:
59
+ out["target_value"] = 0
60
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#ThroughputMode``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ ThroughputMode: TypeAlias = str
@@ -0,0 +1,31 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TimeToLive``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.time_to_live_status
11
+
12
+
13
+ class TimeToLive(TypedDict, closed=True):
14
+ status: "capo_keyspaces.types.time_to_live_status.TimeToLiveStatus"
15
+ """<p>Shows how to enable custom Time to Live (TTL) settings for the specified table.</p>"""
16
+
17
+
18
+ # --- awsJson1_0 ser/de ---
19
+ def serialize_aws_json_1_0(value: TimeToLive) -> dict:
20
+ out: dict = {}
21
+ out["status"] = value["status"]
22
+ return out
23
+
24
+
25
+ def deserialize_aws_json_1_0(data: dict) -> TimeToLive:
26
+ out: TimeToLive = {} # type: ignore[typeddict-item]
27
+ if data.get("status") is not None:
28
+ out["status"] = data["status"]
29
+ else:
30
+ raise DeserializationError("TimeToLive.status required")
31
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TimeToLiveStatus``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TimeToLiveStatus: TypeAlias = str
@@ -0,0 +1,20 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#Timestamp``."""
2
+
3
+ import datetime
4
+ from typing import TypeAlias
5
+
6
+ Timestamp: TypeAlias = datetime.datetime
7
+
8
+
9
+ # --- awsJson1_0 ser/de ---
10
+ def serialize_aws_json_1_0(value: Timestamp) -> float:
11
+ value = (
12
+ value.astimezone(datetime.timezone.utc)
13
+ if value.tzinfo
14
+ else value.replace(tzinfo=datetime.timezone.utc)
15
+ )
16
+ return value.timestamp()
17
+
18
+
19
+ def deserialize_aws_json_1_0(data: float) -> Timestamp:
20
+ return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TypeName``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TypeName: TypeAlias = str
@@ -0,0 +1,17 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TypeNameList``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_keyspaces.types.type_name
7
+
8
+ TypeNameList: TypeAlias = list["capo_keyspaces.types.type_name.TypeName"]
9
+
10
+
11
+ # --- awsJson1_0 ser/de ---
12
+ def serialize_aws_json_1_0(value: TypeNameList) -> list:
13
+ return list(value)
14
+
15
+
16
+ def deserialize_aws_json_1_0(data: list) -> TypeNameList:
17
+ return [item for item in data if item is not None]
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#TypeStatus``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ TypeStatus: TypeAlias = str
@@ -0,0 +1,45 @@
1
+ """Generated from Smithy shape ``com.amazonaws.keyspaces#UntagResourceRequest``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_keyspaces.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_keyspaces.types.arn
11
+ import capo_keyspaces.types.tag_list
12
+
13
+
14
+ class UntagResourceRequest(TypedDict, closed=True):
15
+ resource_arn: "capo_keyspaces.types.arn.ARN"
16
+ """<p>The Amazon Keyspaces resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).</p>"""
17
+ tags: "capo_keyspaces.types.tag_list.TagList"
18
+ """<p>A list of existing tags to be removed from the Amazon Keyspaces resource.</p>"""
19
+
20
+
21
+ # --- awsJson1_0 ser/de ---
22
+ def serialize_aws_json_1_0(value: UntagResourceRequest) -> dict:
23
+ out: dict = {}
24
+ out["resourceArn"] = value["resource_arn"]
25
+ import capo_keyspaces.types.tag_list
26
+
27
+ out["tags"] = capo_keyspaces.types.tag_list.serialize_aws_json_1_0(value["tags"])
28
+ return out
29
+
30
+
31
+ def deserialize_aws_json_1_0(data: dict) -> UntagResourceRequest:
32
+ out: UntagResourceRequest = {} # type: ignore[typeddict-item]
33
+ if data.get("resourceArn") is not None:
34
+ out["resource_arn"] = data["resourceArn"]
35
+ else:
36
+ raise DeserializationError("UntagResourceRequest.resource_arn required")
37
+ if data.get("tags") is not None:
38
+ import capo_keyspaces.types.tag_list
39
+
40
+ out["tags"] = capo_keyspaces.types.tag_list.deserialize_aws_json_1_0(
41
+ data["tags"]
42
+ )
43
+ else:
44
+ raise DeserializationError("UntagResourceRequest.tags required")
45
+ return out