# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from flyteidl.service import external_plugin_service_pb2 as flyteidl_dot_service_dot_external__plugin__service__pb2


class ExternalPluginServiceStub(object):
  """ExternalPluginService defines an RPC Service that allows propeller to send the request to the backend plugin server.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.CreateTask = channel.unary_unary(
        '/flyteidl.service.ExternalPluginService/CreateTask',
        request_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateRequest.SerializeToString,
        response_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateResponse.FromString,
        )
    self.GetTask = channel.unary_unary(
        '/flyteidl.service.ExternalPluginService/GetTask',
        request_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetRequest.SerializeToString,
        response_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetResponse.FromString,
        )
    self.DeleteTask = channel.unary_unary(
        '/flyteidl.service.ExternalPluginService/DeleteTask',
        request_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteRequest.SerializeToString,
        response_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteResponse.FromString,
        )


class ExternalPluginServiceServicer(object):
  """ExternalPluginService defines an RPC Service that allows propeller to send the request to the backend plugin server.
  """

  def CreateTask(self, request, context):
    """Send a task create request to the backend plugin server.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetTask(self, request, context):
    """Get job status.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DeleteTask(self, request, context):
    """Delete the task resource.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ExternalPluginServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'CreateTask': grpc.unary_unary_rpc_method_handler(
          servicer.CreateTask,
          request_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateRequest.FromString,
          response_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateResponse.SerializeToString,
      ),
      'GetTask': grpc.unary_unary_rpc_method_handler(
          servicer.GetTask,
          request_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetRequest.FromString,
          response_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetResponse.SerializeToString,
      ),
      'DeleteTask': grpc.unary_unary_rpc_method_handler(
          servicer.DeleteTask,
          request_deserializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteRequest.FromString,
          response_serializer=flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'flyteidl.service.ExternalPluginService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
