/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.2
 * 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 FlowStatusFailureModule {
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "job", skip_serializing_if = "Option::is_none")]
    pub job: Option<uuid::Uuid>,
    #[serde(rename = "count", skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[serde(rename = "progress", skip_serializing_if = "Option::is_none")]
    pub progress: Option<i32>,
    #[serde(rename = "iterator", skip_serializing_if = "Option::is_none")]
    pub iterator: Option<Box<models::FlowStatusModuleIterator>>,
    #[serde(rename = "flow_jobs", skip_serializing_if = "Option::is_none")]
    pub flow_jobs: Option<Vec<String>>,
    #[serde(rename = "flow_jobs_success", skip_serializing_if = "Option::is_none")]
    pub flow_jobs_success: Option<Vec<bool>>,
    #[serde(rename = "flow_jobs_duration", skip_serializing_if = "Option::is_none")]
    pub flow_jobs_duration: Option<Box<models::FlowStatusModuleFlowJobsDuration>>,
    #[serde(rename = "branch_chosen", skip_serializing_if = "Option::is_none")]
    pub branch_chosen: Option<Box<models::FlowStatusModuleBranchChosen>>,
    #[serde(rename = "branchall", skip_serializing_if = "Option::is_none")]
    pub branchall: Option<Box<models::FlowStatusModuleBranchall>>,
    #[serde(rename = "approvers", skip_serializing_if = "Option::is_none")]
    pub approvers: Option<Vec<models::GetApprovalInfo200ResponseApproversInner>>,
    #[serde(rename = "failed_retries", skip_serializing_if = "Option::is_none")]
    pub failed_retries: Option<Vec<uuid::Uuid>>,
    #[serde(rename = "skipped", skip_serializing_if = "Option::is_none")]
    pub skipped: Option<bool>,
    #[serde(rename = "agent_actions", skip_serializing_if = "Option::is_none")]
    pub agent_actions: Option<Vec<models::FlowStatusModuleAgentActionsInner>>,
    #[serde(rename = "agent_actions_success", skip_serializing_if = "Option::is_none")]
    pub agent_actions_success: Option<Vec<bool>>,
    #[serde(rename = "parent_module", skip_serializing_if = "Option::is_none")]
    pub parent_module: Option<String>,
}

impl FlowStatusFailureModule {
    pub fn new(r#type: Type) -> FlowStatusFailureModule {
        FlowStatusFailureModule {
            r#type,
            id: None,
            job: None,
            count: None,
            progress: None,
            iterator: None,
            flow_jobs: None,
            flow_jobs_success: None,
            flow_jobs_duration: None,
            branch_chosen: None,
            branchall: None,
            approvers: None,
            failed_retries: None,
            skipped: None,
            agent_actions: None,
            agent_actions_success: None,
            parent_module: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "WaitingForPriorSteps")]
    WaitingForPriorSteps,
    #[serde(rename = "WaitingForEvents")]
    WaitingForEvents,
    #[serde(rename = "WaitingForExecutor")]
    WaitingForExecutor,
    #[serde(rename = "InProgress")]
    InProgress,
    #[serde(rename = "Success")]
    Success,
    #[serde(rename = "Failure")]
    Failure,
}

impl Default for Type {
    fn default() -> Type {
        Self::WaitingForPriorSteps
    }
}

