# AUTOGENERATED
from typing import NamedTuple, List, Optional, Iterable
from enum import Enum

from etcd3wrapper._autogen.etcd.etcdserver.etcdserverpb import rpc_pb2
from protobuf_gen.abstract import Service, Message
from etcd3wrapper import kv, auth
from etcd3wrapper._autogen.etcd.etcdserver.etcdserverpb.rpc_pb2_grpc import LeaseStub, AuthStub, WatchStub, KVStub, MaintenanceStub, ClusterStub


# Enums


class AlarmType(Enum):
    NONE = 0
    NOSPACE = 1
    CORRUPT = 2


# Messages


class ResponseHeader(Message):
    pb_cls = rpc_pb2.ResponseHeader

    __slots__ = ['cluster_id', 'member_id', 'revision', 'raft_term']

    def __init__(
        self,
        cluster_id: int = 0,
        member_id: int = 0,
        revision: int = 0,
        raft_term: int = 0
    ):
        self.cluster_id = cluster_id
        self.member_id = member_id
        self.revision = revision
        self.raft_term = raft_term

    @classmethod
    def get_slot_types(cls):
        return [int, int, int, int]


class RangeRequest(Message):
    pb_cls = rpc_pb2.RangeRequest

    __slots__ = ['key', 'range_end', 'limit', 'revision', 'sort_order', 'sort_target', 'serializable', 'keys_only', 'count_only', 'min_mod_revision', 'max_mod_revision', 'min_create_revision', 'max_create_revision']

    class SortOrder(Enum):
        NONE = 0
        ASCEND = 1
        DESCEND = 2

    class SortTarget(Enum):
        KEY = 0
        VERSION = 1
        CREATE = 2
        MOD = 3
        VALUE = 4

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        limit: int = 0,
        revision: int = 0,
        sort_order: 'SortOrder' = SortOrder.NONE,
        sort_target: 'SortTarget' = SortTarget.KEY,
        serializable: bool = False,
        keys_only: bool = False,
        count_only: bool = False,
        min_mod_revision: int = 0,
        max_mod_revision: int = 0,
        min_create_revision: int = 0,
        max_create_revision: int = 0
    ):
        self.key = key
        self.range_end = range_end
        self.limit = limit
        self.revision = revision
        self.sort_order = sort_order
        self.sort_target = sort_target
        self.serializable = serializable
        self.keys_only = keys_only
        self.count_only = count_only
        self.min_mod_revision = min_mod_revision
        self.max_mod_revision = max_mod_revision
        self.min_create_revision = min_create_revision
        self.max_create_revision = max_create_revision

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, int, cls.SortOrder, cls.SortTarget, bool, bool, bool, int, int, int, int]


class RangeResponse(Message):
    pb_cls = rpc_pb2.RangeResponse

    __slots__ = ['header', 'kvs', 'more', 'count']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        kvs: List['kv.KeyValue'] = None,
        more: bool = False,
        count: int = 0
    ):
        self.header = header
        self.kvs = [] if kvs is None else kvs
        self.more = more
        self.count = count

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[kv.KeyValue], bool, int]


class PutRequest(Message):
    pb_cls = rpc_pb2.PutRequest

    __slots__ = ['key', 'value', 'lease', 'prev_kv', 'ignore_value', 'ignore_lease']

    def __init__(
        self,
        key: bytes = b'',
        value: bytes = b'',
        lease: int = 0,
        prev_kv: bool = False,
        ignore_value: bool = False,
        ignore_lease: bool = False
    ):
        self.key = key
        self.value = value
        self.lease = lease
        self.prev_kv = prev_kv
        self.ignore_value = ignore_value
        self.ignore_lease = ignore_lease

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, bool, bool, bool]


class PutResponse(Message):
    pb_cls = rpc_pb2.PutResponse

    __slots__ = ['header', 'prev_kv']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        prev_kv: Optional['kv.KeyValue'] = None
    ):
        self.header = header
        self.prev_kv = prev_kv

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, kv.KeyValue]


class DeleteRangeRequest(Message):
    pb_cls = rpc_pb2.DeleteRangeRequest

    __slots__ = ['key', 'range_end', 'prev_kv']

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        prev_kv: bool = False
    ):
        self.key = key
        self.range_end = range_end
        self.prev_kv = prev_kv

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, bool]


class DeleteRangeResponse(Message):
    pb_cls = rpc_pb2.DeleteRangeResponse

    __slots__ = ['header', 'deleted', 'prev_kvs']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        deleted: int = 0,
        prev_kvs: List['kv.KeyValue'] = None
    ):
        self.header = header
        self.deleted = deleted
        self.prev_kvs = [] if prev_kvs is None else prev_kvs

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, List[kv.KeyValue]]


class RequestOp(Message):
    pb_cls = rpc_pb2.RequestOp

    __slots__ = ['request_range', 'request_put', 'request_delete_range', 'request_txn']

    def __init__(
        self,
        request_range: Optional['RangeRequest'] = None,
        request_put: Optional['PutRequest'] = None,
        request_delete_range: Optional['DeleteRangeRequest'] = None,
        request_txn: Optional['TxnRequest'] = None
    ):
        self.request_range = request_range
        self.request_put = request_put
        self.request_delete_range = request_delete_range
        self.request_txn = request_txn

    @classmethod
    def get_slot_types(cls):
        return [RangeRequest, PutRequest, DeleteRangeRequest, TxnRequest]


class ResponseOp(Message):
    pb_cls = rpc_pb2.ResponseOp

    __slots__ = ['response_range', 'response_put', 'response_delete_range', 'response_txn']

    def __init__(
        self,
        response_range: Optional['RangeResponse'] = None,
        response_put: Optional['PutResponse'] = None,
        response_delete_range: Optional['DeleteRangeResponse'] = None,
        response_txn: Optional['TxnResponse'] = None
    ):
        self.response_range = response_range
        self.response_put = response_put
        self.response_delete_range = response_delete_range
        self.response_txn = response_txn

    @classmethod
    def get_slot_types(cls):
        return [RangeResponse, PutResponse, DeleteRangeResponse, TxnResponse]


class Compare(Message):
    pb_cls = rpc_pb2.Compare

    __slots__ = ['result', 'target', 'key', 'version', 'create_revision', 'mod_revision', 'value', 'lease', 'range_end']

    class CompareResult(Enum):
        EQUAL = 0
        GREATER = 1
        LESS = 2
        NOT_EQUAL = 3

    class CompareTarget(Enum):
        VERSION = 0
        CREATE = 1
        MOD = 2
        VALUE = 3
        LEASE = 4

    def __init__(
        self,
        result: 'CompareResult' = CompareResult.EQUAL,
        target: 'CompareTarget' = CompareTarget.VERSION,
        key: bytes = b'',
        version: int = 0,
        create_revision: int = 0,
        mod_revision: int = 0,
        value: bytes = b'',
        lease: int = 0,
        range_end: bytes = b''
    ):
        self.result = result
        self.target = target
        self.key = key
        self.version = version
        self.create_revision = create_revision
        self.mod_revision = mod_revision
        self.value = value
        self.lease = lease
        self.range_end = range_end

    @classmethod
    def get_slot_types(cls):
        return [cls.CompareResult, cls.CompareTarget, bytes, int, int, int, bytes, int, bytes]


class TxnRequest(Message):
    pb_cls = rpc_pb2.TxnRequest

    __slots__ = ['compare', 'success', 'failure']

    def __init__(
        self,
        compare: List['Compare'] = None,
        success: List['RequestOp'] = None,
        failure: List['RequestOp'] = None
    ):
        self.compare = [] if compare is None else compare
        self.success = [] if success is None else success
        self.failure = [] if failure is None else failure

    @classmethod
    def get_slot_types(cls):
        return [List[Compare], List[RequestOp], List[RequestOp]]


class TxnResponse(Message):
    pb_cls = rpc_pb2.TxnResponse

    __slots__ = ['header', 'succeeded', 'responses']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        succeeded: bool = False,
        responses: List['ResponseOp'] = None
    ):
        self.header = header
        self.succeeded = succeeded
        self.responses = [] if responses is None else responses

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, bool, List[ResponseOp]]


