box-node-sdk
Version:
Official SDK for Box Platform APIs
59 lines • 2.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAutomateWorkflowsV2026R0 = serializeAutomateWorkflowsV2026R0;
exports.deserializeAutomateWorkflowsV2026R0 = deserializeAutomateWorkflowsV2026R0;
const automateWorkflowActionV2026R0_1 = require("./automateWorkflowActionV2026R0.js");
const automateWorkflowActionV2026R0_2 = require("./automateWorkflowActionV2026R0.js");
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");
const json_4 = require("../../serialization/json.js");
function serializeAutomateWorkflowsV2026R0(val) {
return {
['entries']: val.entries == void 0
? val.entries
: val.entries.map(function (item) {
return (0, automateWorkflowActionV2026R0_1.serializeAutomateWorkflowActionV2026R0)(item);
}),
['limit']: val.limit,
['next_marker']: val.nextMarker,
};
}
function deserializeAutomateWorkflowsV2026R0(val) {
if (!(0, json_4.sdIsMap)(val)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "AutomateWorkflowsV2026R0"',
});
}
if (!(val.entries == void 0) && !(0, json_3.sdIsList)(val.entries)) {
throw new errors_1.BoxSdkError({
message: 'Expecting array for "entries" of type "AutomateWorkflowsV2026R0"',
});
}
const entries = val.entries == void 0
? void 0
: (0, json_3.sdIsList)(val.entries)
? val.entries.map(function (itm) {
return (0, automateWorkflowActionV2026R0_2.deserializeAutomateWorkflowActionV2026R0)(itm);
})
: [];
if (!(val.limit == void 0) && !(0, json_1.sdIsNumber)(val.limit)) {
throw new errors_1.BoxSdkError({
message: 'Expecting number for "limit" of type "AutomateWorkflowsV2026R0"',
});
}
const limit = val.limit == void 0 ? void 0 : val.limit;
if (!(val.next_marker == void 0) && !(0, json_2.sdIsString)(val.next_marker)) {
throw new errors_1.BoxSdkError({
message: 'Expecting string for "next_marker" of type "AutomateWorkflowsV2026R0"',
});
}
const nextMarker = val.next_marker == void 0 ? void 0 : val.next_marker;
return {
entries: entries,
limit: limit,
nextMarker: nextMarker,
};
}
//# sourceMappingURL=automateWorkflowsV2026R0.js.map