/*
 * 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 LoginRequest {
    #[serde(rename = "login")]
    pub login: String,
    #[serde(rename = "password")]
    pub password: String,
    /// Browser name and version (e.g., \"Chrome 120.0\")
    #[serde(rename = "sessionName")]
    pub session_name: String,
    /// Type of token to create based on device
    #[serde(rename = "tokenType")]
    pub token_type: TokenType,
}

impl LoginRequest {
    pub fn new(
        login: String,
        password: String,
        session_name: String,
        token_type: TokenType,
    ) -> LoginRequest {
        LoginRequest {
            login,
            password,
            session_name,
            token_type,
        }
    }
}
/// Type of token to create based on device
#[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
    }
}