class CompactionRequest(Message):
    pb_cls = rpc_pb2.CompactionRequest

    __slots__ = ['revision', 'physical']

    def __init__(
        self,
        revision: int = 0,
        physical: bool = False
    ):
        self.revision = revision
        self.physical = physical

    @classmethod
    def get_slot_types(cls):
        return [int, bool]


class CompactionResponse(Message):
    pb_cls = rpc_pb2.CompactionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class HashRequest(Message):
    pb_cls = rpc_pb2.HashRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class HashKVRequest(Message):
    pb_cls = rpc_pb2.HashKVRequest

    __slots__ = ['revision']

    def __init__(
        self,
        revision: int = 0
    ):
        self.revision = revision

    @classmethod
    def get_slot_types(cls):
        return [int]


class HashKVResponse(Message):
    pb_cls = rpc_pb2.HashKVResponse

    __slots__ = ['header', 'hash', 'compact_revision']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        hash: int = 0,
        compact_revision: int = 0
    ):
        self.header = header
        self.hash = hash
        self.compact_revision = compact_revision

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int]


class HashResponse(Message):
    pb_cls = rpc_pb2.HashResponse

    __slots__ = ['header', 'hash']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        hash: int = 0
    ):
        self.header = header
        self.hash = hash

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int]


class SnapshotRequest(Message):
    pb_cls = rpc_pb2.SnapshotRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class SnapshotResponse(Message):
    pb_cls = rpc_pb2.SnapshotResponse

    __slots__ = ['header', 'remaining_bytes', 'blob']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        remaining_bytes: int = 0,
        blob: bytes = b''
    ):
        self.header = header
        self.remaining_bytes = remaining_bytes
        self.blob = blob

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, bytes]


class WatchRequest(Message):
    pb_cls = rpc_pb2.WatchRequest

    __slots__ = ['create_request', 'cancel_request']

    def __init__(
        self,
        create_request: Optional['WatchCreateRequest'] = None,
        cancel_request: Optional['WatchCancelRequest'] = None
    ):
        self.create_request = create_request
        self.cancel_request = cancel_request

    @classmethod
    def get_slot_types(cls):
        return [WatchCreateRequest, WatchCancelRequest]


class WatchCreateRequest(Message):
    pb_cls = rpc_pb2.WatchCreateRequest

    __slots__ = ['key', 'range_end', 'start_revision', 'progress_notify', 'filters', 'prev_kv', 'watch_id']

    class FilterType(Enum):
        NOPUT = 0
        NODELETE = 1

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        start_revision: int = 0,
        progress_notify: bool = False,
        filters: List['FilterType'] = None,
        prev_kv: bool = False,
        watch_id: int = 0
    ):
        self.key = key
        self.range_end = range_end
        self.start_revision = start_revision
        self.progress_notify = progress_notify
        self.filters = [] if filters is None else filters
        self.prev_kv = prev_kv
        self.watch_id = watch_id

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, bool, List[cls.FilterType], bool, int]


class WatchCancelRequest(Message):
    pb_cls = rpc_pb2.WatchCancelRequest

    __slots__ = ['watch_id']

    def __init__(
        self,
        watch_id: int = 0
    ):
        self.watch_id = watch_id

    @classmethod
    def get_slot_types(cls):
        return [int]


class WatchResponse(Message):
    pb_cls = rpc_pb2.WatchResponse

    __slots__ = ['header', 'watch_id', 'created', 'canceled', 'compact_revision', 'cancel_reason', 'events']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        watch_id: int = 0,
        created: bool = False,
        canceled: bool = False,
        compact_revision: int = 0,
        cancel_reason: str = '',
        events: List['kv.Event'] = None
    ):
        self.header = header
        self.watch_id = watch_id
        self.created = created
        self.canceled = canceled
        self.compact_revision = compact_revision
        self.cancel_reason = cancel_reason
        self.events = [] if events is None else events

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, bool, bool, int, str, List[kv.Event]]


class LeaseGrantRequest(Message):
    pb_cls = rpc_pb2.LeaseGrantRequest

    __slots__ = ['TTL', 'ID']

    def __init__(
        self,
        TTL: int = 0,
        ID: int = 0
    ):
        self.TTL = TTL
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int, int]


class LeaseGrantResponse(Message):
    pb_cls = rpc_pb2.LeaseGrantResponse

    __slots__ = ['header', 'ID', 'TTL', 'error']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0,
        error: str = ''
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL
        self.error = error

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int, str]


class LeaseRevokeRequest(Message):
    pb_cls = rpc_pb2.LeaseRevokeRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseRevokeResponse(Message):
    pb_cls = rpc_pb2.LeaseRevokeResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class LeaseKeepAliveRequest(Message):
    pb_cls = rpc_pb2.LeaseKeepAliveRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseKeepAliveResponse(Message):
    pb_cls = rpc_pb2.LeaseKeepAliveResponse

    __slots__ = ['header', 'ID', 'TTL']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int]


class LeaseTimeToLiveRequest(Message):
    pb_cls = rpc_pb2.LeaseTimeToLiveRequest

    __slots__ = ['ID', 'keys']

    def __init__(
        self,
        ID: int = 0,
        keys: bool = False
    ):
        self.ID = ID
        self.keys = keys

    @classmethod
    def get_slot_types(cls):
        return [int, bool]


class LeaseTimeToLiveResponse(Message):
    pb_cls = rpc_pb2.LeaseTimeToLiveResponse

    __slots__ = ['header', 'ID', 'TTL', 'grantedTTL', 'keys']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0,
        grantedTTL: int = 0,
        keys: List[bytes] = None
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL
        self.grantedTTL = grantedTTL
        self.keys = [] if keys is None else keys

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int, int, List[bytes]]


class LeaseLeasesRequest(Message):
    pb_cls = rpc_pb2.LeaseLeasesRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class LeaseStatus(Message):
    pb_cls = rpc_pb2.LeaseStatus

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseLeasesResponse(Message):
    pb_cls = rpc_pb2.LeaseLeasesResponse

    __slots__ = ['header', 'leases']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        leases: List['LeaseStatus'] = None
    ):
        self.header = header
        self.leases = [] if leases is None else leases

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[LeaseStatus]]


class Member(Message):
    pb_cls = rpc_pb2.Member

    __slots__ = ['ID', 'name', 'peerURLs', 'clientURLs']

    def __init__(
        self,
        ID: int = 0,
        name: str = '',
        peerURLs: List[str] = None,
        clientURLs: List[str] = None
    ):
        self.ID = ID
        self.name = name
        self.peerURLs = [] if peerURLs is None else peerURLs
        self.clientURLs = [] if clientURLs is None else clientURLs

    @classmethod
    def get_slot_types(cls):
        return [int, str, List[str], List[str]]


class MemberAddRequest(Message):
    pb_cls = rpc_pb2.MemberAddRequest

    __slots__ = ['peerURLs']

    def __init__(
        self,
        peerURLs: List[str] = None
    ):
        self.peerURLs = [] if peerURLs is None else peerURLs

    @classmethod
    def get_slot_types(cls):
        return [List[str]]


