UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

68 lines 2.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeHubDocumentPageV2025R0 = serializeHubDocumentPageV2025R0; exports.deserializeHubDocumentPageV2025R0 = deserializeHubDocumentPageV2025R0; const errors_1 = require("../../box/errors.js"); const json_1 = require("../../serialization/json.js"); const json_2 = require("../../serialization/json.js"); function serializeHubDocumentPageV2025R0(val) { return { ['id']: val.id, ['type']: val.type, ['parent_id']: val.parentId, ['title_fragment']: val.titleFragment, }; } function deserializeHubDocumentPageV2025R0(val) { if (!(0, json_2.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "HubDocumentPageV2025R0"', }); } if (val.id == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "id" of type "HubDocumentPageV2025R0" to be defined', }); } if (!(0, json_1.sdIsString)(val.id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "id" of type "HubDocumentPageV2025R0"', }); } const id = val.id; if (val.type == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "type" of type "HubDocumentPageV2025R0" to be defined', }); } if (!(0, json_1.sdIsString)(val.type)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "type" of type "HubDocumentPageV2025R0"', }); } const type = val.type; if (!(val.parent_id == void 0) && !(0, json_1.sdIsString)(val.parent_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "parent_id" of type "HubDocumentPageV2025R0"', }); } const parentId = val.parent_id == void 0 ? void 0 : val.parent_id; if (val.title_fragment == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "title_fragment" of type "HubDocumentPageV2025R0" to be defined', }); } if (!(0, json_1.sdIsString)(val.title_fragment)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "title_fragment" of type "HubDocumentPageV2025R0"', }); } const titleFragment = val.title_fragment; return { id: id, type: type, parentId: parentId, titleFragment: titleFragment, }; } //# sourceMappingURL=hubDocumentPageV2025R0.js.map