Skip to main content

windmill_api/models/
new_token.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.863.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NewToken {
16    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
17    pub label: Option<String>,
18    #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
19    pub expiration: Option<String>,
20    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
21    pub scopes: Option<Vec<String>>,
22    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
23    pub workspace_id: Option<String>,
24    /// 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. 
25    #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
26    pub read_only: Option<bool>,
27    /// 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. 
28    #[serde(rename = "super_admin", skip_serializing_if = "Option::is_none")]
29    pub super_admin: Option<bool>,
30}
31
32impl NewToken {
33    pub fn new() -> NewToken {
34        NewToken {
35            label: None,
36            expiration: None,
37            scopes: None,
38            workspace_id: None,
39            read_only: None,
40            super_admin: None,
41        }
42    }
43}
44