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

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

/// FlowGroup : A semantic group of flow modules for organizational purposes. Does not affect execution — modules remain in their original position in the flow. Groups provide naming and collapsibility in the editor. Members are computed dynamically from all nodes on paths between start_id and end_id.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowGroup {
    /// Display name for this group
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    /// Markdown note shown below the group header
    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
    /// If true, this group is collapsed by default in the flow editor. UI hint only.
    #[serde(rename = "autocollapse", skip_serializing_if = "Option::is_none")]
    pub autocollapse: Option<bool>,
    /// ID of the first flow module in this group (topological entry point)
    #[serde(rename = "start_id")]
    pub start_id: String,
    /// ID of the last flow module in this group (topological exit point)
    #[serde(rename = "end_id")]
    pub end_id: String,
    /// Color for the group in the flow editor
    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
    pub color: Option<String>,
}

impl FlowGroup {
    /// A semantic group of flow modules for organizational purposes. Does not affect execution — modules remain in their original position in the flow. Groups provide naming and collapsibility in the editor. Members are computed dynamically from all nodes on paths between start_id and end_id.
    pub fn new(start_id: String, end_id: String) -> FlowGroup {
        FlowGroup {
            summary: None,
            note: None,
            autocollapse: None,
            start_id,
            end_id,
            color: None,
        }
    }
}

