mangadex_api_schema_rust/v5/
cover.rs1use mangadex_api_types::{Language, MangaDexDateTime, RelationshipType};
2use serde::Deserialize;
3
4use crate::TypedAttributes;
5
6#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
8#[serde(rename_all = "camelCase")]
9#[non_exhaustive]
10#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
11#[cfg_attr(feature = "specta", derive(specta::Type))]
12pub struct CoverAttributes {
13 pub description: String,
14 pub locale: Option<Language>,
15 pub volume: Option<String>,
17 pub file_name: String,
19 #[cfg_attr(feature = "specta", specta(type = String))]
21 #[cfg_attr(
22 feature = "serialize",
23 serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
24 )]
25 pub created_at: MangaDexDateTime,
26 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
28 #[cfg_attr(
29 feature = "serialize",
30 serde(serialize_with = "crate::v5::mangadex_datetime_serialize_option")
31 )]
32 pub updated_at: Option<MangaDexDateTime>,
33 pub version: u32,
34}
35
36impl TypedAttributes for CoverAttributes {
37 const TYPE_: mangadex_api_types::RelationshipType = RelationshipType::CoverArt;
38}