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

from . import serializer as jina__pb2


class JinaRPCStub(object):
    """*
    jina gRPC service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Call = channel.stream_stream(
                '/jina.JinaRPC/Call',
                request_serializer=jina__pb2.RequestProto.SerializeToString,
                response_deserializer=jina__pb2.RequestProto.FromString,
                )


class JinaRPCServicer(object):
    """*
    jina gRPC service.
    """

    def Call(self, request_iterator, context):
        """Pass in a Request and a filled Request with matches will be returned.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_JinaRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Call': grpc.stream_stream_rpc_method_handler(
                    servicer.Call,
                    request_deserializer=jina__pb2.RequestProto.FromString,
                    response_serializer=jina__pb2.RequestProto.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'jina.JinaRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class JinaRPC(object):
    """*
    jina gRPC service.
    """

    @staticmethod
    def Call(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, '/jina.JinaRPC/Call',
            jina__pb2.RequestProto.SerializeToString,
            jina__pb2.RequestProto.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
