box-node-sdk
Version:
Official SDK for Box Platform APIs
42 lines • 1.63 kB
JavaScript
import { BoxSdkError } from '../../box/errors.js';
import { sdIsBoolean } from '../../serialization/json.js';
import { sdIsString } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeHubCopyRequestV2025R0(val) {
return {
['title']: val.title,
['description']: val.description,
['include_items']: val.includeItems,
};
}
export function deserializeHubCopyRequestV2025R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "HubCopyRequestV2025R0"',
});
}
if (!(val.title == void 0) && !sdIsString(val.title)) {
throw new BoxSdkError({
message: 'Expecting string for "title" of type "HubCopyRequestV2025R0"',
});
}
const title = val.title == void 0 ? void 0 : val.title;
if (!(val.description == void 0) && !sdIsString(val.description)) {
throw new BoxSdkError({
message: 'Expecting string for "description" of type "HubCopyRequestV2025R0"',
});
}
const description = val.description == void 0 ? void 0 : val.description;
if (!(val.include_items == void 0) && !sdIsBoolean(val.include_items)) {
throw new BoxSdkError({
message: 'Expecting boolean for "include_items" of type "HubCopyRequestV2025R0"',
});
}
const includeItems = val.include_items == void 0 ? void 0 : val.include_items;
return {
title: title,
description: description,
includeItems: includeItems,
};
}
//# sourceMappingURL=hubCopyRequestV2025R0.js.map