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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
use serde_json;

use Location;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserEntry {
    pub title: String,
    pub login: String,
    pub nom: String,
    pub prenom: String,
    pub picture: Option<String>,
    pub location: Location,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataInfo {
    pub city: Option<UserDataInfoFields>,
    pub telephone: Option<UserDataInfoFields>,
    pub country: Option<UserDataInfoFields>,
    pub birthplace: Option<UserDataInfoFields>,
    pub birthday: Option<UserDataInfoFields>,
    pub facebook: Option<UserDataInfoFields>,
    pub email: Option<UserDataInfoFields>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataInfoFields {
    pub value: String,
    pub adm: Option<bool>,
    pub public: Option<bool>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataGroup {
    pub title: String,
    pub name: String,
    pub count: u32,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataGPA {
    pub gpa: String,
    pub cycle: String,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataSpice {
    pub available_spice: Option<String>,
    pub consumed_spice: Option<u32>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserDataNsStat {
    pub active: f32,
    pub idle: f32,
    pub out_active: f32,
    pub out_idle: f32,
    pub nslog_norm: f32,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserData {
    pub login: String,
    pub title: String,
    pub internal_email: String,
    pub lastname: String,
    pub firstname: String,
    pub userinfo: UserDataInfo,
    pub referent_used: bool,
    pub picture: String,
    pub picture_fun: Option<String>,
    pub scolaryear: Option<String>,
    pub promo: Option<u32>,
    pub semester: Option<u32>,
    pub location: String,
    pub documents: Option<String>,
    pub userdocs: Option<String>,
    pub shell: Option<String>,
    pub close: bool,
    pub ctime: String,
    pub mtime: String,
    pub id_promo: Option<String>,
    pub id_history: Option<String>,
    pub course_code: Option<String>,
    pub semester_code: Option<String>,
    pub school_id: Option<String>,
    pub school_code: Option<String>,
    pub school_title: Option<String>,
    pub old_id_promo: Option<String>,
    pub old_id_location: Option<String>,
    pub rights: serde_json::Value,
    pub invited: bool,
    pub studentyear: Option<u32>,
    pub admin: bool,
    pub editable: bool,
    pub groups: Vec<UserDataGroup>,
    pub events: Option<Vec<serde_json::Value>>,
    pub credits: Option<u32>,
    pub gpa: Option<Vec<UserDataGPA>>,
    pub spice: Option<UserDataSpice>,
    pub nsstat: Option<UserDataNsStat>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserNetsoulEntry(u64, f64, f64, f64, f64, f64);

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserNotes {
    pub modules: Vec<UserNotesModule>,
    pub notes: Vec<UserNotesMark>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserNotesModule {
    pub scolaryear: Option<u32>,
    pub id_user_history: Option<String>,
    pub codemodule: Option<String>,
    pub codeinstance: Option<String>,
    pub title: Option<String>,
    pub date_ins: Option<String>,
    pub cycle: Option<String>,
    pub grade: Option<String>,
    pub credits: Option<f32>,
    pub barrage: Option<u32>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserNotesMark {
    pub scolaryear: u32,
    pub codemodule: String,
    pub titlemodule: String,
    pub codeinstance: String,
    pub codeacti: String,
    pub title: String,
    pub date: String,
    pub correcteur: String,
    pub final_note: f32,
    pub comment: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserBinome {
    pub user: UserBinomeUser,
    pub binomes: Vec<UserBinomeEntry>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserBinomeUser {
    pub login: String,
    pub picture: String,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserBinomeEntry {
    pub login: String,
    pub picture: String,
    pub activities: String,
    pub id_activities: String,
    pub nb_activities: String,
    pub weight: String,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UserSearchResultEntry {
    pub title: Option<String>,
    #[serde(rename = "type")]
    pub user_type: String,
    pub login: String,
    pub picture_fun: Option<String>,
    pub picture: Option<String>,
    pub course_code: Option<String>,
    pub promo: Option<String>,
    pub course: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AvailableCourseEntry {
    pub students: String,
    pub code: String,
    pub shortcode_school: String,
    pub title: String,
    pub old_title: String,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AvailablePromoEntry {
    pub students: String,
    pub promo: String,
    pub promo_deprecated: String,
}