box-node-sdk
Version:
Official SDK for Box Platform APIs
40 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeQueryInsightsGroupByV2026R0 = serializeQueryInsightsGroupByV2026R0;
exports.deserializeQueryInsightsGroupByV2026R0 = deserializeQueryInsightsGroupByV2026R0;
const errors_1 = require("../../box/errors.js");
const json_1 = require("../../serialization/json.js");
const json_2 = require("../../serialization/json.js");
const json_3 = require("../../serialization/json.js");
function serializeQueryInsightsGroupByV2026R0(val) {
return { ['field']: val.field, ['bucket_limit']: val.bucketLimit };
}
function deserializeQueryInsightsGroupByV2026R0(val) {
if (!(0, json_3.sdIsMap)(val)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "QueryInsightsGroupByV2026R0"',
});
}
if (val.field == void 0) {
throw new errors_1.BoxSdkError({
message: 'Expecting "field" of type "QueryInsightsGroupByV2026R0" to be defined',
});
}
if (!(0, json_2.sdIsString)(val.field)) {
throw new errors_1.BoxSdkError({
message: 'Expecting string for "field" of type "QueryInsightsGroupByV2026R0"',
});
}
const field = val.field;
if (!(val.bucket_limit == void 0) && !(0, json_1.sdIsNumber)(val.bucket_limit)) {
throw new errors_1.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