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

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

import betterproto
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
import grpclib
from betterproto.grpc.grpclib_server import ServiceBase


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


@dataclass(eq=False, repr=False)
class Input(betterproto.Message):
    pass


class TestStub(betterproto.ServiceStub):
    async def get_double(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.DoubleValue":
        return await self._unary_unary(
            "/googletypes_response.Test/GetDouble",
            input,
            betterproto_lib_google_protobuf.DoubleValue,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_float(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.FloatValue":
        return await self._unary_unary(
            "/googletypes_response.Test/GetFloat",
            input,
            betterproto_lib_google_protobuf.FloatValue,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_int64(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.Int64Value":
        return await self._unary_unary(
            "/googletypes_response.Test/GetInt64",
            input,
            betterproto_lib_google_protobuf.Int64Value,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_u_int64(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.UInt64Value":
        return await self._unary_unary(
            "/googletypes_response.Test/GetUInt64",
            input,
            betterproto_lib_google_protobuf.UInt64Value,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_int32(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.Int32Value":
        return await self._unary_unary(
            "/googletypes_response.Test/GetInt32",
            input,
            betterproto_lib_google_protobuf.Int32Value,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_u_int32(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.UInt32Value":
        return await self._unary_unary(
            "/googletypes_response.Test/GetUInt32",
            input,
            betterproto_lib_google_protobuf.UInt32Value,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_bool(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.BoolValue":
        return await self._unary_unary(
            "/googletypes_response.Test/GetBool",
            input,
            betterproto_lib_google_protobuf.BoolValue,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_string(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.StringValue":
        return await self._unary_unary(
            "/googletypes_response.Test/GetString",
            input,
            betterproto_lib_google_protobuf.StringValue,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_bytes(
        self,
        input: "Input",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "betterproto_lib_google_protobuf.BytesValue":
        return await self._unary_unary(
            "/googletypes_response.Test/GetBytes",
            input,
            betterproto_lib_google_protobuf.BytesValue,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )


class TestBase(ServiceBase):
    async def get_double(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.DoubleValue":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_float(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.FloatValue":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_int64(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.Int64Value":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_u_int64(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.UInt64Value":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_int32(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.Int32Value":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_u_int32(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.UInt32Value":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_bool(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.BoolValue":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_string(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.StringValue":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_bytes(
        self, input: "Input"
    ) -> "betterproto_lib_google_protobuf.BytesValue":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def __rpc_get_double(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.DoubleValue]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_double(request)
        await stream.send_message(response)

    async def __rpc_get_float(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.FloatValue]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_float(request)
        await stream.send_message(response)

    async def __rpc_get_int64(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.Int64Value]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_int64(request)
        await stream.send_message(response)

    async def __rpc_get_u_int64(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.UInt64Value]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_u_int64(request)
        await stream.send_message(response)

    async def __rpc_get_int32(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.Int32Value]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_int32(request)
        await stream.send_message(response)

    async def __rpc_get_u_int32(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.UInt32Value]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_u_int32(request)
        await stream.send_message(response)

    async def __rpc_get_bool(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.BoolValue]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_bool(request)
        await stream.send_message(response)

    async def __rpc_get_string(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.StringValue]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_string(request)
        await stream.send_message(response)

    async def __rpc_get_bytes(
        self,
        stream: "grpclib.server.Stream[Input, betterproto_lib_google_protobuf.BytesValue]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_bytes(request)
        await stream.send_message(response)

    def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
        return {
            "/googletypes_response.Test/GetDouble": grpclib.const.Handler(
                self.__rpc_get_double,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.DoubleValue,
            ),
            "/googletypes_response.Test/GetFloat": grpclib.const.Handler(
                self.__rpc_get_float,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.FloatValue,
            ),
            "/googletypes_response.Test/GetInt64": grpclib.const.Handler(
                self.__rpc_get_int64,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.Int64Value,
            ),
            "/googletypes_response.Test/GetUInt64": grpclib.const.Handler(
                self.__rpc_get_u_int64,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.UInt64Value,
            ),
            "/googletypes_response.Test/GetInt32": grpclib.const.Handler(
                self.__rpc_get_int32,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.Int32Value,
            ),
            "/googletypes_response.Test/GetUInt32": grpclib.const.Handler(
                self.__rpc_get_u_int32,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.UInt32Value,
            ),
            "/googletypes_response.Test/GetBool": grpclib.const.Handler(
                self.__rpc_get_bool,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.BoolValue,
            ),
            "/googletypes_response.Test/GetString": grpclib.const.Handler(
                self.__rpc_get_string,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.StringValue,
            ),
            "/googletypes_response.Test/GetBytes": grpclib.const.Handler(
                self.__rpc_get_bytes,
                grpclib.const.Cardinality.UNARY_UNARY,
                Input,
                betterproto_lib_google_protobuf.BytesValue,
            ),
        }
