# 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 tasks_common_pb2 as tasks__common__pb2


class TasksStub(object):
    """*
    Service for handling tasks.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListTasks = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/ListTasks',
                request_serializer=tasks__common__pb2.ListTasksRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.ListTasksResponse.FromString,
                )
        self.ListTasksRaw = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/ListTasksRaw',
                request_serializer=tasks__common__pb2.ListTasksRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.ListTasksRawResponse.FromString,
                )
        self.GetTask = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/GetTask',
                request_serializer=tasks__common__pb2.GetTaskRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.GetTaskResponse.FromString,
                )
        self.CancelTasks = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/CancelTasks',
                request_serializer=tasks__common__pb2.CancelTasksRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.CancelTasksResponse.FromString,
                )
        self.GetResultIds = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/GetResultIds',
                request_serializer=tasks__common__pb2.GetResultIdsRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.GetResultIdsResponse.FromString,
                )
        self.CountTasksByStatus = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/CountTasksByStatus',
                request_serializer=tasks__common__pb2.CountTasksByStatusRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.CountTasksByStatusResponse.FromString,
                )
        self.SubmitTasks = channel.unary_unary(
                '/armonik.api.grpc.v1.tasks.Tasks/SubmitTasks',
                request_serializer=tasks__common__pb2.SubmitTasksRequest.SerializeToString,
                response_deserializer=tasks__common__pb2.SubmitTasksResponse.FromString,
                )


class TasksServicer(object):
    """*
    Service for handling tasks.
    """

    def ListTasks(self, request, context):
        """*
        Get a tasks list using pagination, filters and sorting.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListTasksRaw(self, request, context):
        """*
        Get a tasks list using pagination, filters and sorting with complete metada.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTask(self, request, context):
        """*
        Get a task by its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelTasks(self, request, context):
        """*
        Cancel tasks using ids.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetResultIds(self, request, context):
        """*
        Get ids of the result that tasks should produce.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CountTasksByStatus(self, request, context):
        """*
        Get count from tasks status.
        """
        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 add_TasksServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.ListTasks,
                    request_deserializer=tasks__common__pb2.ListTasksRequest.FromString,
                    response_serializer=tasks__common__pb2.ListTasksResponse.SerializeToString,
            ),
            'ListTasksRaw': grpc.unary_unary_rpc_method_handler(
                    servicer.ListTasksRaw,
                    request_deserializer=tasks__common__pb2.ListTasksRequest.FromString,
                    response_serializer=tasks__common__pb2.ListTasksRawResponse.SerializeToString,
            ),
            'GetTask': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTask,
                    request_deserializer=tasks__common__pb2.GetTaskRequest.FromString,
                    response_serializer=tasks__common__pb2.GetTaskResponse.SerializeToString,
            ),
            'CancelTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelTasks,
                    request_deserializer=tasks__common__pb2.CancelTasksRequest.FromString,
                    response_serializer=tasks__common__pb2.CancelTasksResponse.SerializeToString,
            ),
            'GetResultIds': grpc.unary_unary_rpc_method_handler(
                    servicer.GetResultIds,
                    request_deserializer=tasks__common__pb2.GetResultIdsRequest.FromString,
                    response_serializer=tasks__common__pb2.GetResultIdsResponse.SerializeToString,
            ),
            'CountTasksByStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.CountTasksByStatus,
                    request_deserializer=tasks__common__pb2.CountTasksByStatusRequest.FromString,
                    response_serializer=tasks__common__pb2.CountTasksByStatusResponse.SerializeToString,
            ),
            'SubmitTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.SubmitTasks,
                    request_deserializer=tasks__common__pb2.SubmitTasksRequest.FromString,
                    response_serializer=tasks__common__pb2.SubmitTasksResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.tasks.Tasks', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Tasks(object):
    """*
    Service for handling tasks.
    """

    @staticmethod
    def ListTasks(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.tasks.Tasks/ListTasks',
            tasks__common__pb2.ListTasksRequest.SerializeToString,
            tasks__common__pb2.ListTasksResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListTasksRaw(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.tasks.Tasks/ListTasksRaw',
            tasks__common__pb2.ListTasksRequest.SerializeToString,
            tasks__common__pb2.ListTasksRawResponse.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, '/armonik.api.grpc.v1.tasks.Tasks/GetTask',
            tasks__common__pb2.GetTaskRequest.SerializeToString,
            tasks__common__pb2.GetTaskResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CancelTasks(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.tasks.Tasks/CancelTasks',
            tasks__common__pb2.CancelTasksRequest.SerializeToString,
            tasks__common__pb2.CancelTasksResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetResultIds(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.tasks.Tasks/GetResultIds',
            tasks__common__pb2.GetResultIdsRequest.SerializeToString,
            tasks__common__pb2.GetResultIdsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CountTasksByStatus(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.tasks.Tasks/CountTasksByStatus',
            tasks__common__pb2.CountTasksByStatusRequest.SerializeToString,
            tasks__common__pb2.CountTasksByStatusResponse.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.tasks.Tasks/SubmitTasks',
            tasks__common__pb2.SubmitTasksRequest.SerializeToString,
            tasks__common__pb2.SubmitTasksResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
