// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// One experiment block execution for a single document, addressed by `experiment_run_id` and `document_id`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExperimentResult {
    pub id: String,
    pub experiment_run_id: String,
    pub experiment_id: String,
    pub document_id: String,
    pub lifecycle: ExperimentResultLifecycleOneOf,
    pub timing: ExperimentResultTiming,
    pub block_type: ExperimentResultBlockType,
    /// Defaults to `{}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub handle_inputs: Option<
        std::collections::HashMap<String, ExplicitExperimentDocumentRequestHandleInputsOneOf>,
    >,
    /// Defaults to `{}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub handle_outputs: Option<
        std::collections::HashMap<String, ExplicitExperimentDocumentRequestHandleInputsOneOf>,
    >,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub artifact: Option<StepArtifactRef>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub attempt: Option<i64>,
}
impl ExperimentResult {
    /// Construct a new `ExperimentResult` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        experiment_run_id: impl Into<String>,
        experiment_id: impl Into<String>,
        document_id: impl Into<String>,
        lifecycle: ExperimentResultLifecycleOneOf,
        timing: ExperimentResultTiming,
        block_type: ExperimentResultBlockType,
    ) -> Self {
        Self {
            id: id.into(),
            experiment_run_id: experiment_run_id.into(),
            experiment_id: experiment_id.into(),
            document_id: document_id.into(),
            lifecycle,
            timing,
            block_type,
            handle_inputs: Default::default(),
            handle_outputs: Default::default(),
            artifact: Default::default(),
            attempt: Default::default(),
        }
    }
}
