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

from . import mqtt_service_pb2 as mqtt__service__pb2

GRPC_GENERATED_VERSION = '1.75.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in mqtt_service_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class MQTTServiceStub(object):
    """========================================
    MQTT 消息代理服务
    ========================================
    这是一个统一的 MQTT 消息服务，为所有后端服务提供设备通信能力
    支持：
    - 用户和组织级别的主题隔离
    - 设备注册和管理
    - 消息发布和订阅
    - QoS 质量保证
    - 保留消息和遗嘱消息
    - 主题通配符订阅

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Connect = channel.unary_unary(
                '/isa.mqtt.MQTTService/Connect',
                request_serializer=mqtt__service__pb2.ConnectRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ConnectResponse.FromString,
                _registered_method=True)
        self.Disconnect = channel.unary_unary(
                '/isa.mqtt.MQTTService/Disconnect',
                request_serializer=mqtt__service__pb2.DisconnectRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.DisconnectResponse.FromString,
                _registered_method=True)
        self.GetConnectionStatus = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetConnectionStatus',
                request_serializer=mqtt__service__pb2.ConnectionStatusRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ConnectionStatusResponse.FromString,
                _registered_method=True)
        self.Publish = channel.unary_unary(
                '/isa.mqtt.MQTTService/Publish',
                request_serializer=mqtt__service__pb2.PublishRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.PublishResponse.FromString,
                _registered_method=True)
        self.PublishBatch = channel.unary_unary(
                '/isa.mqtt.MQTTService/PublishBatch',
                request_serializer=mqtt__service__pb2.PublishBatchRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.PublishBatchResponse.FromString,
                _registered_method=True)
        self.PublishJSON = channel.unary_unary(
                '/isa.mqtt.MQTTService/PublishJSON',
                request_serializer=mqtt__service__pb2.PublishJSONRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.PublishResponse.FromString,
                _registered_method=True)
        self.Subscribe = channel.unary_stream(
                '/isa.mqtt.MQTTService/Subscribe',
                request_serializer=mqtt__service__pb2.SubscribeRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.MessageResponse.FromString,
                _registered_method=True)
        self.SubscribeMultiple = channel.unary_stream(
                '/isa.mqtt.MQTTService/SubscribeMultiple',
                request_serializer=mqtt__service__pb2.SubscribeMultipleRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.MessageResponse.FromString,
                _registered_method=True)
        self.Unsubscribe = channel.unary_unary(
                '/isa.mqtt.MQTTService/Unsubscribe',
                request_serializer=mqtt__service__pb2.UnsubscribeRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.UnsubscribeResponse.FromString,
                _registered_method=True)
        self.ListSubscriptions = channel.unary_unary(
                '/isa.mqtt.MQTTService/ListSubscriptions',
                request_serializer=mqtt__service__pb2.ListSubscriptionsRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ListSubscriptionsResponse.FromString,
                _registered_method=True)
        self.RegisterDevice = channel.unary_unary(
                '/isa.mqtt.MQTTService/RegisterDevice',
                request_serializer=mqtt__service__pb2.RegisterDeviceRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.RegisterDeviceResponse.FromString,
                _registered_method=True)
        self.UnregisterDevice = channel.unary_unary(
                '/isa.mqtt.MQTTService/UnregisterDevice',
                request_serializer=mqtt__service__pb2.UnregisterDeviceRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.UnregisterDeviceResponse.FromString,
                _registered_method=True)
        self.ListDevices = channel.unary_unary(
                '/isa.mqtt.MQTTService/ListDevices',
                request_serializer=mqtt__service__pb2.ListDevicesRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ListDevicesResponse.FromString,
                _registered_method=True)
        self.GetDeviceInfo = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetDeviceInfo',
                request_serializer=mqtt__service__pb2.GetDeviceInfoRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.GetDeviceInfoResponse.FromString,
                _registered_method=True)
        self.UpdateDeviceStatus = channel.unary_unary(
                '/isa.mqtt.MQTTService/UpdateDeviceStatus',
                request_serializer=mqtt__service__pb2.UpdateDeviceStatusRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.UpdateDeviceStatusResponse.FromString,
                _registered_method=True)
        self.GetTopicInfo = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetTopicInfo',
                request_serializer=mqtt__service__pb2.GetTopicInfoRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.GetTopicInfoResponse.FromString,
                _registered_method=True)
        self.ListTopics = channel.unary_unary(
                '/isa.mqtt.MQTTService/ListTopics',
                request_serializer=mqtt__service__pb2.ListTopicsRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ListTopicsResponse.FromString,
                _registered_method=True)
        self.ValidateTopic = channel.unary_unary(
                '/isa.mqtt.MQTTService/ValidateTopic',
                request_serializer=mqtt__service__pb2.ValidateTopicRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ValidateTopicResponse.FromString,
                _registered_method=True)
        self.SetRetainedMessage = channel.unary_unary(
                '/isa.mqtt.MQTTService/SetRetainedMessage',
                request_serializer=mqtt__service__pb2.SetRetainedMessageRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.SetRetainedMessageResponse.FromString,
                _registered_method=True)
        self.GetRetainedMessage = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetRetainedMessage',
                request_serializer=mqtt__service__pb2.GetRetainedMessageRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.GetRetainedMessageResponse.FromString,
                _registered_method=True)
        self.DeleteRetainedMessage = channel.unary_unary(
                '/isa.mqtt.MQTTService/DeleteRetainedMessage',
                request_serializer=mqtt__service__pb2.DeleteRetainedMessageRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.DeleteRetainedMessageResponse.FromString,
                _registered_method=True)
        self.GetStatistics = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetStatistics',
                request_serializer=mqtt__service__pb2.GetStatisticsRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.GetStatisticsResponse.FromString,
                _registered_method=True)
        self.GetDeviceMetrics = channel.unary_unary(
                '/isa.mqtt.MQTTService/GetDeviceMetrics',
                request_serializer=mqtt__service__pb2.GetDeviceMetricsRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.GetDeviceMetricsResponse.FromString,
                _registered_method=True)
        self.HealthCheck = channel.unary_unary(
                '/isa.mqtt.MQTTService/HealthCheck',
                request_serializer=mqtt__service__pb2.MQTTHealthCheckRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.MQTTHealthCheckResponse.FromString,
                _registered_method=True)
        self.SubscribeDeviceMessages = channel.unary_stream(
                '/isa.mqtt.MQTTService/SubscribeDeviceMessages',
                request_serializer=mqtt__service__pb2.SubscribeDeviceMessagesRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.DeviceMessage.FromString,
                _registered_method=True)
        self.RegisterWebhook = channel.unary_unary(
                '/isa.mqtt.MQTTService/RegisterWebhook',
                request_serializer=mqtt__service__pb2.RegisterWebhookRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.RegisterWebhookResponse.FromString,
                _registered_method=True)
        self.UnregisterWebhook = channel.unary_unary(
                '/isa.mqtt.MQTTService/UnregisterWebhook',
                request_serializer=mqtt__service__pb2.UnregisterWebhookRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.UnregisterWebhookResponse.FromString,
                _registered_method=True)
        self.ListWebhooks = channel.unary_unary(
                '/isa.mqtt.MQTTService/ListWebhooks',
                request_serializer=mqtt__service__pb2.ListWebhooksRequest.SerializeToString,
                response_deserializer=mqtt__service__pb2.ListWebhooksResponse.FromString,
                _registered_method=True)


class MQTTServiceServicer(object):
    """========================================
    MQTT 消息代理服务
    ========================================
    这是一个统一的 MQTT 消息服务，为所有后端服务提供设备通信能力
    支持：
    - 用户和组织级别的主题隔离
    - 设备注册和管理
    - 消息发布和订阅
    - QoS 质量保证
    - 保留消息和遗嘱消息
    - 主题通配符订阅

    """

    def Connect(self, request, context):
        """========== 连接管理 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Disconnect(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 GetConnectionStatus(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 Publish(self, request, context):
        """========== 消息发布 ==========
        发布单条消息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PublishBatch(self, request, context):
        """批量发布消息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PublishJSON(self, request, context):
        """发布 JSON 消息（自动序列化）
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Subscribe(self, request, context):
        """========== 消息订阅 ==========
        订阅主题（流式接收消息）
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubscribeMultiple(self, request, context):
        """批量订阅多个主题
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Unsubscribe(self, request, context):
        """取消订阅
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListSubscriptions(self, request, context):
        """获取订阅列表
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterDevice(self, request, context):
        """========== 设备管理 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UnregisterDevice(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 ListDevices(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 GetDeviceInfo(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 UpdateDeviceStatus(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 GetTopicInfo(self, request, context):
        """========== 主题管理 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListTopics(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 ValidateTopic(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 SetRetainedMessage(self, request, context):
        """========== 保留消息 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRetainedMessage(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 DeleteRetainedMessage(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 GetStatistics(self, request, context):
        """========== 统计和监控 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDeviceMetrics(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 HealthCheck(self, request, context):
        """========== 健康检查 ==========
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubscribeDeviceMessages(self, request, context):
        """========== 设备消息监听（新增）==========
        订阅所有设备消息流（替代 Gateway MQTT Adapter）
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterWebhook(self, request, context):
        """========== Webhook 回调（新增）==========
        注册 webhook 用于接收设备消息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UnregisterWebhook(self, request, context):
        """注销 webhook
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListWebhooks(self, request, context):
        """列出已注册的 webhooks
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MQTTServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Connect': grpc.unary_unary_rpc_method_handler(
                    servicer.Connect,
                    request_deserializer=mqtt__service__pb2.ConnectRequest.FromString,
                    response_serializer=mqtt__service__pb2.ConnectResponse.SerializeToString,
            ),
            'Disconnect': grpc.unary_unary_rpc_method_handler(
                    servicer.Disconnect,
                    request_deserializer=mqtt__service__pb2.DisconnectRequest.FromString,
                    response_serializer=mqtt__service__pb2.DisconnectResponse.SerializeToString,
            ),
            'GetConnectionStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetConnectionStatus,
                    request_deserializer=mqtt__service__pb2.ConnectionStatusRequest.FromString,
                    response_serializer=mqtt__service__pb2.ConnectionStatusResponse.SerializeToString,
            ),
            'Publish': grpc.unary_unary_rpc_method_handler(
                    servicer.Publish,
                    request_deserializer=mqtt__service__pb2.PublishRequest.FromString,
                    response_serializer=mqtt__service__pb2.PublishResponse.SerializeToString,
            ),
            'PublishBatch': grpc.unary_unary_rpc_method_handler(
                    servicer.PublishBatch,
                    request_deserializer=mqtt__service__pb2.PublishBatchRequest.FromString,
                    response_serializer=mqtt__service__pb2.PublishBatchResponse.SerializeToString,
            ),
            'PublishJSON': grpc.unary_unary_rpc_method_handler(
                    servicer.PublishJSON,
                    request_deserializer=mqtt__service__pb2.PublishJSONRequest.FromString,
                    response_serializer=mqtt__service__pb2.PublishResponse.SerializeToString,
            ),
            'Subscribe': grpc.unary_stream_rpc_method_handler(
                    servicer.Subscribe,
                    request_deserializer=mqtt__service__pb2.SubscribeRequest.FromString,
                    response_serializer=mqtt__service__pb2.MessageResponse.SerializeToString,
            ),
            'SubscribeMultiple': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeMultiple,
                    request_deserializer=mqtt__service__pb2.SubscribeMultipleRequest.FromString,
                    response_serializer=mqtt__service__pb2.MessageResponse.SerializeToString,
            ),
            'Unsubscribe': grpc.unary_unary_rpc_method_handler(
                    servicer.Unsubscribe,
                    request_deserializer=mqtt__service__pb2.UnsubscribeRequest.FromString,
                    response_serializer=mqtt__service__pb2.UnsubscribeResponse.SerializeToString,
            ),
            'ListSubscriptions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListSubscriptions,
                    request_deserializer=mqtt__service__pb2.ListSubscriptionsRequest.FromString,
                    response_serializer=mqtt__service__pb2.ListSubscriptionsResponse.SerializeToString,
            ),
            'RegisterDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterDevice,
                    request_deserializer=mqtt__service__pb2.RegisterDeviceRequest.FromString,
                    response_serializer=mqtt__service__pb2.RegisterDeviceResponse.SerializeToString,
            ),
            'UnregisterDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.UnregisterDevice,
                    request_deserializer=mqtt__service__pb2.UnregisterDeviceRequest.FromString,
                    response_serializer=mqtt__service__pb2.UnregisterDeviceResponse.SerializeToString,
            ),
            'ListDevices': grpc.unary_unary_rpc_method_handler(
                    servicer.ListDevices,
                    request_deserializer=mqtt__service__pb2.ListDevicesRequest.FromString,
                    response_serializer=mqtt__service__pb2.ListDevicesResponse.SerializeToString,
            ),
            'GetDeviceInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDeviceInfo,
                    request_deserializer=mqtt__service__pb2.GetDeviceInfoRequest.FromString,
                    response_serializer=mqtt__service__pb2.GetDeviceInfoResponse.SerializeToString,
            ),
            'UpdateDeviceStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateDeviceStatus,
                    request_deserializer=mqtt__service__pb2.UpdateDeviceStatusRequest.FromString,
                    response_serializer=mqtt__service__pb2.UpdateDeviceStatusResponse.SerializeToString,
            ),
            'GetTopicInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTopicInfo,
                    request_deserializer=mqtt__service__pb2.GetTopicInfoRequest.FromString,
                    response_serializer=mqtt__service__pb2.GetTopicInfoResponse.SerializeToString,
            ),
            'ListTopics': grpc.unary_unary_rpc_method_handler(
                    servicer.ListTopics,
                    request_deserializer=mqtt__service__pb2.ListTopicsRequest.FromString,
                    response_serializer=mqtt__service__pb2.ListTopicsResponse.SerializeToString,
            ),
            'ValidateTopic': grpc.unary_unary_rpc_method_handler(
                    servicer.ValidateTopic,
                    request_deserializer=mqtt__service__pb2.ValidateTopicRequest.FromString,
                    response_serializer=mqtt__service__pb2.ValidateTopicResponse.SerializeToString,
            ),
            'SetRetainedMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SetRetainedMessage,
                    request_deserializer=mqtt__service__pb2.SetRetainedMessageRequest.FromString,
                    response_serializer=mqtt__service__pb2.SetRetainedMessageResponse.SerializeToString,
            ),
            'GetRetainedMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRetainedMessage,
                    request_deserializer=mqtt__service__pb2.GetRetainedMessageRequest.FromString,
                    response_serializer=mqtt__service__pb2.GetRetainedMessageResponse.SerializeToString,
            ),
            'DeleteRetainedMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteRetainedMessage,
                    request_deserializer=mqtt__service__pb2.DeleteRetainedMessageRequest.FromString,
                    response_serializer=mqtt__service__pb2.DeleteRetainedMessageResponse.SerializeToString,
            ),
            'GetStatistics': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatistics,
                    request_deserializer=mqtt__service__pb2.GetStatisticsRequest.FromString,
                    response_serializer=mqtt__service__pb2.GetStatisticsResponse.SerializeToString,
            ),
            'GetDeviceMetrics': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDeviceMetrics,
                    request_deserializer=mqtt__service__pb2.GetDeviceMetricsRequest.FromString,
                    response_serializer=mqtt__service__pb2.GetDeviceMetricsResponse.SerializeToString,
            ),
            'HealthCheck': grpc.unary_unary_rpc_method_handler(
                    servicer.HealthCheck,
                    request_deserializer=mqtt__service__pb2.MQTTHealthCheckRequest.FromString,
                    response_serializer=mqtt__service__pb2.MQTTHealthCheckResponse.SerializeToString,
            ),
            'SubscribeDeviceMessages': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeDeviceMessages,
                    request_deserializer=mqtt__service__pb2.SubscribeDeviceMessagesRequest.FromString,
                    response_serializer=mqtt__service__pb2.DeviceMessage.SerializeToString,
            ),
            'RegisterWebhook': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterWebhook,
                    request_deserializer=mqtt__service__pb2.RegisterWebhookRequest.FromString,
                    response_serializer=mqtt__service__pb2.RegisterWebhookResponse.SerializeToString,
            ),
            'UnregisterWebhook': grpc.unary_unary_rpc_method_handler(
                    servicer.UnregisterWebhook,
                    request_deserializer=mqtt__service__pb2.UnregisterWebhookRequest.FromString,
                    response_serializer=mqtt__service__pb2.UnregisterWebhookResponse.SerializeToString,
            ),
            'ListWebhooks': grpc.unary_unary_rpc_method_handler(
                    servicer.ListWebhooks,
                    request_deserializer=mqtt__service__pb2.ListWebhooksRequest.FromString,
                    response_serializer=mqtt__service__pb2.ListWebhooksResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'isa.mqtt.MQTTService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('isa.mqtt.MQTTService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class MQTTService(object):
    """========================================
    MQTT 消息代理服务
    ========================================
    这是一个统一的 MQTT 消息服务，为所有后端服务提供设备通信能力
    支持：
    - 用户和组织级别的主题隔离
    - 设备注册和管理
    - 消息发布和订阅
    - QoS 质量保证
    - 保留消息和遗嘱消息
    - 主题通配符订阅

    """

    @staticmethod
    def Connect(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,
            '/isa.mqtt.MQTTService/Connect',
            mqtt__service__pb2.ConnectRequest.SerializeToString,
            mqtt__service__pb2.ConnectResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Disconnect(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,
            '/isa.mqtt.MQTTService/Disconnect',
            mqtt__service__pb2.DisconnectRequest.SerializeToString,
            mqtt__service__pb2.DisconnectResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetConnectionStatus(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,
            '/isa.mqtt.MQTTService/GetConnectionStatus',
            mqtt__service__pb2.ConnectionStatusRequest.SerializeToString,
            mqtt__service__pb2.ConnectionStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Publish(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,
            '/isa.mqtt.MQTTService/Publish',
            mqtt__service__pb2.PublishRequest.SerializeToString,
            mqtt__service__pb2.PublishResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PublishBatch(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,
            '/isa.mqtt.MQTTService/PublishBatch',
            mqtt__service__pb2.PublishBatchRequest.SerializeToString,
            mqtt__service__pb2.PublishBatchResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PublishJSON(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,
            '/isa.mqtt.MQTTService/PublishJSON',
            mqtt__service__pb2.PublishJSONRequest.SerializeToString,
            mqtt__service__pb2.PublishResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Subscribe(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_stream(
            request,
            target,
            '/isa.mqtt.MQTTService/Subscribe',
            mqtt__service__pb2.SubscribeRequest.SerializeToString,
            mqtt__service__pb2.MessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubscribeMultiple(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_stream(
            request,
            target,
            '/isa.mqtt.MQTTService/SubscribeMultiple',
            mqtt__service__pb2.SubscribeMultipleRequest.SerializeToString,
            mqtt__service__pb2.MessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Unsubscribe(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,
            '/isa.mqtt.MQTTService/Unsubscribe',
            mqtt__service__pb2.UnsubscribeRequest.SerializeToString,
            mqtt__service__pb2.UnsubscribeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListSubscriptions(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,
            '/isa.mqtt.MQTTService/ListSubscriptions',
            mqtt__service__pb2.ListSubscriptionsRequest.SerializeToString,
            mqtt__service__pb2.ListSubscriptionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RegisterDevice(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,
            '/isa.mqtt.MQTTService/RegisterDevice',
            mqtt__service__pb2.RegisterDeviceRequest.SerializeToString,
            mqtt__service__pb2.RegisterDeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UnregisterDevice(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,
            '/isa.mqtt.MQTTService/UnregisterDevice',
            mqtt__service__pb2.UnregisterDeviceRequest.SerializeToString,
            mqtt__service__pb2.UnregisterDeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListDevices(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,
            '/isa.mqtt.MQTTService/ListDevices',
            mqtt__service__pb2.ListDevicesRequest.SerializeToString,
            mqtt__service__pb2.ListDevicesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDeviceInfo(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,
            '/isa.mqtt.MQTTService/GetDeviceInfo',
            mqtt__service__pb2.GetDeviceInfoRequest.SerializeToString,
            mqtt__service__pb2.GetDeviceInfoResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateDeviceStatus(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,
            '/isa.mqtt.MQTTService/UpdateDeviceStatus',
            mqtt__service__pb2.UpdateDeviceStatusRequest.SerializeToString,
            mqtt__service__pb2.UpdateDeviceStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTopicInfo(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,
            '/isa.mqtt.MQTTService/GetTopicInfo',
            mqtt__service__pb2.GetTopicInfoRequest.SerializeToString,
            mqtt__service__pb2.GetTopicInfoResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListTopics(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,
            '/isa.mqtt.MQTTService/ListTopics',
            mqtt__service__pb2.ListTopicsRequest.SerializeToString,
            mqtt__service__pb2.ListTopicsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ValidateTopic(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,
            '/isa.mqtt.MQTTService/ValidateTopic',
            mqtt__service__pb2.ValidateTopicRequest.SerializeToString,
            mqtt__service__pb2.ValidateTopicResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetRetainedMessage(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,
            '/isa.mqtt.MQTTService/SetRetainedMessage',
            mqtt__service__pb2.SetRetainedMessageRequest.SerializeToString,
            mqtt__service__pb2.SetRetainedMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRetainedMessage(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,
            '/isa.mqtt.MQTTService/GetRetainedMessage',
            mqtt__service__pb2.GetRetainedMessageRequest.SerializeToString,
            mqtt__service__pb2.GetRetainedMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteRetainedMessage(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,
            '/isa.mqtt.MQTTService/DeleteRetainedMessage',
            mqtt__service__pb2.DeleteRetainedMessageRequest.SerializeToString,
            mqtt__service__pb2.DeleteRetainedMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStatistics(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,
            '/isa.mqtt.MQTTService/GetStatistics',
            mqtt__service__pb2.GetStatisticsRequest.SerializeToString,
            mqtt__service__pb2.GetStatisticsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDeviceMetrics(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,
            '/isa.mqtt.MQTTService/GetDeviceMetrics',
            mqtt__service__pb2.GetDeviceMetricsRequest.SerializeToString,
            mqtt__service__pb2.GetDeviceMetricsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HealthCheck(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,
            '/isa.mqtt.MQTTService/HealthCheck',
            mqtt__service__pb2.MQTTHealthCheckRequest.SerializeToString,
            mqtt__service__pb2.MQTTHealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubscribeDeviceMessages(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_stream(
            request,
            target,
            '/isa.mqtt.MQTTService/SubscribeDeviceMessages',
            mqtt__service__pb2.SubscribeDeviceMessagesRequest.SerializeToString,
            mqtt__service__pb2.DeviceMessage.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RegisterWebhook(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,
            '/isa.mqtt.MQTTService/RegisterWebhook',
            mqtt__service__pb2.RegisterWebhookRequest.SerializeToString,
            mqtt__service__pb2.RegisterWebhookResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UnregisterWebhook(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,
            '/isa.mqtt.MQTTService/UnregisterWebhook',
            mqtt__service__pb2.UnregisterWebhookRequest.SerializeToString,
            mqtt__service__pb2.UnregisterWebhookResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListWebhooks(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,
            '/isa.mqtt.MQTTService/ListWebhooks',
            mqtt__service__pb2.ListWebhooksRequest.SerializeToString,
            mqtt__service__pb2.ListWebhooksResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
