/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.2
 * Contact: contact@orvanta.cloud
 * 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,
    #[serde(rename = "folder")]
    Folder,
    #[serde(rename = "schedule")]
    Schedule,
    #[serde(rename = "http_trigger")]
    HttpTrigger,
    #[serde(rename = "websocket_trigger")]
    WebsocketTrigger,
    #[serde(rename = "kafka_trigger")]
    KafkaTrigger,
    #[serde(rename = "nats_trigger")]
    NatsTrigger,
    #[serde(rename = "postgres_trigger")]
    PostgresTrigger,
    #[serde(rename = "mqtt_trigger")]
    MqttTrigger,
    #[serde(rename = "sqs_trigger")]
    SqsTrigger,
    #[serde(rename = "gcp_trigger")]
    GcpTrigger,
    #[serde(rename = "azure_trigger")]
    AzureTrigger,
    #[serde(rename = "email_trigger")]
    EmailTrigger,
}

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

