# 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.CreateConfigFile = channel.unary_unary(
                '/v1.PolarisConfigGRPC/CreateConfigFile',
                request_serializer=config__file__pb2.ConfigFile.SerializeToString,
                response_deserializer=config__file__response__pb2.ConfigClientResponse.FromString,
                )
        self.UpdateConfigFile = channel.unary_unary(
                '/v1.PolarisConfigGRPC/UpdateConfigFile',
                request_serializer=config__file__pb2.ConfigFile.SerializeToString,
                response_deserializer=config__file__response__pb2.ConfigClientResponse.FromString,
                )
        self.PublishConfigFile = channel.unary_unary(
                '/v1.PolarisConfigGRPC/PublishConfigFile',
                request_serializer=config__file__pb2.ConfigFileRelease.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,
                )
        self.GetConfigFileMetadataList = channel.unary_unary(
                '/v1.PolarisConfigGRPC/GetConfigFileMetadataList',
                request_serializer=config__file__pb2.ConfigFileGroupRequest.SerializeToString,
                response_deserializer=config__file__response__pb2.ConfigClientListResponse.FromString,
                )
        self.Discover = channel.stream_stream(
                '/v1.PolarisConfigGRPC/Discover',
                request_serializer=config__file__pb2.ConfigDiscoverRequest.SerializeToString,
                response_deserializer=config__file__pb2.ConfigDiscoverResponse.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 CreateConfigFile(self, request, context):
        """创建配置
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def PublishConfigFile(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 GetConfigFileMetadataList(self, request, context):
        """拉取指定配置分组下的配置文件列表
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Discover(self, request_iterator, 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_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,
            ),
            'CreateConfigFile': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateConfigFile,
                    request_deserializer=config__file__pb2.ConfigFile.FromString,
                    response_serializer=config__file__response__pb2.ConfigClientResponse.SerializeToString,
            ),
            'UpdateConfigFile': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateConfigFile,
                    request_deserializer=config__file__pb2.ConfigFile.FromString,
                    response_serializer=config__file__response__pb2.ConfigClientResponse.SerializeToString,
            ),
            'PublishConfigFile': grpc.unary_unary_rpc_method_handler(
                    servicer.PublishConfigFile,
                    request_deserializer=config__file__pb2.ConfigFileRelease.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,
            ),
            'GetConfigFileMetadataList': grpc.unary_unary_rpc_method_handler(
                    servicer.GetConfigFileMetadataList,
                    request_deserializer=config__file__pb2.ConfigFileGroupRequest.FromString,
                    response_serializer=config__file__response__pb2.ConfigClientListResponse.SerializeToString,
            ),
            'Discover': grpc.stream_stream_rpc_method_handler(
                    servicer.Discover,
                    request_deserializer=config__file__pb2.ConfigDiscoverRequest.FromString,
                    response_serializer=config__file__pb2.ConfigDiscoverResponse.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 CreateConfigFile(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/CreateConfigFile',
            config__file__pb2.ConfigFile.SerializeToString,
            config__file__response__pb2.ConfigClientResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

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

    @staticmethod
    def PublishConfigFile(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/PublishConfigFile',
            config__file__pb2.ConfigFileRelease.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)

    @staticmethod
    def GetConfigFileMetadataList(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/GetConfigFileMetadataList',
            config__file__pb2.ConfigFileGroupRequest.SerializeToString,
            config__file__response__pb2.ConfigClientListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Discover(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/v1.PolarisConfigGRPC/Discover',
            config__file__pb2.ConfigDiscoverRequest.SerializeToString,
            config__file__pb2.ConfigDiscoverResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
