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.722.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}
28
29impl NewToken {
30    pub fn new() -> NewToken {
31        NewToken {
32            label: None,
33            expiration: None,
34            scopes: None,
35            workspace_id: None,
36            read_only: None,
37        }
38    }
39}
40