xiot-core-message-ts
Version:
23 lines (22 loc) • 844 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const xiot_core_spec_ts_1 = require("xiot-core-spec-ts");
const ChildrenAdded_1 = require("../../typedef/iq/basic/ChildrenAdded");
class ChildrenAddedCodec {
encodeQueryContent(query) {
if (query instanceof ChildrenAdded_1.QueryChildrenAdded) {
return { children: xiot_core_spec_ts_1.DeviceChildCodec.encodeArray(query.children) };
}
return null;
}
encodeResultContent(result) {
return null;
}
decodeQuery(id, content) {
return new ChildrenAdded_1.QueryChildrenAdded(id, xiot_core_spec_ts_1.DeviceChildCodec.decodeArray(content.children));
}
decodeResult(id, content) {
return new ChildrenAdded_1.ResultChildrenAdded(id);
}
}
exports.ChildrenAddedCodec = ChildrenAddedCodec;