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
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use super::{database::DatabaseSummary, plan::Plan};
/// Condensed application metadata as returned inside the `me` response.
#[derive(Debug, Serialize, Deserialize)]
pub struct AppSummary {
/// The application's unique identifier.
pub id: String,
/// The application's display name.
pub name: String,
/// A short description of the application, if set.
pub desc: Option<String>,
/// RAM allocation in megabytes.
pub ram: u32,
/// The programming language or runtime the application uses.
pub lang: String,
/// The primary domain assigned by SquareCloud, if any.
pub domain: Option<String>,
/// A custom domain configured by the owner, if any.
pub custom: Option<String>,
/// The data-centre cluster the application is hosted on.
pub cluster: String,
/// The UTC timestamp when the application was created.
pub created_at: DateTime<Utc>,
}
/// The authenticated user's profile fields.
#[derive(Debug, Serialize, Deserialize)]
pub struct UserInfo {
/// The account's unique identifier.
pub id: String,
/// The account holder's display name.
pub name: String,
/// The account holder's email address.
pub email: String,
/// The active subscription plan and its resource limits.
pub plan: Plan,
/// The UTC timestamp when the account was created.
pub created_at: DateTime<Utc>,
}
/// Full account information returned by `me`.
///
/// Returned by [`ApiClient::me`](crate::ApiClient::me).
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountInfo {
/// The authenticated user's profile.
pub user: UserInfo,
/// All applications owned by this account.
pub applications: Vec<AppSummary>,
/// All managed databases owned by this account.
pub databases: Vec<DatabaseSummary>,
}