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
use serde::Deserialize;

#[derive(Deserialize, Debug)]
pub struct UpcloudAccountsListRoot {
    pub accounts: UpcloudAccountListRoot,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudAccountListRoot {
    pub account: Vec<UpcloudAccountsListItem>,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudAccountsListItem {
    #[serde(rename = "type")]
    pub account_type: String,
    pub username: String,
    pub roles: UpcloudRoleRoot,
}

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

#[derive(Deserialize, Debug)]
pub struct UpcloudAccountRoot {
    pub account: UpcloudAccount,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudAccountResources {
    pub cores: f32,
    pub detached_floating_ips: Option<f32>,
    pub memory: f32,
    pub networks: u32,
    pub public_ipv4: u32,
    pub public_ipv6: u64,
    pub storage_hdd: f32,
    pub storage_maxiops: Option<f32>,
    pub storage_ssd: f32,
}

#[derive(Deserialize, Debug)]
pub struct UpcloudAccount {
    pub credits: f32,
    pub resource_limits: UpcloudAccountResources,
    pub username: String
}