windmill_api/models/
workspace_item_diff.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.593.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WorkspaceItemDiff {
16    /// Type of the item
17    #[serde(rename = "kind")]
18    pub kind: Kind,
19    /// Path of the item in the workspace
20    #[serde(rename = "path")]
21    pub path: String,
22    /// Number of versions source is ahead of target
23    #[serde(rename = "ahead")]
24    pub ahead: i32,
25    /// Number of versions source is behind target
26    #[serde(rename = "behind")]
27    pub behind: i32,
28    /// Whether the item has any differences
29    #[serde(rename = "has_changes")]
30    pub has_changes: bool,
31    /// If the item exists in the source workspace
32    #[serde(rename = "exists_in_source")]
33    pub exists_in_source: bool,
34    /// If the item exists in the fork workspace
35    #[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/// Type of the item
53#[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