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

from . import node_service_pb2 as node__service__pb2


class NodeServiceStub(object):
    """节点服务
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Call = channel.unary_unary(
                '/node.NodeService/Call',
                request_serializer=node__service__pb2.NodeMessage.SerializeToString,
                response_deserializer=node__service__pb2.NodeMessage.FromString,
                )
        self.Notify = channel.unary_unary(
                '/node.NodeService/Notify',
                request_serializer=node__service__pb2.NodeMessage.SerializeToString,
                response_deserializer=node__service__pb2.Empty.FromString,
                )


class NodeServiceServicer(object):
    """节点服务
    """

    def Call(self, request, context):
        """请求-响应调用
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Notify(self, request, context):
        """单向通知
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_NodeServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Call': grpc.unary_unary_rpc_method_handler(
                    servicer.Call,
                    request_deserializer=node__service__pb2.NodeMessage.FromString,
                    response_serializer=node__service__pb2.NodeMessage.SerializeToString,
            ),
            'Notify': grpc.unary_unary_rpc_method_handler(
                    servicer.Notify,
                    request_deserializer=node__service__pb2.NodeMessage.FromString,
                    response_serializer=node__service__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'node.NodeService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class NodeService(object):
    """节点服务
    """

    @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, '/node.NodeService/Call',
            node__service__pb2.NodeMessage.SerializeToString,
            node__service__pb2.NodeMessage.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Notify(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, '/node.NodeService/Notify',
            node__service__pb2.NodeMessage.SerializeToString,
            node__service__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
