// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Public step status object.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowRunStep {
    /// Logical ID of the block
    pub block_id: String,
    /// Full step ID with iteration context. Assigned ONCE at creation, never recomputed.
    pub step_id: String,
    /// Type of the block
    pub block_type: WorkflowRunStepBlockType,
    /// Label of the block
    pub block_label: String,
    /// Current step lifecycle
    pub lifecycle: WorkflowRunStepLifecycleOneOf,
    /// When the step started executing
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub started_at: Option<String>,
    /// When the step finished executing
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_at: Option<String>,
    /// LLM model used by this step, when applicable
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Container hierarchy from outermost to innermost. Empty when not inside any container.
    ///
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub loop_containers: Option<Vec<ContainerContextData>>,
    /// Parent workflow run ID
    pub run_id: String,
    /// When the step was created
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    /// Handle input payloads consumed by this step
    ///
    /// Defaults to `{}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub handle_inputs: Option<std::collections::HashMap<String, PublicHandlePayload>>,
    /// Handle output payloads produced by this step
    ///
    /// Defaults to `{}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub handle_outputs: Option<std::collections::HashMap<String, PublicHandlePayload>>,
    /// Reference to the result produced by this step, if any.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub artifact: Option<StepArtifactRef>,
    /// Number of retry attempts
    ///
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub retry_count: Option<i64>,
}
impl WorkflowRunStep {
    /// Construct a new `WorkflowRunStep` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        block_id: impl Into<String>,
        step_id: impl Into<String>,
        block_type: WorkflowRunStepBlockType,
        block_label: impl Into<String>,
        lifecycle: WorkflowRunStepLifecycleOneOf,
        run_id: impl Into<String>,
    ) -> Self {
        Self {
            block_id: block_id.into(),
            step_id: step_id.into(),
            block_type,
            block_label: block_label.into(),
            lifecycle,
            started_at: Default::default(),
            completed_at: Default::default(),
            model: Default::default(),
            loop_containers: Default::default(),
            run_id: run_id.into(),
            created_at: Default::default(),
            handle_inputs: Default::default(),
            handle_outputs: Default::default(),
            artifact: Default::default(),
            retry_count: Default::default(),
        }
    }
}
