/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExternalJwtToken {
    #[serde(rename = "jwt_hash")]
    pub jwt_hash: i64,
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "username")]
    pub username: String,
    #[serde(rename = "is_admin")]
    pub is_admin: bool,
    #[serde(rename = "is_operator")]
    pub is_operator: bool,
    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
    pub workspace_id: Option<String>,
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
    pub scopes: Option<Vec<String>>,
    #[serde(rename = "last_used_at")]
    pub last_used_at: String,
}

impl ExternalJwtToken {
    pub fn new(jwt_hash: i64, email: String, username: String, is_admin: bool, is_operator: bool, last_used_at: String) -> ExternalJwtToken {
        ExternalJwtToken {
            jwt_hash,
            email,
            username,
            is_admin,
            is_operator,
            workspace_id: None,
            label: None,
            scopes: None,
            last_used_at,
        }
    }
}

