Skip to content

Commit

Permalink
fix: Re-generate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
aiven-anton committed Oct 21, 2024
1 parent bbe7e2e commit 1244be0
Show file tree
Hide file tree
Showing 150 changed files with 6,699 additions and 72 deletions.
Empty file.
7 changes: 7 additions & 0 deletions src/kio/schema/add_raft_voter/v0/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .request import AddRaftVoterRequest
from .response import AddRaftVoterResponse

__all__ = (
"AddRaftVoterRequest",
"AddRaftVoterResponse",
)
48 changes: 48 additions & 0 deletions src/kio/schema/add_raft_voter/v0/request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
Generated from ``clients/src/main/resources/common/message/AddRaftVoterRequest.json``.
"""

import uuid

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.request_header.v2.header import RequestHeader
from kio.static.constants import EntityType
from kio.static.primitive import i16
from kio.static.primitive import i32
from kio.static.primitive import i32Timedelta
from kio.static.primitive import u16


@dataclass(frozen=True, slots=True, kw_only=True)
class Listener:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(0)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(80)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
name: str = field(metadata={"kafka_type": "string"})
"""The name of the endpoint"""
host: str = field(metadata={"kafka_type": "string"})
"""The hostname"""
port: u16 = field(metadata={"kafka_type": "uint16"})
"""The port"""


@dataclass(frozen=True, slots=True, kw_only=True)
class AddRaftVoterRequest:
__type__: ClassVar = EntityType.request
__version__: ClassVar[i16] = i16(0)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(80)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
cluster_id: str | None = field(metadata={"kafka_type": "string"})
timeout: i32Timedelta = field(metadata={"kafka_type": "timedelta_i32"})
voter_id: i32 = field(metadata={"kafka_type": "int32"})
"""The replica id of the voter getting added to the topic partition"""
voter_directory_id: uuid.UUID | None = field(metadata={"kafka_type": "uuid"})
"""The directory id of the voter getting added to the topic partition"""
listeners: tuple[Listener, ...]
"""The endpoints that can be used to communicate with the voter"""
28 changes: 28 additions & 0 deletions src/kio/schema/add_raft_voter/v0/response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Generated from ``clients/src/main/resources/common/message/AddRaftVoterResponse.json``.
"""

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.errors import ErrorCode
from kio.schema.response_header.v1.header import ResponseHeader
from kio.static.constants import EntityType
from kio.static.primitive import i16
from kio.static.primitive import i32Timedelta


@dataclass(frozen=True, slots=True, kw_only=True)
class AddRaftVoterResponse:
__type__: ClassVar = EntityType.response
__version__: ClassVar[i16] = i16(0)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(80)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
throttle_time: i32Timedelta = field(metadata={"kafka_type": "timedelta_i32"})
"""The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota."""
error_code: ErrorCode = field(metadata={"kafka_type": "error_code"})
"""The error code, or 0 if there was no error"""
error_message: str | None = field(metadata={"kafka_type": "string"})
"""The error message, or null if there was no error."""
2 changes: 1 addition & 1 deletion src/kio/schema/api_versions/v3/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ApiVersionsResponse:
supported_features: tuple[SupportedFeatureKey, ...] = field(
metadata={"tag": 0}, default=()
)
"""Features supported by the broker."""
"""Features supported by the broker. Note: in v0-v3, features with MinSupportedVersion = 0 are omitted."""
finalized_features_epoch: i64 = field(
metadata={"kafka_type": "int64", "tag": 1}, default=i64(-1)
)
Expand Down
7 changes: 7 additions & 0 deletions src/kio/schema/api_versions/v4/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .request import ApiVersionsRequest
from .response import ApiVersionsResponse

