/*
 * 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};

/// FlowNote : A sticky note attached to a flow for documentation and annotation
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowNote {
    /// Unique identifier for the note
    #[serde(rename = "id")]
    pub id: String,
    /// Content of the note
    #[serde(rename = "text")]
    pub text: String,
    #[serde(rename = "position", skip_serializing_if = "Option::is_none")]
    pub position: Option<Box<models::FlowNotePosition>>,
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<Box<models::FlowNoteSize>>,
    /// Color of the note (e.g., \"yellow\", \"#ffff00\")
    #[serde(rename = "color")]
    pub color: String,
    /// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
    #[serde(rename = "type")]
    pub r#type: Type,
    /// Whether the note is locked and cannot be edited or moved
    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
    pub locked: Option<bool>,
    /// For group notes, the IDs of nodes contained within this group
    #[serde(rename = "contained_node_ids", skip_serializing_if = "Option::is_none")]
    pub contained_node_ids: Option<Vec<String>>,
}

impl FlowNote {
    /// A sticky note attached to a flow for documentation and annotation
    pub fn new(id: String, text: String, color: String, r#type: Type) -> FlowNote {
        FlowNote {
            id,
            text,
            position: None,
            size: None,
            color,
            r#type,
            locked: None,
            contained_node_ids: None,
        }
    }
}
/// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "free")]
    Free,
    #[serde(rename = "group")]
    Group,
}

impl Default for Type {
    fn default() -> Type {
        Self::Free
    }
}

