use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AlbumResponseDto {
#[serde(rename = "albumName")]
pub album_name: String,
#[serde(rename = "albumThumbnailAssetId", deserialize_with = "Option::deserialize")]
pub album_thumbnail_asset_id: Option<String>,
#[serde(rename = "albumUsers")]
pub album_users: Vec<models::AlbumUserResponseDto>,
#[serde(rename = "assetCount")]
pub asset_count: i32,
#[serde(rename = "assets")]
pub assets: Vec<models::AssetResponseDto>,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "endDate", skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
#[serde(rename = "hasSharedLink")]
pub has_shared_link: bool,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "isActivityEnabled")]
pub is_activity_enabled: bool,
#[serde(rename = "lastModifiedAssetTimestamp", skip_serializing_if = "Option::is_none")]
pub last_modified_asset_timestamp: Option<String>,
#[serde(rename = "order", skip_serializing_if = "Option::is_none")]
pub order: Option<models::AssetOrder>,
#[serde(rename = "owner")]
pub owner: Box<models::UserResponseDto>,
#[serde(rename = "ownerId")]
pub owner_id: String,
#[serde(rename = "shared")]
pub shared: bool,
#[serde(rename = "startDate", skip_serializing_if = "Option::is_none")]
pub start_date: Option<String>,
#[serde(rename = "updatedAt")]
pub updated_at: String,
}
impl AlbumResponseDto {
pub fn new(album_name: String, album_thumbnail_asset_id: Option<String>, album_users: Vec<models::AlbumUserResponseDto>, asset_count: i32, assets: Vec<models::AssetResponseDto>, created_at: String, description: String, has_shared_link: bool, id: String, is_activity_enabled: bool, owner: models::UserResponseDto, owner_id: String, shared: bool, updated_at: String) -> AlbumResponseDto {
AlbumResponseDto {
album_name,
album_thumbnail_asset_id,
album_users,
asset_count,
assets,
created_at,
description,
end_date: None,
has_shared_link,
id,
is_activity_enabled,
last_modified_asset_timestamp: None,
order: None,
owner: Box::new(owner),
owner_id,
shared,
start_date: None,
updated_at,
}
}
}