/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowStatus {
    #[serde(rename = "step")]
    pub step: i32,
    #[serde(rename = "modules")]
    pub modules: Vec<models::FlowStatusModule>,
    #[serde(rename = "user_states", skip_serializing_if = "Option::is_none")]
    pub user_states: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "preprocessor_module", skip_serializing_if = "Option::is_none")]
    pub preprocessor_module: Option<Box<models::FlowStatusModule>>,
    #[serde(rename = "failure_module")]
    pub failure_module: Box<models::FlowStatusFailureModule>,
    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
    pub retry: Option<Box<models::FlowStatusRetry>>,
}

impl FlowStatus {
    pub fn new(step: i32, modules: Vec<models::FlowStatusModule>, failure_module: models::FlowStatusFailureModule) -> FlowStatus {
        FlowStatus {
            step,
            modules,
            user_states: None,
            preprocessor_module: None,
            failure_module: Box::new(failure_module),
            retry: None,
        }
    }
}