class MemberAddResponse(Message):
    pb_cls = rpc_pb2.MemberAddResponse

    __slots__ = ['header', 'member', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        member: Optional['Member'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.member = member
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, Member, List[Member]]


class MemberRemoveRequest(Message):
    pb_cls = rpc_pb2.MemberRemoveRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class MemberRemoveResponse(Message):
    pb_cls = rpc_pb2.MemberRemoveResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class MemberUpdateRequest(Message):
    pb_cls = rpc_pb2.MemberUpdateRequest

    __slots__ = ['ID', 'peerURLs']

    def __init__(
        self,
        ID: int = 0,
        peerURLs: List[str] = None
    ):
        self.ID = ID
        self.peerURLs = [] if peerURLs is None else peerURLs

    @classmethod
    def get_slot_types(cls):
        return [int, List[str]]


class MemberUpdateResponse(Message):
    pb_cls = rpc_pb2.MemberUpdateResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class MemberListRequest(Message):
    pb_cls = rpc_pb2.MemberListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class MemberListResponse(Message):
    pb_cls = rpc_pb2.MemberListResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class DefragmentRequest(Message):
    pb_cls = rpc_pb2.DefragmentRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class DefragmentResponse(Message):
    pb_cls = rpc_pb2.DefragmentResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class MoveLeaderRequest(Message):
    pb_cls = rpc_pb2.MoveLeaderRequest

    __slots__ = ['targetID']

    def __init__(
        self,
        targetID: int = 0
    ):
        self.targetID = targetID

    @classmethod
    def get_slot_types(cls):
        return [int]


class MoveLeaderResponse(Message):
    pb_cls = rpc_pb2.MoveLeaderResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AlarmRequest(Message):
    pb_cls = rpc_pb2.AlarmRequest

    __slots__ = ['action', 'memberID', 'alarm']

    class AlarmAction(Enum):
        GET = 0
        ACTIVATE = 1
        DEACTIVATE = 2

    def __init__(
        self,
        action: 'AlarmAction' = AlarmAction.GET,
        memberID: int = 0,
        alarm: 'AlarmType' = AlarmType.NONE
    ):
        self.action = action
        self.memberID = memberID
        self.alarm = alarm

    @classmethod
    def get_slot_types(cls):
        return [cls.AlarmAction, int, AlarmType]


class AlarmMember(Message):
    pb_cls = rpc_pb2.AlarmMember

    __slots__ = ['memberID', 'alarm']

    def __init__(
        self,
        memberID: int = 0,
        alarm: 'AlarmType' = AlarmType.NONE
    ):
        self.memberID = memberID
        self.alarm = alarm

    @classmethod
    def get_slot_types(cls):
        return [int, AlarmType]


class AlarmResponse(Message):
    pb_cls = rpc_pb2.AlarmResponse

    __slots__ = ['header', 'alarms']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        alarms: List['AlarmMember'] = None
    ):
        self.header = header
        self.alarms = [] if alarms is None else alarms

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[AlarmMember]]


class StatusRequest(Message):
    pb_cls = rpc_pb2.StatusRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class StatusResponse(Message):
    pb_cls = rpc_pb2.StatusResponse

    __slots__ = ['header', 'version', 'dbSize', 'leader', 'raftIndex', 'raftTerm', 'raftAppliedIndex', 'errors', 'dbSizeInUse']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        version: str = '',
        dbSize: int = 0,
        leader: int = 0,
        raftIndex: int = 0,
        raftTerm: int = 0,
        raftAppliedIndex: int = 0,
        errors: List[str] = None,
        dbSizeInUse: int = 0
    ):
        self.header = header
        self.version = version
        self.dbSize = dbSize
        self.leader = leader
        self.raftIndex = raftIndex
        self.raftTerm = raftTerm
        self.raftAppliedIndex = raftAppliedIndex
        self.errors = [] if errors is None else errors
        self.dbSizeInUse = dbSizeInUse

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, str, int, int, int, int, int, List[str], int]


class AuthEnableRequest(Message):
    pb_cls = rpc_pb2.AuthEnableRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthDisableRequest(Message):
    pb_cls = rpc_pb2.AuthDisableRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthenticateRequest(Message):
    pb_cls = rpc_pb2.AuthenticateRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserAddRequest(Message):
    pb_cls = rpc_pb2.AuthUserAddRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserGetRequest(Message):
    pb_cls = rpc_pb2.AuthUserGetRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserDeleteRequest(Message):
    pb_cls = rpc_pb2.AuthUserDeleteRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserChangePasswordRequest(Message):
    pb_cls = rpc_pb2.AuthUserChangePasswordRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserGrantRoleRequest(Message):
    pb_cls = rpc_pb2.AuthUserGrantRoleRequest

    __slots__ = ['user', 'role']

    def __init__(
        self,
        user: str = '',
        role: str = ''
    ):
        self.user = user
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserRevokeRoleRequest(Message):
    pb_cls = rpc_pb2.AuthUserRevokeRoleRequest

    __slots__ = ['name', 'role']

    def __init__(
        self,
        name: str = '',
        role: str = ''
    ):
        self.name = name
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthRoleAddRequest(Message):
    pb_cls = rpc_pb2.AuthRoleAddRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthRoleGetRequest(Message):
    pb_cls = rpc_pb2.AuthRoleGetRequest

    __slots__ = ['role']

    def __init__(
        self,
        role: str = ''
    ):
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserListRequest(Message):
    pb_cls = rpc_pb2.AuthUserListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthRoleListRequest(Message):
    pb_cls = rpc_pb2.AuthRoleListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthRoleDeleteRequest(Message):
    pb_cls = rpc_pb2.AuthRoleDeleteRequest

    __slots__ = ['role']

    def __init__(
        self,
        role: str = ''
    ):
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthRoleGrantPermissionRequest(Message):
    pb_cls = rpc_pb2.AuthRoleGrantPermissionRequest

    __slots__ = ['name', 'perm']

    def __init__(
        self,
        name: str = '',
        perm: Optional['auth.Permission'] = None
    ):
        self.name = name
        self.perm = perm

    @classmethod
    def get_slot_types(cls):
        return [str, auth.Permission]


class AuthRoleRevokePermissionRequest(Message):
    pb_cls = rpc_pb2.AuthRoleRevokePermissionRequest

    __slots__ = ['role', 'key', 'range_end']

    def __init__(
        self,
        role: str = '',
        key: str = '',
        range_end: str = ''
    ):
        self.role = role
        self.key = key
        self.range_end = range_end

    @classmethod
    def get_slot_types(cls):
        return [str, str, str]


class AuthEnableResponse(Message):
    pb_cls = rpc_pb2.AuthEnableResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthDisableResponse(Message):
    pb_cls = rpc_pb2.AuthDisableResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthenticateResponse(Message):
    pb_cls = rpc_pb2.AuthenticateResponse

    __slots__ = ['header', 'token']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        token: str = ''
    ):
        self.header = header
        self.token = token

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, str]


class AuthUserAddResponse(Message):
    pb_cls = rpc_pb2.AuthUserAddResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserGetResponse(Message):
    pb_cls = rpc_pb2.AuthUserGetResponse

    __slots__ = ['header', 'roles']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        roles: List[str] = None
    ):
        self.header = header
        self.roles = [] if roles is None else roles

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthUserDeleteResponse(Message):
    pb_cls = rpc_pb2.AuthUserDeleteResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserChangePasswordResponse(Message):
    pb_cls = rpc_pb2.AuthUserChangePasswordResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserGrantRoleResponse(Message):
    pb_cls = rpc_pb2.AuthUserGrantRoleResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserRevokeRoleResponse(Message):
    pb_cls = rpc_pb2.AuthUserRevokeRoleResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleAddResponse(Message):
    pb_cls = rpc_pb2.AuthRoleAddResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleGetResponse(Message):
    pb_cls = rpc_pb2.AuthRoleGetResponse

    __slots__ = ['header', 'perm']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        perm: List['auth.Permission'] = None
    ):
        self.header = header
        self.perm = [] if perm is None else perm

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[auth.Permission]]


class AuthRoleListResponse(Message):
    pb_cls = rpc_pb2.AuthRoleListResponse

    __slots__ = ['header', 'roles']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        roles: List[str] = None
    ):
        self.header = header
        self.roles = [] if roles is None else roles

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthUserListResponse(Message):
    pb_cls = rpc_pb2.AuthUserListResponse

    __slots__ = ['header', 'users']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        users: List[str] = None
    ):
        self.header = header
        self.users = [] if users is None else users

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthRoleDeleteResponse(Message):
    pb_cls = rpc_pb2.AuthRoleDeleteResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleGrantPermissionResponse(Message):
    pb_cls = rpc_pb2.AuthRoleGrantPermissionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleRevokePermissionResponse(Message):
    pb_cls = rpc_pb2.AuthRoleRevokePermissionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


# Services


class KV(Service):
    stub_cls = KVStub

    def Range(self, arg: 'RangeRequest') -> 'RangeResponse':
        return RangeResponse.from_pb(self.stub.Range(arg.to_pb()))

    def Put(self, arg: 'PutRequest') -> 'PutResponse':
        return PutResponse.from_pb(self.stub.Put(arg.to_pb()))

    def DeleteRange(self, arg: 'DeleteRangeRequest') -> 'DeleteRangeResponse':
        return DeleteRangeResponse.from_pb(self.stub.DeleteRange(arg.to_pb()))

    def Txn(self, arg: 'TxnRequest') -> 'TxnResponse':
        return TxnResponse.from_pb(self.stub.Txn(arg.to_pb()))

    def Compact(self, arg: 'CompactionRequest') -> 'CompactionResponse':
        return CompactionResponse.from_pb(self.stub.Compact(arg.to_pb()))


