/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RestartFlowAtStepRequest {
    /// top-level step id to restart the flow from (or the outermost container when restarting at a nested step)
    #[serde(rename = "step_id")]
    pub step_id: String,
    /// for branchall or loop at the top level, the iteration at which the flow should restart (optional)
    #[serde(rename = "branch_or_iteration_n", skip_serializing_if = "Option::is_none")]
    pub branch_or_iteration_n: Option<i32>,
    /// specific flow version to use for restart (optional, uses current version if not specified)
    #[serde(rename = "flow_version", skip_serializing_if = "Option::is_none")]
    pub flow_version: Option<i32>,
    /// path of additional steps to descend into AFTER `step_id`. Each entry represents one level of nesting inside the spawned child of the previous level's container (BranchOne / sequential ForLoop iteration / Subflow). When non-empty, the actual restart point is the LAST entry's step_id.
    #[serde(rename = "nested_path", skip_serializing_if = "Option::is_none")]
    pub nested_path: Option<Vec<models::RestartFlowAtStepRequestNestedPathInner>>,
}

impl RestartFlowAtStepRequest {
    pub fn new(step_id: String) -> RestartFlowAtStepRequest {
        RestartFlowAtStepRequest {
            step_id,
            branch_or_iteration_n: None,
            flow_version: None,
            nested_path: None,
        }
    }
}

