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

from bilireq.grpc.protos.bilibili.polymer.app.search.v1 import search_pb2 as bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2


class SearchStub(object):
    """
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SearchAll = channel.unary_unary(
                '/bilibili.polymer.app.search.v1.Search/SearchAll',
                request_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllRequest.SerializeToString,
                response_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllResponse.FromString,
                )
        self.SearchByType = channel.unary_unary(
                '/bilibili.polymer.app.search.v1.Search/SearchByType',
                request_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeRequest.SerializeToString,
                response_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeResponse.FromString,
                )
        self.SearchComic = channel.unary_unary(
                '/bilibili.polymer.app.search.v1.Search/SearchComic',
                request_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicRequest.SerializeToString,
                response_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicResponse.FromString,
                )


class SearchServicer(object):
    """
    """

    def SearchAll(self, request, context):
        """搜索所有类型结果
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchByType(self, request, context):
        """搜索指定类型结果
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchComic(self, request, context):
        """
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SearchServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SearchAll': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchAll,
                    request_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllRequest.FromString,
                    response_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllResponse.SerializeToString,
            ),
            'SearchByType': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchByType,
                    request_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeRequest.FromString,
                    response_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeResponse.SerializeToString,
            ),
            'SearchComic': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchComic,
                    request_deserializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicRequest.FromString,
                    response_serializer=bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'bilibili.polymer.app.search.v1.Search', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Search(object):
    """
    """

    @staticmethod
    def SearchAll(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, '/bilibili.polymer.app.search.v1.Search/SearchAll',
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllRequest.SerializeToString,
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchAllResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SearchByType(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, '/bilibili.polymer.app.search.v1.Search/SearchByType',
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeRequest.SerializeToString,
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchByTypeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SearchComic(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, '/bilibili.polymer.app.search.v1.Search/SearchComic',
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicRequest.SerializeToString,
            bilibili_dot_polymer_dot_app_dot_search_dot_v1_dot_search__pb2.SearchComicResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
