// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A saved workflow eval: a target block, an input `source`, and the `assertion` evaluated against its output.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowEval {
    pub id: String,
    pub workflow_id: String,
    pub target: WorkflowEvalBlockTarget,
    pub source: CreateWorkflowEvalRequestSourceOneOf,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub assertion: Option<AssertionSpec>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub assertion_schema_dep: Option<AssertionSchemaDep>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub assertion_drift_status: Option<AssertionDriftStatus>,
    /// Defaults to `unknown`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub schema_drift: Option<WorkflowEvalSchemaDrift>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub schema_drift_detail: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub freshness: Option<ArtifactFreshness>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub drift: Option<ArtifactDrift>,
    /// Defaults to `valid`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub validation_status: Option<String>,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub validation_issues: Option<Vec<String>>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub latest_run_summary: Option<LatestBlockEvalRunSummary>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub latest_passing_run_summary: Option<LatestBlockEvalRunSummary>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub latest_failing_run_summary: Option<LatestBlockEvalRunSummary>,
    /// When the workflow eval was created
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    /// When the workflow eval was last updated
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub updated_at: Option<String>,
}
impl WorkflowEval {
    /// Construct a new `WorkflowEval` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        workflow_id: impl Into<String>,
        target: WorkflowEvalBlockTarget,
        source: CreateWorkflowEvalRequestSourceOneOf,
    ) -> Self {
        Self {
            id: id.into(),
            workflow_id: workflow_id.into(),
            target,
            source,
            name: Default::default(),
            assertion: Default::default(),
            assertion_schema_dep: Default::default(),
            assertion_drift_status: Default::default(),
            schema_drift: Default::default(),
            schema_drift_detail: Default::default(),
            freshness: Default::default(),
            drift: Default::default(),
            validation_status: Default::default(),
            validation_issues: Default::default(),
            latest_run_summary: Default::default(),
            latest_passing_run_summary: Default::default(),
            latest_failing_run_summary: Default::default(),
            created_at: Default::default(),
            updated_at: Default::default(),
        }
    }
}
