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
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Debug)]
pub struct UpcloudServerListRoot {
    pub servers: UpcloudServerList,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudServerList {
    pub server: Vec<UpcloudServer>,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudServerRoot {
    pub server: UpcloudServer,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudServer {
    pub core_number: String,
    pub hostname: String,
    pub labels: UpcloudLabelList,
    pub license: u32,
    pub memory_amount: String,
    pub plan: String,
    pub plan_ipv4_bytes: String,
    pub plan_ipv6_bytes: String,
    pub state: String,
    pub tags: UpcloudTagList,
    pub title: String,
    pub uuid: String,
    pub zone: String,
}


#[derive(Deserialize, Serialize, Debug)]
pub struct UpcloudLabelList {
    pub label: Vec<UpcloudLabel>
}

#[derive(Deserialize, Serialize, Debug)]
pub struct UpcloudLabel {
    pub key: String,
    pub value: String,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudTagList {
    pub tag: Vec<String>
}