windmill_api/models/
workspace_item_diff.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WorkspaceItemDiff {
16 #[serde(rename = "kind")]
18 pub kind: Kind,
19 #[serde(rename = "path")]
21 pub path: String,
22 #[serde(rename = "ahead")]
24 pub ahead: i32,
25 #[serde(rename = "behind")]
27 pub behind: i32,
28 #[serde(rename = "has_changes")]
30 pub has_changes: bool,
31 #[serde(rename = "exists_in_source")]
33 pub exists_in_source: bool,
34 #[serde(rename = "exists_in_fork")]
36 pub exists_in_fork: bool,
37}
38
39impl WorkspaceItemDiff {
40 pub fn new(kind: Kind, path: String, ahead: i32, behind: i32, has_changes: bool, exists_in_source: bool, exists_in_fork: bool) -> WorkspaceItemDiff {
41 WorkspaceItemDiff {
42 kind,
43 path,
44 ahead,
45 behind,
46 has_changes,
47 exists_in_source,
48 exists_in_fork,
49 }
50 }
51}
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Kind {
55 #[serde(rename = "script")]
56 Script,
57 #[serde(rename = "flow")]
58 Flow,
59 #[serde(rename = "app")]
60 App,
61 #[serde(rename = "resource")]
62 Resource,
63 #[serde(rename = "variable")]
64 Variable,
65}
66
67impl Default for Kind {
68 fn default() -> Kind {
69 Self::Script
70 }
71}
72