// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Request body to create an experiment run.
/// `workflow_id` is optional; when omitted it is taken from the experiment,
/// and when supplied it must match the experiment's workflow.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateExperimentRunRequest {
    /// The experiment to create a run for.
    pub experiment_id: String,
    /// Optional. When omitted, the workflow is derived from the experiment record. When supplied, must match the experiment's workflow_id (404 otherwise).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub workflow_id: Option<String>,
    /// Optional short-lived token returned by the run-plan preview. When supplied, run creation rejects if the current plan no longer matches the preview.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub plan_token: Option<crate::SecretString>,
}
impl CreateExperimentRunRequest {
    /// Construct a new `CreateExperimentRunRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new(experiment_id: impl Into<String>) -> Self {
        Self {
            experiment_id: experiment_id.into(),
            workflow_id: Default::default(),
            plan_token: Default::default(),
        }
    }
}
