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 AssetResponseDto {
    /// base64 encoded sha1 hash
    #[serde(rename = "checksum")]
    pub checksum: String,
    #[serde(rename = "deviceAssetId")]
    pub device_asset_id: String,
    #[serde(rename = "deviceId")]
    pub device_id: String,
    #[serde(rename = "duplicateId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub duplicate_id: Option<Option<String>>,
    #[serde(rename = "duration")]
    pub duration: String,
    #[serde(rename = "exifInfo", skip_serializing_if = "Option::is_none")]
    pub exif_info: Option<Box<models::ExifResponseDto>>,
    /// The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken.
    #[serde(rename = "fileCreatedAt")]
    pub file_created_at: String,
    /// The UTC timestamp when the file was last modified on the filesystem. This reflects the last time the physical file was changed, which may be different from when the photo was originally taken.
    #[serde(rename = "fileModifiedAt")]
    pub file_modified_at: String,
    #[serde(rename = "hasMetadata")]
    pub has_metadata: bool,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "isArchived")]
    pub is_archived: bool,
    #[serde(rename = "isFavorite")]
    pub is_favorite: bool,
    #[serde(rename = "isOffline")]
    pub is_offline: bool,
    #[serde(rename = "isTrashed")]
    pub is_trashed: bool,
    /// This property was deprecated in v1.106.0
    #[serde(rename = "libraryId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub library_id: Option<Option<String>>,
    #[serde(rename = "livePhotoVideoId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub live_photo_video_id: Option<Option<String>>,
    /// The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months.
    #[serde(rename = "localDateTime")]
    pub local_date_time: String,
    #[serde(rename = "originalFileName")]
    pub original_file_name: String,
    #[serde(rename = "originalMimeType", skip_serializing_if = "Option::is_none")]
    pub original_mime_type: Option<String>,
    #[serde(rename = "originalPath")]
    pub original_path: String,
    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
    pub owner: Option<Box<models::UserResponseDto>>,
    #[serde(rename = "ownerId")]
    pub owner_id: String,
    #[serde(rename = "people", skip_serializing_if = "Option::is_none")]
    pub people: Option<Vec<models::PersonWithFacesResponseDto>>,
    /// This property was deprecated in v1.113.0
    #[serde(rename = "resized", skip_serializing_if = "Option::is_none")]
    pub resized: Option<bool>,
    #[serde(rename = "stack", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub stack: Option<Option<Box<models::AssetStackResponseDto>>>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<models::TagResponseDto>>,
    #[serde(rename = "thumbhash", deserialize_with = "Option::deserialize")]
    pub thumbhash: Option<String>,
    #[serde(rename = "type")]
    pub r#type: models::AssetTypeEnum,
    #[serde(rename = "unassignedFaces", skip_serializing_if = "Option::is_none")]
    pub unassigned_faces: Option<Vec<models::AssetFaceWithoutPersonResponseDto>>,
    /// The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified.
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
    #[serde(rename = "visibility")]
    pub visibility: models::AssetVisibility,
}

impl AssetResponseDto {
    pub fn new(checksum: String, device_asset_id: String, device_id: String, duration: String, file_created_at: String, file_modified_at: String, has_metadata: bool, id: String, is_archived: bool, is_favorite: bool, is_offline: bool, is_trashed: bool, local_date_time: String, original_file_name: String, original_path: String, owner_id: String, thumbhash: Option<String>, r#type: models::AssetTypeEnum, updated_at: String, visibility: models::AssetVisibility) -> AssetResponseDto {
        AssetResponseDto {
            checksum,
            device_asset_id,
            device_id,
            duplicate_id: None,
            duration,
            exif_info: None,
            file_created_at,
            file_modified_at,
            has_metadata,
            id,
            is_archived,
            is_favorite,
            is_offline,
            is_trashed,
            library_id: None,
            live_photo_video_id: None,
            local_date_time,
            original_file_name,
            original_mime_type: None,
            original_path,
            owner: None,
            owner_id,
            people: None,
            resized: None,
            stack: None,
            tags: None,
            thumbhash,
            r#type,
            unassigned_faces: None,
            updated_at,
            visibility,
        }
    }
}