1 use serde::{Deserialize, Serialize};
2 use spinners::Spinner;
3
4 pub struct CommandResult {
5 pub spinner: Spinner,
6 pub symbol: String,
7 pub msg: String,
8 }
9
10 #[derive(Serialize, Deserialize, Debug)]
11 pub struct AuthApp {
12 pub id: String,
13 pub secret: Option<String>,
14 pub name: String,
15 pub created_at: String,
16 pub updated_at: String,
17 }
18
19 #[derive(Serialize, Deserialize, Debug)]
20 pub struct AuthAppCreate {
21 pub name: String,
22 pub description: String,
23 }
24
25 #[derive(Deserialize, Debug, Serialize)]
26 pub struct Config {
27 pub current_project: Option<Project>,
28 pub current_auth_app: Option<AuthApp>,
29 }
30
31 #[derive(Deserialize, Debug, Serialize)]
32 pub struct Project {
33 pub id: i32,
34 pub name: String,
35 pub created_at: String,
36 pub updated_at: String,
37 }
38 #[derive(Serialize, Debug)]
39 pub struct ProjectCreate {
40 pub name: String,
41 pub description: String,
42 }
43
44 #[cfg(test)]
45 mod tests {
46 use super::*;
47
48 #[test]
49 fn it_parse_auth_app() {
50 let data = r#"{
51
52 }"#;
53 //let auth_app = serde_json::from_value(data.into());
54 }
55 }