records

Kinesis-specific record types for producing to and consuming from AWS Kinesis Data Streams.

class unistream_aws_kinesis.records.KinesisRecord(id: str = <factory>, create_at: str = <factory>)[source]

A record designed for AWS Kinesis Data Streams. Extends DataClassRecord with Kinesis-specific binary encoding methods.

Parameters:

partition_key – Kinesis partition key. Defaults to record.id.

to_put_record_data() bytes[source]

Convert the record to binary data for the put_records API.

classmethod from_get_record_data(data: bytes) Self[source]

Convert get_records API response data to a record instance.

property partition_key: str

Kinesis partition key. Override this property for custom partitioning. Defaults to self.id.

class unistream_aws_kinesis.records.KinesisGetRecordsResponseRecord(sequence_number: str, approximate_arrival_timestamp: str, data: bytes, partition_key: str, encryption_type: str | None)[source]

Deserializes the Records part of the get_records API response.

classmethod from_get_records_response(res: dict) list[Self][source]

Parse the Records part of the get_records API response.