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 SharedLinkResponseDto {
    #[serde(rename = "album", skip_serializing_if = "Option::is_none")]
    pub album: Option<Box<models::AlbumResponseDto>>,
    #[serde(rename = "allowDownload")]
    pub allow_download: bool,
    #[serde(rename = "allowUpload")]
    pub allow_upload: bool,
    #[serde(rename = "assets")]
    pub assets: Vec<models::AssetResponseDto>,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "expiresAt", deserialize_with = "Option::deserialize")]
    pub expires_at: Option<String>,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "password", deserialize_with = "Option::deserialize")]
    pub password: Option<String>,
    #[serde(rename = "showMetadata")]
    pub show_metadata: bool,
    #[serde(rename = "slug", deserialize_with = "Option::deserialize")]
    pub slug: Option<String>,
    #[serde(rename = "token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub token: Option<Option<String>>,
    #[serde(rename = "type")]
    pub r#type: models::SharedLinkType,
    #[serde(rename = "userId")]
    pub user_id: String,
}

impl SharedLinkResponseDto {
    pub fn new(allow_download: bool, allow_upload: bool, assets: Vec<models::AssetResponseDto>, created_at: String, description: Option<String>, expires_at: Option<String>, id: String, key: String, password: Option<String>, show_metadata: bool, slug: Option<String>, r#type: models::SharedLinkType, user_id: String) -> SharedLinkResponseDto {
        SharedLinkResponseDto {
            album: None,
            allow_download,
            allow_upload,
            assets,
            created_at,
            description,
            expires_at,
            id,
            key,
            password,
            show_metadata,
            slug,
            token: None,
            r#type,
            user_id,
        }
    }
}