mangadex_api_schema_rust/v5/
author.rs1use mangadex_api_types::{MangaDexDateTime, RelationshipType};
2use serde::Deserialize;
3use url::Url;
4
5use crate::{
6 TypedAttributes,
7 v5::{LocalizedString, localizedstring_array_or_map},
8};
9
10#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
12#[serde(rename_all = "camelCase")]
13#[non_exhaustive]
14#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
15#[cfg_attr(feature = "specta", derive(specta::Type))]
16pub struct AuthorAttributes {
17 pub name: String,
18 pub image_url: Option<String>,
19 #[serde(with = "localizedstring_array_or_map")]
20 pub biography: LocalizedString,
21 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
23 pub twitter: Option<Url>,
24 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
26 pub pixiv: Option<Url>,
27 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
29 pub melon_book: Option<Url>,
30 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
32 pub fan_box: Option<Url>,
33 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
35 pub booth: Option<Url>,
36 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
38 pub nico_video: Option<Url>,
39 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
41 pub skeb: Option<Url>,
42 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
44 pub fantia: Option<Url>,
45 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
47 pub tumblr: Option<Url>,
48 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
50 pub youtube: Option<Url>,
51 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
55 pub weibo: Option<Url>,
56 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
58 pub naver: Option<Url>,
59 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
61 pub namicomi: Option<Url>,
62 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
63 pub website: Option<Url>,
64 pub version: u32,
65 #[cfg_attr(feature = "specta", specta(type = String))]
67 #[cfg_attr(
68 feature = "serialize",
69 serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
70 )]
71 pub created_at: MangaDexDateTime,
72 #[cfg_attr(feature = "specta", specta(type = Option<String>))]
74 #[cfg_attr(
75 feature = "serialize",
76 serde(serialize_with = "crate::v5::mangadex_datetime_serialize_option")
77 )]
78 pub updated_at: Option<MangaDexDateTime>,
79}
80
81impl TypedAttributes for AuthorAttributes {
82 const TYPE_: RelationshipType = RelationshipType::Author;
83}