/*
 * Artifact Keeper API
 *
 * REST API for Artifact Keeper, an open-source universal artifact registry. Covers user management, repositories, artifacts, search, security scanning, SBOM, dependency tracking, SSO, analytics, monitoring, telemetry, lifecycle policies, plugins, edge nodes, migration, and administration. Format-specific protocol endpoints (npm, PyPI, Maven, Docker/OCI, etc.) are not included; those follow their respective upstream specifications.
 *
 * The version of the OpenAPI document: 1.0.0-a2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VerifyTotp200Response {
    #[serde(rename = "access_token")]
    pub access_token: String,
    #[serde(rename = "refresh_token")]
    pub refresh_token: String,
    #[serde(rename = "token_type")]
    pub token_type: TokenType,
    /// Token lifetime in seconds
    #[serde(rename = "expires_in")]
    pub expires_in: i32,
    /// Whether the user must change their password before proceeding
    #[serde(rename = "must_change_password")]
    pub must_change_password: bool,
    /// Always false after successful TOTP verification
    #[serde(rename = "totp_required", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub totp_required: Option<Option<bool>>,
    /// Always null after successful TOTP verification
    #[serde(rename = "totp_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub totp_token: Option<Option<String>>,
}

impl VerifyTotp200Response {
    pub fn new(access_token: String, refresh_token: String, token_type: TokenType, expires_in: i32, must_change_password: bool) -> VerifyTotp200Response {
        VerifyTotp200Response {
            access_token,
            refresh_token,
            token_type,
            expires_in,
            must_change_password,
            totp_required: None,
            totp_token: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenType {
    #[serde(rename = "Bearer")]
    Bearer,
}

impl Default for TokenType {
    fn default() -> TokenType {
        Self::Bearer
    }
}