__all__ = (
"ApiVersionsRequest",
"ApiVersionsResponse",
)
24 changes: 24 additions & 0 deletions src/kio/schema/api_versions/v4/request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Generated from ``clients/src/main/resources/common/message/ApiVersionsRequest.json``.
"""

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.request_header.v2.header import RequestHeader
from kio.static.constants import EntityType
from kio.static.primitive import i16


@dataclass(frozen=True, slots=True, kw_only=True)
class ApiVersionsRequest:
__type__: ClassVar = EntityType.request
__version__: ClassVar[i16] = i16(4)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(18)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
client_software_name: str = field(metadata={"kafka_type": "string"})
"""The name of the client."""
client_software_version: str = field(metadata={"kafka_type": "string"})
"""The version of the client."""
90 changes: 90 additions & 0 deletions src/kio/schema/api_versions/v4/response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
"""
Generated from ``clients/src/main/resources/common/message/ApiVersionsResponse.json``.
"""

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.errors import ErrorCode
from kio.schema.response_header.v0.header import ResponseHeader
from kio.static.constants import EntityType
from kio.static.primitive import i16
from kio.static.primitive import i32Timedelta
from kio.static.primitive import i64


@dataclass(frozen=True, slots=True, kw_only=True)
class ApiVersion:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(4)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(18)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
api_key: i16 = field(metadata={"kafka_type": "int16"})
"""The API index."""
min_version: i16 = field(metadata={"kafka_type": "int16"})
"""The minimum supported version, inclusive."""
max_version: i16 = field(metadata={"kafka_type": "int16"})
"""The maximum supported version, inclusive."""


@dataclass(frozen=True, slots=True, kw_only=True)
class SupportedFeatureKey:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(4)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(18)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
name: str = field(metadata={"kafka_type": "string"})
"""The name of the feature."""
min_version: i16 = field(metadata={"kafka_type": "int16"})
"""The minimum supported version for the feature."""
max_version: i16 = field(metadata={"kafka_type": "int16"})
"""The maximum supported version for the feature."""


@dataclass(frozen=True, slots=True, kw_only=True)
class FinalizedFeatureKey:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(4)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(18)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
name: str = field(metadata={"kafka_type": "string"})
"""The name of the feature."""
max_version_level: i16 = field(metadata={"kafka_type": "int16"})
"""The cluster-wide finalized max version level for the feature."""
min_version_level: i16 = field(metadata={"kafka_type": "int16"})
"""The cluster-wide finalized min version level for the feature."""


@dataclass(frozen=True, slots=True, kw_only=True)
class ApiVersionsResponse:
__type__: ClassVar = EntityType.response
__version__: ClassVar[i16] = i16(4)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(18)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
error_code: ErrorCode = field(metadata={"kafka_type": "error_code"})
"""The top-level error code."""
api_keys: tuple[ApiVersion, ...]
"""The APIs supported by the broker."""
throttle_time: i32Timedelta = field(metadata={"kafka_type": "timedelta_i32"})
"""The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota."""
supported_features: tuple[SupportedFeatureKey, ...] = field(
metadata={"tag": 0}, default=()
)
"""Features supported by the broker. Note: in v0-v3, features with MinSupportedVersion = 0 are omitted."""
finalized_features_epoch: i64 = field(
metadata={"kafka_type": "int64", "tag": 1}, default=i64(-1)
)
"""The monotonically increasing epoch for the finalized features information. Valid values are >= 0. A value of -1 is special and represents unknown epoch."""
finalized_features: tuple[FinalizedFeatureKey, ...] = field(
metadata={"tag": 2}, default=()
)
"""List of cluster-wide finalized features. The information is valid only if FinalizedFeaturesEpoch >= 0."""
zk_migration_ready: bool = field(
metadata={"kafka_type": "bool", "tag": 3}, default=False
)
"""Set by a KRaft controller if the required configurations for ZK migration are present"""
4 changes: 2 additions & 2 deletions src/kio/schema/begin_quorum_epoch/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PartitionData:
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
partition_index: i32 = field(metadata={"kafka_type": "int32"})
"""The partition index."""
"""The partition index"""
leader_id: BrokerId = field(metadata={"kafka_type": "int32"})
"""The ID of the newly elected leader"""
leader_epoch: i32 = field(metadata={"kafka_type": "int32"})
Expand All @@ -37,7 +37,7 @@ class TopicData:
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topic_name: TopicName = field(metadata={"kafka_type": "string"})
"""The topic name."""
"""The topic name"""
partitions: tuple[PartitionData, ...]


Expand Down
7 changes: 7 additions & 0 deletions src/kio/schema/begin_quorum_epoch/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .request import BeginQuorumEpochRequest
from .response import BeginQuorumEpochResponse

__all__ = (
"BeginQuorumEpochRequest",
"BeginQuorumEpochResponse",
)
76 changes: 76 additions & 0 deletions src/kio/schema/begin_quorum_epoch/v1/request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""
Generated from ``clients/src/main/resources/common/message/BeginQuorumEpochRequest.json``.
"""

