// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Create an experiment, in one of two modes.
/// - **Create from scratch** — provide `block_id`, `name`, optional
/// `document_captures`/`documents`/`n_consensus`. Leave
/// `source_experiment_id` unset.
/// - **Duplicate an existing experiment** — provide only
/// `source_experiment_id`. The source's block, name (with a `(Copy)`
/// suffix), `n_consensus`, and documents are copied. All other fields
/// must be omitted.
/// Combining `source_experiment_id` with any other field is rejected.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateExperimentRequest {
    pub workflow_id: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub block_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub document_captures: Option<Vec<ExperimentDocumentCaptureRequest>>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub documents: Option<Vec<ExplicitExperimentDocumentRequest>>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub n_consensus: Option<CreateExperimentRequestNConsensus>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub source_experiment_id: Option<String>,
}
impl CreateExperimentRequest {
    /// Construct a new `CreateExperimentRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new(workflow_id: impl Into<String>) -> Self {
        Self {
            workflow_id: workflow_id.into(),
            block_id: Default::default(),
            document_captures: Default::default(),
            documents: Default::default(),
            n_consensus: Default::default(),
            name: Default::default(),
            source_experiment_id: Default::default(),
        }
    }
}
