windmill-api 1.684.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.684.1
 * Contact: contact@windmill.dev
 * 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
    }
}