# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: map.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from typing import (
    TYPE_CHECKING,
    Dict,
    List,
    Optional,
)

import betterproto
import grpc
from betterproto.grpcstub.grpcio_client import SyncServiceStub
from betterproto.grpcstub.grpclib_server import ServiceBase


if TYPE_CHECKING:
    import grpclib.server
    from betterproto.grpcstub.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline


@dataclass(eq=False, repr=False)
class MapSetRequest(betterproto.Message):
    name: str = betterproto.string_field(1)
    key: str = betterproto.string_field(2)
    value: bytes = betterproto.bytes_field(3)
    ttl: int = betterproto.int64_field(4)


@dataclass(eq=False, repr=False)
class MapSetResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class MapGetRequest(betterproto.Message):
    name: str = betterproto.string_field(1)
    key: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class MapGetResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    value: bytes = betterproto.bytes_field(2)


@dataclass(eq=False, repr=False)
class MapDeleteRequest(betterproto.Message):
    name: str = betterproto.string_field(1)
    key: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class MapDeleteResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)


@dataclass(eq=False, repr=False)
class MapCountRequest(betterproto.Message):
    name: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class MapCountResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    count: int = betterproto.uint32_field(2)


@dataclass(eq=False, repr=False)
class MapKeysRequest(betterproto.Message):
    name: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class MapKeysResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    keys: List[str] = betterproto.string_field(2)


class MapServiceStub(SyncServiceStub):
    def map_set(self, map_set_request: "MapSetRequest") -> "MapSetResponse":
        return self._unary_unary(
            "/map.MapService/MapSet",
            MapSetRequest,
            MapSetResponse,
        )(map_set_request)

    def map_get(self, map_get_request: "MapGetRequest") -> "MapGetResponse":
        return self._unary_unary(
            "/map.MapService/MapGet",
            MapGetRequest,
            MapGetResponse,
        )(map_get_request)

    def map_delete(self, map_delete_request: "MapDeleteRequest") -> "MapDeleteResponse":
        return self._unary_unary(
            "/map.MapService/MapDelete",
            MapDeleteRequest,
            MapDeleteResponse,
        )(map_delete_request)

    def map_count(self, map_count_request: "MapCountRequest") -> "MapCountResponse":
        return self._unary_unary(
            "/map.MapService/MapCount",
            MapCountRequest,
            MapCountResponse,
        )(map_count_request)

    def map_keys(self, map_keys_request: "MapKeysRequest") -> "MapKeysResponse":
        return self._unary_unary(
            "/map.MapService/MapKeys",
            MapKeysRequest,
            MapKeysResponse,
        )(map_keys_request)
