from _typeshed import Incomplete

from kafka.record.abc import ABCRecord, ABCRecordBatch, ABCRecordBatchBuilder

class DefaultRecordBase:
    HEADER_STRUCT: Incomplete
    ATTRIBUTES_OFFSET: Incomplete
    CRC_OFFSET: Incomplete
    AFTER_LEN_OFFSET: Incomplete
    CODEC_MASK: int
    CODEC_NONE: int
    CODEC_GZIP: int
    CODEC_SNAPPY: int
    CODEC_LZ4: int
    CODEC_ZSTD: int
    TIMESTAMP_TYPE_MASK: int
    TRANSACTIONAL_MASK: int
    CONTROL_MASK: int
    LOG_APPEND_TIME: int
    CREATE_TIME: int
    NO_PRODUCER_ID: int
    NO_SEQUENCE: int
    MAX_INT: int

class DefaultRecordBatch(DefaultRecordBase, ABCRecordBatch):
    def __init__(self, buffer) -> None: ...
    @property
    def base_offset(self): ...
    @property
    def size_in_bytes(self): ...
    @property
    def leader_epoch(self): ...
    @property
    def magic(self): ...
    @property
    def crc(self): ...
    @property
    def attributes(self): ...
    @property
    def last_offset_delta(self): ...
    @property
    def last_offset(self): ...
    @property
    def next_offset(self): ...
    @property
    def compression_type(self): ...
    @property
    def timestamp_type(self): ...
    @property
    def is_transactional(self): ...
    @property
    def is_control_batch(self): ...
    @property
    def first_timestamp(self): ...
    @property
    def max_timestamp(self): ...
    @property
    def producer_id(self): ...
    def has_producer_id(self): ...
    @property
    def producer_epoch(self): ...
    @property
    def base_sequence(self): ...
    @property
    def has_sequence(self): ...
    @property
    def last_sequence(self): ...
    @property
    def records_count(self): ...
    def __iter__(self): ...
    def __next__(self): ...
    next = __next__
    def validate_crc(self): ...

class DefaultRecord(ABCRecord):
    def __init__(self, size_in_bytes, offset, timestamp, timestamp_type, key, value, headers) -> None: ...
    @property
    def size_in_bytes(self): ...
    @property
    def offset(self): ...
    @property
    def timestamp(self): ...
    @property
    def timestamp_type(self): ...
    @property
    def key(self): ...
    @property
    def value(self): ...
    @property
    def headers(self): ...
    @property
    def checksum(self) -> None: ...
    def validate_crc(self): ...

class ControlRecord(DefaultRecord):
    KEY_STRUCT: Incomplete
    def __init__(self, size_in_bytes, offset, timestamp, timestamp_type, key, value, headers) -> None: ...
    @property
    def version(self): ...
    @property
    def type(self): ...
    @property
    def abort(self): ...
    @property
    def commit(self): ...

class DefaultRecordBatchBuilder(DefaultRecordBase, ABCRecordBatchBuilder):
    MAX_RECORD_OVERHEAD: int
    def __init__(
        self, magic, compression_type, is_transactional, producer_id, producer_epoch, base_sequence, batch_size
    ) -> None: ...
    def set_producer_state(self, producer_id, producer_epoch, base_sequence, is_transactional) -> None: ...
    @property
    def producer_id(self): ...
    @property
    def producer_epoch(self): ...
    def append(  # type: ignore[override]
        self,
        offset,
        timestamp,
        key,
        value,
        headers,
        encode_varint=...,
        size_of_varint=...,
        get_type=...,
        type_int=...,
        time_time=...,
        byte_like=...,
        bytearray_type=...,
        len_func=...,
        zero_len_varint: int = 1,
    ): ...
    def write_header(self, use_compression_type: bool = True) -> None: ...
    def build(self): ...
    def size(self): ...
    @classmethod
    def header_size_in_bytes(cls): ...
    @classmethod
    def size_in_bytes(cls, offset_delta, timestamp_delta, key, value, headers): ...
    @classmethod
    def size_of(cls, key, value, headers): ...
    @classmethod
    def estimate_size_in_bytes(cls, key, value, headers): ...

class DefaultRecordMetadata:
    def __init__(self, offset, size, timestamp) -> None: ...
    @property
    def offset(self): ...
    @property
    def crc(self) -> None: ...
    @property
    def size(self): ...
    @property
    def timestamp(self): ...
