Skip to content

Commit

Permalink
feat: implement admin metadata typings (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
benbenbang authored Aug 12, 2023
1 parent b4d233c commit 351e6ef
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions confluent_kafka-stubs/admin/_metadata.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,60 @@
types-confluent-kafka: A package providing type hints for the confluent-kafka Python package.
This package is licensed under the Apache 2.0 License.
"""

from __future__ import annotations

# standard library
from typing import TYPE_CHECKING, Any, ClassVar

if TYPE_CHECKING:
# pypi/conda library
from confluent_kafka._model import ConsumerGroupState
from confluent_kafka.cimpl import KafkaError

class ClusterMetadata:
cluster_id: ClassVar[str]
controller_id: ClassVar[int] = -1
brokers: ClassVar[dict[int, "BrokerMetadata"] | None] = None
topics: ClassVar[dict[int, "TopicMetadata"] | None] = None
orig_broker_id: ClassVar[int] = -1
orig_broker_name: ClassVar[str] = ""
def __init__(self) -> None: ...

class BrokerMetadata:
id: ClassVar[int] = -1
host: ClassVar[str] | None = None
port: ClassVar[int] = -1
def __init__(self) -> None: ...

class TopicMetadata:
topic: ClassVar[str | None] = None
partitions: ClassVar[dict[int, "PartitionMetadata"] | None] = None
error: ClassVar["KafkaError" | None] = None
def __init__(self) -> None: ...

class PartitionMetadata:
id: ClassVar[int]
leader: ClassVar[int]
replicas: ClassVar[list[int] | None] = None
isrs: ClassVar[list[int] | None] = None
error: ClassVar["KafkaError" | None] = None
def __init__(self) -> None: ...

class GroupMember:
id: ClassVar[int | None] = None
client_id: ClassVar[str | None] = None
client_host: ClassVar[str | None] = None
metadata: ClassVar[Any | None] = None
assignment: ClassVar[Any | None] = None
def __init__(self) -> None: ...

class GroupMetadata:
broker: ClassVar["BrokerMetadata" | None] = None
id: ClassVar[str | None] = None
error: ClassVar["KafkaError" | None] = None
state: ClassVar["ConsumerGroupState" | None] = None
protocol_type: ClassVar[Any | None] = None
protocol: ClassVar[Any] = None
members: ClassVar[list | None] = None
def __init__(self) -> None: ...

0 comments on commit 351e6ef

Please sign in to comment.