UNPKG

xiot-core-spec-ts

Version:
27 lines (26 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OwnerDeviceSomewhereChangedCodec = void 0; const OwnerDeviceSomewhereChanged_1 = require("../../../typedef/notice/owner/impl/OwnerDeviceSomewhereChanged"); const SomewhereCodec_1 = require("../../somewhere/SomewhereCodec"); class OwnerDeviceSomewhereChangedCodec { static encode(x) { return { timestamp: x.timestamp, appId: x.appId, ownerId: x.ownerId, did: x.did, somewhere: SomewhereCodec_1.SomewhereCodec.encodeObject(x.somewhere) }; } static decode(x) { const appId = x["appId"] || ""; const ownerId = x["ownerId"] || ""; const userId = x["userId"] || ""; const did = x["did"]; const somewhere = x["somewhere"]; const timestamp = x["timestamp"] || 0; return new OwnerDeviceSomewhereChanged_1.OwnerDeviceSomewhereChanged(timestamp, appId, ownerId, userId, did, SomewhereCodec_1.SomewhereCodec.decodeObject(somewhere)); } } exports.OwnerDeviceSomewhereChangedCodec = OwnerDeviceSomewhereChangedCodec;