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
79
80
81
82
83
84
85
86
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
pub mod task;
#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct DueDateTime {
pub string: String,
pub date: String,
pub recurring: bool,
pub datetime: Option<String>,
pub timezone: Option<String>,
}
#[derive(Debug, Default)]
pub struct Project {
pub id: usize,
pub name: String,
pub color: Color,
pub parent_id: Option<usize>,
pub order: usize,
pub favorite: bool,
pub inbox_project: Option<bool>,
pub url: String,
}
#[derive(Debug, Default)]
pub struct Label {
pub id: usize,
pub name: String,
pub color: Color,
pub favorite: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize_repr, Deserialize_repr)]
#[repr(usize)]
pub enum Color {
BerryRed = 30,
Red = 31,
Orange = 32,
Yellow = 33,
OliveGreen = 34,
LimeGreen = 35,
Green = 36,
MintGreen = 37,
Teal = 38,
SkyBlue = 39,
LightBlue = 40,
Blue = 41,
Grape = 42,
Violet = 43,
Lavender = 44,
Magenta = 45,
Salmon = 46,
Charcoal = 47,
Grey = 48,
Taupe = 49,
}
impl Default for Color {
fn default() -> Self {
Self::Charcoal
}
}