UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

36 lines 1.38 kB
import { BoxSdkError } from '../../box/errors.js'; import { sdIsNumber } from '../../serialization/json.js'; import { sdIsString } from '../../serialization/json.js'; import { sdIsMap } from '../../serialization/json.js'; export function serializeQueryInsightsGroupByV2026R0(val) { return { ['field']: val.field, ['bucket_limit']: val.bucketLimit }; } export function deserializeQueryInsightsGroupByV2026R0(val) { if (!sdIsMap(val)) { throw new BoxSdkError({ message: 'Expecting a map for "QueryInsightsGroupByV2026R0"', }); } if (val.field == void 0) { throw new BoxSdkError({ message: 'Expecting "field" of type "QueryInsightsGroupByV2026R0" to be defined', }); } if (!sdIsString(val.field)) { throw new BoxSdkError({ message: 'Expecting string for "field" of type "QueryInsightsGroupByV2026R0"', }); } const field = val.field; if (!(val.bucket_limit == void 0) && !sdIsNumber(val.bucket_limit)) { throw new BoxSdkError({ message: 'Expecting number for "bucket_limit" of type "QueryInsightsGroupByV2026R0"', }); } const bucketLimit = val.bucket_limit == void 0 ? void 0 : val.bucket_limit; return { field: field, bucketLimit: bucketLimit, }; } //# sourceMappingURL=queryInsightsGroupByV2026R0.js.map