xiot-core-spec-ts
Version:
XIOT Specification Codec
19 lines (18 loc) • 862 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const XepRecordPropertiesChanged_1 = require("../../typedef/xep/impl/XepRecordPropertiesChanged");
const PropertyOperationCodec_1 = require("../operation/PropertyOperationCodec");
class XepRecordDevicePropertiesChangedCodec {
static encodeObject(record) {
return {
ownerId: record.ownerId,
properties: PropertyOperationCodec_1.PropertyOperationCodec.encodeQuerySET(record.operations)
};
}
static decodeObject(o) {
const ownerId = o.ownerId;
const properties = PropertyOperationCodec_1.PropertyOperationCodec.decodeValues(o);
return new XepRecordPropertiesChanged_1.XepRecordPropertiesChanged(ownerId, properties);
}
}
exports.XepRecordDevicePropertiesChangedCodec = XepRecordDevicePropertiesChangedCodec;