class Watch(Service):
    stub_cls = WatchStub

    def Watch(self, arg: 'Iterable[WatchRequest]') -> 'Iterable[WatchResponse]':
        return (WatchResponse.from_pb(x) for x in self.stub.Watch((x.to_pb() for x in arg)))


class Lease(Service):
    stub_cls = LeaseStub

    def LeaseGrant(self, arg: 'LeaseGrantRequest') -> 'LeaseGrantResponse':
        return LeaseGrantResponse.from_pb(self.stub.LeaseGrant(arg.to_pb()))

    def LeaseRevoke(self, arg: 'LeaseRevokeRequest') -> 'LeaseRevokeResponse':
        return LeaseRevokeResponse.from_pb(self.stub.LeaseRevoke(arg.to_pb()))

    def LeaseKeepAlive(self, arg: 'Iterable[LeaseKeepAliveRequest]') -> 'Iterable[LeaseKeepAliveResponse]':
        return (LeaseKeepAliveResponse.from_pb(x) for x in self.stub.LeaseKeepAlive((x.to_pb() for x in arg)))

    def LeaseTimeToLive(self, arg: 'LeaseTimeToLiveRequest') -> 'LeaseTimeToLiveResponse':
        return LeaseTimeToLiveResponse.from_pb(self.stub.LeaseTimeToLive(arg.to_pb()))

    def LeaseLeases(self, arg: 'LeaseLeasesRequest') -> 'LeaseLeasesResponse':
        return LeaseLeasesResponse.from_pb(self.stub.LeaseLeases(arg.to_pb()))


class Cluster(Service):
    stub_cls = ClusterStub

    def MemberAdd(self, arg: 'MemberAddRequest') -> 'MemberAddResponse':
        return MemberAddResponse.from_pb(self.stub.MemberAdd(arg.to_pb()))

    def MemberRemove(self, arg: 'MemberRemoveRequest') -> 'MemberRemoveResponse':
        return MemberRemoveResponse.from_pb(self.stub.MemberRemove(arg.to_pb()))

    def MemberUpdate(self, arg: 'MemberUpdateRequest') -> 'MemberUpdateResponse':
        return MemberUpdateResponse.from_pb(self.stub.MemberUpdate(arg.to_pb()))

    def MemberList(self, arg: 'MemberListRequest') -> 'MemberListResponse':
        return MemberListResponse.from_pb(self.stub.MemberList(arg.to_pb()))


class Maintenance(Service):
    stub_cls = MaintenanceStub

    def Alarm(self, arg: 'AlarmRequest') -> 'AlarmResponse':
        return AlarmResponse.from_pb(self.stub.Alarm(arg.to_pb()))

    def Status(self, arg: 'StatusRequest') -> 'StatusResponse':
        return StatusResponse.from_pb(self.stub.Status(arg.to_pb()))

    def Defragment(self, arg: 'DefragmentRequest') -> 'DefragmentResponse':
        return DefragmentResponse.from_pb(self.stub.Defragment(arg.to_pb()))

    def Hash(self, arg: 'HashRequest') -> 'HashResponse':
        return HashResponse.from_pb(self.stub.Hash(arg.to_pb()))

    def HashKV(self, arg: 'HashKVRequest') -> 'HashKVResponse':
        return HashKVResponse.from_pb(self.stub.HashKV(arg.to_pb()))

    def Snapshot(self, arg: 'SnapshotRequest') -> 'Iterable[SnapshotResponse]':
        return (SnapshotResponse.from_pb(x) for x in self.stub.Snapshot(arg.to_pb()))

    def MoveLeader(self, arg: 'MoveLeaderRequest') -> 'MoveLeaderResponse':
        return MoveLeaderResponse.from_pb(self.stub.MoveLeader(arg.to_pb()))


class Auth(Service):
    stub_cls = AuthStub

    def AuthEnable(self, arg: 'AuthEnableRequest') -> 'AuthEnableResponse':
        return AuthEnableResponse.from_pb(self.stub.AuthEnable(arg.to_pb()))

    def AuthDisable(self, arg: 'AuthDisableRequest') -> 'AuthDisableResponse':
        return AuthDisableResponse.from_pb(self.stub.AuthDisable(arg.to_pb()))

    def Authenticate(self, arg: 'AuthenticateRequest') -> 'AuthenticateResponse':
        return AuthenticateResponse.from_pb(self.stub.Authenticate(arg.to_pb()))

    def UserAdd(self, arg: 'AuthUserAddRequest') -> 'AuthUserAddResponse':
        return AuthUserAddResponse.from_pb(self.stub.UserAdd(arg.to_pb()))

    def UserGet(self, arg: 'AuthUserGetRequest') -> 'AuthUserGetResponse':
        return AuthUserGetResponse.from_pb(self.stub.UserGet(arg.to_pb()))

    def UserList(self, arg: 'AuthUserListRequest') -> 'AuthUserListResponse':
        return AuthUserListResponse.from_pb(self.stub.UserList(arg.to_pb()))

    def UserDelete(self, arg: 'AuthUserDeleteRequest') -> 'AuthUserDeleteResponse':
        return AuthUserDeleteResponse.from_pb(self.stub.UserDelete(arg.to_pb()))

    def UserChangePassword(self, arg: 'AuthUserChangePasswordRequest') -> 'AuthUserChangePasswordResponse':
        return AuthUserChangePasswordResponse.from_pb(self.stub.UserChangePassword(arg.to_pb()))

    def UserGrantRole(self, arg: 'AuthUserGrantRoleRequest') -> 'AuthUserGrantRoleResponse':
        return AuthUserGrantRoleResponse.from_pb(self.stub.UserGrantRole(arg.to_pb()))

    def UserRevokeRole(self, arg: 'AuthUserRevokeRoleRequest') -> 'AuthUserRevokeRoleResponse':
        return AuthUserRevokeRoleResponse.from_pb(self.stub.UserRevokeRole(arg.to_pb()))

    def RoleAdd(self, arg: 'AuthRoleAddRequest') -> 'AuthRoleAddResponse':
        return AuthRoleAddResponse.from_pb(self.stub.RoleAdd(arg.to_pb()))

    def RoleGet(self, arg: 'AuthRoleGetRequest') -> 'AuthRoleGetResponse':
        return AuthRoleGetResponse.from_pb(self.stub.RoleGet(arg.to_pb()))

    def RoleList(self, arg: 'AuthRoleListRequest') -> 'AuthRoleListResponse':
        return AuthRoleListResponse.from_pb(self.stub.RoleList(arg.to_pb()))

    def RoleDelete(self, arg: 'AuthRoleDeleteRequest') -> 'AuthRoleDeleteResponse':
        return AuthRoleDeleteResponse.from_pb(self.stub.RoleDelete(arg.to_pb()))

    def RoleGrantPermission(self, arg: 'AuthRoleGrantPermissionRequest') -> 'AuthRoleGrantPermissionResponse':
        return AuthRoleGrantPermissionResponse.from_pb(self.stub.RoleGrantPermission(arg.to_pb()))

    def RoleRevokePermission(self, arg: 'AuthRoleRevokePermissionRequest') -> 'AuthRoleRevokePermissionResponse':
        return AuthRoleRevokePermissionResponse.from_pb(self.stub.RoleRevokePermission(arg.to_pb()))

# AUTOGENERATED
from typing import NamedTuple, List, Optional, Iterable
from enum import Enum

from etcd3wrapper._autogen.etcd.etcdserver.etcdserverpb import rpc_pb2
from protobuf_gen.abstract import Service, Message
from etcd3wrapper import kv, auth
from etcd3wrapper._autogen.etcd.etcdserver.etcdserverpb.rpc_pb2_grpc import LeaseStub, AuthStub, WatchStub, KVStub, MaintenanceStub, ClusterStub


# Enums


class AlarmType(Enum):
    NONE = 0
    NOSPACE = 1
    CORRUPT = 2


# Messages


