From 83b6f6cf705b9ed19153669cfcac57fb53a5f7d5 Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Fri, 27 Mar 2020 12:24:41 +0530 Subject: [PATCH] Use an Option for the frequency field of Plan struct Since Free plans don't have a frequency of billing. --- cloudflare/src/endpoints/plan.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudflare/src/endpoints/plan.rs b/cloudflare/src/endpoints/plan.rs index 8b21246c..96e80dfb 100644 --- a/cloudflare/src/endpoints/plan.rs +++ b/cloudflare/src/endpoints/plan.rs @@ -1,5 +1,6 @@ #[derive(Deserialize, Debug)] #[serde(rename_all = "lowercase")] +/// Free plans won't have a Frequency, so most responses should accept Option instead. pub enum Frequency { Weekly, Monthly, @@ -18,7 +19,7 @@ pub struct Plan { /// The monetary unit in which pricing information is displayed currency: String, /// The frequency at which you will be billed for this plan - frequency: Frequency, + frequency: Option, /// A 'friendly' identifier to indicate to the UI what plan the object is legacy_id: String, /// If the zone is subscribed to this plan