windmill-api 1.896.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.896.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 NewTokenImpersonate {
    #[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 = "impersonate_email")]
    pub impersonate_email: String,
    /// Bind the token to this workspace; omit for a token that reaches every workspace.
    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
    pub workspace_id: Option<String>,
    /// Carry the impersonated account's superadmin rights. Defaults to false.
    #[serde(rename = "super_admin", skip_serializing_if = "Option::is_none")]
    pub super_admin: Option<bool>,
    /// Carry the impersonated account's workspace admin rights. Defaults to false.
    #[serde(rename = "admin", skip_serializing_if = "Option::is_none")]
    pub admin: Option<bool>,
    /// IPs or CIDRs the token may be used from; omit to allow any.
    #[serde(rename = "allowed_ips", skip_serializing_if = "Option::is_none")]
    pub allowed_ips: Option<Vec<String>>,
}

impl NewTokenImpersonate {
    pub fn new(impersonate_email: String) -> NewTokenImpersonate {
        NewTokenImpersonate {
            label: None,
            expiration: None,
            impersonate_email,
            workspace_id: None,
            super_admin: None,
            admin: None,
            allowed_ips: None,
        }
    }
}