box-node-sdk
Version:
Official SDK for Box Platform APIs
61 lines • 2.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeQueryOrderByV2026R0DirectionField = serializeQueryOrderByV2026R0DirectionField;
exports.deserializeQueryOrderByV2026R0DirectionField = deserializeQueryOrderByV2026R0DirectionField;
exports.serializeQueryOrderByV2026R0 = serializeQueryOrderByV2026R0;
exports.deserializeQueryOrderByV2026R0 = deserializeQueryOrderByV2026R0;
const errors_1 = require("../../box/errors.js");
const json_1 = require("../../serialization/json.js");
const json_2 = require("../../serialization/json.js");
function serializeQueryOrderByV2026R0DirectionField(val) {
return val;
}
function deserializeQueryOrderByV2026R0DirectionField(val) {
if (val == 'asc') {
return val;
}
if (val == 'desc') {
return val;
}
if ((0, json_1.sdIsString)(val)) {
return val;
}
throw new errors_1.BoxSdkError({
message: "Can't deserialize QueryOrderByV2026R0DirectionField",
});
}
function serializeQueryOrderByV2026R0(val) {
return {
['field_key']: val.fieldKey,
['direction']: serializeQueryOrderByV2026R0DirectionField(val.direction),
};
}
function deserializeQueryOrderByV2026R0(val) {
if (!(0, json_2.sdIsMap)(val)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "QueryOrderByV2026R0"',
});
}
if (val.field_key == void 0) {
throw new errors_1.BoxSdkError({
message: 'Expecting "field_key" of type "QueryOrderByV2026R0" to be defined',
});
}
if (!(0, json_1.sdIsString)(val.field_key)) {
throw new errors_1.BoxSdkError({
message: 'Expecting string for "field_key" of type "QueryOrderByV2026R0"',
});
}
const fieldKey = val.field_key;
if (val.direction == void 0) {
throw new errors_1.BoxSdkError({
message: 'Expecting "direction" of type "QueryOrderByV2026R0" to be defined',
});
}
const direction = deserializeQueryOrderByV2026R0DirectionField(val.direction);
return {
fieldKey: fieldKey,
direction: direction,
};
}
//# sourceMappingURL=queryOrderByV2026R0.js.map