From a942c7c8e17eb829ef1581c0b556665784f19e33 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 7 Nov 2019 03:57:33 -0500 Subject: update openapi spec and regenerate with newer openapi-generator the newer openapi-generator picks up fixes for optional parameters, among other things --- src/models/category.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/models/category.rs') diff --git a/src/models/category.rs b/src/models/category.rs index 6677f8d..253f061 100644 --- a/src/models/category.rs +++ b/src/models/category.rs @@ -10,6 +10,7 @@ + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id")] @@ -42,8 +43,8 @@ pub struct Category { #[serde(rename = "goal_creation_month", skip_serializing_if = "Option::is_none")] pub goal_creation_month: Option, /// The goal target amount in milliunits - #[serde(rename = "goal_target")] - pub goal_target: i64, + #[serde(rename = "goal_target", skip_serializing_if = "Option::is_none")] + pub goal_target: Option, /// If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed #[serde(rename = "goal_target_month", skip_serializing_if = "Option::is_none")] pub goal_target_month: Option, @@ -56,23 +57,23 @@ pub struct Category { } impl Category { - pub fn new(id: String, category_group_id: String, name: String, hidden: bool, budgeted: i64, activity: i64, balance: i64, goal_target: i64, deleted: bool) -> Category { + pub fn new(id: String, category_group_id: String, name: String, hidden: bool, budgeted: i64, activity: i64, balance: i64, deleted: bool) -> Category { Category { - id: id, - category_group_id: category_group_id, - name: name, - hidden: hidden, + id, + category_group_id, + name, + hidden, original_category_group_id: None, note: None, - budgeted: budgeted, - activity: activity, - balance: balance, + budgeted, + activity, + balance, goal_type: None, goal_creation_month: None, - goal_target: goal_target, + goal_target: None, goal_target_month: None, goal_percentage_complete: None, - deleted: deleted, + deleted, } } } -- cgit v1.2.3-54-g00ecf