box-node-sdk
Version:
Official SDK for Box Platform APIs
37 lines • 1.33 kB
JavaScript
import { BoxSdkError } from '../../box/errors.js';
import { sdIsString } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeQueryAncestorReferenceV2026R0(val) {
return { ['id']: val.id, ['type']: val.type };
}
export function deserializeQueryAncestorReferenceV2026R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "QueryAncestorReferenceV2026R0"',
});
}
if (val.id == void 0) {
throw new BoxSdkError({
message: 'Expecting "id" of type "QueryAncestorReferenceV2026R0" to be defined',
});
}
if (!sdIsString(val.id)) {
throw new BoxSdkError({
message: 'Expecting string for "id" of type "QueryAncestorReferenceV2026R0"',
});
}
const id = val.id;
if (val.type == void 0) {
throw new BoxSdkError({
message: 'Expecting "type" of type "QueryAncestorReferenceV2026R0" to be defined',
});
}
if (!sdIsString(val.type)) {
throw new BoxSdkError({
message: 'Expecting string for "type" of type "QueryAncestorReferenceV2026R0"',
});
}
const type = val.type;
return { id: id, type: type };
}
//# sourceMappingURL=queryAncestorReferenceV2026R0.js.map