class ProjectConfig(TlvModel): project_id = BytesField(0x80) description = BytesField(0x90) inherit_from = BytesField(0x91) sync_interval = UintField(0x92) ref_configs = RepeatedField(ModelField(0x93, RefConfig)) labels = RepeatedField(ModelField(0x94, LabelConfig))
class Model(TlvModel): name = NameField() int_val = UintField(0x03) bytes_val = BytesField(0x02) bool_val = BoolField(0x01) array = ModelField(0x05, WordArray) flag_val = UintField(0x06, val_base_type=FlagVal) enum_arr = RepeatedField(UintField(0x07, val_base_type=EnumVal)) str_val = BytesField(0x08, is_string=True) str_arr = RepeatedField(BytesField(0x09, is_string=True))
class PrefixesInStorage(TlvModel): prefixes = RepeatedField(NameField())
class RepeatedNames(TlvModel): names = RepeatedField(NameField())
class DeviceList(TlvModel): device = RepeatedField(ModelField(1, DeviceItem))
class SharedSecrets(TlvModel): shared_secrets = RepeatedField(ModelField(1, SharedSecretsItem))
class AccessList(TlvModel): access = RepeatedField(ModelField(1, AccessItem))
class ServiceList(TlvModel): service = RepeatedField(ModelField(1, ServiceItem))
class ServiceList(TlvModel): services = RepeatedField(ModelField(1, ServiceItem)) service_meta_items = RepeatedField(ModelField(2, ServiceMetaItem))
class Catalog(TlvModel): entries = RepeatedField(BytesField(0xaf))
class GroupConfig(TlvModel): group_id = BytesField(0x82) full_name = BytesField(0xa2) owner = BytesField(0xa3) members = RepeatedField(BytesField(0xa4))
class LabelConfig(TlvModel): label = BytesField(0x98) function = UintField(0x99) default_value = UintField(0x9a) values = RepeatedField(ModelField(0x9b, LabelValue))
class RefConfig(TlvModel): ref_name = BytesField(0x95) operation_rules = RepeatedField(ModelField(0x96, OperationRule)) label_rules = RepeatedField(ModelField(0x97, LabelRule))
class WordArray(TlvModel): words = RepeatedField(UintField(0x01, fixed_len=2))
class SqlsTlvModel(TlvModel): sqls = RepeatedField( BytesField(0x02)) # multiple SQL statements, each is a byte array
class CatalogDataListParameter(TlvModel): name = NameField() insert_data_names = RepeatedField(NameField()) delete_data_names = RepeatedField(NameField())