# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
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,))


 # This class is part of an EXPERIMENTAL API.
class ExternalPluginService(object):
    """ExternalPluginService defines an RPC Service that allows propeller to send the request to the backend plugin server.
    """

    @staticmethod
    def CreateTask(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.ExternalPluginService/CreateTask',
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateRequest.SerializeToString,
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskCreateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetTask(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.ExternalPluginService/GetTask',
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetRequest.SerializeToString,
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskGetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteTask(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.ExternalPluginService/DeleteTask',
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteRequest.SerializeToString,
            flyteidl_dot_service_dot_external__plugin__service__pb2.TaskDeleteResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
