Skip to main content

windmill_api/models/
external_jwt_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.683.1
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 ExternalJwtToken {
16    #[serde(rename = "jwt_hash")]
17    pub jwt_hash: i64,
18    #[serde(rename = "email")]
19    pub email: String,
20    #[serde(rename = "username")]
21    pub username: String,
22    #[serde(rename = "is_admin")]
23    pub is_admin: bool,
24    #[serde(rename = "is_operator")]
25    pub is_operator: bool,
26    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
27    pub workspace_id: Option<String>,
28    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
29    pub label: Option<String>,
30    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
31    pub scopes: Option<Vec<String>>,
32    #[serde(rename = "last_used_at")]
33    pub last_used_at: String,
34}
35
36impl ExternalJwtToken {
37    pub fn new(jwt_hash: i64, email: String, username: String, is_admin: bool, is_operator: bool, last_used_at: String) -> ExternalJwtToken {
38        ExternalJwtToken {
39            jwt_hash,
40            email,
41            username,
42            is_admin,
43            is_operator,
44            workspace_id: None,
45            label: None,
46            scopes: None,
47            last_used_at,
48        }
49    }
50}
51