diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-07 03:57:33 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-07 03:57:33 -0500 |
commit | a942c7c8e17eb829ef1581c0b556665784f19e33 (patch) | |
tree | ff391dc8d22860009bd06f77042cb74d6eb6c1f2 /src/models/category.rs | |
parent | 4c94e5f9101c14bfc5c6989d11ea6c855c809f0b (diff) | |
download | ynab-api-a942c7c8e17eb829ef1581c0b556665784f19e33.tar.gz ynab-api-a942c7c8e17eb829ef1581c0b556665784f19e33.zip |
update openapi spec and regenerate with newer openapi-generator
the newer openapi-generator picks up fixes for optional parameters,
among other things
Diffstat (limited to 'src/models/category.rs')
-rw-r--r-- | src/models/category.rs | 25 |
1 files changed, 13 insertions, 12 deletions
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<String>, /// 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<i64>, /// 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<String>, @@ -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, } } } |