babelforce-manager-sdk 0.44.0

Rust SDK for the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations.
Documentation
/*
 * task-automation API
 *
 * task-automation engine to automate and customize web based integration processes
 *
 * The version of the OpenAPI document: 3.63.10
 * Contact: support@babelforce.com
 * Generated by: https://openapi-generator.tech
 */

use crate::gen::task_automation::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IterationProperties {
    ///  The number of items specified for iteration. If you supply more elements, a runtime error will occur. Additionally, when increasing this limit beyond the default, consider setting the timeout property on both the state, parents and iteration.
    #[serde(rename = "items_max", skip_serializing_if = "Option::is_none")]
    pub items_max: Option<i32>,
    #[serde(rename = "result")]
    pub result: Result,
    /// on child error continue or fail the iteration
    #[serde(rename = "onError", skip_serializing_if = "Option::is_none")]
    pub on_error: Option<OnError>,
    #[serde(rename = "items")]
    pub items: Vec<serde_json::Value>,
    #[serde(rename = "actions", skip_serializing_if = "Option::is_none")]
    pub actions: Option<Vec<models::TypedAction>>,
}

impl IterationProperties {
    pub fn new(result: Result, items: Vec<serde_json::Value>) -> IterationProperties {
        IterationProperties {
            items_max: None,
            result,
            on_error: None,
            items,
            actions: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Result {
    #[serde(rename = "single")]
    Single,
    #[serde(rename = "full")]
    Full,
}

impl Default for Result {
    fn default() -> Result {
        Self::Single
    }
}
/// on child error continue or fail the iteration
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OnError {
    #[serde(rename = "fail")]
    Fail,
    #[serde(rename = "continue")]
    Continue,
}

impl Default for OnError {
    fn default() -> OnError {
        Self::Fail
    }
}