Skip to content

Commit

Permalink
Use an Option for the frequency field of Plan struct
Browse files Browse the repository at this point in the history
Since Free plans don't have a frequency of billing.
  • Loading branch information
shalzz authored and adamchalmers committed Nov 25, 2020
1 parent c63da05 commit 83b6f6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cloudflare/src/endpoints/plan.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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<Frequency>,
/// A 'friendly' identifier to indicate to the UI what plan the object is
legacy_id: String,
/// If the zone is subscribed to this plan
Expand Down

0 comments on commit 83b6f6c

Please sign in to comment.