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

from pyfilter.src.transport.proto.filter_service import text_filter_pb2 as filter__service_dot_text__filter__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.SingleFilter = channel.unary_unary(
                '/filter_transport.TextFilterService/SingleFilter',
                request_serializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
                response_deserializer=filter__service_dot_text__filter__pb2.SingleTextFilterResponse.FromString,
                )
        self.MultiFilter = channel.stream_unary(
                '/filter_transport.TextFilterService/MultiFilter',
                request_serializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
                response_deserializer=filter__service_dot_text__filter__pb2.MultiFilterResponse.FromString,
                )
        self.MultiFilterStream = channel.stream_stream(
                '/filter_transport.TextFilterService/MultiFilterStream',
                request_serializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
                response_deserializer=filter__service_dot_text__filter__pb2.SingleTextFilterResponse.FromString,
                )


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

    def SingleFilter(self, request, context):
        """Send one text input and receive a boolean response whether it passed the filter or not
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def MultiFilter(self, request_iterator, context):
        """Send a stream of text inputs and receive an array of the outputs which passed the filter
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def MultiFilterStream(self, request_iterator, context):
        """Send a stream of text inputs and receive a stream of pass/fail booleans for each one
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TextFilterServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SingleFilter': grpc.unary_unary_rpc_method_handler(
                    servicer.SingleFilter,
                    request_deserializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.FromString,
                    response_serializer=filter__service_dot_text__filter__pb2.SingleTextFilterResponse.SerializeToString,
            ),
            'MultiFilter': grpc.stream_unary_rpc_method_handler(
                    servicer.MultiFilter,
                    request_deserializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.FromString,
                    response_serializer=filter__service_dot_text__filter__pb2.MultiFilterResponse.SerializeToString,
            ),
            'MultiFilterStream': grpc.stream_stream_rpc_method_handler(
                    servicer.MultiFilterStream,
                    request_deserializer=filter__service_dot_text__filter__pb2.SingleTextFilterRequest.FromString,
                    response_serializer=filter__service_dot_text__filter__pb2.SingleTextFilterResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'filter_transport.TextFilterService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def SingleFilter(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, '/filter_transport.TextFilterService/SingleFilter',
            filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
            filter__service_dot_text__filter__pb2.SingleTextFilterResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def MultiFilter(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, '/filter_transport.TextFilterService/MultiFilter',
            filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
            filter__service_dot_text__filter__pb2.MultiFilterResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def MultiFilterStream(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, '/filter_transport.TextFilterService/MultiFilterStream',
            filter__service_dot_text__filter__pb2.SingleTextFilterRequest.SerializeToString,
            filter__service_dot_text__filter__pb2.SingleTextFilterResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
