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

from ..common import agent_common_pb2 as agent__common__pb2


class AgentStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateTask = channel.stream_unary(
                '/armonik.api.grpc.v1.agent.Agent/CreateTask',
                request_serializer=agent__common__pb2.CreateTaskRequest.SerializeToString,
                response_deserializer=agent__common__pb2.CreateTaskReply.FromString,
                )
        self.CreateResultsMetaData = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/CreateResultsMetaData',
                request_serializer=agent__common__pb2.CreateResultsMetaDataRequest.SerializeToString,
                response_deserializer=agent__common__pb2.CreateResultsMetaDataResponse.FromString,
                )
        self.CreateResults = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/CreateResults',
                request_serializer=agent__common__pb2.CreateResultsRequest.SerializeToString,
                response_deserializer=agent__common__pb2.CreateResultsResponse.FromString,
                )
        self.NotifyResultData = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/NotifyResultData',
                request_serializer=agent__common__pb2.NotifyResultDataRequest.SerializeToString,
                response_deserializer=agent__common__pb2.NotifyResultDataResponse.FromString,
                )
        self.SubmitTasks = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/SubmitTasks',
                request_serializer=agent__common__pb2.SubmitTasksRequest.SerializeToString,
                response_deserializer=agent__common__pb2.SubmitTasksResponse.FromString,
                )
        self.GetResourceData = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/GetResourceData',
                request_serializer=agent__common__pb2.DataRequest.SerializeToString,
                response_deserializer=agent__common__pb2.DataResponse.FromString,
                )
        self.GetCommonData = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/GetCommonData',
                request_serializer=agent__common__pb2.DataRequest.SerializeToString,
                response_deserializer=agent__common__pb2.DataResponse.FromString,
                )
        self.GetDirectData = channel.unary_unary(
                '/armonik.api.grpc.v1.agent.Agent/GetDirectData',
                request_serializer=agent__common__pb2.DataRequest.SerializeToString,
                response_deserializer=agent__common__pb2.DataResponse.FromString,
                )


class AgentServicer(object):
    """Missing associated documentation comment in .proto file."""

    def CreateTask(self, request_iterator, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateResultsMetaData(self, request, context):
        """*
        Create the metadata of multiple results at once
        Data have to be uploaded separately
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateResults(self, request, context):
        """*
        Create one result with data included in the request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def NotifyResultData(self, request, context):
        """*
        Notify Agent that a data file representing the Result to upload is available in the shared folder
        The name of the file should be the result id
        Blocks until data are stored in Object Storage
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubmitTasks(self, request, context):
        """*
        Create tasks metadata and submit task for processing.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetResourceData(self, request, context):
        """*
        Retrieve Resource Data from the Agent
        Data is stored in the shared folder between Agent and Worker as a file with the result id as name
        Blocks until data are available in the shared folder
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCommonData(self, request, context):
        """*
        Retrieve Resource Data from the Agent
        Data is stored in the shared folder between Agent and Worker as a file with the result id as name
        Blocks until data are available in the shared folder
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDirectData(self, request, context):
        """*
        Retrieve Resource Data from the Agent
        Data is stored in the shared folder between Agent and Worker as a file with the result id as name
        Blocks until data are available in the shared folder
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgentServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateTask': grpc.stream_unary_rpc_method_handler(
                    servicer.CreateTask,
                    request_deserializer=agent__common__pb2.CreateTaskRequest.FromString,
                    response_serializer=agent__common__pb2.CreateTaskReply.SerializeToString,
            ),
            'CreateResultsMetaData': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateResultsMetaData,
                    request_deserializer=agent__common__pb2.CreateResultsMetaDataRequest.FromString,
                    response_serializer=agent__common__pb2.CreateResultsMetaDataResponse.SerializeToString,
            ),
            'CreateResults': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateResults,
                    request_deserializer=agent__common__pb2.CreateResultsRequest.FromString,
                    response_serializer=agent__common__pb2.CreateResultsResponse.SerializeToString,
            ),
            'NotifyResultData': grpc.unary_unary_rpc_method_handler(
                    servicer.NotifyResultData,
                    request_deserializer=agent__common__pb2.NotifyResultDataRequest.FromString,
                    response_serializer=agent__common__pb2.NotifyResultDataResponse.SerializeToString,
            ),
            'SubmitTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.SubmitTasks,
                    request_deserializer=agent__common__pb2.SubmitTasksRequest.FromString,
                    response_serializer=agent__common__pb2.SubmitTasksResponse.SerializeToString,
            ),
            'GetResourceData': grpc.unary_unary_rpc_method_handler(
                    servicer.GetResourceData,
                    request_deserializer=agent__common__pb2.DataRequest.FromString,
                    response_serializer=agent__common__pb2.DataResponse.SerializeToString,
            ),
            'GetCommonData': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCommonData,
                    request_deserializer=agent__common__pb2.DataRequest.FromString,
                    response_serializer=agent__common__pb2.DataResponse.SerializeToString,
            ),
            'GetDirectData': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDirectData,
                    request_deserializer=agent__common__pb2.DataRequest.FromString,
                    response_serializer=agent__common__pb2.DataResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.agent.Agent', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Agent(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def CreateTask(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(request_iterator, target, '/armonik.api.grpc.v1.agent.Agent/CreateTask',
            agent__common__pb2.CreateTaskRequest.SerializeToString,
            agent__common__pb2.CreateTaskReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateResultsMetaData(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, '/armonik.api.grpc.v1.agent.Agent/CreateResultsMetaData',
            agent__common__pb2.CreateResultsMetaDataRequest.SerializeToString,
            agent__common__pb2.CreateResultsMetaDataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateResults(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, '/armonik.api.grpc.v1.agent.Agent/CreateResults',
            agent__common__pb2.CreateResultsRequest.SerializeToString,
            agent__common__pb2.CreateResultsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def NotifyResultData(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, '/armonik.api.grpc.v1.agent.Agent/NotifyResultData',
            agent__common__pb2.NotifyResultDataRequest.SerializeToString,
            agent__common__pb2.NotifyResultDataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SubmitTasks(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, '/armonik.api.grpc.v1.agent.Agent/SubmitTasks',
            agent__common__pb2.SubmitTasksRequest.SerializeToString,
            agent__common__pb2.SubmitTasksResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetResourceData(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, '/armonik.api.grpc.v1.agent.Agent/GetResourceData',
            agent__common__pb2.DataRequest.SerializeToString,
            agent__common__pb2.DataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetCommonData(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, '/armonik.api.grpc.v1.agent.Agent/GetCommonData',
            agent__common__pb2.DataRequest.SerializeToString,
            agent__common__pb2.DataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDirectData(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, '/armonik.api.grpc.v1.agent.Agent/GetDirectData',
            agent__common__pb2.DataRequest.SerializeToString,
            agent__common__pb2.DataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
