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

from . import common_pb2 as common__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import log_pb2 as log__pb2
from . import orchestrator_pb2 as orchestrator__pb2
from . import runner_pb2 as runner__pb2

GRPC_GENERATED_VERSION = '1.74.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in service_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.connect = channel.stream_stream(
                '/rdfc.Runner/connect',
                request_serializer=orchestrator__pb2.OrchestratorMessage.SerializeToString,
                response_deserializer=runner__pb2.RunnerMessage.FromString,
                _registered_method=True)
        self.sendStreamMessage = channel.stream_stream(
                '/rdfc.Runner/sendStreamMessage',
                request_serializer=common__pb2.DataChunk.SerializeToString,
                response_deserializer=common__pb2.Id.FromString,
                _registered_method=True)
        self.receiveStreamMessage = channel.unary_stream(
                '/rdfc.Runner/receiveStreamMessage',
                request_serializer=common__pb2.Id.SerializeToString,
                response_deserializer=common__pb2.DataChunk.FromString,
                _registered_method=True)
        self.logStream = channel.stream_unary(
                '/rdfc.Runner/logStream',
                request_serializer=log__pb2.LogMessage.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)


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

    def connect(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 sendStreamMessage(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 receiveStreamMessage(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 logStream(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 add_RunnerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'connect': grpc.stream_stream_rpc_method_handler(
                    servicer.connect,
                    request_deserializer=orchestrator__pb2.OrchestratorMessage.FromString,
                    response_serializer=runner__pb2.RunnerMessage.SerializeToString,
            ),
            'sendStreamMessage': grpc.stream_stream_rpc_method_handler(
                    servicer.sendStreamMessage,
                    request_deserializer=common__pb2.DataChunk.FromString,
                    response_serializer=common__pb2.Id.SerializeToString,
            ),
            'receiveStreamMessage': grpc.unary_stream_rpc_method_handler(
                    servicer.receiveStreamMessage,
                    request_deserializer=common__pb2.Id.FromString,
                    response_serializer=common__pb2.DataChunk.SerializeToString,
            ),
            'logStream': grpc.stream_unary_rpc_method_handler(
                    servicer.logStream,
                    request_deserializer=log__pb2.LogMessage.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'rdfc.Runner', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('rdfc.Runner', rpc_method_handlers)


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

    @staticmethod
    def connect(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,
            '/rdfc.Runner/connect',
            orchestrator__pb2.OrchestratorMessage.SerializeToString,
            runner__pb2.RunnerMessage.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def sendStreamMessage(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,
            '/rdfc.Runner/sendStreamMessage',
            common__pb2.DataChunk.SerializeToString,
            common__pb2.Id.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def receiveStreamMessage(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_stream(
            request,
            target,
            '/rdfc.Runner/receiveStreamMessage',
            common__pb2.Id.SerializeToString,
            common__pb2.DataChunk.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def logStream(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,
            '/rdfc.Runner/logStream',
            log__pb2.LogMessage.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)