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

try:
        from . import grpc_pb2 as grpc__pb2
except:
        import grpc_pb2 as grpc__pb2



class GrpcServiceStub(object):
    """定义服务接口
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.hello = channel.unary_unary(
                '/GrpcService/hello',
                request_serializer=grpc__pb2.HelloRequest.SerializeToString,
                response_deserializer=grpc__pb2.HelloResponse.FromString,
                )
        self.call = channel.unary_unary(
                '/GrpcService/call',
                request_serializer=grpc__pb2.CallRequest.SerializeToString,
                response_deserializer=grpc__pb2.CallResponse.FromString,
                )


class GrpcServiceServicer(object):
    """定义服务接口
    """

    def hello(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 call(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_GrpcServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'hello': grpc.unary_unary_rpc_method_handler(
                    servicer.hello,
                    request_deserializer=grpc__pb2.HelloRequest.FromString,
                    response_serializer=grpc__pb2.HelloResponse.SerializeToString,
            ),
            'call': grpc.unary_unary_rpc_method_handler(
                    servicer.call,
                    request_deserializer=grpc__pb2.CallRequest.FromString,
                    response_serializer=grpc__pb2.CallResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'GrpcService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def hello(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, '/GrpcService/hello',
            grpc__pb2.HelloRequest.SerializeToString,
            grpc__pb2.HelloResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def call(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, '/GrpcService/call',
            grpc__pb2.CallRequest.SerializeToString,
            grpc__pb2.CallResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
