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

from . import api_pb2 as api__pb2


class RainbowSchedulerStub(object):
    """RainbowSchedulerService provides API endpoints for interacting with the central scheduler service
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Register = channel.unary_unary(
                '/convergedcomputing.org.grpc.v1.RainbowScheduler/Register',
                request_serializer=api__pb2.RegisterRequest.SerializeToString,
                response_deserializer=api__pb2.RegisterResponse.FromString,
                )
        self.SubmitJob = channel.unary_unary(
                '/convergedcomputing.org.grpc.v1.RainbowScheduler/SubmitJob',
                request_serializer=api__pb2.SubmitJobRequest.SerializeToString,
                response_deserializer=api__pb2.SubmitJobResponse.FromString,
                )
        self.Serial = channel.unary_unary(
                '/convergedcomputing.org.grpc.v1.RainbowScheduler/Serial',
                request_serializer=api__pb2.Request.SerializeToString,
                response_deserializer=api__pb2.Response.FromString,
                )
        self.Stream = channel.stream_stream(
                '/convergedcomputing.org.grpc.v1.RainbowScheduler/Stream',
                request_serializer=api__pb2.Request.SerializeToString,
                response_deserializer=api__pb2.Response.FromString,
                )


class RainbowSchedulerServicer(object):
    """RainbowSchedulerService provides API endpoints for interacting with the central scheduler service
    """

    def Register(self, request, context):
        """Register cluster - request to register a new cluster
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubmitJob(self, request, context):
        """Job Submission - request for submitting a job to a named cluster
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Serial(self, request, context):
        """TESTING ENDPOINTS
        Serial checks the connectivity and response time of the service.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stream(self, request_iterator, context):
        """Stream continuously sends and receives response messages.
        It is useful for scenarios where constant data flow is required.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_RainbowSchedulerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Register': grpc.unary_unary_rpc_method_handler(
                    servicer.Register,
                    request_deserializer=api__pb2.RegisterRequest.FromString,
                    response_serializer=api__pb2.RegisterResponse.SerializeToString,
            ),
            'SubmitJob': grpc.unary_unary_rpc_method_handler(
                    servicer.SubmitJob,
                    request_deserializer=api__pb2.SubmitJobRequest.FromString,
                    response_serializer=api__pb2.SubmitJobResponse.SerializeToString,
            ),
            'Serial': grpc.unary_unary_rpc_method_handler(
                    servicer.Serial,
                    request_deserializer=api__pb2.Request.FromString,
                    response_serializer=api__pb2.Response.SerializeToString,
            ),
            'Stream': grpc.stream_stream_rpc_method_handler(
                    servicer.Stream,
                    request_deserializer=api__pb2.Request.FromString,
                    response_serializer=api__pb2.Response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'convergedcomputing.org.grpc.v1.RainbowScheduler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class RainbowScheduler(object):
    """RainbowSchedulerService provides API endpoints for interacting with the central scheduler service
    """

    @staticmethod
    def Register(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, '/convergedcomputing.org.grpc.v1.RainbowScheduler/Register',
            api__pb2.RegisterRequest.SerializeToString,
            api__pb2.RegisterResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SubmitJob(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, '/convergedcomputing.org.grpc.v1.RainbowScheduler/SubmitJob',
            api__pb2.SubmitJobRequest.SerializeToString,
            api__pb2.SubmitJobResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Serial(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, '/convergedcomputing.org.grpc.v1.RainbowScheduler/Serial',
            api__pb2.Request.SerializeToString,
            api__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Stream(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_stream(request_iterator, target, '/convergedcomputing.org.grpc.v1.RainbowScheduler/Stream',
            api__pb2.Request.SerializeToString,
            api__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
