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

import document_pb2 as document__pb2


class DocumentServiceStub(object):
    """定义服务
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SyncChunkDocument = channel.unary_unary(
                '/document.DocumentService/SyncChunkDocument',
                request_serializer=document__pb2.ChunkRequest.SerializeToString,
                response_deserializer=document__pb2.ChunkedResponse.FromString,
                )
        self.AsyncChunkDocument = channel.unary_unary(
                '/document.DocumentService/AsyncChunkDocument',
                request_serializer=document__pb2.ChunkRequest.SerializeToString,
                response_deserializer=document__pb2.ChunkedResponse.FromString,
                )
        self.StreamChunkDocument = channel.unary_stream(
                '/document.DocumentService/StreamChunkDocument',
                request_serializer=document__pb2.ChunkRequest.SerializeToString,
                response_deserializer=document__pb2.ChunkedResponse.FromString,
                )


class DocumentServiceServicer(object):
    """定义服务
    """

    def SyncChunkDocument(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 AsyncChunkDocument(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 StreamChunkDocument(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_DocumentServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SyncChunkDocument': grpc.unary_unary_rpc_method_handler(
                    servicer.SyncChunkDocument,
                    request_deserializer=document__pb2.ChunkRequest.FromString,
                    response_serializer=document__pb2.ChunkedResponse.SerializeToString,
            ),
            'AsyncChunkDocument': grpc.unary_unary_rpc_method_handler(
                    servicer.AsyncChunkDocument,
                    request_deserializer=document__pb2.ChunkRequest.FromString,
                    response_serializer=document__pb2.ChunkedResponse.SerializeToString,
            ),
            'StreamChunkDocument': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamChunkDocument,
                    request_deserializer=document__pb2.ChunkRequest.FromString,
                    response_serializer=document__pb2.ChunkedResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'document.DocumentService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DocumentService(object):
    """定义服务
    """

    @staticmethod
    def SyncChunkDocument(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, '/document.DocumentService/SyncChunkDocument',
            document__pb2.ChunkRequest.SerializeToString,
            document__pb2.ChunkedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AsyncChunkDocument(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, '/document.DocumentService/AsyncChunkDocument',
            document__pb2.ChunkRequest.SerializeToString,
            document__pb2.ChunkedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StreamChunkDocument(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, '/document.DocumentService/StreamChunkDocument',
            document__pb2.ChunkRequest.SerializeToString,
            document__pb2.ChunkedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
