diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-09-14 14:19:01 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-09-14 14:39:29 -0400 |
commit | 4c94e5f9101c14bfc5c6989d11ea6c855c809f0b (patch) | |
tree | 4e4e7ba93d41eda4c8a4c5346c3e02fc88d8789d /src/models/hybrid_transaction_all_of.rs | |
parent | a43423c5f36f8ff6642c9f6ad85800ab38758395 (diff) | |
download | ynab-api-4c94e5f9101c14bfc5c6989d11ea6c855c809f0b.tar.gz ynab-api-4c94e5f9101c14bfc5c6989d11ea6c855c809f0b.zip |
update openapi spec2.0.0
Diffstat (limited to 'src/models/hybrid_transaction_all_of.rs')
-rw-r--r-- | src/models/hybrid_transaction_all_of.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/models/hybrid_transaction_all_of.rs b/src/models/hybrid_transaction_all_of.rs index 42fd515..7092a71 100644 --- a/src/models/hybrid_transaction_all_of.rs +++ b/src/models/hybrid_transaction_all_of.rs @@ -9,40 +9,37 @@ */ -#[allow(unused_imports)] -use serde_json::Value; - -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct HybridTransactionAllOf { /// Whether the hybrid transaction represents a regular transaction or a subtransaction #[serde(rename = "type")] - pub _type: String, - /// For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null. + pub _type: Type, + /// For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null. #[serde(rename = "parent_transaction_id", skip_serializing_if = "Option::is_none")] pub parent_transaction_id: Option<String>, #[serde(rename = "account_name")] pub account_name: String, #[serde(rename = "payee_name", skip_serializing_if = "Option::is_none")] pub payee_name: Option<String>, - #[serde(rename = "category_name")] - pub category_name: String, + #[serde(rename = "category_name", skip_serializing_if = "Option::is_none")] + pub category_name: Option<String>, } impl HybridTransactionAllOf { - pub fn new(_type: String, account_name: String, category_name: String) -> HybridTransactionAllOf { + pub fn new(_type: Type, account_name: String) -> HybridTransactionAllOf { HybridTransactionAllOf { _type: _type, parent_transaction_id: None, account_name: account_name, payee_name: None, - category_name: category_name, + category_name: None, } } } /// Whether the hybrid transaction represents a regular transaction or a subtransaction -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Type { #[serde(rename = "transaction")] Transaction, |