box-node-sdk
Version:
Official SDK for Box Platform APIs
32 lines • 1.33 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 serializeListUserV2025R0(val) {
return { ['id']: val.id, ['name']: val.name, ['email']: val.email };
}
export function deserializeListUserV2025R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({ message: 'Expecting a map for "ListUserV2025R0"' });
}
if (!(val.id == void 0) && !sdIsNumber(val.id)) {
throw new BoxSdkError({
message: 'Expecting number for "id" of type "ListUserV2025R0"',
});
}
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 "ListUserV2025R0"',
});
}
const name = val.name == void 0 ? void 0 : val.name;
if (!(val.email == void 0) && !sdIsString(val.email)) {
throw new BoxSdkError({
message: 'Expecting string for "email" of type "ListUserV2025R0"',
});
}
const email = val.email == void 0 ? void 0 : val.email;
return { id: id, name: name, email: email };
}
//# sourceMappingURL=listUserV2025R0.js.map