// 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 a workflow.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowRun {
    /// Unique ID for this run
    pub id: String,
    /// ID of the workflow that was run
    pub workflow_id: String,
    /// Content-addressed workflow version used for this run.
    pub workflow_version_id: String,
    /// What started this run
    pub trigger: TriggerInfo,
    /// Lifecycle state of the run.
    pub lifecycle: WorkflowRunLifecycleOneOf,
    /// All timing information
    pub timing: RunTiming,
    /// Input payloads supplied at run creation time
    ///
    /// Defaults to `{"documents":{},"json_data":{}}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub inputs: Option<RunInputs>,
}
impl WorkflowRun {
    /// Construct a new `WorkflowRun` 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: TriggerInfo,
        lifecycle: WorkflowRunLifecycleOneOf,
        timing: RunTiming,
    ) -> Self {
        Self {
            id: id.into(),
            workflow_id: workflow_id.into(),
            workflow_version_id: workflow_version_id.into(),
            trigger,
            lifecycle,
            timing,
            inputs: Default::default(),
        }
    }
}
