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

from paperpilot_common.protobuf.test import test_pb2 as paperpilot__common_dot_protobuf_dot_test_dot_test__pb2


class TestPublicServiceStub(object):
    """测试公开接口"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Test = channel.unary_unary(
            "/test.TestPublicService/Test",
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_test_dot_test__pb2.TestResult.FromString,
        )


class TestPublicServiceServicer(object):
    """测试公开接口"""

    def Test(self, request, context):
        """测试接口"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_TestPublicServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Test": grpc.unary_unary_rpc_method_handler(
            servicer.Test,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_test_dot_test__pb2.TestResult.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("test.TestPublicService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class TestPublicService(object):
    """测试公开接口"""

    @staticmethod
    def Test(
        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,
            "/test.TestPublicService/Test",
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            paperpilot__common_dot_protobuf_dot_test_dot_test__pb2.TestResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