class ResponseHeader(Message):
    pb_cls = rpc_pb2.ResponseHeader

    __slots__ = ['cluster_id', 'member_id', 'revision', 'raft_term']

    def __init__(
        self,
        cluster_id: int = 0,
        member_id: int = 0,
        revision: int = 0,
        raft_term: int = 0
    ):
        self.cluster_id = cluster_id
        self.member_id = member_id
        self.revision = revision
        self.raft_term = raft_term

    @classmethod
    def get_slot_types(cls):
        return [int, int, int, int]


class RangeRequest(Message):
    pb_cls = rpc_pb2.RangeRequest

    __slots__ = ['key', 'range_end', 'limit', 'revision', 'sort_order', 'sort_target', 'serializable', 'keys_only', 'count_only', 'min_mod_revision', 'max_mod_revision', 'min_create_revision', 'max_create_revision']

    class SortOrder(Enum):
        NONE = 0
        ASCEND = 1
        DESCEND = 2

    class SortTarget(Enum):
        KEY = 0
        VERSION = 1
        CREATE = 2
        MOD = 3
        VALUE = 4

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        limit: int = 0,
        revision: int = 0,
        sort_order: 'SortOrder' = SortOrder.NONE,
        sort_target: 'SortTarget' = SortTarget.KEY,
        serializable: bool = False,
        keys_only: bool = False,
        count_only: bool = False,
        min_mod_revision: int = 0,
        max_mod_revision: int = 0,
        min_create_revision: int = 0,
        max_create_revision: int = 0
    ):
        self.key = key
        self.range_end = range_end
        self.limit = limit
        self.revision = revision
        self.sort_order = sort_order
        self.sort_target = sort_target
        self.serializable = serializable
        self.keys_only = keys_only
        self.count_only = count_only
        self.min_mod_revision = min_mod_revision
        self.max_mod_revision = max_mod_revision
        self.min_create_revision = min_create_revision
        self.max_create_revision = max_create_revision

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, int, cls.SortOrder, cls.SortTarget, bool, bool, bool, int, int, int, int]


class RangeResponse(Message):
    pb_cls = rpc_pb2.RangeResponse

    __slots__ = ['header', 'kvs', 'more', 'count']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        kvs: List['kv.KeyValue'] = None,
        more: bool = False,
        count: int = 0
    ):
        self.header = header
        self.kvs = [] if kvs is None else kvs
        self.more = more
        self.count = count

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[kv.KeyValue], bool, int]


class PutRequest(Message):
    pb_cls = rpc_pb2.PutRequest

    __slots__ = ['key', 'value', 'lease', 'prev_kv', 'ignore_value', 'ignore_lease']

    def __init__(
        self,
        key: bytes = b'',
        value: bytes = b'',
        lease: int = 0,
        prev_kv: bool = False,
        ignore_value: bool = False,
        ignore_lease: bool = False
    ):
        self.key = key
        self.value = value
        self.lease = lease
        self.prev_kv = prev_kv
        self.ignore_value = ignore_value
        self.ignore_lease = ignore_lease

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, bool, bool, bool]


class PutResponse(Message):
    pb_cls = rpc_pb2.PutResponse

    __slots__ = ['header', 'prev_kv']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        prev_kv: Optional['kv.KeyValue'] = None
    ):
        self.header = header
        self.prev_kv = prev_kv

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, kv.KeyValue]


class DeleteRangeRequest(Message):
    pb_cls = rpc_pb2.DeleteRangeRequest

    __slots__ = ['key', 'range_end', 'prev_kv']

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        prev_kv: bool = False
    ):
        self.key = key
        self.range_end = range_end
        self.prev_kv = prev_kv

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, bool]


class DeleteRangeResponse(Message):
    pb_cls = rpc_pb2.DeleteRangeResponse

    __slots__ = ['header', 'deleted', 'prev_kvs']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        deleted: int = 0,
        prev_kvs: List['kv.KeyValue'] = None
    ):
        self.header = header
        self.deleted = deleted
        self.prev_kvs = [] if prev_kvs is None else prev_kvs

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, List[kv.KeyValue]]


class RequestOp(Message):
    pb_cls = rpc_pb2.RequestOp

    __slots__ = ['request_range', 'request_put', 'request_delete_range', 'request_txn']

    def __init__(
        self,
        request_range: Optional['RangeRequest'] = None,
        request_put: Optional['PutRequest'] = None,
        request_delete_range: Optional['DeleteRangeRequest'] = None,
        request_txn: Optional['TxnRequest'] = None
    ):
        self.request_range = request_range
        self.request_put = request_put
        self.request_delete_range = request_delete_range
        self.request_txn = request_txn

    @classmethod
    def get_slot_types(cls):
        return [RangeRequest, PutRequest, DeleteRangeRequest, TxnRequest]


class ResponseOp(Message):
    pb_cls = rpc_pb2.ResponseOp

    __slots__ = ['response_range', 'response_put', 'response_delete_range', 'response_txn']

    def __init__(
        self,
        response_range: Optional['RangeResponse'] = None,
        response_put: Optional['PutResponse'] = None,
        response_delete_range: Optional['DeleteRangeResponse'] = None,
        response_txn: Optional['TxnResponse'] = None
    ):
        self.response_range = response_range
        self.response_put = response_put
        self.response_delete_range = response_delete_range
        self.response_txn = response_txn

    @classmethod
    def get_slot_types(cls):
        return [RangeResponse, PutResponse, DeleteRangeResponse, TxnResponse]


class Compare(Message):
    pb_cls = rpc_pb2.Compare

    __slots__ = ['result', 'target', 'key', 'version', 'create_revision', 'mod_revision', 'value', 'lease', 'range_end']

    class CompareResult(Enum):
        EQUAL = 0
        GREATER = 1
        LESS = 2
        NOT_EQUAL = 3

    class CompareTarget(Enum):
        VERSION = 0
        CREATE = 1
        MOD = 2
        VALUE = 3
        LEASE = 4

    def __init__(
        self,
        result: 'CompareResult' = CompareResult.EQUAL,
        target: 'CompareTarget' = CompareTarget.VERSION,
        key: bytes = b'',
        version: int = 0,
        create_revision: int = 0,
        mod_revision: int = 0,
        value: bytes = b'',
        lease: int = 0,
        range_end: bytes = b''
    ):
        self.result = result
        self.target = target
        self.key = key
        self.version = version
        self.create_revision = create_revision
        self.mod_revision = mod_revision
        self.value = value
        self.lease = lease
        self.range_end = range_end

    @classmethod
    def get_slot_types(cls):
        return [cls.CompareResult, cls.CompareTarget, bytes, int, int, int, bytes, int, bytes]


class TxnRequest(Message):
    pb_cls = rpc_pb2.TxnRequest

    __slots__ = ['compare', 'success', 'failure']

    def __init__(
        self,
        compare: List['Compare'] = None,
        success: List['RequestOp'] = None,
        failure: List['RequestOp'] = None
    ):
        self.compare = [] if compare is None else compare
        self.success = [] if success is None else success
        self.failure = [] if failure is None else failure

    @classmethod
    def get_slot_types(cls):
        return [List[Compare], List[RequestOp], List[RequestOp]]


class TxnResponse(Message):
    pb_cls = rpc_pb2.TxnResponse

    __slots__ = ['header', 'succeeded', 'responses']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        succeeded: bool = False,
        responses: List['ResponseOp'] = None
    ):
        self.header = header
        self.succeeded = succeeded
        self.responses = [] if responses is None else responses

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, bool, List[ResponseOp]]


class CompactionRequest(Message):
    pb_cls = rpc_pb2.CompactionRequest

    __slots__ = ['revision', 'physical']

    def __init__(
        self,
        revision: int = 0,
        physical: bool = False
    ):
        self.revision = revision
        self.physical = physical

    @classmethod
    def get_slot_types(cls):
        return [int, bool]


class CompactionResponse(Message):
    pb_cls = rpc_pb2.CompactionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class HashRequest(Message):
    pb_cls = rpc_pb2.HashRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class HashKVRequest(Message):
    pb_cls = rpc_pb2.HashKVRequest

    __slots__ = ['revision']

    def __init__(
        self,
        revision: int = 0
    ):
        self.revision = revision

    @classmethod
    def get_slot_types(cls):
        return [int]


