// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A single execution of an experiment, identified by `id`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExperimentRun {
    pub id: String,
    pub workflow_id: String,
    pub workflow_version_id: String,
    pub trigger: ExperimentRunTrigger,
    pub experiment_id: String,
    pub block_id: String,
    pub block_type: ExperimentRunBlockType,
    pub n_consensus: ExperimentRunNConsensus,
    pub lifecycle: CancelWorkflowExperimentRunResponseLifecycleOneOf,
    pub timing: ExperimentRunTiming,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub parent_run_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub block_version_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metrics_validity_fingerprint: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub metrics_validity_fingerprint_version: Option<i64>,
    pub block_execution_fingerprint: String,
    pub documents_fingerprint: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub score: Option<f64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub total_document_count: Option<i64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_document_count: Option<i64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub document_count: Option<i64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub error_count: Option<i64>,
}
impl ExperimentRun {
    /// Construct a new `ExperimentRun` 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: ExperimentRunTrigger,
        experiment_id: impl Into<String>,
        block_id: impl Into<String>,
        block_type: ExperimentRunBlockType,
        n_consensus: ExperimentRunNConsensus,
        lifecycle: CancelWorkflowExperimentRunResponseLifecycleOneOf,
        timing: ExperimentRunTiming,
        block_execution_fingerprint: impl Into<String>,
        documents_fingerprint: impl Into<String>,
    ) -> Self {
        Self {
            id: id.into(),
            workflow_id: workflow_id.into(),
            workflow_version_id: workflow_version_id.into(),
            trigger,
            experiment_id: experiment_id.into(),
            block_id: block_id.into(),
            block_type,
            n_consensus,
            lifecycle,
            timing,
            parent_run_id: Default::default(),
            block_version_id: Default::default(),
            metrics_validity_fingerprint: Default::default(),
            metrics_validity_fingerprint_version: Default::default(),
            block_execution_fingerprint: block_execution_fingerprint.into(),
            documents_fingerprint: documents_fingerprint.into(),
            score: Default::default(),
            total_document_count: Default::default(),
            completed_document_count: Default::default(),
            document_count: Default::default(),
            error_count: Default::default(),
        }
    }
}
