immich_api_rs 1.137.3

Immich API
Documentation
/*
 * Immich
 *
 * Immich API
 *
 * The version of the OpenAPI document: 1.137.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserAdminResponseDto {
    #[serde(rename = "avatarColor")]
    pub avatar_color: models::UserAvatarColor,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "deletedAt", deserialize_with = "Option::deserialize")]
    pub deleted_at: Option<String>,
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "isAdmin")]
    pub is_admin: bool,
    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
    pub license: Option<Box<models::UserLicense>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "oauthId")]
    pub oauth_id: String,
    #[serde(rename = "profileChangedAt")]
    pub profile_changed_at: String,
    #[serde(rename = "profileImagePath")]
    pub profile_image_path: String,
    #[serde(rename = "quotaSizeInBytes", deserialize_with = "Option::deserialize")]
    pub quota_size_in_bytes: Option<i64>,
    #[serde(rename = "quotaUsageInBytes", deserialize_with = "Option::deserialize")]
    pub quota_usage_in_bytes: Option<i64>,
    #[serde(rename = "shouldChangePassword")]
    pub should_change_password: bool,
    #[serde(rename = "status")]
    pub status: models::UserStatus,
    #[serde(rename = "storageLabel", deserialize_with = "Option::deserialize")]
    pub storage_label: Option<String>,
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
}

impl UserAdminResponseDto {
    pub fn new(avatar_color: models::UserAvatarColor, created_at: String, deleted_at: Option<String>, email: String, id: String, is_admin: bool, license: Option<models::UserLicense>, name: String, oauth_id: String, profile_changed_at: String, profile_image_path: String, quota_size_in_bytes: Option<i64>, quota_usage_in_bytes: Option<i64>, should_change_password: bool, status: models::UserStatus, storage_label: Option<String>, updated_at: String) -> UserAdminResponseDto {
        UserAdminResponseDto {
            avatar_color,
            created_at,
            deleted_at,
            email,
            id,
            is_admin,
            license: if let Some(x) = license {Some(Box::new(x))} else {None},
            name,
            oauth_id,
            profile_changed_at,
            profile_image_path,
            quota_size_in_bytes,
            quota_usage_in_bytes,
            should_change_password,
            status,
            storage_label,
            updated_at,
        }
    }
}