// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A batch execution of a workflow's evals, with overall `lifecycle`, `timing`, and pass/fail `counts`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowEvalRun {
    pub id: String,
    pub workflow_id: String,
    pub workflow_version_id: String,
    pub trigger: EvalRunTrigger,
    pub lifecycle: WorkflowEvalResultLifecycleOneOf,
    pub timing: WorkflowEvalRunTiming,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub target: Option<EvalRunBlockTarget>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub eval_id: Option<String>,
    pub total_evals: i64,
    /// Defaults to `{"lifecycle_counts":{"cancelled":0,"completed":0,"error":0,"pending":0,"queued":0,"running":0},"outcome":{"blocked":0,"failed":0,"passed":0}}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub counts: Option<BlockEvalBatchExecutionCounts>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub freshness: Option<EvalRunFreshness>,
}
impl WorkflowEvalRun {
    /// Construct a new `WorkflowEvalRun` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        workflow_id: impl Into<String>,
        workflow_version_id: impl Into<String>,
        trigger: EvalRunTrigger,
        lifecycle: WorkflowEvalResultLifecycleOneOf,
        timing: WorkflowEvalRunTiming,
        total_evals: i64,
    ) -> Self {
        Self {
            id: id.into(),
            workflow_id: workflow_id.into(),
            workflow_version_id: workflow_version_id.into(),
            trigger,
            lifecycle,
            timing,
            target: Default::default(),
            eval_id: Default::default(),
            total_evals,
            counts: Default::default(),
            freshness: Default::default(),
        }
    }
}