import uuid

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.request_header.v2.header import RequestHeader
from kio.schema.types import BrokerId
from kio.schema.types import TopicName
from kio.static.constants import EntityType
from kio.static.primitive import i16
from kio.static.primitive import i32
from kio.static.primitive import u16


@dataclass(frozen=True, slots=True, kw_only=True)
class PartitionData:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
partition_index: i32 = field(metadata={"kafka_type": "int32"})
"""The partition index"""
voter_directory_id: uuid.UUID | None = field(metadata={"kafka_type": "uuid"})
"""The directory id of the receiving replica"""
leader_id: BrokerId = field(metadata={"kafka_type": "int32"})
"""The ID of the newly elected leader"""
leader_epoch: i32 = field(metadata={"kafka_type": "int32"})
"""The epoch of the newly elected leader"""


@dataclass(frozen=True, slots=True, kw_only=True)
class TopicData:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topic_name: TopicName = field(metadata={"kafka_type": "string"})
"""The topic name"""
partitions: tuple[PartitionData, ...]


@dataclass(frozen=True, slots=True, kw_only=True)
class LeaderEndpoint:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
name: str = field(metadata={"kafka_type": "string"})
"""The name of the endpoint"""
host: str = field(metadata={"kafka_type": "string"})
"""The node's hostname"""
port: u16 = field(metadata={"kafka_type": "uint16"})
"""The node's port"""


@dataclass(frozen=True, slots=True, kw_only=True)
class BeginQuorumEpochRequest:
__type__: ClassVar = EntityType.request
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
cluster_id: str | None = field(metadata={"kafka_type": "string"}, default=None)
voter_id: BrokerId = field(metadata={"kafka_type": "int32"}, default=BrokerId(-1))
"""The replica id of the voter receiving the request"""
topics: tuple[TopicData, ...]
leader_endpoints: tuple[LeaderEndpoint, ...]
"""Endpoints for the leader"""
73 changes: 73 additions & 0 deletions src/kio/schema/begin_quorum_epoch/v1/response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"""
Generated from ``clients/src/main/resources/common/message/BeginQuorumEpochResponse.json``.
"""

from dataclasses import dataclass
from dataclasses import field
from typing import ClassVar

from kio.schema.errors import ErrorCode
from kio.schema.response_header.v1.header import ResponseHeader
from kio.schema.types import BrokerId
from kio.schema.types import TopicName
from kio.static.constants import EntityType
from kio.static.primitive import i16
from kio.static.primitive import i32
from kio.static.primitive import u16


@dataclass(frozen=True, slots=True, kw_only=True)
class PartitionData:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
partition_index: i32 = field(metadata={"kafka_type": "int32"})
"""The partition index."""
error_code: ErrorCode = field(metadata={"kafka_type": "error_code"})
leader_id: BrokerId = field(metadata={"kafka_type": "int32"})
"""The ID of the current leader or -1 if the leader is unknown."""
leader_epoch: i32 = field(metadata={"kafka_type": "int32"})
"""The latest known leader epoch"""


@dataclass(frozen=True, slots=True, kw_only=True)
class TopicData:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
topic_name: TopicName = field(metadata={"kafka_type": "string"})
"""The topic name."""
partitions: tuple[PartitionData, ...]


@dataclass(frozen=True, slots=True, kw_only=True)
class NodeEndpoint:
__type__: ClassVar = EntityType.nested
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
node_id: BrokerId = field(metadata={"kafka_type": "int32"})
"""The ID of the associated node"""
host: str = field(metadata={"kafka_type": "string"})
"""The node's hostname"""
port: u16 = field(metadata={"kafka_type": "uint16"})
"""The node's port"""


@dataclass(frozen=True, slots=True, kw_only=True)
class BeginQuorumEpochResponse:
__type__: ClassVar = EntityType.response
__version__: ClassVar[i16] = i16(1)
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(53)
__header_schema__: ClassVar[type[ResponseHeader]] = ResponseHeader
error_code: ErrorCode = field(metadata={"kafka_type": "error_code"})
"""The top level error code."""
topics: tuple[TopicData, ...]
node_endpoints: tuple[NodeEndpoint, ...] = field(metadata={"tag": 0}, default=())
"""Endpoints for all leaders enumerated in PartitionData"""
Loading

0 comments on commit 1244be0

Please sign in to comment.