class HashKVResponse(Message):
    pb_cls = rpc_pb2.HashKVResponse

    __slots__ = ['header', 'hash', 'compact_revision']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        hash: int = 0,
        compact_revision: int = 0
    ):
        self.header = header
        self.hash = hash
        self.compact_revision = compact_revision

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int]


class HashResponse(Message):
    pb_cls = rpc_pb2.HashResponse

    __slots__ = ['header', 'hash']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        hash: int = 0
    ):
        self.header = header
        self.hash = hash

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int]


class SnapshotRequest(Message):
    pb_cls = rpc_pb2.SnapshotRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class SnapshotResponse(Message):
    pb_cls = rpc_pb2.SnapshotResponse

    __slots__ = ['header', 'remaining_bytes', 'blob']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        remaining_bytes: int = 0,
        blob: bytes = b''
    ):
        self.header = header
        self.remaining_bytes = remaining_bytes
        self.blob = blob

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, bytes]


class WatchRequest(Message):
    pb_cls = rpc_pb2.WatchRequest

    __slots__ = ['create_request', 'cancel_request']

    def __init__(
        self,
        create_request: Optional['WatchCreateRequest'] = None,
        cancel_request: Optional['WatchCancelRequest'] = None
    ):
        self.create_request = create_request
        self.cancel_request = cancel_request

    @classmethod
    def get_slot_types(cls):
        return [WatchCreateRequest, WatchCancelRequest]


class WatchCreateRequest(Message):
    pb_cls = rpc_pb2.WatchCreateRequest

    __slots__ = ['key', 'range_end', 'start_revision', 'progress_notify', 'filters', 'prev_kv', 'watch_id']

    class FilterType(Enum):
        NOPUT = 0
        NODELETE = 1

    def __init__(
        self,
        key: bytes = b'',
        range_end: bytes = b'',
        start_revision: int = 0,
        progress_notify: bool = False,
        filters: List['FilterType'] = None,
        prev_kv: bool = False,
        watch_id: int = 0
    ):
        self.key = key
        self.range_end = range_end
        self.start_revision = start_revision
        self.progress_notify = progress_notify
        self.filters = [] if filters is None else filters
        self.prev_kv = prev_kv
        self.watch_id = watch_id

    @classmethod
    def get_slot_types(cls):
        return [bytes, bytes, int, bool, List[cls.FilterType], bool, int]


class WatchCancelRequest(Message):
    pb_cls = rpc_pb2.WatchCancelRequest

    __slots__ = ['watch_id']

    def __init__(
        self,
        watch_id: int = 0
    ):
        self.watch_id = watch_id

    @classmethod
    def get_slot_types(cls):
        return [int]


class WatchResponse(Message):
    pb_cls = rpc_pb2.WatchResponse

    __slots__ = ['header', 'watch_id', 'created', 'canceled', 'compact_revision', 'cancel_reason', 'events']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        watch_id: int = 0,
        created: bool = False,
        canceled: bool = False,
        compact_revision: int = 0,
        cancel_reason: str = '',
        events: List['kv.Event'] = None
    ):
        self.header = header
        self.watch_id = watch_id
        self.created = created
        self.canceled = canceled
        self.compact_revision = compact_revision
        self.cancel_reason = cancel_reason
        self.events = [] if events is None else events

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, bool, bool, int, str, List[kv.Event]]


class LeaseGrantRequest(Message):
    pb_cls = rpc_pb2.LeaseGrantRequest

    __slots__ = ['TTL', 'ID']

    def __init__(
        self,
        TTL: int = 0,
        ID: int = 0
    ):
        self.TTL = TTL
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int, int]


class LeaseGrantResponse(Message):
    pb_cls = rpc_pb2.LeaseGrantResponse

    __slots__ = ['header', 'ID', 'TTL', 'error']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0,
        error: str = ''
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL
        self.error = error

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int, str]


class LeaseRevokeRequest(Message):
    pb_cls = rpc_pb2.LeaseRevokeRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseRevokeResponse(Message):
    pb_cls = rpc_pb2.LeaseRevokeResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class LeaseKeepAliveRequest(Message):
    pb_cls = rpc_pb2.LeaseKeepAliveRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseKeepAliveResponse(Message):
    pb_cls = rpc_pb2.LeaseKeepAliveResponse

    __slots__ = ['header', 'ID', 'TTL']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int]


class LeaseTimeToLiveRequest(Message):
    pb_cls = rpc_pb2.LeaseTimeToLiveRequest

    __slots__ = ['ID', 'keys']

    def __init__(
        self,
        ID: int = 0,
        keys: bool = False
    ):
        self.ID = ID
        self.keys = keys

    @classmethod
    def get_slot_types(cls):
        return [int, bool]


class LeaseTimeToLiveResponse(Message):
    pb_cls = rpc_pb2.LeaseTimeToLiveResponse

    __slots__ = ['header', 'ID', 'TTL', 'grantedTTL', 'keys']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        ID: int = 0,
        TTL: int = 0,
        grantedTTL: int = 0,
        keys: List[bytes] = None
    ):
        self.header = header
        self.ID = ID
        self.TTL = TTL
        self.grantedTTL = grantedTTL
        self.keys = [] if keys is None else keys

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, int, int, int, List[bytes]]


class LeaseLeasesRequest(Message):
    pb_cls = rpc_pb2.LeaseLeasesRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class LeaseStatus(Message):
    pb_cls = rpc_pb2.LeaseStatus

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class LeaseLeasesResponse(Message):
    pb_cls = rpc_pb2.LeaseLeasesResponse

    __slots__ = ['header', 'leases']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        leases: List['LeaseStatus'] = None
    ):
        self.header = header
        self.leases = [] if leases is None else leases

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[LeaseStatus]]


class Member(Message):
    pb_cls = rpc_pb2.Member

    __slots__ = ['ID', 'name', 'peerURLs', 'clientURLs']

    def __init__(
        self,
        ID: int = 0,
        name: str = '',
        peerURLs: List[str] = None,
        clientURLs: List[str] = None
    ):
        self.ID = ID
        self.name = name
        self.peerURLs = [] if peerURLs is None else peerURLs
        self.clientURLs = [] if clientURLs is None else clientURLs

    @classmethod
    def get_slot_types(cls):
        return [int, str, List[str], List[str]]


class MemberAddRequest(Message):
    pb_cls = rpc_pb2.MemberAddRequest

    __slots__ = ['peerURLs']

    def __init__(
        self,
        peerURLs: List[str] = None
    ):
        self.peerURLs = [] if peerURLs is None else peerURLs

    @classmethod
    def get_slot_types(cls):
        return [List[str]]


class MemberAddResponse(Message):
    pb_cls = rpc_pb2.MemberAddResponse

    __slots__ = ['header', 'member', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        member: Optional['Member'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.member = member
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, Member, List[Member]]


class MemberRemoveRequest(Message):
    pb_cls = rpc_pb2.MemberRemoveRequest

    __slots__ = ['ID']

    def __init__(
        self,
        ID: int = 0
    ):
        self.ID = ID

    @classmethod
    def get_slot_types(cls):
        return [int]


class MemberRemoveResponse(Message):
    pb_cls = rpc_pb2.MemberRemoveResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class MemberUpdateRequest(Message):
    pb_cls = rpc_pb2.MemberUpdateRequest

    __slots__ = ['ID', 'peerURLs']

    def __init__(
        self,
        ID: int = 0,
        peerURLs: List[str] = None
    ):
        self.ID = ID
        self.peerURLs = [] if peerURLs is None else peerURLs

    @classmethod
    def get_slot_types(cls):
        return [int, List[str]]


class MemberUpdateResponse(Message):
    pb_cls = rpc_pb2.MemberUpdateResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class MemberListRequest(Message):
    pb_cls = rpc_pb2.MemberListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class MemberListResponse(Message):
    pb_cls = rpc_pb2.MemberListResponse

    __slots__ = ['header', 'members']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        members: List['Member'] = None
    ):
        self.header = header
        self.members = [] if members is None else members

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[Member]]


class DefragmentRequest(Message):
    pb_cls = rpc_pb2.DefragmentRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class DefragmentResponse(Message):
    pb_cls = rpc_pb2.DefragmentResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class MoveLeaderRequest(Message):
    pb_cls = rpc_pb2.MoveLeaderRequest

    __slots__ = ['targetID']

    def __init__(
        self,
        targetID: int = 0
    ):
        self.targetID = targetID

    @classmethod
    def get_slot_types(cls):
        return [int]


