windmill_api/models/token_risk.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.891.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// 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.
15/// 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.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum TokenRisk {
18 #[serde(rename = "superadmin")]
19 Superadmin,
20 #[serde(rename = "admin")]
21 Admin,
22 #[serde(rename = "all_workspaces")]
23 AllWorkspaces,
24 #[serde(rename = "never_expires")]
25 NeverExpires,
26 #[serde(rename = "unused")]
27 Unused,
28
29}
30
31impl std::fmt::Display for TokenRisk {
32 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33 match self {
34 Self::Superadmin => write!(f, "superadmin"),
35 Self::Admin => write!(f, "admin"),
36 Self::AllWorkspaces => write!(f, "all_workspaces"),
37 Self::NeverExpires => write!(f, "never_expires"),
38 Self::Unused => write!(f, "unused"),
39 }
40 }
41}
42
43impl Default for TokenRisk {
44 fn default() -> TokenRisk {
45 Self::Superadmin
46 }
47}
48