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

import control_server_pb2 as control__server__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2


class BoxServiceStub(object):
    """service ControlService {
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Echo = channel.unary_unary(
                '/scalebox.BoxService/Echo',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.FromString,
                )
        self.GetNextTask = channel.unary_unary(
                '/scalebox.BoxService/GetNextTask',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
                response_deserializer=control__server__pb2.TaskItem.FromString,
                )
        self.SetTaskStarted = channel.unary_unary(
                '/scalebox.BoxService/SetTaskStarted',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int64Value.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.SetTaskFinished = channel.unary_unary(
                '/scalebox.BoxService/SetTaskFinished',
                request_serializer=control__server__pb2.TaskExecMessage.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.SetSlotTerminated = channel.unary_unary(
                '/scalebox.BoxService/SetSlotTerminated',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.GetRunnableSlotList = channel.unary_unary(
                '/scalebox.BoxService/GetRunnableSlotList',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=control__server__pb2.CommandList.FromString,
                )
        self.SetSlotInitialized = channel.unary_unary(
                '/scalebox.BoxService/SetSlotInitialized',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.GetTerminableSlotList = channel.unary_unary(
                '/scalebox.BoxService/GetTerminableSlotList',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=control__server__pb2.CommandList.FromString,
                )
        self.GetRunnableWorkerList = channel.unary_unary(
                '/scalebox.BoxService/GetRunnableWorkerList',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=control__server__pb2.CommandList.FromString,
                )
        self.SetWorkerInitialized = channel.unary_unary(
                '/scalebox.BoxService/SetWorkerInitialized',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.GetTerminableWorkerList = channel.unary_unary(
                '/scalebox.BoxService/GetTerminableWorkerList',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=control__server__pb2.CommandList.FromString,
                )
        self.SetWorkerTerminated = channel.unary_unary(
                '/scalebox.BoxService/SetWorkerTerminated',
                request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.SendToNextJob = channel.unary_unary(
                '/scalebox.BoxService/SendToNextJob',
                request_serializer=control__server__pb2.JobKey.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )
        self.SendMessagesToNext = channel.unary_unary(
                '/scalebox.BoxService/SendMessagesToNext',
                request_serializer=control__server__pb2.JobKeys.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                )


class BoxServiceServicer(object):
    """service ControlService {
    """

    def Echo(self, request, context):
        """//////////////////////////////////////////////////////////////////
        agent client
        //////////////////////////////////////////////////////////////////
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetNextTask(self, request, context):
        """input : slot id('ON')
        return : job-key of the task, id==0(NULL)
        task id : 'READY/-1' -> 'QUEUED/-2'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetTaskStarted(self, request, context):
        """input : task id('QUEUED/-2')
        return : ret_code : 0(OK), -1(task NOT FOUND), -2(WRONG STATUS)
        task_status_code:'QUEUED'/-2 -> 'RUNNING'/-3
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetTaskFinished(self, request, context):
        """input : TaskExecMessage
        return : ret_code : 0(OK), -1(task NOT FOUND), -2(task WRONG STATUS)
        task_status_code:'RUNNING'/-3 -> 'OK'/0, ...
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetSlotTerminated(self, request, context):
        """if on-demand-job, slot exit automatically, called in agent side
        if long-run-job, slot terminated by actuator
        input : slot id
        return : ret_code : 0(OK), -1(slot NOT FOUND), -2(slot WRONG STATUS)
        slot : 'ON' -> 'OFF'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRunnableSlotList(self, request, context):
        """//////////////////////////////////////////////////////////////////
        actuator client
        //////////////////////////////////////////////////////////////////
        input: token_string ?
        job:'RUNNING' && slot:'READY'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetSlotInitialized(self, request, context):
        """input : slot id
        return : ret_code : 0(OK), -1(slot NOT FOUND), -2(slot WRONG STATUS)
        slot: 'READY' -> 'ON'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTerminableSlotList(self, request, context):
        """job:'PAUSED'/'ARCHIVED' && slot:'ON'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRunnableWorkerList(self, request, context):
        """job:'RUNNING' && worker:'PAUSED'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetWorkerInitialized(self, request, context):
        """input : worker id
        return : ret_code : 0(OK), -1(worker NOT FOUND), -2(worker WRONG STATUS)
        worker: 'PAUSED' -> 'RUNNING'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTerminableWorkerList(self, request, context):
        """job:'PAUSED' && worker:'RUNNING'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetWorkerTerminated(self, request, context):
        """input : worker id, return ret_code;
        return : ret_code : 0(OK), -1(worker NOT FOUND), -2(worker WRONG STATUS)
        worker : 'RUNNING' -> 'PAUSED'
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendToNextJob(self, request, context):
        """//////////////////////////////////////////////////////////////////
        app client , called by user app.
        //////////////////////////////////////////////////////////////////

        send task-key to next job in current app
        return : ret_code : 0(OK), -1(job NOT FOUND)
        task_status_code : 'INITIAL'/-9
        rpc SendJobMessage(JobMessage) returns (google.protobuf.Int32Value);
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendMessagesToNext(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_BoxServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Echo': grpc.unary_unary_rpc_method_handler(
                    servicer.Echo,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.SerializeToString,
            ),
            'GetNextTask': grpc.unary_unary_rpc_method_handler(
                    servicer.GetNextTask,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                    response_serializer=control__server__pb2.TaskItem.SerializeToString,
            ),
            'SetTaskStarted': grpc.unary_unary_rpc_method_handler(
                    servicer.SetTaskStarted,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int64Value.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'SetTaskFinished': grpc.unary_unary_rpc_method_handler(
                    servicer.SetTaskFinished,
                    request_deserializer=control__server__pb2.TaskExecMessage.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'SetSlotTerminated': grpc.unary_unary_rpc_method_handler(
                    servicer.SetSlotTerminated,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'GetRunnableSlotList': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRunnableSlotList,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=control__server__pb2.CommandList.SerializeToString,
            ),
            'SetSlotInitialized': grpc.unary_unary_rpc_method_handler(
                    servicer.SetSlotInitialized,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'GetTerminableSlotList': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTerminableSlotList,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=control__server__pb2.CommandList.SerializeToString,
            ),
            'GetRunnableWorkerList': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRunnableWorkerList,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=control__server__pb2.CommandList.SerializeToString,
            ),
            'SetWorkerInitialized': grpc.unary_unary_rpc_method_handler(
                    servicer.SetWorkerInitialized,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'GetTerminableWorkerList': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTerminableWorkerList,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=control__server__pb2.CommandList.SerializeToString,
            ),
            'SetWorkerTerminated': grpc.unary_unary_rpc_method_handler(
                    servicer.SetWorkerTerminated,
                    request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'SendToNextJob': grpc.unary_unary_rpc_method_handler(
                    servicer.SendToNextJob,
                    request_deserializer=control__server__pb2.JobKey.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
            'SendMessagesToNext': grpc.unary_unary_rpc_method_handler(
                    servicer.SendMessagesToNext,
                    request_deserializer=control__server__pb2.JobKeys.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'scalebox.BoxService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class BoxService(object):
    """service ControlService {
    """

    @staticmethod
    def Echo(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, '/scalebox.BoxService/Echo',
            google_dot_protobuf_dot_wrappers__pb2.StringValue.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.StringValue.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetNextTask(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, '/scalebox.BoxService/GetNextTask',
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            control__server__pb2.TaskItem.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetTaskStarted(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, '/scalebox.BoxService/SetTaskStarted',
            google_dot_protobuf_dot_wrappers__pb2.Int64Value.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetTaskFinished(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, '/scalebox.BoxService/SetTaskFinished',
            control__server__pb2.TaskExecMessage.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetSlotTerminated(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, '/scalebox.BoxService/SetSlotTerminated',
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetRunnableSlotList(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, '/scalebox.BoxService/GetRunnableSlotList',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            control__server__pb2.CommandList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetSlotInitialized(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, '/scalebox.BoxService/SetSlotInitialized',
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetTerminableSlotList(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, '/scalebox.BoxService/GetTerminableSlotList',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            control__server__pb2.CommandList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetRunnableWorkerList(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, '/scalebox.BoxService/GetRunnableWorkerList',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            control__server__pb2.CommandList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetWorkerInitialized(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, '/scalebox.BoxService/SetWorkerInitialized',
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetTerminableWorkerList(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, '/scalebox.BoxService/GetTerminableWorkerList',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            control__server__pb2.CommandList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetWorkerTerminated(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, '/scalebox.BoxService/SetWorkerTerminated',
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendToNextJob(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, '/scalebox.BoxService/SendToNextJob',
            control__server__pb2.JobKey.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendMessagesToNext(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, '/scalebox.BoxService/SendMessagesToNext',
            control__server__pb2.JobKeys.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
