/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdminUserResponse {
    #[serde(rename = "auth_provider")]
    pub auth_provider: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<Option<String>>,
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_active")]
    pub is_active: bool,
    #[serde(rename = "is_admin")]
    pub is_admin: bool,
    #[serde(rename = "last_login_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_login_at: Option<Option<String>>,
    #[serde(rename = "must_change_password")]
    pub must_change_password: bool,
    #[serde(rename = "username")]
    pub username: String,
}

impl AdminUserResponse {
    pub fn new(auth_provider: String, created_at: String, email: String, id: uuid::Uuid, is_active: bool, is_admin: bool, must_change_password: bool, username: String) -> AdminUserResponse {
        AdminUserResponse {
            auth_provider,
            created_at,
            display_name: None,
            email,
            id,
            is_active,
            is_admin,
            last_login_at: None,
            must_change_password,
            username,
        }
    }
}

