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

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

/// TokenRisk : superadmin / admin: minted with those rights (and the owner still an admin where the token reaches), not narrowed by scopes or read-only mode. all_workspaces: not bound to a workspace. never_expires: no expiration. unused: not used in over 90 days. 
/// superadmin / admin: minted with those rights (and the owner still an admin where the token reaches), not narrowed by scopes or read-only mode. all_workspaces: not bound to a workspace. never_expires: no expiration. unused: not used in over 90 days. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenRisk {
    #[serde(rename = "superadmin")]
    Superadmin,
    #[serde(rename = "admin")]
    Admin,
    #[serde(rename = "all_workspaces")]
    AllWorkspaces,
    #[serde(rename = "never_expires")]
    NeverExpires,
    #[serde(rename = "unused")]
    Unused,

}

impl std::fmt::Display for TokenRisk {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Superadmin => write!(f, "superadmin"),
            Self::Admin => write!(f, "admin"),
            Self::AllWorkspaces => write!(f, "all_workspaces"),
            Self::NeverExpires => write!(f, "never_expires"),
            Self::Unused => write!(f, "unused"),
        }
    }
}

impl Default for TokenRisk {
    fn default() -> TokenRisk {
        Self::Superadmin
    }
}