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

__all__ = (
    "Input",
    "TestStub",
    "TestBase",
)


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

import grpclib

import betterproto
from betterproto.grpc.grpclib_server import ServiceBase


if TYPE_CHECKING:
    import grpclib.server
    from grpclib.metadata import Deadline

    from betterproto.grpc.grpclib_client import MetadataLike


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

    pass


class TestStub(betterproto.ServiceStub):
    """Tests that google types can be used as params"""

    async def send_double(
        self,
        betterproto_lib_google_protobuf_double_value: "betterproto_lib_google_protobuf.DoubleValue",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendDouble",
            betterproto_lib_google_protobuf_double_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_float(
        self,
        betterproto_lib_google_protobuf_float_value: "betterproto_lib_google_protobuf.FloatValue",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendFloat",
            betterproto_lib_google_protobuf_float_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_int64(
        self,
        betterproto_lib_google_protobuf_int64_value: "betterproto_lib_google_protobuf.Int64Value",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendInt64",
            betterproto_lib_google_protobuf_int64_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_u_int64(
        self,
        betterproto_lib_google_protobuf_u_int64_value: "betterproto_lib_google_protobuf.UInt64Value",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendUInt64",
            betterproto_lib_google_protobuf_u_int64_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_int32(
        self,
        betterproto_lib_google_protobuf_int32_value: "betterproto_lib_google_protobuf.Int32Value",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendInt32",
            betterproto_lib_google_protobuf_int32_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_u_int32(
        self,
        betterproto_lib_google_protobuf_u_int32_value: "betterproto_lib_google_protobuf.UInt32Value",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendUInt32",
            betterproto_lib_google_protobuf_u_int32_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_bool(
        self,
        betterproto_lib_google_protobuf_bool_value: "betterproto_lib_google_protobuf.BoolValue",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendBool",
            betterproto_lib_google_protobuf_bool_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_string(
        self,
        betterproto_lib_google_protobuf_string_value: "betterproto_lib_google_protobuf.StringValue",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendString",
            betterproto_lib_google_protobuf_string_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_bytes(
        self,
        betterproto_lib_google_protobuf_bytes_value: "betterproto_lib_google_protobuf.BytesValue",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendBytes",
            betterproto_lib_google_protobuf_bytes_value,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_datetime(
        self,
        betterproto_lib_google_protobuf_timestamp: "betterproto_lib_google_protobuf.Timestamp",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendDatetime",
            betterproto_lib_google_protobuf_timestamp,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_timedelta(
        self,
        betterproto_lib_google_protobuf_duration: "betterproto_lib_google_protobuf.Duration",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendTimedelta",
            betterproto_lib_google_protobuf_duration,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def send_empty(
        self,
        betterproto_lib_google_protobuf_empty: "betterproto_lib_google_protobuf.Empty",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "Input":
        """ """

        return await self._unary_unary(
            "/googletypes_request.Test/SendEmpty",
            betterproto_lib_google_protobuf_empty,
            Input,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )


import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf


class TestBase(ServiceBase):
    """Tests that google types can be used as params"""

    async def send_double(
        self,
        betterproto_lib_google_protobuf_double_value: "betterproto_lib_google_protobuf.DoubleValue",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_float(
        self,
        betterproto_lib_google_protobuf_float_value: "betterproto_lib_google_protobuf.FloatValue",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_int64(
        self,
        betterproto_lib_google_protobuf_int64_value: "betterproto_lib_google_protobuf.Int64Value",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_u_int64(
        self,
        betterproto_lib_google_protobuf_u_int64_value: "betterproto_lib_google_protobuf.UInt64Value",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_int32(
        self,
        betterproto_lib_google_protobuf_int32_value: "betterproto_lib_google_protobuf.Int32Value",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_u_int32(
        self,
        betterproto_lib_google_protobuf_u_int32_value: "betterproto_lib_google_protobuf.UInt32Value",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_bool(
        self,
        betterproto_lib_google_protobuf_bool_value: "betterproto_lib_google_protobuf.BoolValue",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_string(
        self,
        betterproto_lib_google_protobuf_string_value: "betterproto_lib_google_protobuf.StringValue",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_bytes(
        self,
        betterproto_lib_google_protobuf_bytes_value: "betterproto_lib_google_protobuf.BytesValue",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_datetime(
        self,
        betterproto_lib_google_protobuf_timestamp: "betterproto_lib_google_protobuf.Timestamp",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_timedelta(
        self,
        betterproto_lib_google_protobuf_duration: "betterproto_lib_google_protobuf.Duration",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def send_empty(
        self,
        betterproto_lib_google_protobuf_empty: "betterproto_lib_google_protobuf.Empty",
    ) -> "Input":
        """ """

        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

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

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

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

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

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

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

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

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

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

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

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

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

    def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
        return {
            "/googletypes_request.Test/SendDouble": grpclib.const.Handler(
                self.__rpc_send_double,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.DoubleValue,
                Input,
            ),
            "/googletypes_request.Test/SendFloat": grpclib.const.Handler(
                self.__rpc_send_float,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.FloatValue,
                Input,
            ),
            "/googletypes_request.Test/SendInt64": grpclib.const.Handler(
                self.__rpc_send_int64,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.Int64Value,
                Input,
            ),
            "/googletypes_request.Test/SendUInt64": grpclib.const.Handler(
                self.__rpc_send_u_int64,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.UInt64Value,
                Input,
            ),
            "/googletypes_request.Test/SendInt32": grpclib.const.Handler(
                self.__rpc_send_int32,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.Int32Value,
                Input,
            ),
            "/googletypes_request.Test/SendUInt32": grpclib.const.Handler(
                self.__rpc_send_u_int32,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.UInt32Value,
                Input,
            ),
            "/googletypes_request.Test/SendBool": grpclib.const.Handler(
                self.__rpc_send_bool,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.BoolValue,
                Input,
            ),
            "/googletypes_request.Test/SendString": grpclib.const.Handler(
                self.__rpc_send_string,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.StringValue,
                Input,
            ),
            "/googletypes_request.Test/SendBytes": grpclib.const.Handler(
                self.__rpc_send_bytes,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.BytesValue,
                Input,
            ),
            "/googletypes_request.Test/SendDatetime": grpclib.const.Handler(
                self.__rpc_send_datetime,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.Timestamp,
                Input,
            ),
            "/googletypes_request.Test/SendTimedelta": grpclib.const.Handler(
                self.__rpc_send_timedelta,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.Duration,
                Input,
            ),
            "/googletypes_request.Test/SendEmpty": grpclib.const.Handler(
                self.__rpc_send_empty,
                grpclib.const.Cardinality.UNARY_UNARY,
                betterproto_lib_google_protobuf.Empty,
                Input,
            ),
        }
