/*
 * 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 SessionListTokens200ResponseInner {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "tokenType")]
    pub token_type: TokenType,
    #[serde(
        rename = "sessionName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub session_name: Option<Option<String>>,
    #[serde(rename = "expiresAt")]
    pub expires_at: String,
    #[serde(rename = "created")]
    pub created: String,
}

impl SessionListTokens200ResponseInner {
    pub fn new(
        id: uuid::Uuid,
        token_type: TokenType,
        expires_at: String,
        created: String,
    ) -> SessionListTokens200ResponseInner {
        SessionListTokens200ResponseInner {
            id,
            token_type,
            session_name: None,
            expires_at,
            created,
        }
    }
}
///
#[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
    }
}
