xiot-core-spec-ts
Version:
XIOT Specification Codec
21 lines (20 loc) • 893 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OwnerEventOccurredCodec = void 0;
const OwnerEventOccurred_1 = require("../../../typedef/notice/owner/impl/OwnerEventOccurred");
const EventOperationCodec_1 = require("../../operation/EventOperationCodec");
class OwnerEventOccurredCodec {
static encode(x) {
return {
event: EventOperationCodec_1.EventOperationCodec.Query.encodeObject(x.event),
timestamp: x.timestamp,
appId: x.appId,
ownerId: x.ownerId
};
}
static decode(o) {
const e = EventOperationCodec_1.EventOperationCodec.Query.decodeObject(o.event);
return new OwnerEventOccurred_1.OwnerEventOccurred(o.timestamp || new Date().getTime(), o.appId || '', o.ownerId || '', o.userId || '', e);
}
}
exports.OwnerEventOccurredCodec = OwnerEventOccurredCodec;