box-node-sdk
Version:
Official SDK for Box Platform APIs
28 lines • 1.11 kB
JavaScript
import { BoxSdkError } from '../../box/errors.js';
import { sdIsNumber } from '../../serialization/json.js';
import { sdIsString } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeUserTrackingCodeV2025R0(val) {
return { ['id']: val.id, ['name']: val.name };
}
export function deserializeUserTrackingCodeV2025R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "UserTrackingCodeV2025R0"',
});
}
if (!(val.id == void 0) && !sdIsNumber(val.id)) {
throw new BoxSdkError({
message: 'Expecting number for "id" of type "UserTrackingCodeV2025R0"',
});
}
const id = val.id == void 0 ? void 0 : val.id;
if (!(val.name == void 0) && !sdIsString(val.name)) {
throw new BoxSdkError({
message: 'Expecting string for "name" of type "UserTrackingCodeV2025R0"',
});
}
const name = val.name == void 0 ? void 0 : val.name;
return { id: id, name: name };
}
//# sourceMappingURL=userTrackingCodeV2025R0.js.map