windmill_api/models/
flow_note.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.581.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// FlowNote : A sticky note attached to a flow for documentation and annotation
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FlowNote {
17    /// Unique identifier for the note
18    #[serde(rename = "id")]
19    pub id: String,
20    /// Content of the note
21    #[serde(rename = "text")]
22    pub text: String,
23    #[serde(rename = "position", skip_serializing_if = "Option::is_none")]
24    pub position: Option<Box<models::FlowNotePosition>>,
25    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
26    pub size: Option<Box<models::FlowNoteSize>>,
27    /// Color of the note (e.g., \"yellow\", \"#ffff00\")
28    #[serde(rename = "color")]
29    pub color: String,
30    /// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
31    #[serde(rename = "type")]
32    pub r#type: Type,
33    /// Whether the note is locked and cannot be edited or moved
34    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
35    pub locked: Option<bool>,
36    /// For group notes, the IDs of nodes contained within this group
37    #[serde(rename = "contained_node_ids", skip_serializing_if = "Option::is_none")]
38    pub contained_node_ids: Option<Vec<String>>,
39}
40
41impl FlowNote {
42    /// A sticky note attached to a flow for documentation and annotation
43    pub fn new(id: String, text: String, color: String, r#type: Type) -> FlowNote {
44        FlowNote {
45            id,
46            text,
47            position: None,
48            size: None,
49            color,
50            r#type,
51            locked: None,
52            contained_node_ids: None,
53        }
54    }
55}
56/// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "free")]
60    Free,
61    #[serde(rename = "group")]
62    Group,
63}
64
65impl Default for Type {
66    fn default() -> Type {
67        Self::Free
68    }
69}
70