# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import sideinput_pb2 as sideinput__pb2


class SideInputStub(object):
    """SideInput is the gRPC service for user-defined Side Inputs.
    It is used to propagate changes in the values of the provided Side Inputs
    which allows access to slow updated data or configuration without needing to retrieve
    it during each message processing.
    Through this service we should should be able to:-
    1) Invoke retrieval request for a single Side Input parameter, which in turn should
    check for updates and return its latest value.
    2) Provide a health check endpoint to indicate whether the service is ready to be used.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.RetrieveSideInput = channel.unary_unary(
            "/sideinput.v1.SideInput/RetrieveSideInput",
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=sideinput__pb2.SideInputResponse.FromString,
        )
        self.IsReady = channel.unary_unary(
            "/sideinput.v1.SideInput/IsReady",
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=sideinput__pb2.ReadyResponse.FromString,
        )


class SideInputServicer(object):
    """SideInput is the gRPC service for user-defined Side Inputs.
    It is used to propagate changes in the values of the provided Side Inputs
    which allows access to slow updated data or configuration without needing to retrieve
    it during each message processing.
    Through this service we should should be able to:-
    1) Invoke retrieval request for a single Side Input parameter, which in turn should
    check for updates and return its latest value.
    2) Provide a health check endpoint to indicate whether the service is ready to be used.
    """

    def RetrieveSideInput(self, request, context):
        """RetrieveSideInput is the endpoint to retrieve the latest value of a given Side Input."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def IsReady(self, request, context):
        """IsReady is the health check endpoint to indicate whether the service is ready to be used."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_SideInputServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "RetrieveSideInput": grpc.unary_unary_rpc_method_handler(
            servicer.RetrieveSideInput,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=sideinput__pb2.SideInputResponse.SerializeToString,
        ),
        "IsReady": grpc.unary_unary_rpc_method_handler(
            servicer.IsReady,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=sideinput__pb2.ReadyResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "sideinput.v1.SideInput", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class SideInput(object):
    """SideInput is the gRPC service for user-defined Side Inputs.
    It is used to propagate changes in the values of the provided Side Inputs
    which allows access to slow updated data or configuration without needing to retrieve
    it during each message processing.
    Through this service we should should be able to:-
    1) Invoke retrieval request for a single Side Input parameter, which in turn should
    check for updates and return its latest value.
    2) Provide a health check endpoint to indicate whether the service is ready to be used.
    """

    @staticmethod
    def RetrieveSideInput(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/sideinput.v1.SideInput/RetrieveSideInput",
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            sideinput__pb2.SideInputResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def IsReady(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/sideinput.v1.SideInput/IsReady",
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            sideinput__pb2.ReadyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
