mango_api/requests/
cover.rs

1//! Utilities for scanlation group specific server part of the application.
2//!
3//! The meaning of most of the confusing structs here can be found at <https://api.mangadex.org/docs/3-enumerations/#manga-links-data>
4//!
5//! All queries encountered here can be constructed with the builder syntax from the [bon] crate
6
7use serde::{Deserialize, Serialize};
8
9use super::query_utils::Relationship;
10use super::{EntityType, Locale};
11
12/// Used for serialization/deserialization
13#[derive(Serialize, Deserialize, Debug)]
14#[serde(rename_all = "camelCase")]
15pub struct CoverArtAttributes {
16    pub volume: Option<String>,
17    pub file_name: String,
18    pub description: Option<String>,
19    pub locale: Option<Locale>,
20    pub version: usize,
21    pub created_at: String,
22    pub updated_at: String,
23}
24
25/// Main structure used for representing the response containg cover info
26#[derive(Serialize, Deserialize, Debug)]
27pub struct CoverArt {
28    pub id: String,
29    #[serde(rename(deserialize = "type"))]
30    pub entity_type: EntityType,
31    pub attributes: CoverArtAttributes,
32    pub relationships: Vec<Relationship>,
33}