import abc
from _typeshed import Incomplete
from enum import IntEnum

from kafka.util import synchronized

log: Incomplete

class SubscriptionType(IntEnum):
    NONE = 0
    AUTO_TOPICS = 1
    AUTO_PATTERN = 2
    USER_ASSIGNED = 3

class SubscriptionState:
    subscription: Incomplete
    subscription_type: Incomplete
    subscribed_pattern: Incomplete
    assignment: Incomplete
    rebalance_listener: Incomplete
    listeners: Incomplete
    def __init__(self, offset_reset_strategy: str = "earliest") -> None: ...
    @synchronized
    def subscribe(self, topics=(), pattern=None, listener=None) -> None: ...
    @synchronized
    def change_subscription(self, topics) -> None: ...
    @synchronized
    def group_subscribe(self, topics) -> None: ...
    @synchronized
    def reset_group_subscription(self) -> None: ...
    @synchronized
    def assign_from_user(self, partitions) -> None: ...
    @synchronized
    def assign_from_subscribed(self, assignments) -> None: ...
    @synchronized
    def unsubscribe(self) -> None: ...
    @synchronized
    def group_subscription(self): ...
    @synchronized
    def seek(self, partition, offset) -> None: ...
    @synchronized
    def assigned_partitions(self): ...
    @synchronized
    def paused_partitions(self): ...
    @synchronized
    def fetchable_partitions(self): ...
    @synchronized
    def partitions_auto_assigned(self): ...
    @synchronized
    def all_consumed_offsets(self): ...
    @synchronized
    def request_offset_reset(self, partition, offset_reset_strategy=None) -> None: ...
    @synchronized
    def set_reset_pending(self, partitions, next_allowed_reset_time) -> None: ...
    @synchronized
    def has_default_offset_reset_policy(self): ...
    @synchronized
    def is_offset_reset_needed(self, partition): ...
    @synchronized
    def has_all_fetch_positions(self): ...
    @synchronized
    def missing_fetch_positions(self): ...
    @synchronized
    def has_valid_position(self, partition): ...
    @synchronized
    def reset_missing_positions(self) -> None: ...
    @synchronized
    def partitions_needing_reset(self): ...
    @synchronized
    def is_assigned(self, partition): ...
    @synchronized
    def is_paused(self, partition): ...
    @synchronized
    def is_fetchable(self, partition): ...
    @synchronized
    def pause(self, partition) -> None: ...
    @synchronized
    def resume(self, partition) -> None: ...
    @synchronized
    def reset_failed(self, partitions, next_retry_time) -> None: ...
    @synchronized
    def move_partition_to_end(self, partition) -> None: ...
    @synchronized
    def position(self, partition): ...

class TopicPartitionState:
    paused: bool
    reset_strategy: Incomplete
    highwater: Incomplete
    drop_pending_record_batch: bool
    next_allowed_retry_time: Incomplete
    def __init__(self) -> None: ...
    position: Incomplete
    def reset(self, strategy) -> None: ...
    def is_reset_allowed(self): ...
    @property
    def awaiting_reset(self): ...
    def set_reset_pending(self, next_allowed_retry_time) -> None: ...
    def reset_failed(self, next_allowed_retry_time) -> None: ...
    @property
    def has_valid_position(self): ...
    def is_missing_position(self): ...
    def seek(self, offset) -> None: ...
    def pause(self) -> None: ...
    def resume(self) -> None: ...
    def is_fetchable(self): ...

class ConsumerRebalanceListener(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def on_partitions_revoked(self, revoked): ...
    @abc.abstractmethod
    def on_partitions_assigned(self, assigned): ...
