box-node-sdk
Version:
Official SDK for Box Platform APIs
59 lines • 2.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAutomateWorkflowStartRequestV2026R0 = serializeAutomateWorkflowStartRequestV2026R0;
exports.deserializeAutomateWorkflowStartRequestV2026R0 = deserializeAutomateWorkflowStartRequestV2026R0;
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 serializeAutomateWorkflowStartRequestV2026R0(val) {
return {
['workflow_action_id']: val.workflowActionId,
['file_ids']: val.fileIds.map(function (item) {
return item;
}),
};
}
function deserializeAutomateWorkflowStartRequestV2026R0(val) {
if (!(0, json_3.sdIsMap)(val)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "AutomateWorkflowStartRequestV2026R0"',
});
}
if (val.workflow_action_id == void 0) {
throw new errors_1.BoxSdkError({
message: 'Expecting "workflow_action_id" of type "AutomateWorkflowStartRequestV2026R0" to be defined',
});
}
if (!(0, json_1.sdIsString)(val.workflow_action_id)) {
throw new errors_1.BoxSdkError({
message: 'Expecting string for "workflow_action_id" of type "AutomateWorkflowStartRequestV2026R0"',
});
}
const workflowActionId = val.workflow_action_id;
if (val.file_ids == void 0) {
throw new errors_1.BoxSdkError({
message: 'Expecting "file_ids" of type "AutomateWorkflowStartRequestV2026R0" to be defined',
});
}
if (!(0, json_2.sdIsList)(val.file_ids)) {
throw new errors_1.BoxSdkError({
message: 'Expecting array for "file_ids" of type "AutomateWorkflowStartRequestV2026R0"',
});
}
const fileIds = (0, json_2.sdIsList)(val.file_ids)
? val.file_ids.map(function (itm) {
if (!(0, json_1.sdIsString)(itm)) {
throw new errors_1.BoxSdkError({
message: 'Expecting string for "AutomateWorkflowStartRequestV2026R0"',
});
}
return itm;
})
: [];
return {
workflowActionId: workflowActionId,
fileIds: fileIds,
};
}
//# sourceMappingURL=automateWorkflowStartRequestV2026R0.js.map