capo-keyspacesstreams 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capo_keyspacesstreams/__init__.py +74 -0
- capo_keyspacesstreams/_async.py +25 -0
- capo_keyspacesstreams/_auth/_identity.py +16 -0
- capo_keyspacesstreams/_auth/_providers.py +886 -0
- capo_keyspacesstreams/_auth/_signers.py +88 -0
- capo_keyspacesstreams/_auth/_sigv4.py +434 -0
- capo_keyspacesstreams/_auth/_zapros_handler.py +80 -0
- capo_keyspacesstreams/_iter.py +113 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_records.py +171 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_shard_iterator.py +170 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_stream.py +174 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/list_streams.py +170 -0
- capo_keyspacesstreams/_pagination.py +21 -0
- capo_keyspacesstreams/_protocol/__init__.py +1 -0
- capo_keyspacesstreams/_protocol/errors.py +93 -0
- capo_keyspacesstreams/_protocol/eventstream.py +238 -0
- capo_keyspacesstreams/_protocol/serialize.py +47 -0
- capo_keyspacesstreams/_protocol/xml.py +33 -0
- capo_keyspacesstreams/_rule_engine/__init__.py +0 -0
- capo_keyspacesstreams/_rule_engine/_aws_partition.py +160 -0
- capo_keyspacesstreams/_rule_engine/_endpoint_rule_set.py +65 -0
- capo_keyspacesstreams/_rule_engine/_endpoint_runtime.py +389 -0
- capo_keyspacesstreams/_services/_aws_config.py +156 -0
- capo_keyspacesstreams/_services/_pipeline.py +196 -0
- capo_keyspacesstreams/_services/async_keyspaces_streams.py +442 -0
- capo_keyspacesstreams/_services/keyspaces_streams.py +438 -0
- capo_keyspacesstreams/errors/__init__.py +32 -0
- capo_keyspacesstreams/errors/_base.py +94 -0
- capo_keyspacesstreams/errors/access_denied_exception.py +47 -0
- capo_keyspacesstreams/errors/internal_server_exception.py +47 -0
- capo_keyspacesstreams/errors/resource_not_found_exception.py +47 -0
- capo_keyspacesstreams/errors/throttling_exception.py +47 -0
- capo_keyspacesstreams/errors/validation_exception.py +72 -0
- capo_keyspacesstreams/py.typed +0 -0
- capo_keyspacesstreams/types/_prelude/blob.py +12 -0
- capo_keyspacesstreams/types/_prelude/timestamp.py +17 -0
- capo_keyspacesstreams/types/date.py +20 -0
- capo_keyspacesstreams/types/get_records_input.py +37 -0
- capo_keyspacesstreams/types/get_records_output.py +70 -0
- capo_keyspacesstreams/types/get_shard_iterator_input.py +70 -0
- capo_keyspacesstreams/types/get_shard_iterator_output.py +30 -0
- capo_keyspacesstreams/types/get_stream_input.py +63 -0
- capo_keyspacesstreams/types/get_stream_output.py +144 -0
- capo_keyspacesstreams/types/iterator_description.py +42 -0
- capo_keyspacesstreams/types/iterator_position.py +17 -0
- capo_keyspacesstreams/types/keyspace_name.py +5 -0
- capo_keyspacesstreams/types/keyspaces_cell.py +63 -0
- capo_keyspacesstreams/types/keyspaces_cell_list.py +35 -0
- capo_keyspacesstreams/types/keyspaces_cell_map.py +39 -0
- capo_keyspacesstreams/types/keyspaces_cell_map_definition.py +83 -0
- capo_keyspacesstreams/types/keyspaces_cell_value.py +333 -0
- capo_keyspacesstreams/types/keyspaces_cells.py +35 -0
- capo_keyspacesstreams/types/keyspaces_keys_map.py +39 -0
- capo_keyspacesstreams/types/keyspaces_metadata.py +29 -0
- capo_keyspacesstreams/types/keyspaces_row.py +83 -0
- capo_keyspacesstreams/types/keyspaces_udt_map.py +35 -0
- capo_keyspacesstreams/types/list_streams_input.py +50 -0
- capo_keyspacesstreams/types/list_streams_output.py +47 -0
- capo_keyspacesstreams/types/origin_type.py +18 -0
- capo_keyspacesstreams/types/record.py +146 -0
- capo_keyspacesstreams/types/record_list.py +29 -0
- capo_keyspacesstreams/types/sequence_number.py +5 -0
- capo_keyspacesstreams/types/sequence_number_range.py +38 -0
- capo_keyspacesstreams/types/shard.py +70 -0
- capo_keyspacesstreams/types/shard_description_list.py +29 -0
- capo_keyspacesstreams/types/shard_filter.py +47 -0
- capo_keyspacesstreams/types/shard_filter_type.py +14 -0
- capo_keyspacesstreams/types/shard_id.py +5 -0
- capo_keyspacesstreams/types/shard_id_list.py +17 -0
- capo_keyspacesstreams/types/shard_id_token.py +5 -0
- capo_keyspacesstreams/types/shard_iterator.py +5 -0
- capo_keyspacesstreams/types/shard_iterator_type.py +19 -0
- capo_keyspacesstreams/types/stream.py +54 -0
- capo_keyspacesstreams/types/stream_arn.py +5 -0
- capo_keyspacesstreams/types/stream_arn_token.py +5 -0
- capo_keyspacesstreams/types/stream_list.py +29 -0
- capo_keyspacesstreams/types/stream_status.py +19 -0
- capo_keyspacesstreams/types/stream_view_type.py +19 -0
- capo_keyspacesstreams/types/table_name.py +5 -0
- capo_keyspacesstreams/types/validation_exception_type.py +19 -0
- capo_keyspacesstreams-0.1.0.dist-info/METADATA +101 -0
- capo_keyspacesstreams-0.1.0.dist-info/RECORD +85 -0
- capo_keyspacesstreams-0.1.0.dist-info/WHEEL +5 -0
- capo_keyspacesstreams-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_keyspacesstreams-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#InternalServerException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_keyspacesstreams.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InternalServerException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
"""<p>The service encountered an internal error. Try your request again.</p>"""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- awsJson1_0 ser/de ---
|
|
14
|
+
def serialize_aws_json_1_0(value: InternalServerException_) -> dict:
|
|
15
|
+
out: dict = {}
|
|
16
|
+
if "message" in value:
|
|
17
|
+
out["message"] = value["message"]
|
|
18
|
+
return out
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def deserialize_aws_json_1_0(data: dict) -> InternalServerException_:
|
|
22
|
+
out: InternalServerException_ = {} # type: ignore[typeddict-item]
|
|
23
|
+
if data.get("message") is not None:
|
|
24
|
+
out["message"] = data["message"]
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class InternalServerException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.keyspacesstreams#InternalServerException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "InternalServerException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: InternalServerException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"server",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=False,
|
|
38
|
+
code="InternalServerException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_aws_json_1_0(
|
|
45
|
+
cls, data: dict, message: str | None = None
|
|
46
|
+
) -> "InternalServerException":
|
|
47
|
+
return cls(deserialize_aws_json_1_0(data), message)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#ResourceNotFoundException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_keyspacesstreams.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResourceNotFoundException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
"""<p>The requested resource wasn't found. Verify that the resource exists and try again.</p>"""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- awsJson1_0 ser/de ---
|
|
14
|
+
def serialize_aws_json_1_0(value: ResourceNotFoundException_) -> dict:
|
|
15
|
+
out: dict = {}
|
|
16
|
+
if "message" in value:
|
|
17
|
+
out["message"] = value["message"]
|
|
18
|
+
return out
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def deserialize_aws_json_1_0(data: dict) -> ResourceNotFoundException_:
|
|
22
|
+
out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
|
|
23
|
+
if data.get("message") is not None:
|
|
24
|
+
out["message"] = data["message"]
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ResourceNotFoundException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.keyspacesstreams#ResourceNotFoundException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "ResourceNotFoundException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"client",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=False,
|
|
38
|
+
code="ResourceNotFoundException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_aws_json_1_0(
|
|
45
|
+
cls, data: dict, message: str | None = None
|
|
46
|
+
) -> "ResourceNotFoundException":
|
|
47
|
+
return cls(deserialize_aws_json_1_0(data), message)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#ThrottlingException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_keyspacesstreams.errors import ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ThrottlingException_(TypedDict, closed=True):
|
|
9
|
+
message: NotRequired["str"]
|
|
10
|
+
"""<p>The request was denied due to request throttling. Reduce the frequency of requests and try again.</p>"""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- awsJson1_0 ser/de ---
|
|
14
|
+
def serialize_aws_json_1_0(value: ThrottlingException_) -> dict:
|
|
15
|
+
out: dict = {}
|
|
16
|
+
if "message" in value:
|
|
17
|
+
out["message"] = value["message"]
|
|
18
|
+
return out
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def deserialize_aws_json_1_0(data: dict) -> ThrottlingException_:
|
|
22
|
+
out: ThrottlingException_ = {} # type: ignore[typeddict-item]
|
|
23
|
+
if data.get("message") is not None:
|
|
24
|
+
out["message"] = data["message"]
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ThrottlingException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.keyspacesstreams#ThrottlingException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "ThrottlingException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: ThrottlingException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"client",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=False,
|
|
38
|
+
code="ThrottlingException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_aws_json_1_0(
|
|
45
|
+
cls, data: dict, message: str | None = None
|
|
46
|
+
) -> "ThrottlingException":
|
|
47
|
+
return cls(deserialize_aws_json_1_0(data), message)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#ValidationException``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_keyspacesstreams.errors import ServiceError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_keyspacesstreams.types.validation_exception_type
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ValidationException_(TypedDict, closed=True):
|
|
14
|
+
message: NotRequired["str"]
|
|
15
|
+
"""<p>The input fails to satisfy the constraints specified by the service. Check the error details and modify your request.</p>"""
|
|
16
|
+
error_code: NotRequired[
|
|
17
|
+
"capo_keyspacesstreams.types.validation_exception_type.ValidationExceptionType"
|
|
18
|
+
]
|
|
19
|
+
"""<p>An error occurred validating your request. See the error message for details.</p>"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# --- awsJson1_0 ser/de ---
|
|
23
|
+
def serialize_aws_json_1_0(value: ValidationException_) -> dict:
|
|
24
|
+
out: dict = {}
|
|
25
|
+
if "message" in value:
|
|
26
|
+
out["message"] = value["message"]
|
|
27
|
+
if "error_code" in value:
|
|
28
|
+
import capo_keyspacesstreams.types.validation_exception_type
|
|
29
|
+
|
|
30
|
+
out["errorCode"] = (
|
|
31
|
+
capo_keyspacesstreams.types.validation_exception_type.serialize_aws_json_1_0(
|
|
32
|
+
value["error_code"]
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
return out
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def deserialize_aws_json_1_0(data: dict) -> ValidationException_:
|
|
39
|
+
out: ValidationException_ = {} # type: ignore[typeddict-item]
|
|
40
|
+
if data.get("message") is not None:
|
|
41
|
+
out["message"] = data["message"]
|
|
42
|
+
if data.get("errorCode") is not None:
|
|
43
|
+
import capo_keyspacesstreams.types.validation_exception_type
|
|
44
|
+
|
|
45
|
+
out["error_code"] = (
|
|
46
|
+
capo_keyspacesstreams.types.validation_exception_type.deserialize_aws_json_1_0(
|
|
47
|
+
data["errorCode"]
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
return out
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ValidationException(ServiceError):
|
|
54
|
+
"""Modeled error for Smithy shape ``com.amazonaws.keyspacesstreams#ValidationException``."""
|
|
55
|
+
|
|
56
|
+
code: str | None = "ValidationException"
|
|
57
|
+
|
|
58
|
+
def __init__(self, data: ValidationException_, message: str | None = None):
|
|
59
|
+
super().__init__(
|
|
60
|
+
"client",
|
|
61
|
+
is_throttling_error=False,
|
|
62
|
+
is_retryable=False,
|
|
63
|
+
code="ValidationException",
|
|
64
|
+
message=message,
|
|
65
|
+
)
|
|
66
|
+
self.data = data
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_aws_json_1_0(
|
|
70
|
+
cls, data: dict, message: str | None = None
|
|
71
|
+
) -> "ValidationException":
|
|
72
|
+
return cls(deserialize_aws_json_1_0(data), message)
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Generated from Smithy prelude shape ``smithy.api#Blob``."""
|
|
2
|
+
|
|
3
|
+
import base64
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# --- awsJson1_0 ser/de ---
|
|
7
|
+
def serialize_aws_json_1_0(value: bytes) -> str:
|
|
8
|
+
return base64.b64encode(value).decode("ascii")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def deserialize_aws_json_1_0(data: str) -> bytes:
|
|
12
|
+
return base64.b64decode(data)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Generated from Smithy prelude shape ``smithy.api#Timestamp``."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# --- awsJson1_0 ser/de ---
|
|
7
|
+
def serialize_aws_json_1_0(value: datetime.datetime) -> float:
|
|
8
|
+
value = (
|
|
9
|
+
value.astimezone(datetime.timezone.utc)
|
|
10
|
+
if value.tzinfo
|
|
11
|
+
else value.replace(tzinfo=datetime.timezone.utc)
|
|
12
|
+
)
|
|
13
|
+
return value.timestamp()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def deserialize_aws_json_1_0(data: float) -> datetime.datetime:
|
|
17
|
+
return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#Date``."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from typing import TypeAlias
|
|
5
|
+
|
|
6
|
+
Date: TypeAlias = datetime.datetime
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# --- awsJson1_0 ser/de ---
|
|
10
|
+
def serialize_aws_json_1_0(value: Date) -> 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) -> Date:
|
|
20
|
+
return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#GetRecordsInput``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_keyspacesstreams.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_keyspacesstreams.types.shard_iterator
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class GetRecordsInput(TypedDict, closed=True):
|
|
14
|
+
shard_iterator: "capo_keyspacesstreams.types.shard_iterator.ShardIterator"
|
|
15
|
+
"""<p> The unique identifier of the shard iterator. A shard iterator specifies the position in the shard from which you want to start reading data records sequentially. You obtain this value by calling the <code>GetShardIterator </code> operation. Each shard iterator is valid for 15 minutes after creation. </p>"""
|
|
16
|
+
max_results: NotRequired["int"]
|
|
17
|
+
"""<p> The maximum number of records to return in a single <code>GetRecords</code> request. The default value is 100. You can specify a limit between 1 and 1000, but the actual number returned might be less than the specified maximum if the size of the data for the returned records exceeds the internal size limit. </p>"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# --- awsJson1_0 ser/de ---
|
|
21
|
+
def serialize_aws_json_1_0(value: GetRecordsInput) -> dict:
|
|
22
|
+
out: dict = {}
|
|
23
|
+
out["shardIterator"] = value["shard_iterator"]
|
|
24
|
+
if "max_results" in value:
|
|
25
|
+
out["maxResults"] = value["max_results"]
|
|
26
|
+
return out
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def deserialize_aws_json_1_0(data: dict) -> GetRecordsInput:
|
|
30
|
+
out: GetRecordsInput = {} # type: ignore[typeddict-item]
|
|
31
|
+
if data.get("shardIterator") is not None:
|
|
32
|
+
out["shard_iterator"] = data["shardIterator"]
|
|
33
|
+
else:
|
|
34
|
+
raise DeserializationError("GetRecordsInput.shard_iterator required")
|
|
35
|
+
if data.get("maxResults") is not None:
|
|
36
|
+
out["max_results"] = data["maxResults"]
|
|
37
|
+
return out
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#GetRecordsOutput``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
import capo_keyspacesstreams.types.iterator_description
|
|
9
|
+
import capo_keyspacesstreams.types.record_list
|
|
10
|
+
import capo_keyspacesstreams.types.shard_iterator
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class GetRecordsOutput(TypedDict, closed=True):
|
|
14
|
+
change_records: NotRequired["capo_keyspacesstreams.types.record_list.RecordList"]
|
|
15
|
+
"""<p> An array of change data records retrieved from the specified shard. Each record represents a single data modification (insert, update, or delete) to a row in the Amazon Keyspaces table. Records include the primary key columns and information about what data was modified. </p>"""
|
|
16
|
+
next_shard_iterator: NotRequired[
|
|
17
|
+
"capo_keyspacesstreams.types.shard_iterator.ShardIterator"
|
|
18
|
+
]
|
|
19
|
+
"""<p> The next position in the shard from which to start sequentially reading data records. If null, the shard has been closed and the requested iterator will not return any more data. </p>"""
|
|
20
|
+
iterator_description: NotRequired[
|
|
21
|
+
"capo_keyspacesstreams.types.iterator_description.IteratorDescription"
|
|
22
|
+
]
|
|
23
|
+
"""<p> Provides information about the current iterator at the time GetRecords request was processed by Keyspaces. </p>"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# --- awsJson1_0 ser/de ---
|
|
27
|
+
def serialize_aws_json_1_0(value: GetRecordsOutput) -> dict:
|
|
28
|
+
out: dict = {}
|
|
29
|
+
if "change_records" in value:
|
|
30
|
+
import capo_keyspacesstreams.types.record_list
|
|
31
|
+
|
|
32
|
+
out["changeRecords"] = (
|
|
33
|
+
capo_keyspacesstreams.types.record_list.serialize_aws_json_1_0(
|
|
34
|
+
value["change_records"]
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
if "next_shard_iterator" in value:
|
|
38
|
+
out["nextShardIterator"] = value["next_shard_iterator"]
|
|
39
|
+
if "iterator_description" in value:
|
|
40
|
+
import capo_keyspacesstreams.types.iterator_description
|
|
41
|
+
|
|
42
|
+
out["iteratorDescription"] = (
|
|
43
|
+
capo_keyspacesstreams.types.iterator_description.serialize_aws_json_1_0(
|
|
44
|
+
value["iterator_description"]
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
return out
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def deserialize_aws_json_1_0(data: dict) -> GetRecordsOutput:
|
|
51
|
+
out: GetRecordsOutput = {} # type: ignore[typeddict-item]
|
|
52
|
+
if data.get("changeRecords") is not None:
|
|
53
|
+
import capo_keyspacesstreams.types.record_list
|
|
54
|
+
|
|
55
|
+
out["change_records"] = (
|
|
56
|
+
capo_keyspacesstreams.types.record_list.deserialize_aws_json_1_0(
|
|
57
|
+
data["changeRecords"]
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
if data.get("nextShardIterator") is not None:
|
|
61
|
+
out["next_shard_iterator"] = data["nextShardIterator"]
|
|
62
|
+
if data.get("iteratorDescription") is not None:
|
|
63
|
+
import capo_keyspacesstreams.types.iterator_description
|
|
64
|
+
|
|
65
|
+
out["iterator_description"] = (
|
|
66
|
+
capo_keyspacesstreams.types.iterator_description.deserialize_aws_json_1_0(
|
|
67
|
+
data["iteratorDescription"]
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
return out
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#GetShardIteratorInput``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_keyspacesstreams.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_keyspacesstreams.types.sequence_number
|
|
11
|
+
import capo_keyspacesstreams.types.shard_id
|
|
12
|
+
import capo_keyspacesstreams.types.shard_iterator_type
|
|
13
|
+
import capo_keyspacesstreams.types.stream_arn
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class GetShardIteratorInput(TypedDict, closed=True):
|
|
17
|
+
stream_arn: "capo_keyspacesstreams.types.stream_arn.StreamArn"
|
|
18
|
+
"""<p> The Amazon Resource Name (ARN) of the stream for which to get the shard iterator. The ARN uniquely identifies the stream within Amazon Keyspaces. </p>"""
|
|
19
|
+
shard_id: "capo_keyspacesstreams.types.shard_id.ShardId"
|
|
20
|
+
"""<p> The identifier of the shard within the stream. The shard ID uniquely identifies a subset of the stream's data records that you want to access. </p>"""
|
|
21
|
+
shard_iterator_type: (
|
|
22
|
+
"capo_keyspacesstreams.types.shard_iterator_type.ShardIteratorType"
|
|
23
|
+
)
|
|
24
|
+
"""<p> Determines how the shard iterator is positioned. Must be one of the following: </p> <ul> <li> <p> <code>TRIM_HORIZON</code> - Start reading at the last untrimmed record in the shard, which is the oldest data record in the shard.</p> </li> <li> <p> <code>AT_SEQUENCE_NUMBER</code> - Start reading exactly from the specified sequence number.</p> </li> <li> <p> <code>AFTER_SEQUENCE_NUMBER</code> - Start reading right after the specified sequence number. </p> </li> <li> <p> <code>LATEST</code> - Start reading just after the most recent record in the shard, so that you always read the most recent data. </p> </li> </ul>"""
|
|
25
|
+
sequence_number: NotRequired[
|
|
26
|
+
"capo_keyspacesstreams.types.sequence_number.SequenceNumber"
|
|
27
|
+
]
|
|
28
|
+
"""<p> The sequence number of the data record in the shard from which to start reading. Required if <code>ShardIteratorType</code> is <code>AT_SEQUENCE_NUMBER</code> or <code>AFTER_SEQUENCE_NUMBER</code>. This parameter is ignored for other iterator types. </p>"""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# --- awsJson1_0 ser/de ---
|
|
32
|
+
def serialize_aws_json_1_0(value: GetShardIteratorInput) -> dict:
|
|
33
|
+
out: dict = {}
|
|
34
|
+
out["streamArn"] = value["stream_arn"]
|
|
35
|
+
out["shardId"] = value["shard_id"]
|
|
36
|
+
import capo_keyspacesstreams.types.shard_iterator_type
|
|
37
|
+
|
|
38
|
+
out["shardIteratorType"] = (
|
|
39
|
+
capo_keyspacesstreams.types.shard_iterator_type.serialize_aws_json_1_0(
|
|
40
|
+
value["shard_iterator_type"]
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
if "sequence_number" in value:
|
|
44
|
+
out["sequenceNumber"] = value["sequence_number"]
|
|
45
|
+
return out
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def deserialize_aws_json_1_0(data: dict) -> GetShardIteratorInput:
|
|
49
|
+
out: GetShardIteratorInput = {} # type: ignore[typeddict-item]
|
|
50
|
+
if data.get("streamArn") is not None:
|
|
51
|
+
out["stream_arn"] = data["streamArn"]
|
|
52
|
+
else:
|
|
53
|
+
raise DeserializationError("GetShardIteratorInput.stream_arn required")
|
|
54
|
+
if data.get("shardId") is not None:
|
|
55
|
+
out["shard_id"] = data["shardId"]
|
|
56
|
+
else:
|
|
57
|
+
raise DeserializationError("GetShardIteratorInput.shard_id required")
|
|
58
|
+
if data.get("shardIteratorType") is not None:
|
|
59
|
+
import capo_keyspacesstreams.types.shard_iterator_type
|
|
60
|
+
|
|
61
|
+
out["shard_iterator_type"] = (
|
|
62
|
+
capo_keyspacesstreams.types.shard_iterator_type.deserialize_aws_json_1_0(
|
|
63
|
+
data["shardIteratorType"]
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
else:
|
|
67
|
+
raise DeserializationError("GetShardIteratorInput.shard_iterator_type required")
|
|
68
|
+
if data.get("sequenceNumber") is not None:
|
|
69
|
+
out["sequence_number"] = data["sequenceNumber"]
|
|
70
|
+
return out
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#GetShardIteratorOutput``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
import capo_keyspacesstreams.types.shard_iterator
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class GetShardIteratorOutput(TypedDict, closed=True):
|
|
12
|
+
shard_iterator: NotRequired[
|
|
13
|
+
"capo_keyspacesstreams.types.shard_iterator.ShardIterator"
|
|
14
|
+
]
|
|
15
|
+
"""<p> The unique identifier for the shard iterator. This value is used in the <code>GetRecords</code> operation to retrieve data records from the specified shard. Each shard iterator expires 15 minutes after it is returned to the requester. </p>"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# --- awsJson1_0 ser/de ---
|
|
19
|
+
def serialize_aws_json_1_0(value: GetShardIteratorOutput) -> dict:
|
|
20
|
+
out: dict = {}
|
|
21
|
+
if "shard_iterator" in value:
|
|
22
|
+
out["shardIterator"] = value["shard_iterator"]
|
|
23
|
+
return out
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def deserialize_aws_json_1_0(data: dict) -> GetShardIteratorOutput:
|
|
27
|
+
out: GetShardIteratorOutput = {} # type: ignore[typeddict-item]
|
|
28
|
+
if data.get("shardIterator") is not None:
|
|
29
|
+
out["shard_iterator"] = data["shardIterator"]
|
|
30
|
+
return out
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#GetStreamInput``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_keyspacesstreams.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_keyspacesstreams.types.shard_filter
|
|
11
|
+
import capo_keyspacesstreams.types.shard_id_token
|
|
12
|
+
import capo_keyspacesstreams.types.stream_arn
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GetStreamInput(TypedDict, closed=True):
|
|
16
|
+
stream_arn: "capo_keyspacesstreams.types.stream_arn.StreamArn"
|
|
17
|
+
"""<p> The Amazon Resource Name (ARN) of the stream for which detailed information is requested. This uniquely identifies the specific stream you want to get information about. </p>"""
|
|
18
|
+
max_results: NotRequired["int"]
|
|
19
|
+
"""<p> The maximum number of shard objects to return in a single <code>GetStream</code> request. The default value is 100. The minimum value is 1 and the maximum value is 100. </p>"""
|
|
20
|
+
shard_filter: NotRequired["capo_keyspacesstreams.types.shard_filter.ShardFilter"]
|
|
21
|
+
"""<p> Optional filter criteria to apply when retrieving shards. You can filter shards based on their parent <code>shardID</code> to get a list of children shards to narrow down the results returned by the <code>GetStream</code> operation. </p>"""
|
|
22
|
+
next_token: NotRequired["capo_keyspacesstreams.types.shard_id_token.ShardIdToken"]
|
|
23
|
+
"""<p> An optional pagination token provided by a previous <code>GetStream</code> operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxResults</code>. </p>"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# --- awsJson1_0 ser/de ---
|
|
27
|
+
def serialize_aws_json_1_0(value: GetStreamInput) -> dict:
|
|
28
|
+
out: dict = {}
|
|
29
|
+
out["streamArn"] = value["stream_arn"]
|
|
30
|
+
if "max_results" in value:
|
|
31
|
+
out["maxResults"] = value["max_results"]
|
|
32
|
+
if "shard_filter" in value:
|
|
33
|
+
import capo_keyspacesstreams.types.shard_filter
|
|
34
|
+
|
|
35
|
+
out["shardFilter"] = (
|
|
36
|
+
capo_keyspacesstreams.types.shard_filter.serialize_aws_json_1_0(
|
|
37
|
+
value["shard_filter"]
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
if "next_token" in value:
|
|
41
|
+
out["nextToken"] = value["next_token"]
|
|
42
|
+
return out
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def deserialize_aws_json_1_0(data: dict) -> GetStreamInput:
|
|
46
|
+
out: GetStreamInput = {} # type: ignore[typeddict-item]
|
|
47
|
+
if data.get("streamArn") is not None:
|
|
48
|
+
out["stream_arn"] = data["streamArn"]
|
|
49
|
+
else:
|
|
50
|
+
raise DeserializationError("GetStreamInput.stream_arn required")
|
|
51
|
+
if data.get("maxResults") is not None:
|
|
52
|
+
out["max_results"] = data["maxResults"]
|
|
53
|
+
if data.get("shardFilter") is not None:
|
|
54
|
+
import capo_keyspacesstreams.types.shard_filter
|
|
55
|
+
|
|
56
|
+
out["shard_filter"] = (
|
|
57
|
+
capo_keyspacesstreams.types.shard_filter.deserialize_aws_json_1_0(
|
|
58
|
+
data["shardFilter"]
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
if data.get("nextToken") is not None:
|
|
62
|
+
out["next_token"] = data["nextToken"]
|
|
63
|
+
return out
|