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

from flyteidl.admin import signal_pb2 as flyteidl_dot_admin_dot_signal__pb2


class SignalServiceStub(object):
    """SignalService defines an RPC Service that may create, update, and retrieve signal(s).
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetOrCreateSignal = channel.unary_unary(
                '/flyteidl.service.SignalService/GetOrCreateSignal',
                request_serializer=flyteidl_dot_admin_dot_signal__pb2.SignalGetOrCreateRequest.SerializeToString,
                response_deserializer=flyteidl_dot_admin_dot_signal__pb2.Signal.FromString,
                )
        self.ListSignals = channel.unary_unary(
                '/flyteidl.service.SignalService/ListSignals',
                request_serializer=flyteidl_dot_admin_dot_signal__pb2.SignalListRequest.SerializeToString,
                response_deserializer=flyteidl_dot_admin_dot_signal__pb2.SignalList.FromString,
                )
        self.SetSignal = channel.unary_unary(
                '/flyteidl.service.SignalService/SetSignal',
                request_serializer=flyteidl_dot_admin_dot_signal__pb2.SignalSetRequest.SerializeToString,
                response_deserializer=flyteidl_dot_admin_dot_signal__pb2.SignalSetResponse.FromString,
                )


class SignalServiceServicer(object):
    """SignalService defines an RPC Service that may create, update, and retrieve signal(s).
    """

    def GetOrCreateSignal(self, request, context):
        """Fetches or creates a :ref:`ref_flyteidl.admin.Signal`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListSignals(self, request, context):
        """Fetch a list of :ref:`ref_flyteidl.admin.Signal` definitions.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetSignal(self, request, context):
        """Sets the value on a :ref:`ref_flyteidl.admin.Signal` definition
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SignalServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetOrCreateSignal': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOrCreateSignal,
                    request_deserializer=flyteidl_dot_admin_dot_signal__pb2.SignalGetOrCreateRequest.FromString,
                    response_serializer=flyteidl_dot_admin_dot_signal__pb2.Signal.SerializeToString,
            ),
            'ListSignals': grpc.unary_unary_rpc_method_handler(
                    servicer.ListSignals,
                    request_deserializer=flyteidl_dot_admin_dot_signal__pb2.SignalListRequest.FromString,
                    response_serializer=flyteidl_dot_admin_dot_signal__pb2.SignalList.SerializeToString,
            ),
            'SetSignal': grpc.unary_unary_rpc_method_handler(
                    servicer.SetSignal,
                    request_deserializer=flyteidl_dot_admin_dot_signal__pb2.SignalSetRequest.FromString,
                    response_serializer=flyteidl_dot_admin_dot_signal__pb2.SignalSetResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'flyteidl.service.SignalService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SignalService(object):
    """SignalService defines an RPC Service that may create, update, and retrieve signal(s).
    """

    @staticmethod
    def GetOrCreateSignal(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, '/flyteidl.service.SignalService/GetOrCreateSignal',
            flyteidl_dot_admin_dot_signal__pb2.SignalGetOrCreateRequest.SerializeToString,
            flyteidl_dot_admin_dot_signal__pb2.Signal.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListSignals(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, '/flyteidl.service.SignalService/ListSignals',
            flyteidl_dot_admin_dot_signal__pb2.SignalListRequest.SerializeToString,
            flyteidl_dot_admin_dot_signal__pb2.SignalList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetSignal(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, '/flyteidl.service.SignalService/SetSignal',
            flyteidl_dot_admin_dot_signal__pb2.SignalSetRequest.SerializeToString,
            flyteidl_dot_admin_dot_signal__pb2.SignalSetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
