diff options
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, |