// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Record of how a conditional block routed during a workflow run.
/// Captures each condition that was evaluated (`evaluations`), which output
/// branches were chosen (`selected_handles`), and the branch and condition
/// IDs that matched (`matched_branch_id`, `matched_condition_ids`).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConditionalEvaluation {
    /// The operation that produced this artifact
    ///
    /// Defaults to `conditional_evaluation`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub operation: Option<String>,
    pub id: String,
    pub run_id: String,
    pub step_id: String,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub evaluations: Option<Vec<ConditionEvaluationResult>>,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub selected_handles: Option<Vec<String>>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub matched_branch_id: Option<String>,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub matched_condition_ids: Option<Vec<String>>,
    /// Timestamp when this artifact was created.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
}
impl ConditionalEvaluation {
    /// Construct a new `ConditionalEvaluation` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        run_id: impl Into<String>,
        step_id: impl Into<String>,
    ) -> Self {
        Self {
            operation: Default::default(),
            id: id.into(),
            run_id: run_id.into(),
            step_id: step_id.into(),
            evaluations: Default::default(),
            selected_handles: Default::default(),
            matched_branch_id: Default::default(),
            matched_condition_ids: Default::default(),
            created_at: Default::default(),
        }
    }
}
