/*
 * doqium - service-auth REST API
 *
 * doqium - service-auth REST API
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LoginWebAuthnRequest {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "response")]
    pub response: Box<models::LoginWebAuthnRequestResponse>,
    #[serde(
        rename = "authenticatorAttachment",
        skip_serializing_if = "Option::is_none"
    )]
    pub authenticator_attachment: Option<String>,
    #[serde(rename = "sessionName")]
    pub session_name: String,
    #[serde(rename = "tokenType")]
    pub token_type: TokenType,
}

impl LoginWebAuthnRequest {
    pub fn new(
        id: String,
        response: models::LoginWebAuthnRequestResponse,
        session_name: String,
        token_type: TokenType,
    ) -> LoginWebAuthnRequest {
        LoginWebAuthnRequest {
            id,
            response: Box::new(response),
            authenticator_attachment: None,
            session_name,
            token_type,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenType {
    #[serde(rename = "web")]
    Web,
    #[serde(rename = "mobile")]
    Mobile,
    #[serde(rename = "cli")]
    Cli,
}

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