# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
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,))
