// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// An experiment that evaluates a workflow block against a set of documents, with its latest run status and score.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowExperiment {
    pub id: String,
    pub workflow_id: String,
    pub block_id: String,
    pub n_consensus: NConsensusValue,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub document_count: Option<i64>,
    pub name: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub last_run_id: Option<String>,
    /// When the experiment was created
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    /// When the experiment was last updated
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub updated_at: Option<String>,
    /// Defaults to `draft`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub status: Option<ExperimentPublicStatus>,
    pub block_type: ExperimentBlockType,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub score: Option<f64>,
    /// Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub is_stale: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub freshness: Option<ArtifactFreshness>,
    /// Defaults to `unknown`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub freshness_state: Option<WorkflowExperimentFreshnessState>,
    /// Defaults to `[]`.
    pub freshness_reasons: Vec<String>,
    /// Defaults to `unknown`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub run_plan_mode: Option<WorkflowExperimentRunPlanMode>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub rerunnable_document_count: Option<i64>,
    /// Defaults to `unknown`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub schema_drift: Option<ExperimentSchemaDriftStatus>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub schema_drift_detail: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub drift: Option<ArtifactDrift>,
}
impl WorkflowExperiment {
    /// Construct a new `WorkflowExperiment` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        workflow_id: impl Into<String>,
        block_id: impl Into<String>,
        n_consensus: NConsensusValue,
        name: impl Into<String>,
        block_type: ExperimentBlockType,
        freshness_reasons: Vec<String>,
    ) -> Self {
        Self {
            id: id.into(),
            workflow_id: workflow_id.into(),
            block_id: block_id.into(),
            n_consensus,
            document_count: Default::default(),
            name: name.into(),
            last_run_id: Default::default(),
            created_at: Default::default(),
            updated_at: Default::default(),
            status: Default::default(),
            block_type,
            score: Default::default(),
            is_stale: Default::default(),
            freshness: Default::default(),
            freshness_state: Default::default(),
            freshness_reasons,
            run_plan_mode: Default::default(),
            rerunnable_document_count: Default::default(),
            schema_drift: Default::default(),
            schema_drift_detail: Default::default(),
            drift: Default::default(),
        }
    }
}
