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

from ..config_manage import config_file_pb2 as config__file__pb2
from ..config_manage import config_file_response_pb2 as config__file__response__pb2


class PolarisConfigGRPCStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetConfigFile = channel.unary_unary(
                '/v1.PolarisConfigGRPC/GetConfigFile',
                request_serializer=config__file__pb2.ClientConfigFileInfo.SerializeToString,
                response_deserializer=config__file__response__pb2.ConfigClientResponse.FromString,
                )
        self.WatchConfigFiles = channel.unary_unary(
                '/v1.PolarisConfigGRPC/WatchConfigFiles',
                request_serializer=config__file__pb2.ClientWatchConfigFileRequest.SerializeToString,
                response_deserializer=config__file__response__pb2.ConfigClientResponse.FromString,
                )


class PolarisConfigGRPCServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetConfigFile(self, request, context):
        """拉取配置
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WatchConfigFiles(self, request, context):
        """订阅配置变更
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PolarisConfigGRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetConfigFile': grpc.unary_unary_rpc_method_handler(
                    servicer.GetConfigFile,
                    request_deserializer=config__file__pb2.ClientConfigFileInfo.FromString,
                    response_serializer=config__file__response__pb2.ConfigClientResponse.SerializeToString,
            ),
            'WatchConfigFiles': grpc.unary_unary_rpc_method_handler(
                    servicer.WatchConfigFiles,
                    request_deserializer=config__file__pb2.ClientWatchConfigFileRequest.FromString,
                    response_serializer=config__file__response__pb2.ConfigClientResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'v1.PolarisConfigGRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class PolarisConfigGRPC(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetConfigFile(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, '/v1.PolarisConfigGRPC/GetConfigFile',
            config__file__pb2.ClientConfigFileInfo.SerializeToString,
            config__file__response__pb2.ConfigClientResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def WatchConfigFiles(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, '/v1.PolarisConfigGRPC/WatchConfigFiles',
            config__file__pb2.ClientWatchConfigFileRequest.SerializeToString,
            config__file__response__pb2.ConfigClientResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
