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

import helloworld_pb2 as helloworld__pb2


class HelloServiceStub(object):
    """生成go代码：protoc --go_out=plugins=grpc:. helloworld/helloworld.proto
    生成python代码：python -m grpc_tools.protoc -I../../protos --python_out=. --grpc_python_out=. ../../protos/route_guide.proto

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SayHello = channel.unary_unary(
                '/HelloService/SayHello',
                request_serializer=helloworld__pb2.HelloReq.SerializeToString,
                response_deserializer=helloworld__pb2.HelloRes.FromString,
                )
        self.Add = channel.unary_unary(
                '/HelloService/Add',
                request_serializer=helloworld__pb2.AddReq.SerializeToString,
                response_deserializer=helloworld__pb2.AddRes.FromString,
                )


class HelloServiceServicer(object):
    """生成go代码：protoc --go_out=plugins=grpc:. helloworld/helloworld.proto
    生成python代码：python -m grpc_tools.protoc -I../../protos --python_out=. --grpc_python_out=. ../../protos/route_guide.proto

    """

    def SayHello(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(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_HelloServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SayHello': grpc.unary_unary_rpc_method_handler(
                    servicer.SayHello,
                    request_deserializer=helloworld__pb2.HelloReq.FromString,
                    response_serializer=helloworld__pb2.HelloRes.SerializeToString,
            ),
            'Add': grpc.unary_unary_rpc_method_handler(
                    servicer.Add,
                    request_deserializer=helloworld__pb2.AddReq.FromString,
                    response_serializer=helloworld__pb2.AddRes.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'HelloService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class HelloService(object):
    """生成go代码：protoc --go_out=plugins=grpc:. helloworld/helloworld.proto
    生成python代码：python -m grpc_tools.protoc -I../../protos --python_out=. --grpc_python_out=. ../../protos/route_guide.proto

    """

    @staticmethod
    def SayHello(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, '/HelloService/SayHello',
            helloworld__pb2.HelloReq.SerializeToString,
            helloworld__pb2.HelloRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Add(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, '/HelloService/Add',
            helloworld__pb2.AddReq.SerializeToString,
            helloworld__pb2.AddRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
