windmill-api 1.895.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.895.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>>,
    /// Bind the token to this workspace: it is then refused on every other workspace and on instance-level endpoints. Omit for a token that reaches every workspace. 
    #[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>,
    /// Carry the owner's superadmin rights: admin in every workspace, including ones they are not a member of, and the superadmin endpoints. Defaults to false, and is ignored when the owner or the calling token does not hold them. 
    #[serde(rename = "super_admin", skip_serializing_if = "Option::is_none")]
    pub super_admin: Option<bool>,
    /// Carry the owner's workspace admin rights in the workspaces the token reaches. Defaults to false: the token then acts as a regular member. Ignored when the calling token does not hold them. 
    #[serde(rename = "admin", skip_serializing_if = "Option::is_none")]
    pub admin: Option<bool>,
    /// IPs or CIDRs (IPv4 or IPv6) the token may be used from; omit to allow any. A request from elsewhere is refused as unauthenticated. A token that is itself restricted can only create tokens within its own networks, and creates one restricted to them when this is omitted. 
    #[serde(rename = "allowed_ips", skip_serializing_if = "Option::is_none")]
    pub allowed_ips: Option<Vec<String>>,
}

impl NewToken {
    pub fn new() -> NewToken {
        NewToken {
            label: None,
            expiration: None,
            scopes: None,
            workspace_id: None,
            read_only: None,
            super_admin: None,
            admin: None,
            allowed_ips: None,
        }
    }
}