windmill-api 1.682.0

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.682.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkspaceItemDiff {
    /// Type of the item
    #[serde(rename = "kind")]
    pub kind: Kind,
    /// Path of the item in the workspace
    #[serde(rename = "path")]
    pub path: String,
    /// Number of versions source is ahead of target
    #[serde(rename = "ahead")]
    pub ahead: i32,
    /// Number of versions source is behind target
    #[serde(rename = "behind")]
    pub behind: i32,
    /// Whether the item has any differences
    #[serde(rename = "has_changes")]
    pub has_changes: bool,
    /// If the item exists in the source workspace
    #[serde(rename = "exists_in_source")]
    pub exists_in_source: bool,
    /// If the item exists in the fork workspace
    #[serde(rename = "exists_in_fork")]
    pub exists_in_fork: bool,
}

impl WorkspaceItemDiff {
    pub fn new(kind: Kind, path: String, ahead: i32, behind: i32, has_changes: bool, exists_in_source: bool, exists_in_fork: bool) -> WorkspaceItemDiff {
        WorkspaceItemDiff {
            kind,
            path,
            ahead,
            behind,
            has_changes,
            exists_in_source,
            exists_in_fork,
        }
    }
}
/// Type of the item
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
    #[serde(rename = "script")]
    Script,
    #[serde(rename = "flow")]
    Flow,
    #[serde(rename = "app")]
    App,
    #[serde(rename = "raw_app")]
    RawApp,
    #[serde(rename = "resource")]
    Resource,
    #[serde(rename = "variable")]
    Variable,
    #[serde(rename = "resource_type")]
    ResourceType,
}

impl Default for Kind {
    fn default() -> Kind {
        Self::Script
    }
}