UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

40 lines 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeQueryInsightsV2026R0 = serializeQueryInsightsV2026R0; exports.deserializeQueryInsightsV2026R0 = deserializeQueryInsightsV2026R0; const queryInsightEntryV2026R0_1 = require("./queryInsightEntryV2026R0.js"); const queryInsightEntryV2026R0_2 = require("./queryInsightEntryV2026R0.js"); const errors_1 = require("../../box/errors.js"); const json_1 = require("../../serialization/json.js"); const json_2 = require("../../serialization/json.js"); function serializeQueryInsightsV2026R0(val) { return { ['insights']: val.insights.map(function (item) { return (0, queryInsightEntryV2026R0_1.serializeQueryInsightEntryV2026R0)(item); }), }; } function deserializeQueryInsightsV2026R0(val) { if (!(0, json_2.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "QueryInsightsV2026R0"', }); } if (val.insights == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "insights" of type "QueryInsightsV2026R0" to be defined', }); } if (!(0, json_1.sdIsList)(val.insights)) { throw new errors_1.BoxSdkError({ message: 'Expecting array for "insights" of type "QueryInsightsV2026R0"', }); } const insights = (0, json_1.sdIsList)(val.insights) ? val.insights.map(function (itm) { return (0, queryInsightEntryV2026R0_2.deserializeQueryInsightEntryV2026R0)(itm); }) : []; return { insights: insights }; } //# sourceMappingURL=queryInsightsV2026R0.js.map