From c63da05a5c8c28ee34fe0c09ba869ae6227cb51e Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Fri, 27 Mar 2020 12:18:45 +0530 Subject: [PATCH] add a AccountDetails struct for use by zone endpoint --- cloudflare/src/endpoints/account/mod.rs | 11 +++++++++++ cloudflare/src/endpoints/zone.rs | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cloudflare/src/endpoints/account/mod.rs b/cloudflare/src/endpoints/account/mod.rs index 6a7492ed..68f1e4cf 100644 --- a/cloudflare/src/endpoints/account/mod.rs +++ b/cloudflare/src/endpoints/account/mod.rs @@ -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 {} diff --git a/cloudflare/src/endpoints/zone.rs b/cloudflare/src/endpoints/zone.rs index 8f670e35..936740a4 100644 --- a/cloudflare/src/endpoints/zone.rs +++ b/cloudflare/src/endpoints/zone.rs @@ -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, @@ -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>, /// When the zone was created