windmill-api 1.681.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.681.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 AppWithLastVersion {
    #[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 = "versions")]
    pub versions: Vec<i32>,
    #[serde(rename = "created_by")]
    pub created_by: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
    pub value: Option<serde_json::Value>,
    #[serde(rename = "policy")]
    pub policy: Box<models::Policy>,
    #[serde(rename = "execution_mode")]
    pub execution_mode: ExecutionMode,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "custom_path", skip_serializing_if = "Option::is_none")]
    pub custom_path: Option<String>,
    #[serde(rename = "raw_app")]
    pub raw_app: bool,
    #[serde(rename = "bundle_secret", skip_serializing_if = "Option::is_none")]
    pub bundle_secret: Option<String>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
}

impl AppWithLastVersion {
    pub fn new(id: i32, workspace_id: String, path: String, summary: String, versions: Vec<i32>, created_by: String, created_at: String, value: Option<serde_json::Value>, policy: models::Policy, execution_mode: ExecutionMode, extra_perms: std::collections::HashMap<String, bool>, raw_app: bool) -> AppWithLastVersion {
        AppWithLastVersion {
            id,
            workspace_id,
            path,
            summary,
            versions,
            created_by,
            created_at,
            value,
            policy: Box::new(policy),
            execution_mode,
            extra_perms,
            custom_path: None,
            raw_app,
            bundle_secret: None,
            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
    }
}