# Generated by generate_stubs.py (Python 3.14)
import uuid
from typing import Any, Self

from kafka.protocol.api_message import ApiMessage
from kafka.protocol.data_container import DataContainer

__all__ = ['InitProducerIdRequest', 'InitProducerIdResponse', 'AddPartitionsToTxnRequest', 'AddPartitionsToTxnResponse', 'AddOffsetsToTxnRequest', 'AddOffsetsToTxnResponse', 'EndTxnRequest', 'EndTxnResponse', 'TxnOffsetCommitRequest', 'TxnOffsetCommitResponse', 'WriteTxnMarkersRequest', 'WriteTxnMarkersResponse']

class InitProducerIdRequest(ApiMessage):
    transactional_id: str | None
    transaction_timeout_ms: int
    producer_id: int
    producer_epoch: int
    enable2_pc: bool
    keep_prepared_txn: bool
    def __init__(
        self,
        *args: Any,
        transactional_id: str | None = ...,
        transaction_timeout_ms: int = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        enable2_pc: bool = ...,
        keep_prepared_txn: bool = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class InitProducerIdResponse(ApiMessage):
    throttle_time_ms: int
    error_code: int
    producer_id: int
    producer_epoch: int
    ongoing_txn_producer_id: int
    ongoing_txn_producer_epoch: int
    def __init__(
        self,
        *args: Any,
        throttle_time_ms: int = ...,
        error_code: int = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        ongoing_txn_producer_id: int = ...,
        ongoing_txn_producer_epoch: int = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class AddPartitionsToTxnRequest(ApiMessage):
    class AddPartitionsToTxnTransaction(DataContainer):
        class AddPartitionsToTxnTopic(DataContainer):
            name: str
            partitions: list[int]
            def __init__(
                self,
                *args: Any,
                name: str = ...,
                partitions: list[int] = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        transactional_id: str
        producer_id: int
        producer_epoch: int
        verify_only: bool
        topics: list[AddPartitionsToTxnTopic]
        def __init__(
            self,
            *args: Any,
            transactional_id: str = ...,
            producer_id: int = ...,
            producer_epoch: int = ...,
            verify_only: bool = ...,
            topics: list[AddPartitionsToTxnTopic] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    class AddPartitionsToTxnTopic(DataContainer):
        name: str
        partitions: list[int]
        def __init__(
            self,
            *args: Any,
            name: str = ...,
            partitions: list[int] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    transactions: list[AddPartitionsToTxnTransaction]
    v3_and_below_transactional_id: str
    v3_and_below_producer_id: int
    v3_and_below_producer_epoch: int
    v3_and_below_topics: list[AddPartitionsToTxnTopic]
    def __init__(
        self,
        *args: Any,
        transactions: list[AddPartitionsToTxnTransaction] = ...,
        v3_and_below_transactional_id: str = ...,
        v3_and_below_producer_id: int = ...,
        v3_and_below_producer_epoch: int = ...,
        v3_and_below_topics: list[AddPartitionsToTxnTopic] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class AddPartitionsToTxnResponse(ApiMessage):
    class AddPartitionsToTxnResult(DataContainer):
        class AddPartitionsToTxnTopicResult(DataContainer):
            class AddPartitionsToTxnPartitionResult(DataContainer):
                partition_index: int
                partition_error_code: int
                def __init__(
                    self,
                    *args: Any,
                    partition_index: int = ...,
                    partition_error_code: int = ...,
                    version: int | None = None,
                    **kwargs: Any,
                ) -> None: ...
                @property
                def version(self) -> int | None: ...
                def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

            name: str
            results_by_partition: list[AddPartitionsToTxnPartitionResult]
            def __init__(
                self,
                *args: Any,
                name: str = ...,
                results_by_partition: list[AddPartitionsToTxnPartitionResult] = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        transactional_id: str
        topic_results: list[AddPartitionsToTxnTopicResult]
        def __init__(
            self,
            *args: Any,
            transactional_id: str = ...,
            topic_results: list[AddPartitionsToTxnTopicResult] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    class AddPartitionsToTxnTopicResult(DataContainer):
        class AddPartitionsToTxnPartitionResult(DataContainer):
            partition_index: int
            partition_error_code: int
            def __init__(
                self,
                *args: Any,
                partition_index: int = ...,
                partition_error_code: int = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        name: str
        results_by_partition: list[AddPartitionsToTxnPartitionResult]
        def __init__(
            self,
            *args: Any,
            name: str = ...,
            results_by_partition: list[AddPartitionsToTxnPartitionResult] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    throttle_time_ms: int
    error_code: int
    results_by_transaction: list[AddPartitionsToTxnResult]
    results_by_topic_v3_and_below: list[AddPartitionsToTxnTopicResult]
    def __init__(
        self,
        *args: Any,
        throttle_time_ms: int = ...,
        error_code: int = ...,
        results_by_transaction: list[AddPartitionsToTxnResult] = ...,
        results_by_topic_v3_and_below: list[AddPartitionsToTxnTopicResult] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class AddOffsetsToTxnRequest(ApiMessage):
    transactional_id: str
    producer_id: int
    producer_epoch: int
    group_id: str
    def __init__(
        self,
        *args: Any,
        transactional_id: str = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        group_id: str = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class AddOffsetsToTxnResponse(ApiMessage):
    throttle_time_ms: int
    error_code: int
    def __init__(
        self,
        *args: Any,
        throttle_time_ms: int = ...,
        error_code: int = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class EndTxnRequest(ApiMessage):
    transactional_id: str
    producer_id: int
    producer_epoch: int
    committed: bool
    def __init__(
        self,
        *args: Any,
        transactional_id: str = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        committed: bool = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class EndTxnResponse(ApiMessage):
    throttle_time_ms: int
    error_code: int
    producer_id: int
    producer_epoch: int
    def __init__(
        self,
        *args: Any,
        throttle_time_ms: int = ...,
        error_code: int = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class TxnOffsetCommitRequest(ApiMessage):
    class TxnOffsetCommitRequestTopic(DataContainer):
        class TxnOffsetCommitRequestPartition(DataContainer):
            partition_index: int
            committed_offset: int
            committed_leader_epoch: int
            committed_metadata: str | None
            def __init__(
                self,
                *args: Any,
                partition_index: int = ...,
                committed_offset: int = ...,
                committed_leader_epoch: int = ...,
                committed_metadata: str | None = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        name: str
        partitions: list[TxnOffsetCommitRequestPartition]
        def __init__(
            self,
            *args: Any,
            name: str = ...,
            partitions: list[TxnOffsetCommitRequestPartition] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    transactional_id: str
    group_id: str
    producer_id: int
    producer_epoch: int
    generation_id: int
    member_id: str
    group_instance_id: str | None
    topics: list[TxnOffsetCommitRequestTopic]
    def __init__(
        self,
        *args: Any,
        transactional_id: str = ...,
        group_id: str = ...,
        producer_id: int = ...,
        producer_epoch: int = ...,
        generation_id: int = ...,
        member_id: str = ...,
        group_instance_id: str | None = ...,
        topics: list[TxnOffsetCommitRequestTopic] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class TxnOffsetCommitResponse(ApiMessage):
    class TxnOffsetCommitResponseTopic(DataContainer):
        class TxnOffsetCommitResponsePartition(DataContainer):
            partition_index: int
            error_code: int
            def __init__(
                self,
                *args: Any,
                partition_index: int = ...,
                error_code: int = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        name: str
        partitions: list[TxnOffsetCommitResponsePartition]
        def __init__(
            self,
            *args: Any,
            name: str = ...,
            partitions: list[TxnOffsetCommitResponsePartition] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    throttle_time_ms: int
    topics: list[TxnOffsetCommitResponseTopic]
    def __init__(
        self,
        *args: Any,
        throttle_time_ms: int = ...,
        topics: list[TxnOffsetCommitResponseTopic] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class WriteTxnMarkersRequest(ApiMessage):
    class WritableTxnMarker(DataContainer):
        class WritableTxnMarkerTopic(DataContainer):
            name: str
            partition_indexes: list[int]
            def __init__(
                self,
                *args: Any,
                name: str = ...,
                partition_indexes: list[int] = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        producer_id: int
        producer_epoch: int
        transaction_result: bool
        topics: list[WritableTxnMarkerTopic]
        coordinator_epoch: int
        transaction_version: int
        def __init__(
            self,
            *args: Any,
            producer_id: int = ...,
            producer_epoch: int = ...,
            transaction_result: bool = ...,
            topics: list[WritableTxnMarkerTopic] = ...,
            coordinator_epoch: int = ...,
            transaction_version: int = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    markers: list[WritableTxnMarker]
    def __init__(
        self,
        *args: Any,
        markers: list[WritableTxnMarker] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...

class WriteTxnMarkersResponse(ApiMessage):
    class WritableTxnMarkerResult(DataContainer):
        class WritableTxnMarkerTopicResult(DataContainer):
            class WritableTxnMarkerPartitionResult(DataContainer):
                partition_index: int
                error_code: int
                def __init__(
                    self,
                    *args: Any,
                    partition_index: int = ...,
                    error_code: int = ...,
                    version: int | None = None,
                    **kwargs: Any,
                ) -> None: ...
                @property
                def version(self) -> int | None: ...
                def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

            name: str
            partitions: list[WritableTxnMarkerPartitionResult]
            def __init__(
                self,
                *args: Any,
                name: str = ...,
                partitions: list[WritableTxnMarkerPartitionResult] = ...,
                version: int | None = None,
                **kwargs: Any,
            ) -> None: ...
            @property
            def version(self) -> int | None: ...
            def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

        producer_id: int
        topics: list[WritableTxnMarkerTopicResult]
        def __init__(
            self,
            *args: Any,
            producer_id: int = ...,
            topics: list[WritableTxnMarkerTopicResult] = ...,
            version: int | None = None,
            **kwargs: Any,
        ) -> None: ...
        @property
        def version(self) -> int | None: ...
        def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...

    markers: list[WritableTxnMarkerResult]
    def __init__(
        self,
        *args: Any,
        markers: list[WritableTxnMarkerResult] = ...,
        version: int | None = None,
        **kwargs: Any,
    ) -> None: ...
    @property
    def version(self) -> int | None: ...
    def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
    name: str
    type: str
    API_KEY: int
    API_VERSION: int
    valid_versions: tuple[int, int]
    min_version: int
    max_version: int
    @property
    def header(self) -> Any: ...
    @classmethod
    def is_request(cls) -> bool: ...
    def expect_response(self) -> bool: ...
    def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
