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
use crate::common::*;
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct Book {
pub id: u64,
pub title: String,
pub author: Option<String>,
pub category: String,
pub num_highlights: u64,
pub last_highlighted_at: Option<String>,
pub updated: String,
pub cover_image_url: String,
pub highlights_url: String,
pub source_url: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct BooksResponse {
pub count: u64,
pub next: Option<String>,
pub previous: Option<String>,
pub results: Vec<Book>,
}
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct Highlight {
pub id: u64,
pub text: String,
pub note: String,
pub location: u64,
pub location_type: String,
pub highlighted_at: Option<String>,
pub url: Option<String>,
pub color: String,
pub updated: String,
pub books_id: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct HighlightsResponse {
pub count: u64,
pub next: Option<String>,
pub previous: Option<String>,
pub results: Vec<Highlight>,
}
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct HighlightCreateResponse {
pub id: u64,
pub title: String,
pub auhtor: Option<String>,
pub category: String,
pub num_highlights: u64,
pub last_highlighted_at: Option<String>,
pub updated: String,
pub cover_image_url: String,
pub highlights_url: String,
pub source_url: Option<String>,
pub modified_highlights: Vec<u64>,
}