Skip to content

Commit

Permalink
add a AccountDetails struct for use by zone endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shalzz authored and adamchalmers committed Nov 25, 2020
1 parent 47b02db commit c63da05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions cloudflare/src/endpoints/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,16 @@ pub struct Settings {
enforce_twofactor: bool,
}

/// Cloudflare Accounts Details
/// An Account is the root object which owns other resources such as zones, load balancers and billing details.
/// https://api.cloudflare.com/#accounts-properties
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
pub struct AccountDetails {
/// Account identifier tag.
pub id: String,
/// Account name
pub name: String,
}

impl ApiResult for Account {}
impl ApiResult for Vec<Account> {}
4 changes: 2 additions & 2 deletions cloudflare/src/endpoints/zone.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::endpoints::{account::Account, plan::Plan};
use crate::endpoints::{account::AccountDetails, plan::Plan};
use crate::framework::{
endpoint::{Endpoint, Method},
response::ApiResult,
Expand Down Expand Up @@ -117,7 +117,7 @@ pub struct Zone {
/// The domain name
pub name: String,
/// Information about the account the zone belongs to
pub account: Account,
pub account: AccountDetails,
/// A list of beta features in which the zone is participating
pub betas: Option<Vec<String>>,
/// When the zone was created
Expand Down

0 comments on commit c63da05

Please sign in to comment.