1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.864.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 NewToken {
#[serde(rename = "label", skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
pub expiration: Option<String>,
#[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
pub workspace_id: Option<String>,
/// If true, the token is restricted to read-only HTTP methods (GET/HEAD/OPTIONS). Mutating endpoints and job-run actions are rejected with 403, regardless of the scopes attached.
#[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
/// For an MCP token (an `mcp:` scope) owned by a superadmin: carry the owner's superadmin rights, reaching every workspace rather than only their memberships. Ignored for other tokens, which always carry them.
#[serde(rename = "super_admin", skip_serializing_if = "Option::is_none")]
pub super_admin: Option<bool>,
}
impl NewToken {
pub fn new() -> NewToken {
NewToken {
label: None,
expiration: None,
scopes: None,
workspace_id: None,
read_only: None,
super_admin: None,
}
}
}