box-node-sdk
Version:
Official SDK for Box Platform APIs
61 lines • 2.22 kB
JavaScript
import { serializeQueryResultEntryV2026R0 } from './queryResultEntryV2026R0.js';
import { deserializeQueryResultEntryV2026R0 } from './queryResultEntryV2026R0.js';
import { BoxSdkError } from '../../box/errors.js';
import { sdIsNumber } from '../../serialization/json.js';
import { sdIsString } from '../../serialization/json.js';
import { sdIsList } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeQueryResultsV2026R0(val) {
return {
['entries']: val.entries.map(function (item) {
return serializeQueryResultEntryV2026R0(item);
}),
['next_marker']: val.nextMarker,
['limit']: val.limit,
};
}
export function deserializeQueryResultsV2026R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "QueryResultsV2026R0"',
});
}
if (val.entries == void 0) {
throw new BoxSdkError({
message: 'Expecting "entries" of type "QueryResultsV2026R0" to be defined',
});
}
if (!sdIsList(val.entries)) {
throw new BoxSdkError({
message: 'Expecting array for "entries" of type "QueryResultsV2026R0"',
});
}
const entries = sdIsList(val.entries)
? val.entries.map(function (itm) {
return deserializeQueryResultEntryV2026R0(itm);
})
: [];
if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) {
throw new BoxSdkError({
message: 'Expecting string for "next_marker" of type "QueryResultsV2026R0"',
});
}
const nextMarker = val.next_marker == void 0 ? void 0 : val.next_marker;
if (val.limit == void 0) {
throw new BoxSdkError({
message: 'Expecting "limit" of type "QueryResultsV2026R0" to be defined',
});
}
if (!sdIsNumber(val.limit)) {
throw new BoxSdkError({
message: 'Expecting number for "limit" of type "QueryResultsV2026R0"',
});
}
const limit = val.limit;
return {
entries: entries,
nextMarker: nextMarker,
limit: limit,
};
}
//# sourceMappingURL=queryResultsV2026R0.js.map