class MoveLeaderResponse(Message):
    pb_cls = rpc_pb2.MoveLeaderResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AlarmRequest(Message):
    pb_cls = rpc_pb2.AlarmRequest

    __slots__ = ['action', 'memberID', 'alarm']

    class AlarmAction(Enum):
        GET = 0
        ACTIVATE = 1
        DEACTIVATE = 2

    def __init__(
        self,
        action: 'AlarmAction' = AlarmAction.GET,
        memberID: int = 0,
        alarm: 'AlarmType' = AlarmType.NONE
    ):
        self.action = action
        self.memberID = memberID
        self.alarm = alarm

    @classmethod
    def get_slot_types(cls):
        return [cls.AlarmAction, int, AlarmType]


class AlarmMember(Message):
    pb_cls = rpc_pb2.AlarmMember

    __slots__ = ['memberID', 'alarm']

    def __init__(
        self,
        memberID: int = 0,
        alarm: 'AlarmType' = AlarmType.NONE
    ):
        self.memberID = memberID
        self.alarm = alarm

    @classmethod
    def get_slot_types(cls):
        return [int, AlarmType]


class AlarmResponse(Message):
    pb_cls = rpc_pb2.AlarmResponse

    __slots__ = ['header', 'alarms']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        alarms: List['AlarmMember'] = None
    ):
        self.header = header
        self.alarms = [] if alarms is None else alarms

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[AlarmMember]]


class StatusRequest(Message):
    pb_cls = rpc_pb2.StatusRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class StatusResponse(Message):
    pb_cls = rpc_pb2.StatusResponse

    __slots__ = ['header', 'version', 'dbSize', 'leader', 'raftIndex', 'raftTerm', 'raftAppliedIndex', 'errors', 'dbSizeInUse']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        version: str = '',
        dbSize: int = 0,
        leader: int = 0,
        raftIndex: int = 0,
        raftTerm: int = 0,
        raftAppliedIndex: int = 0,
        errors: List[str] = None,
        dbSizeInUse: int = 0
    ):
        self.header = header
        self.version = version
        self.dbSize = dbSize
        self.leader = leader
        self.raftIndex = raftIndex
        self.raftTerm = raftTerm
        self.raftAppliedIndex = raftAppliedIndex
        self.errors = [] if errors is None else errors
        self.dbSizeInUse = dbSizeInUse

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, str, int, int, int, int, int, List[str], int]


class AuthEnableRequest(Message):
    pb_cls = rpc_pb2.AuthEnableRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthDisableRequest(Message):
    pb_cls = rpc_pb2.AuthDisableRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthenticateRequest(Message):
    pb_cls = rpc_pb2.AuthenticateRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserAddRequest(Message):
    pb_cls = rpc_pb2.AuthUserAddRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserGetRequest(Message):
    pb_cls = rpc_pb2.AuthUserGetRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserDeleteRequest(Message):
    pb_cls = rpc_pb2.AuthUserDeleteRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserChangePasswordRequest(Message):
    pb_cls = rpc_pb2.AuthUserChangePasswordRequest

    __slots__ = ['name', 'password']

    def __init__(
        self,
        name: str = '',
        password: str = ''
    ):
        self.name = name
        self.password = password

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserGrantRoleRequest(Message):
    pb_cls = rpc_pb2.AuthUserGrantRoleRequest

    __slots__ = ['user', 'role']

    def __init__(
        self,
        user: str = '',
        role: str = ''
    ):
        self.user = user
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthUserRevokeRoleRequest(Message):
    pb_cls = rpc_pb2.AuthUserRevokeRoleRequest

    __slots__ = ['name', 'role']

    def __init__(
        self,
        name: str = '',
        role: str = ''
    ):
        self.name = name
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str, str]


class AuthRoleAddRequest(Message):
    pb_cls = rpc_pb2.AuthRoleAddRequest

    __slots__ = ['name']

    def __init__(
        self,
        name: str = ''
    ):
        self.name = name

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthRoleGetRequest(Message):
    pb_cls = rpc_pb2.AuthRoleGetRequest

    __slots__ = ['role']

    def __init__(
        self,
        role: str = ''
    ):
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthUserListRequest(Message):
    pb_cls = rpc_pb2.AuthUserListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthRoleListRequest(Message):
    pb_cls = rpc_pb2.AuthRoleListRequest

    __slots__ = []

    def __init__(
        self
    ):
        pass

    @classmethod
    def get_slot_types(cls):
        return []


class AuthRoleDeleteRequest(Message):
    pb_cls = rpc_pb2.AuthRoleDeleteRequest

    __slots__ = ['role']

    def __init__(
        self,
        role: str = ''
    ):
        self.role = role

    @classmethod
    def get_slot_types(cls):
        return [str]


class AuthRoleGrantPermissionRequest(Message):
    pb_cls = rpc_pb2.AuthRoleGrantPermissionRequest

    __slots__ = ['name', 'perm']

    def __init__(
        self,
        name: str = '',
        perm: Optional['auth.Permission'] = None
    ):
        self.name = name
        self.perm = perm

    @classmethod
    def get_slot_types(cls):
        return [str, auth.Permission]


class AuthRoleRevokePermissionRequest(Message):
    pb_cls = rpc_pb2.AuthRoleRevokePermissionRequest

    __slots__ = ['role', 'key', 'range_end']

    def __init__(
        self,
        role: str = '',
        key: str = '',
        range_end: str = ''
    ):
        self.role = role
        self.key = key
        self.range_end = range_end

    @classmethod
    def get_slot_types(cls):
        return [str, str, str]


class AuthEnableResponse(Message):
    pb_cls = rpc_pb2.AuthEnableResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthDisableResponse(Message):
    pb_cls = rpc_pb2.AuthDisableResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthenticateResponse(Message):
    pb_cls = rpc_pb2.AuthenticateResponse

    __slots__ = ['header', 'token']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        token: str = ''
    ):
        self.header = header
        self.token = token

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, str]


class AuthUserAddResponse(Message):
    pb_cls = rpc_pb2.AuthUserAddResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserGetResponse(Message):
    pb_cls = rpc_pb2.AuthUserGetResponse

    __slots__ = ['header', 'roles']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        roles: List[str] = None
    ):
        self.header = header
        self.roles = [] if roles is None else roles

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthUserDeleteResponse(Message):
    pb_cls = rpc_pb2.AuthUserDeleteResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserChangePasswordResponse(Message):
    pb_cls = rpc_pb2.AuthUserChangePasswordResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserGrantRoleResponse(Message):
    pb_cls = rpc_pb2.AuthUserGrantRoleResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthUserRevokeRoleResponse(Message):
    pb_cls = rpc_pb2.AuthUserRevokeRoleResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleAddResponse(Message):
    pb_cls = rpc_pb2.AuthRoleAddResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleGetResponse(Message):
    pb_cls = rpc_pb2.AuthRoleGetResponse

    __slots__ = ['header', 'perm']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        perm: List['auth.Permission'] = None
    ):
        self.header = header
        self.perm = [] if perm is None else perm

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[auth.Permission]]


class AuthRoleListResponse(Message):
    pb_cls = rpc_pb2.AuthRoleListResponse

    __slots__ = ['header', 'roles']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        roles: List[str] = None
    ):
        self.header = header
        self.roles = [] if roles is None else roles

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthUserListResponse(Message):
    pb_cls = rpc_pb2.AuthUserListResponse

    __slots__ = ['header', 'users']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None,
        users: List[str] = None
    ):
        self.header = header
        self.users = [] if users is None else users

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader, List[str]]


class AuthRoleDeleteResponse(Message):
    pb_cls = rpc_pb2.AuthRoleDeleteResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleGrantPermissionResponse(Message):
    pb_cls = rpc_pb2.AuthRoleGrantPermissionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


class AuthRoleRevokePermissionResponse(Message):
    pb_cls = rpc_pb2.AuthRoleRevokePermissionResponse

    __slots__ = ['header']

    def __init__(
        self,
        header: Optional['ResponseHeader'] = None
    ):
        self.header = header

    @classmethod
    def get_slot_types(cls):
        return [ResponseHeader]


