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

import hash_name_pb2 as hash__name__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Find = channel.unary_unary(
                '/hash_name.HashFinder/Find',
                request_serializer=hash__name__pb2.HashNameRequest.SerializeToString,
                response_deserializer=hash__name__pb2.HashNameResponse.FromString,
                )
        self.FindRange = channel.unary_stream(
                '/hash_name.HashFinder/FindRange',
                request_serializer=hash__name__pb2.HashNameRequest.SerializeToString,
                response_deserializer=hash__name__pb2.HashNameResponse.FromString,
                )


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

    def Find(self, request, context):
        """Search for a single string whose hash is similar to the specified
        desired_name. interesting_hamming_distance is ignored.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FindRange(self, request, context):
        """Search for a string whose hash is similar to the specified desired_name,
        but also stream back less-than-ideal candidates.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_HashFinderServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Find': grpc.unary_unary_rpc_method_handler(
                    servicer.Find,
                    request_deserializer=hash__name__pb2.HashNameRequest.FromString,
                    response_serializer=hash__name__pb2.HashNameResponse.SerializeToString,
            ),
            'FindRange': grpc.unary_stream_rpc_method_handler(
                    servicer.FindRange,
                    request_deserializer=hash__name__pb2.HashNameRequest.FromString,
                    response_serializer=hash__name__pb2.HashNameResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'hash_name.HashFinder', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Find(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, '/hash_name.HashFinder/Find',
            hash__name__pb2.HashNameRequest.SerializeToString,
            hash__name__pb2.HashNameResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FindRange(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, '/hash_name.HashFinder/FindRange',
            hash__name__pb2.HashNameRequest.SerializeToString,
            hash__name__pb2.HashNameResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
