Skip to main content

orvanta_api/models/
flow_note.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 6.3.0
7 * Contact: contact@orvanta.cloud
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 = "canvas_position", skip_serializing_if = "Option::is_none")]
26    pub canvas_position: Option<Box<models::FlowNoteCanvasPosition>>,
27    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
28    pub size: Option<Box<models::FlowNoteSize>>,
29    /// Color of the note (e.g., \"yellow\", \"#ffff00\")
30    #[serde(rename = "color")]
31    pub color: String,
32    /// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
33    #[serde(rename = "type")]
34    pub r#type: Type,
35    /// Whether the note is locked and cannot be edited or moved
36    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
37    pub locked: Option<bool>,
38    /// For group notes, the IDs of nodes contained within this group
39    #[serde(rename = "contained_node_ids", skip_serializing_if = "Option::is_none")]
40    pub contained_node_ids: Option<Vec<String>>,
41}
42
43impl FlowNote {
44    /// A sticky note attached to a flow for documentation and annotation
45    pub fn new(id: String, text: String, color: String, r#type: Type) -> FlowNote {
46        FlowNote {
47            id,
48            text,
49            position: None,
50            canvas_position: None,
51            size: None,
52            color,
53            r#type,
54            locked: None,
55            contained_node_ids: None,
56        }
57    }
58}
59/// Type of note - 'free' for standalone notes, 'group' for notes that group other nodes
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum Type {
62    #[serde(rename = "free")]
63    Free,
64    #[serde(rename = "group")]
65    Group,
66}
67
68impl Default for Type {
69    fn default() -> Type {
70        Self::Free
71    }
72}
73