# Services


class KV(Service):
    stub_cls = KVStub

    def Range(self, arg: 'RangeRequest') -> 'RangeResponse':
        return RangeResponse.from_pb(self.stub.Range(arg.to_pb()))

    def Put(self, arg: 'PutRequest') -> 'PutResponse':
        return PutResponse.from_pb(self.stub.Put(arg.to_pb()))

    def DeleteRange(self, arg: 'DeleteRangeRequest') -> 'DeleteRangeResponse':
        return DeleteRangeResponse.from_pb(self.stub.DeleteRange(arg.to_pb()))

    def Txn(self, arg: 'TxnRequest') -> 'TxnResponse':
        return TxnResponse.from_pb(self.stub.Txn(arg.to_pb()))

    def Compact(self, arg: 'CompactionRequest') -> 'CompactionResponse':
        return CompactionResponse.from_pb(self.stub.Compact(arg.to_pb()))


class Watch(Service):
    stub_cls = WatchStub

    def Watch(self, arg: 'Iterable[WatchRequest]') -> 'Iterable[WatchResponse]':
        return (WatchResponse.from_pb(x) for x in self.stub.Watch((x.to_pb() for x in arg)))


class Lease(Service):
    stub_cls = LeaseStub

    def LeaseGrant(self, arg: 'LeaseGrantRequest') -> 'LeaseGrantResponse':
        return LeaseGrantResponse.from_pb(self.stub.LeaseGrant(arg.to_pb()))

    def LeaseRevoke(self, arg: 'LeaseRevokeRequest') -> 'LeaseRevokeResponse':
        return LeaseRevokeResponse.from_pb(self.stub.LeaseRevoke(arg.to_pb()))

    def LeaseKeepAlive(self, arg: 'Iterable[LeaseKeepAliveRequest]') -> 'Iterable[LeaseKeepAliveResponse]':
        return (LeaseKeepAliveResponse.from_pb(x) for x in self.stub.LeaseKeepAlive((x.to_pb() for x in arg)))

    def LeaseTimeToLive(self, arg: 'LeaseTimeToLiveRequest') -> 'LeaseTimeToLiveResponse':
        return LeaseTimeToLiveResponse.from_pb(self.stub.LeaseTimeToLive(arg.to_pb()))

    def LeaseLeases(self, arg: 'LeaseLeasesRequest') -> 'LeaseLeasesResponse':
        return LeaseLeasesResponse.from_pb(self.stub.LeaseLeases(arg.to_pb()))


class Cluster(Service):
    stub_cls = ClusterStub

    def MemberAdd(self, arg: 'MemberAddRequest') -> 'MemberAddResponse':
        return MemberAddResponse.from_pb(self.stub.MemberAdd(arg.to_pb()))

    def MemberRemove(self, arg: 'MemberRemoveRequest') -> 'MemberRemoveResponse':
        return MemberRemoveResponse.from_pb(self.stub.MemberRemove(arg.to_pb()))

    def MemberUpdate(self, arg: 'MemberUpdateRequest') -> 'MemberUpdateResponse':
        return MemberUpdateResponse.from_pb(self.stub.MemberUpdate(arg.to_pb()))

    def MemberList(self, arg: 'MemberListRequest') -> 'MemberListResponse':
        return MemberListResponse.from_pb(self.stub.MemberList(arg.to_pb()))


class Maintenance(Service):
    stub_cls = MaintenanceStub

    def Alarm(self, arg: 'AlarmRequest') -> 'AlarmResponse':
        return AlarmResponse.from_pb(self.stub.Alarm(arg.to_pb()))

    def Status(self, arg: 'StatusRequest') -> 'StatusResponse':
        return StatusResponse.from_pb(self.stub.Status(arg.to_pb()))

    def Defragment(self, arg: 'DefragmentRequest') -> 'DefragmentResponse':
        return DefragmentResponse.from_pb(self.stub.Defragment(arg.to_pb()))

    def Hash(self, arg: 'HashRequest') -> 'HashResponse':
        return HashResponse.from_pb(self.stub.Hash(arg.to_pb()))

    def HashKV(self, arg: 'HashKVRequest') -> 'HashKVResponse':
        return HashKVResponse.from_pb(self.stub.HashKV(arg.to_pb()))

    def Snapshot(self, arg: 'SnapshotRequest') -> 'Iterable[SnapshotResponse]':
        return (SnapshotResponse.from_pb(x) for x in self.stub.Snapshot(arg.to_pb()))

    def MoveLeader(self, arg: 'MoveLeaderRequest') -> 'MoveLeaderResponse':
        return MoveLeaderResponse.from_pb(self.stub.MoveLeader(arg.to_pb()))


class Auth(Service):
    stub_cls = AuthStub

    def AuthEnable(self, arg: 'AuthEnableRequest') -> 'AuthEnableResponse':
        return AuthEnableResponse.from_pb(self.stub.AuthEnable(arg.to_pb()))

    def AuthDisable(self, arg: 'AuthDisableRequest') -> 'AuthDisableResponse':
        return AuthDisableResponse.from_pb(self.stub.AuthDisable(arg.to_pb()))

    def Authenticate(self, arg: 'AuthenticateRequest') -> 'AuthenticateResponse':
        return AuthenticateResponse.from_pb(self.stub.Authenticate(arg.to_pb()))

    def UserAdd(self, arg: 'AuthUserAddRequest') -> 'AuthUserAddResponse':
        return AuthUserAddResponse.from_pb(self.stub.UserAdd(arg.to_pb()))

    def UserGet(self, arg: 'AuthUserGetRequest') -> 'AuthUserGetResponse':
        return AuthUserGetResponse.from_pb(self.stub.UserGet(arg.to_pb()))

    def UserList(self, arg: 'AuthUserListRequest') -> 'AuthUserListResponse':
        return AuthUserListResponse.from_pb(self.stub.UserList(arg.to_pb()))

    def UserDelete(self, arg: 'AuthUserDeleteRequest') -> 'AuthUserDeleteResponse':
        return AuthUserDeleteResponse.from_pb(self.stub.UserDelete(arg.to_pb()))

    def UserChangePassword(self, arg: 'AuthUserChangePasswordRequest') -> 'AuthUserChangePasswordResponse':
        return AuthUserChangePasswordResponse.from_pb(self.stub.UserChangePassword(arg.to_pb()))

    def UserGrantRole(self, arg: 'AuthUserGrantRoleRequest') -> 'AuthUserGrantRoleResponse':
        return AuthUserGrantRoleResponse.from_pb(self.stub.UserGrantRole(arg.to_pb()))

    def UserRevokeRole(self, arg: 'AuthUserRevokeRoleRequest') -> 'AuthUserRevokeRoleResponse':
        return AuthUserRevokeRoleResponse.from_pb(self.stub.UserRevokeRole(arg.to_pb()))

    def RoleAdd(self, arg: 'AuthRoleAddRequest') -> 'AuthRoleAddResponse':
        return AuthRoleAddResponse.from_pb(self.stub.RoleAdd(arg.to_pb()))

    def RoleGet(self, arg: 'AuthRoleGetRequest') -> 'AuthRoleGetResponse':
        return AuthRoleGetResponse.from_pb(self.stub.RoleGet(arg.to_pb()))

    def RoleList(self, arg: 'AuthRoleListRequest') -> 'AuthRoleListResponse':
        return AuthRoleListResponse.from_pb(self.stub.RoleList(arg.to_pb()))

    def RoleDelete(self, arg: 'AuthRoleDeleteRequest') -> 'AuthRoleDeleteResponse':
        return AuthRoleDeleteResponse.from_pb(self.stub.RoleDelete(arg.to_pb()))

    def RoleGrantPermission(self, arg: 'AuthRoleGrantPermissionRequest') -> 'AuthRoleGrantPermissionResponse':
        return AuthRoleGrantPermissionResponse.from_pb(self.stub.RoleGrantPermission(arg.to_pb()))

    def RoleRevokePermission(self, arg: 'AuthRoleRevokePermissionRequest') -> 'AuthRoleRevokePermissionResponse':
        return AuthRoleRevokePermissionResponse.from_pb(self.stub.RoleRevokePermission(arg.to_pb()))

# AUTOGENERATED # Enums # Messages # Services