discloud_rs/
user.rs

1use std::fmt::Display;
2
3use serde::Deserialize;
4
5#[derive(Deserialize, Debug)]
6pub struct UserResponse {
7    pub status: String,
8    pub message: String,
9    pub user: User,
10}
11
12#[derive(Deserialize, Debug, Clone)]
13pub struct User {
14    #[serde(rename = "userID")]
15    pub user_id: String,
16    #[serde(rename = "totalRamMb")]
17    pub total_ram: u32,
18    #[serde(rename = "ramUsedMb")]
19    pub used_ram: u32,
20    pub subdomains: Vec<String>,
21    #[serde(rename = "customdomains")]
22    pub custom_domains: Vec<String>,
23    pub apps: Vec<String>,
24    pub plan: String,
25    pub locale: String,
26    #[serde(rename = "planDataEnd")]
27    pub plan_date_end: String,
28}
29
30#[derive(Deserialize, Debug)]
31pub struct LocaleResponse {
32    pub status: String,
33    pub locale: Locale,
34}
35
36#[derive(Deserialize, Debug, Clone)]
37pub enum Locale {
38    #[serde(rename = "pt-BR")]
39    PtBR,
40    #[serde(rename = "en-US")]
41    EnUS,
42}
43
44impl Display for Locale {
45    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
46        match self {
47            Self::PtBR => write!(f, "pt-BR"),
48            Self::EnUS => write!(f, "en-US"),
49        }
50    }
51}