windmill-api 1.727.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.727.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 ListableApp {
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "summary")]
    pub summary: String,
    #[serde(rename = "version")]
    pub version: i32,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "starred", skip_serializing_if = "Option::is_none")]
    pub starred: Option<bool>,
    #[serde(rename = "edited_at")]
    pub edited_at: String,
    #[serde(rename = "execution_mode")]
    pub execution_mode: ExecutionMode,
    #[serde(rename = "raw_app", skip_serializing_if = "Option::is_none")]
    pub raw_app: Option<bool>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
    /// True when the authed user has a draft for this app — either no deployed row exists at this path (draft-only) or the user has saved a per-user draft on top of the deployed row. 
    #[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. Sourced from the draft JSON's `draft_path` field (the editor only writes it when the typed path differs from the deployed one). Lets the home list 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::ListScripts200ResponseInnerAllOfDraftUsersInner>>,
    /// Labels inherited from the parent folder, computed at read time. Read-only — edit them on the folder. 
    #[serde(rename = "inherited_labels", skip_serializing_if = "Option::is_none")]
    pub inherited_labels: Option<Vec<String>>,
}

impl ListableApp {
    pub fn new(id: i32, workspace_id: String, path: String, summary: String, version: i32, extra_perms: std::collections::HashMap<String, bool>, edited_at: String, execution_mode: ExecutionMode) -> ListableApp {
        ListableApp {
            id,
            workspace_id,
            path,
            summary,
            version,
            extra_perms,
            starred: None,
            edited_at,
            execution_mode,
            raw_app: None,
            labels: None,
            is_draft: None,
            draft_path: None,
            draft_users: None,
            inherited_labels: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ExecutionMode {
    #[serde(rename = "viewer")]
    Viewer,
    #[serde(rename = "publisher")]
    Publisher,
    #[serde(rename = "anonymous")]
    Anonymous,
}

impl Default for ExecutionMode {
    fn default() -> ExecutionMode {
        Self::Viewer
    }
}