box-node-sdk
Version:
Official SDK for Box Platform APIs
36 lines • 1.33 kB
JavaScript
import { serializeQueryInsightEntryV2026R0 } from './queryInsightEntryV2026R0.js';
import { deserializeQueryInsightEntryV2026R0 } from './queryInsightEntryV2026R0.js';
import { BoxSdkError } from '../../box/errors.js';
import { sdIsList } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeQueryInsightsV2026R0(val) {
return {
['insights']: val.insights.map(function (item) {
return serializeQueryInsightEntryV2026R0(item);
}),
};
}
export function deserializeQueryInsightsV2026R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "QueryInsightsV2026R0"',
});
}
if (val.insights == void 0) {
throw new BoxSdkError({
message: 'Expecting "insights" of type "QueryInsightsV2026R0" to be defined',
});
}
if (!sdIsList(val.insights)) {
throw new BoxSdkError({
message: 'Expecting array for "insights" of type "QueryInsightsV2026R0"',
});
}
const insights = sdIsList(val.insights)
? val.insights.map(function (itm) {
return deserializeQueryInsightEntryV2026R0(itm);
})
: [];
return { insights: insights };
}
//# sourceMappingURL=queryInsightsV2026R0.js.map