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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from experiment_scheduler.task_manager.grpc_task_manager import task_manager_pb2 as task__manager__pb2


class TaskManagerStub(object):
    """Interface exported by the server.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.health_check = channel.unary_unary(
                '/TaskManager/health_check',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=task__manager__pb2.ServerStatus.FromString,
                )
        self.run_task = channel.unary_unary(
                '/TaskManager/run_task',
                request_serializer=task__manager__pb2.TaskStatement.SerializeToString,
                response_deserializer=task__manager__pb2.TaskStatus.FromString,
                )
        self.get_task_log = channel.unary_unary(
                '/TaskManager/get_task_log',
                request_serializer=task__manager__pb2.Task.SerializeToString,
                response_deserializer=task__manager__pb2.TaskLog.FromString,
                )
        self.kill_task = channel.unary_unary(
                '/TaskManager/kill_task',
                request_serializer=task__manager__pb2.Task.SerializeToString,
                response_deserializer=task__manager__pb2.TaskStatus.FromString,
                )
        self.get_task_status = channel.unary_unary(
                '/TaskManager/get_task_status',
                request_serializer=task__manager__pb2.Task.SerializeToString,
                response_deserializer=task__manager__pb2.TaskStatus.FromString,
                )
        self.get_all_tasks = channel.unary_unary(
                '/TaskManager/get_all_tasks',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=task__manager__pb2.AllTasksStatus.FromString,
                )


class TaskManagerServicer(object):
    """Interface exported by the server.
    """

    def health_check(self, request, 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 run_task(self, request, 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 get_task_log(self, request, 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 kill_task(self, request, 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 get_task_status(self, request, 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 get_all_tasks(self, request, 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 add_TaskManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'health_check': grpc.unary_unary_rpc_method_handler(
                    servicer.health_check,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=task__manager__pb2.ServerStatus.SerializeToString,
            ),
            'run_task': grpc.unary_unary_rpc_method_handler(
                    servicer.run_task,
                    request_deserializer=task__manager__pb2.TaskStatement.FromString,
                    response_serializer=task__manager__pb2.TaskStatus.SerializeToString,
            ),
            'get_task_log': grpc.unary_unary_rpc_method_handler(
                    servicer.get_task_log,
                    request_deserializer=task__manager__pb2.Task.FromString,
                    response_serializer=task__manager__pb2.TaskLog.SerializeToString,
            ),
            'kill_task': grpc.unary_unary_rpc_method_handler(
                    servicer.kill_task,
                    request_deserializer=task__manager__pb2.Task.FromString,
                    response_serializer=task__manager__pb2.TaskStatus.SerializeToString,
            ),
            'get_task_status': grpc.unary_unary_rpc_method_handler(
                    servicer.get_task_status,
                    request_deserializer=task__manager__pb2.Task.FromString,
                    response_serializer=task__manager__pb2.TaskStatus.SerializeToString,
            ),
            'get_all_tasks': grpc.unary_unary_rpc_method_handler(
                    servicer.get_all_tasks,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=task__manager__pb2.AllTasksStatus.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'TaskManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class TaskManager(object):
    """Interface exported by the server.
    """

    @staticmethod
    def health_check(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, '/TaskManager/health_check',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            task__manager__pb2.ServerStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def run_task(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, '/TaskManager/run_task',
            task__manager__pb2.TaskStatement.SerializeToString,
            task__manager__pb2.TaskStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get_task_log(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, '/TaskManager/get_task_log',
            task__manager__pb2.Task.SerializeToString,
            task__manager__pb2.TaskLog.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def kill_task(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, '/TaskManager/kill_task',
            task__manager__pb2.Task.SerializeToString,
            task__manager__pb2.TaskStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get_task_status(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, '/TaskManager/get_task_status',
            task__manager__pb2.Task.SerializeToString,
            task__manager__pb2.TaskStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get_all_tasks(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, '/TaskManager/get_all_tasks',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            task__manager__pb2.AllTasksStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
