mango_api/requests/
chapter.rs1use serde::{Deserialize, Serialize};
8
9use super::query_utils::Relationship;
10use super::{Entity, EntityType, Locale};
11
12#[derive(Serialize, Deserialize, Debug, Clone)]
14#[serde(rename_all = "camelCase")]
15pub struct ChapterAttributes {
16 pub title: Option<String>,
17 pub volume: Option<String>,
18 pub chapter: Option<String>,
19 pub pages: usize,
20 pub translated_language: Locale,
21 pub uploader: Option<String>,
22 pub external_url: Option<String>,
23 pub version: usize,
24 pub created_at: String,
25 pub updated_at: String,
26 pub publish_at: String,
27 pub readable_at: String,
28}
29
30#[derive(Serialize, Deserialize, Debug, Clone)]
32pub struct Chapter {
33 pub id: String,
34 #[serde(rename = "type")]
35 pub entity_type: EntityType,
36 pub attributes: ChapterAttributes,
37 pub relationships: Vec<Relationship>,
38}
39
40impl Entity for Chapter {}
41
42#[derive(Serialize, Deserialize, Debug, Clone)]
44#[serde(rename_all = "camelCase")]
45pub struct ChapterMeta {
46 pub hash: String,
47 pub data: Vec<String>,
48 pub data_saver: Vec<String>,
49}
50
51#[derive(Serialize, Deserialize, Debug, Clone)]
53#[serde(rename_all = "camelCase")]
54pub struct ChapterDownloadMeta {
55 pub result: String,
56 pub base_url: String,
57 pub chapter: ChapterMeta,
58}