Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
Property(40, '!B', 'wildcard_subscription_available', ['CONNACK']),
Property(41, '!B', 'sub_id_available', ['CONNACK', ]),
Property(42, '!B', 'shared_subscription_available', ['CONNACK']),
]
raise ValueError('Either id or name should be not None')
if name is not None:
return PROPERTIES_BY_NAME.get(name)
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
if name is not None:
return PROPERTIES_BY_NAME.get(name)
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
if (name is None and id_ is None) or (name is not None and id_ is not None):
raise ValueError('Either id or name should be not None')
if name is not None:
return PROPERTIES_BY_NAME.get(name)
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
Property(40, '!B', 'wildcard_subscription_available', ['CONNACK']),
Property(41, '!B', 'sub_id_available', ['CONNACK', ]),
Property(42, '!B', 'shared_subscription_available', ['CONNACK']),
]
PROPERTIES_BY_ID = {pr.id: pr for pr in PROPERTIES}
PROPERTIES_BY_NAME = {pr.name: pr for pr in PROPERTIES}
return PROPERTIES_BY_NAME.get(name)
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
Property(40, '!B', 'wildcard_subscription_available', ['CONNACK']),
@classmethod
def factory(cls, id_=None, name=None):
if (name is None and id_ is None) or (name is not None and id_ is not None):
raise ValueError('Either id or name should be not None')
if name is not None:
return PROPERTIES_BY_NAME.get(name)
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
Property(40, '!B', 'wildcard_subscription_available', ['CONNACK']),
Property(41, '!B', 'sub_id_available', ['CONNACK', ]),
Property(42, '!B', 'shared_subscription_available', ['CONNACK']),
]
PROPERTIES_BY_ID = {pr.id: pr for pr in PROPERTIES}
else:
return PROPERTIES_BY_ID.get(id_)
PROPERTIES = [
Property(1, '!B', 'payload_format_id', ['PUBLISH', ]),
Property(2, '!L', 'message_expiry_interval', ['PUBLISH', ]),
Property(3, 'u8', 'content_type', ['PUBLISH']),
Property(8, 'u8', 'response_topic', ['PUBLISH', ]),
Property(9, 'b', 'correlation_data', ['PUBLISH']),
Property(11, 'vbi', 'subscription_identifier', ['PUBLISH', 'SUBSCRIBE']),
Property(17, '!L', 'session_expiry_interval', ['CONNECT', ]),
Property(18, 'u8', 'assigned_client_identifier', ['CONNACK', ]),
Property(19, '!H', 'server_keep_alive', ['CONNACK']),
Property(21, 'u8', 'auth_method', ['CONNECT', 'CONNACK', 'AUTH']),
Property(23, '!B', 'request_problem_info', ['CONNECT']),
Property(24, '!L', 'will_delay_interval', ['CONNECT', ]),
Property(25, '!B', 'request_response_info', ['CONNECT']),
Property(26, 'u8', 'response_info', ['CONNACK']),
Property(28, 'u8', 'server_reference', ['CONNACK', 'DISCONNECT']),
Property(31, 'u8', 'reason_string', ['CONNACK', 'PUBACK', 'PUBREC', 'PUBREL', 'PUBCOMP', 'SUBACK', 'UNSUBACK',
'DISCONNECT', 'AUTH']),
Property(33, '!H', 'receive_maximum', ['CONNECT', 'CONNACK']),
Property(34, '!H', 'topic_alias_maximum', ['CONNECT', 'CONNACK']),
Property(35, '!H', 'topic_alias', ['CONNECT', 'CONNACK']),
Property(36, '!B', 'max_qos', ['CONNACK', ]),
Property(37, '!B', 'retain_available', ['CONNACK', ]),
Property(38, 'u8x2', 'user_property', ['CONNECT', 'CONNACK', 'PUBLISH', 'PUBACK', 'PUBREC', 'PUBREL',
'PUBCOMP', 'SUBACK', 'UNSUBACK', 'DISCONNECT', 'AUTH']),
Property(39, '!L', 'maximum_packet_size', ['CONNECT', 'CONNACK']),
Property(40, '!B', 'wildcard_subscription_available', ['CONNACK']),
Property(41, '!B', 'sub_id_available', ['CONNACK', ]),