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

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

/// ListableScript : A script as returned by the list endpoint: the deployed row's summary fields, without its content, lock or schema. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListableScript {
    #[serde(rename = "hash")]
    pub hash: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "summary")]
    pub summary: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "archived")]
    pub archived: bool,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "language")]
    pub language: models::ScriptLang,
    #[serde(rename = "kind")]
    pub kind: Kind,
    #[serde(rename = "starred")]
    pub starred: bool,
    #[serde(rename = "tag", deserialize_with = "Option::deserialize")]
    pub tag: Option<String>,
    /// True on rows built from a draft that was never deployed. Omitted on deployed rows. 
    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
    pub draft_only: Option<bool>,
    #[serde(rename = "has_deploy_errors")]
    pub has_deploy_errors: bool,
    #[serde(rename = "ws_error_handler_muted", deserialize_with = "Option::deserialize")]
    pub ws_error_handler_muted: Option<bool>,
    #[serde(rename = "auto_kind", skip_serializing_if = "Option::is_none")]
    pub auto_kind: Option<String>,
    /// Omitted when false.
    #[serde(rename = "use_codebase", skip_serializing_if = "Option::is_none")]
    pub use_codebase: Option<bool>,
    /// Only returned with `with_deployment_msg=true`.
    #[serde(rename = "deployment_msg", skip_serializing_if = "Option::is_none")]
    pub deployment_msg: Option<String>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
    pub inherited_labels: Option<Vec<String>>,
    /// True when the authed user has a draft for this script — either no deployed row exists at this path (draft-only) or the user saved a per-user draft on top of the deployed row. Omitted when false. 
    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
    pub is_draft: Option<bool>,
    /// User-typed path the editor has staged but not yet deployed. Surfaced for draft-only rows so the home list can render the meaningful name instead of the autogenerated `u/{user}/draft_{uuid}` URL path. Omitted when unchanged. 
    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
    pub draft_path: Option<String>,
    /// Workspace users (including the authed user, and the legacy NULL-email row if any) who have a per-user draft at this path. Drives the home page's user-avatar circles inside the Draft badge. Omitted when no drafts exist. 
    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
    pub draft_users: Option<Vec<models::ListDrafts200ResponseInnerDraftUsersInner>>,
}

impl ListableScript {
    /// A script as returned by the list endpoint: the deployed row's summary fields, without its content, lock or schema. 
    pub fn new(hash: String, path: String, summary: String, created_at: String, archived: bool, extra_perms: std::collections::HashMap<String, bool>, language: models::ScriptLang, kind: Kind, starred: bool, tag: Option<String>, has_deploy_errors: bool, ws_error_handler_muted: Option<bool>) -> ListableScript {
        ListableScript {
            hash,
            path,
            summary,
            description: None,
            created_at,
            archived,
            extra_perms,
            language,
            kind,
            starred,
            tag,
            draft_only: None,
            has_deploy_errors,
            ws_error_handler_muted,
            auto_kind: None,
            use_codebase: None,
            deployment_msg: None,
            labels: None,
            inherited_labels: None,
            is_draft: None,
            draft_path: None,
            draft_users: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
    #[serde(rename = "script")]
    Script,
    #[serde(rename = "failure")]
    Failure,
    #[serde(rename = "trigger")]
    Trigger,
    #[serde(rename = "approval")]
    Approval,
    #[serde(rename = "preprocessor")]
    Preprocessor,
}

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