cloudflare/endpoints/account/mod.rs
1use crate::framework::ApiResultTraits;
2use chrono::{DateTime, Utc};
3use serde::Deserialize;
4
5pub mod list_accounts;
6pub use list_accounts::ListAccounts;
7
8/// Cloudflare Accounts
9/// An Account is the root object which owns other resources such as zones, load balancers and billing details.
10/// https://api.cloudflare.com/#accounts-properties
11#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
12pub struct Account {
13 /// Account identifier tag.
14 pub id: String,
15 /// Account name
16 pub name: String,
17 /// Account Settings
18 pub settings: Option<Settings>,
19 /// describes when the account was created
20 pub created_on: Option<DateTime<Utc>>,
21}
22
23/// Cloudflare Accounts Settings
24/// An object containing the enforce two factor auth property.
25#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
26pub struct Settings {
27 /// Indicates whether or not membership in this account requires that Two-Factor Authentication is enabled
28 enforce_twofactor: bool,
29}
30
31/// Cloudflare Accounts Details
32/// An Account is the root object which owns other resources such as zones, load balancers and billing details.
33/// https://api.cloudflare.com/#accounts-properties
34#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
35pub struct AccountDetails {
36 /// Account identifier tag.
37 pub id: String,
38 /// Account name
39 pub name: String,
40}
41
42impl ApiResultTraits for Account {}
43impl ApiResultTraits for Vec<Account> {}