1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use std::collections::HashMap;
use serde::Deserialize;
use uuid::Uuid;
use crate::FromResponse;
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct MangaStatisticsObject {
pub statistics: HashMap<Uuid, MangaStatistics>,
}
#[derive(Clone, Debug, Deserialize)]
pub struct MangaStatistics {
pub rating: MangaRating,
pub follows: u64,
}
#[derive(Clone, Debug, Deserialize)]
pub struct MangaRating {
pub average: Option<f32>,
#[serde(default)]
pub distribution: RatingsDistribution,
}
#[derive(Clone, Debug, Deserialize, Default)]
pub struct RatingsDistribution {
#[serde(rename = "1")]
pub r1: u64,
#[serde(rename = "2")]
pub r2: u64,
#[serde(rename = "3")]
pub r3: u64,
#[serde(rename = "4")]
pub r4: u64,
#[serde(rename = "5")]
pub r5: u64,
#[serde(rename = "6")]
pub r6: u64,
#[serde(rename = "7")]
pub r7: u64,
#[serde(rename = "8")]
pub r8: u64,
#[serde(rename = "9")]
pub r9: u64,
#[serde(rename = "10")]
pub r10: u64,
}
impl FromResponse for MangaStatisticsObject {
type Response = Self;
fn from_response(value: Self::Response) -> Self {
value
}
}