aboutsummaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/models')
-rw-r--r--src/models/account.rs21
-rw-r--r--src/models/account_response.rs3
-rw-r--r--src/models/account_response_data.rs3
-rw-r--r--src/models/accounts_response.rs3
-rw-r--r--src/models/accounts_response_data.rs5
-rw-r--r--src/models/budget_detail.rs5
-rw-r--r--src/models/budget_detail_all_of.rs1
-rw-r--r--src/models/budget_detail_response.rs3
-rw-r--r--src/models/budget_detail_response_data.rs5
-rw-r--r--src/models/budget_settings.rs5
-rw-r--r--src/models/budget_settings_response.rs3
-rw-r--r--src/models/budget_settings_response_data.rs3
-rw-r--r--src/models/budget_summary.rs5
-rw-r--r--src/models/budget_summary_response.rs3
-rw-r--r--src/models/budget_summary_response_data.rs3
-rw-r--r--src/models/bulk_response.rs3
-rw-r--r--src/models/bulk_response_data.rs3
-rw-r--r--src/models/bulk_response_data_bulk.rs5
-rw-r--r--src/models/bulk_transactions.rs3
-rw-r--r--src/models/categories_response.rs3
-rw-r--r--src/models/categories_response_data.rs5
-rw-r--r--src/models/category.rs25
-rw-r--r--src/models/category_group.rs9
-rw-r--r--src/models/category_group_with_categories.rs11
-rw-r--r--src/models/category_group_with_categories_all_of.rs3
-rw-r--r--src/models/category_response.rs3
-rw-r--r--src/models/category_response_data.rs3
-rw-r--r--src/models/currency_format.rs17
-rw-r--r--src/models/date_format.rs3
-rw-r--r--src/models/error_detail.rs7
-rw-r--r--src/models/error_response.rs3
-rw-r--r--src/models/hybrid_transaction.rs51
-rw-r--r--src/models/hybrid_transaction_all_of.rs5
-rw-r--r--src/models/hybrid_transactions_response.rs3
-rw-r--r--src/models/hybrid_transactions_response_data.rs3
-rw-r--r--src/models/mod.rs166
-rw-r--r--src/models/month_detail.rs15
-rw-r--r--src/models/month_detail_all_of.rs3
-rw-r--r--src/models/month_detail_response.rs3
-rw-r--r--src/models/month_detail_response_data.rs3
-rw-r--r--src/models/month_summaries_response.rs3
-rw-r--r--src/models/month_summaries_response_data.rs5
-rw-r--r--src/models/month_summary.rs13
-rw-r--r--src/models/payee.rs7
-rw-r--r--src/models/payee_location.rs11
-rw-r--r--src/models/payee_location_response.rs3
-rw-r--r--src/models/payee_location_response_data.rs3
-rw-r--r--src/models/payee_locations_response.rs3
-rw-r--r--src/models/payee_locations_response_data.rs3
-rw-r--r--src/models/payee_response.rs3
-rw-r--r--src/models/payee_response_data.rs3
-rw-r--r--src/models/payees_response.rs3
-rw-r--r--src/models/payees_response_data.rs5
-rw-r--r--src/models/save_category_response.rs3
-rw-r--r--src/models/save_category_response_data.rs5
-rw-r--r--src/models/save_month_category.rs3
-rw-r--r--src/models/save_month_category_wrapper.rs3
-rw-r--r--src/models/save_transaction.rs37
-rw-r--r--src/models/save_transaction_wrapper.rs3
-rw-r--r--src/models/save_transactions_response.rs3
-rw-r--r--src/models/save_transactions_response_data.rs5
-rw-r--r--src/models/save_transactions_wrapper.rs1
-rw-r--r--src/models/scheduled_sub_transaction.rs9
-rw-r--r--src/models/scheduled_transaction_detail.rs71
-rw-r--r--src/models/scheduled_transaction_detail_all_of.rs5
-rw-r--r--src/models/scheduled_transaction_response.rs3
-rw-r--r--src/models/scheduled_transaction_response_data.rs3
-rw-r--r--src/models/scheduled_transaction_summary.rs67
-rw-r--r--src/models/scheduled_transactions_response.rs3
-rw-r--r--src/models/scheduled_transactions_response_data.rs5
-rw-r--r--src/models/sub_transaction.rs9
-rw-r--r--src/models/transaction_detail.rs51
-rw-r--r--src/models/transaction_detail_all_of.rs5
-rw-r--r--src/models/transaction_response.rs3
-rw-r--r--src/models/transaction_response_data.rs3
-rw-r--r--src/models/transaction_summary.rs47
-rw-r--r--src/models/transactions_response.rs3
-rw-r--r--src/models/transactions_response_data.rs5
-rw-r--r--src/models/update_transaction.rs39
-rw-r--r--src/models/update_transaction_all_of.rs3
-rw-r--r--src/models/update_transactions_wrapper.rs3
-rw-r--r--src/models/user.rs3
-rw-r--r--src/models/user_response.rs3
-rw-r--r--src/models/user_response_data.rs3
84 files changed, 604 insertions, 299 deletions
diff --git a/src/models/account.rs b/src/models/account.rs
index 44ad808..c2581f0 100644
--- a/src/models/account.rs
+++ b/src/models/account.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Account {
#[serde(rename = "id")]
@@ -47,17 +48,17 @@ pub struct Account {
impl Account {
pub fn new(id: String, name: String, _type: Type, on_budget: bool, closed: bool, balance: i64, cleared_balance: i64, uncleared_balance: i64, transfer_payee_id: String, deleted: bool) -> Account {
Account {
- id: id,
- name: name,
- _type: _type,
- on_budget: on_budget,
- closed: closed,
+ id,
+ name,
+ _type,
+ on_budget,
+ closed,
note: None,
- balance: balance,
- cleared_balance: cleared_balance,
- uncleared_balance: uncleared_balance,
- transfer_payee_id: transfer_payee_id,
- deleted: deleted,
+ balance,
+ cleared_balance,
+ uncleared_balance,
+ transfer_payee_id,
+ deleted,
}
}
}
diff --git a/src/models/account_response.rs b/src/models/account_response.rs
index 3f24283..5f90ddf 100644
--- a/src/models/account_response.rs
+++ b/src/models/account_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct AccountResponse {
impl AccountResponse {
pub fn new(data: crate::models::AccountResponseData) -> AccountResponse {
AccountResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/account_response_data.rs b/src/models/account_response_data.rs
index c74e20a..f08e252 100644
--- a/src/models/account_response_data.rs
+++ b/src/models/account_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountResponseData {
#[serde(rename = "account")]
@@ -19,7 +20,7 @@ pub struct AccountResponseData {
impl AccountResponseData {
pub fn new(account: crate::models::Account) -> AccountResponseData {
AccountResponseData {
- account: account,
+ account,
}
}
}
diff --git a/src/models/accounts_response.rs b/src/models/accounts_response.rs
index ccf8809..0d2b696 100644
--- a/src/models/accounts_response.rs
+++ b/src/models/accounts_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct AccountsResponse {
impl AccountsResponse {
pub fn new(data: crate::models::AccountsResponseData) -> AccountsResponse {
AccountsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/accounts_response_data.rs b/src/models/accounts_response_data.rs
index 670c777..effeec4 100644
--- a/src/models/accounts_response_data.rs
+++ b/src/models/accounts_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountsResponseData {
#[serde(rename = "accounts")]
@@ -22,8 +23,8 @@ pub struct AccountsResponseData {
impl AccountsResponseData {
pub fn new(accounts: Vec<crate::models::Account>, server_knowledge: i64) -> AccountsResponseData {
AccountsResponseData {
- accounts: accounts,
- server_knowledge: server_knowledge,
+ accounts,
+ server_knowledge,
}
}
}
diff --git a/src/models/budget_detail.rs b/src/models/budget_detail.rs
index b14f4b0..2ab61ac 100644
--- a/src/models/budget_detail.rs
+++ b/src/models/budget_detail.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetDetail {
#[serde(rename = "id")]
@@ -54,8 +55,8 @@ pub struct BudgetDetail {
impl BudgetDetail {
pub fn new(id: String, name: String) -> BudgetDetail {
BudgetDetail {
- id: id,
- name: name,
+ id,
+ name,
last_modified_on: None,
first_month: None,
last_month: None,
diff --git a/src/models/budget_detail_all_of.rs b/src/models/budget_detail_all_of.rs
index 8b7da42..058494a 100644
--- a/src/models/budget_detail_all_of.rs
+++ b/src/models/budget_detail_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetDetailAllOf {
#[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
diff --git a/src/models/budget_detail_response.rs b/src/models/budget_detail_response.rs
index 3ffcdcd..f068af4 100644
--- a/src/models/budget_detail_response.rs
+++ b/src/models/budget_detail_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetDetailResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct BudgetDetailResponse {
impl BudgetDetailResponse {
pub fn new(data: crate::models::BudgetDetailResponseData) -> BudgetDetailResponse {
BudgetDetailResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/budget_detail_response_data.rs b/src/models/budget_detail_response_data.rs
index 13dd651..e83ab1a 100644
--- a/src/models/budget_detail_response_data.rs
+++ b/src/models/budget_detail_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetDetailResponseData {
#[serde(rename = "budget")]
@@ -22,8 +23,8 @@ pub struct BudgetDetailResponseData {
impl BudgetDetailResponseData {
pub fn new(budget: crate::models::BudgetDetail, server_knowledge: i64) -> BudgetDetailResponseData {
BudgetDetailResponseData {
- budget: budget,
- server_knowledge: server_knowledge,
+ budget,
+ server_knowledge,
}
}
}
diff --git a/src/models/budget_settings.rs b/src/models/budget_settings.rs
index adb2d78..c1506bf 100644
--- a/src/models/budget_settings.rs
+++ b/src/models/budget_settings.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSettings {
#[serde(rename = "date_format")]
@@ -21,8 +22,8 @@ pub struct BudgetSettings {
impl BudgetSettings {
pub fn new(date_format: crate::models::DateFormat, currency_format: crate::models::CurrencyFormat) -> BudgetSettings {
BudgetSettings {
- date_format: date_format,
- currency_format: currency_format,
+ date_format,
+ currency_format,
}
}
}
diff --git a/src/models/budget_settings_response.rs b/src/models/budget_settings_response.rs
index e6a3fb8..fe93039 100644
--- a/src/models/budget_settings_response.rs
+++ b/src/models/budget_settings_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSettingsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct BudgetSettingsResponse {
impl BudgetSettingsResponse {
pub fn new(data: crate::models::BudgetSettingsResponseData) -> BudgetSettingsResponse {
BudgetSettingsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/budget_settings_response_data.rs b/src/models/budget_settings_response_data.rs
index bc9045e..63879fb 100644
--- a/src/models/budget_settings_response_data.rs
+++ b/src/models/budget_settings_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSettingsResponseData {
#[serde(rename = "settings")]
@@ -19,7 +20,7 @@ pub struct BudgetSettingsResponseData {
impl BudgetSettingsResponseData {
pub fn new(settings: crate::models::BudgetSettings) -> BudgetSettingsResponseData {
BudgetSettingsResponseData {
- settings: settings,
+ settings,
}
}
}
diff --git a/src/models/budget_summary.rs b/src/models/budget_summary.rs
index 742fcdf..a36abd8 100644
--- a/src/models/budget_summary.rs
+++ b/src/models/budget_summary.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSummary {
#[serde(rename = "id")]
@@ -34,8 +35,8 @@ pub struct BudgetSummary {
impl BudgetSummary {
pub fn new(id: String, name: String) -> BudgetSummary {
BudgetSummary {
- id: id,
- name: name,
+ id,
+ name,
last_modified_on: None,
first_month: None,
last_month: None,
diff --git a/src/models/budget_summary_response.rs b/src/models/budget_summary_response.rs
index 2327d4d..e2a0bc4 100644
--- a/src/models/budget_summary_response.rs
+++ b/src/models/budget_summary_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSummaryResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct BudgetSummaryResponse {
impl BudgetSummaryResponse {
pub fn new(data: crate::models::BudgetSummaryResponseData) -> BudgetSummaryResponse {
BudgetSummaryResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/budget_summary_response_data.rs b/src/models/budget_summary_response_data.rs
index 90802e7..938775d 100644
--- a/src/models/budget_summary_response_data.rs
+++ b/src/models/budget_summary_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetSummaryResponseData {
#[serde(rename = "budgets")]
@@ -21,7 +22,7 @@ pub struct BudgetSummaryResponseData {
impl BudgetSummaryResponseData {
pub fn new(budgets: Vec<crate::models::BudgetSummary>) -> BudgetSummaryResponseData {
BudgetSummaryResponseData {
- budgets: budgets,
+ budgets,
default_budget: None,
}
}
diff --git a/src/models/bulk_response.rs b/src/models/bulk_response.rs
index f40b58b..f6a9438 100644
--- a/src/models/bulk_response.rs
+++ b/src/models/bulk_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct BulkResponse {
impl BulkResponse {
pub fn new(data: crate::models::BulkResponseData) -> BulkResponse {
BulkResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/bulk_response_data.rs b/src/models/bulk_response_data.rs
index 192b489..389e2c5 100644
--- a/src/models/bulk_response_data.rs
+++ b/src/models/bulk_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkResponseData {
#[serde(rename = "bulk")]
@@ -19,7 +20,7 @@ pub struct BulkResponseData {
impl BulkResponseData {
pub fn new(bulk: crate::models::BulkResponseDataBulk) -> BulkResponseData {
BulkResponseData {
- bulk: bulk,
+ bulk,
}
}
}
diff --git a/src/models/bulk_response_data_bulk.rs b/src/models/bulk_response_data_bulk.rs
index 538f48c..4ca0e45 100644
--- a/src/models/bulk_response_data_bulk.rs
+++ b/src/models/bulk_response_data_bulk.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkResponseDataBulk {
/// The list of Transaction ids that were created.
@@ -23,8 +24,8 @@ pub struct BulkResponseDataBulk {
impl BulkResponseDataBulk {
pub fn new(transaction_ids: Vec<String>, duplicate_import_ids: Vec<String>) -> BulkResponseDataBulk {
BulkResponseDataBulk {
- transaction_ids: transaction_ids,
- duplicate_import_ids: duplicate_import_ids,
+ transaction_ids,
+ duplicate_import_ids,
}
}
}
diff --git a/src/models/bulk_transactions.rs b/src/models/bulk_transactions.rs
index b3e0466..f84874c 100644
--- a/src/models/bulk_transactions.rs
+++ b/src/models/bulk_transactions.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkTransactions {
#[serde(rename = "transactions")]
@@ -19,7 +20,7 @@ pub struct BulkTransactions {
impl BulkTransactions {
pub fn new(transactions: Vec<crate::models::SaveTransaction>) -> BulkTransactions {
BulkTransactions {
- transactions: transactions,
+ transactions,
}
}
}
diff --git a/src/models/categories_response.rs b/src/models/categories_response.rs
index 8b804c0..f4d570f 100644
--- a/src/models/categories_response.rs
+++ b/src/models/categories_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoriesResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct CategoriesResponse {
impl CategoriesResponse {
pub fn new(data: crate::models::CategoriesResponseData) -> CategoriesResponse {
CategoriesResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/categories_response_data.rs b/src/models/categories_response_data.rs
index 5a1dad3..62c3002 100644
--- a/src/models/categories_response_data.rs
+++ b/src/models/categories_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoriesResponseData {
#[serde(rename = "category_groups")]
@@ -22,8 +23,8 @@ pub struct CategoriesResponseData {
impl CategoriesResponseData {
pub fn new(category_groups: Vec<crate::models::CategoryGroupWithCategories>, server_knowledge: i64) -> CategoriesResponseData {
CategoriesResponseData {
- category_groups: category_groups,
- server_knowledge: server_knowledge,
+ category_groups,
+ server_knowledge,
}
}
}
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,
}
}
}
diff --git a/src/models/category_group.rs b/src/models/category_group.rs
index b4f75ee..9200d80 100644
--- a/src/models/category_group.rs
+++ b/src/models/category_group.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoryGroup {
#[serde(rename = "id")]
@@ -27,10 +28,10 @@ pub struct CategoryGroup {
impl CategoryGroup {
pub fn new(id: String, name: String, hidden: bool, deleted: bool) -> CategoryGroup {
CategoryGroup {
- id: id,
- name: name,
- hidden: hidden,
- deleted: deleted,
+ id,
+ name,
+ hidden,
+ deleted,
}
}
}
diff --git a/src/models/category_group_with_categories.rs b/src/models/category_group_with_categories.rs
index f674b4c..161294a 100644
--- a/src/models/category_group_with_categories.rs
+++ b/src/models/category_group_with_categories.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoryGroupWithCategories {
#[serde(rename = "id")]
@@ -30,11 +31,11 @@ pub struct CategoryGroupWithCategories {
impl CategoryGroupWithCategories {
pub fn new(id: String, name: String, hidden: bool, deleted: bool, categories: Vec<crate::models::Category>) -> CategoryGroupWithCategories {
CategoryGroupWithCategories {
- id: id,
- name: name,
- hidden: hidden,
- deleted: deleted,
- categories: categories,
+ id,
+ name,
+ hidden,
+ deleted,
+ categories,
}
}
}
diff --git a/src/models/category_group_with_categories_all_of.rs b/src/models/category_group_with_categories_all_of.rs
index 0820aef..83dcd00 100644
--- a/src/models/category_group_with_categories_all_of.rs
+++ b/src/models/category_group_with_categories_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoryGroupWithCategoriesAllOf {
/// Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
@@ -20,7 +21,7 @@ pub struct CategoryGroupWithCategoriesAllOf {
impl CategoryGroupWithCategoriesAllOf {
pub fn new(categories: Vec<crate::models::Category>) -> CategoryGroupWithCategoriesAllOf {
CategoryGroupWithCategoriesAllOf {
- categories: categories,
+ categories,
}
}
}
diff --git a/src/models/category_response.rs b/src/models/category_response.rs
index 13dff4a..179fc1b 100644
--- a/src/models/category_response.rs
+++ b/src/models/category_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoryResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct CategoryResponse {
impl CategoryResponse {
pub fn new(data: crate::models::CategoryResponseData) -> CategoryResponse {
CategoryResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/category_response_data.rs b/src/models/category_response_data.rs
index 078f720..9afeb49 100644
--- a/src/models/category_response_data.rs
+++ b/src/models/category_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CategoryResponseData {
#[serde(rename = "category")]
@@ -19,7 +20,7 @@ pub struct CategoryResponseData {
impl CategoryResponseData {
pub fn new(category: crate::models::Category) -> CategoryResponseData {
CategoryResponseData {
- category: category,
+ category,
}
}
}
diff --git a/src/models/currency_format.rs b/src/models/currency_format.rs
index 8831679..44a99aa 100644
--- a/src/models/currency_format.rs
+++ b/src/models/currency_format.rs
@@ -11,6 +11,7 @@
/// CurrencyFormat : The currency format setting for the budget. In some cases the format will not be available and will be specified as null.
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct CurrencyFormat {
#[serde(rename = "iso_code")]
@@ -35,14 +36,14 @@ impl CurrencyFormat {
/// The currency format setting for the budget. In some cases the format will not be available and will be specified as null.
pub fn new(iso_code: String, example_format: String, decimal_digits: i32, decimal_separator: String, symbol_first: bool, group_separator: String, currency_symbol: String, display_symbol: bool) -> CurrencyFormat {
CurrencyFormat {
- iso_code: iso_code,
- example_format: example_format,
- decimal_digits: decimal_digits,
- decimal_separator: decimal_separator,
- symbol_first: symbol_first,
- group_separator: group_separator,
- currency_symbol: currency_symbol,
- display_symbol: display_symbol,
+ iso_code,
+ example_format,
+ decimal_digits,
+ decimal_separator,
+ symbol_first,
+ group_separator,
+ currency_symbol,
+ display_symbol,
}
}
}
diff --git a/src/models/date_format.rs b/src/models/date_format.rs
index d9259d9..9a4ce0f 100644
--- a/src/models/date_format.rs
+++ b/src/models/date_format.rs
@@ -11,6 +11,7 @@
/// DateFormat : The date format setting for the budget. In some cases the format will not be available and will be specified as null.
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct DateFormat {
#[serde(rename = "format")]
@@ -21,7 +22,7 @@ impl DateFormat {
/// The date format setting for the budget. In some cases the format will not be available and will be specified as null.
pub fn new(format: String) -> DateFormat {
DateFormat {
- format: format,
+ format,
}
}
}
diff --git a/src/models/error_detail.rs b/src/models/error_detail.rs
index 32e0380..b8ce02a 100644
--- a/src/models/error_detail.rs
+++ b/src/models/error_detail.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorDetail {
#[serde(rename = "id")]
@@ -23,9 +24,9 @@ pub struct ErrorDetail {
impl ErrorDetail {
pub fn new(id: String, name: String, detail: String) -> ErrorDetail {
ErrorDetail {
- id: id,
- name: name,
- detail: detail,
+ id,
+ name,
+ detail,
}
}
}
diff --git a/src/models/error_response.rs b/src/models/error_response.rs
index 49760b3..7c43363 100644
--- a/src/models/error_response.rs
+++ b/src/models/error_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponse {
#[serde(rename = "error")]
@@ -19,7 +20,7 @@ pub struct ErrorResponse {
impl ErrorResponse {
pub fn new(error: crate::models::ErrorDetail) -> ErrorResponse {
ErrorResponse {
- error: error,
+ error,
}
}
}
diff --git a/src/models/hybrid_transaction.rs b/src/models/hybrid_transaction.rs
index a0b0f07..9085d6f 100644
--- a/src/models/hybrid_transaction.rs
+++ b/src/models/hybrid_transaction.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct HybridTransaction {
#[serde(rename = "id")]
@@ -24,13 +25,13 @@ pub struct HybridTransaction {
pub memo: Option<String>,
/// The cleared status of the transaction
#[serde(rename = "cleared")]
- pub cleared: String,
+ pub cleared: Cleared,
/// Whether or not the transaction is approved
#[serde(rename = "approved")]
pub approved: bool,
/// The transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
@@ -67,32 +68,58 @@ pub struct HybridTransaction {
}
impl HybridTransaction {
- pub fn new(id: String, date: String, amount: i64, cleared: String, approved: bool, account_id: String, deleted: bool, _type: Type, account_name: String) -> HybridTransaction {
+ pub fn new(id: String, date: String, amount: i64, cleared: Cleared, approved: bool, account_id: String, deleted: bool, _type: Type, account_name: String) -> HybridTransaction {
HybridTransaction {
- id: id,
- date: date,
- amount: amount,
+ id,
+ date,
+ amount,
memo: None,
- cleared: cleared,
- approved: approved,
+ cleared,
+ approved,
flag_color: None,
- account_id: account_id,
+ account_id,
payee_id: None,
category_id: None,
transfer_account_id: None,
transfer_transaction_id: None,
matched_transaction_id: None,
import_id: None,
- deleted: deleted,
- _type: _type,
+ deleted,
+ _type,
parent_transaction_id: None,
- account_name: account_name,
+ account_name,
payee_name: None,
category_name: None,
}
}
}
+/// The cleared status of the transaction
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Cleared {
+ #[serde(rename = "cleared")]
+ Cleared,
+ #[serde(rename = "uncleared")]
+ Uncleared,
+ #[serde(rename = "reconciled")]
+ Reconciled,
+}
+/// The transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
/// Whether the hybrid transaction represents a regular transaction or a subtransaction
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum Type {
diff --git a/src/models/hybrid_transaction_all_of.rs b/src/models/hybrid_transaction_all_of.rs
index 7092a71..c5ff791 100644
--- a/src/models/hybrid_transaction_all_of.rs
+++ b/src/models/hybrid_transaction_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct HybridTransactionAllOf {
/// Whether the hybrid transaction represents a regular transaction or a subtransaction
@@ -29,9 +30,9 @@ pub struct HybridTransactionAllOf {
impl HybridTransactionAllOf {
pub fn new(_type: Type, account_name: String) -> HybridTransactionAllOf {
HybridTransactionAllOf {
- _type: _type,
+ _type,
parent_transaction_id: None,
- account_name: account_name,
+ account_name,
payee_name: None,
category_name: None,
}
diff --git a/src/models/hybrid_transactions_response.rs b/src/models/hybrid_transactions_response.rs
index 11926f7..46896dd 100644
--- a/src/models/hybrid_transactions_response.rs
+++ b/src/models/hybrid_transactions_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct HybridTransactionsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct HybridTransactionsResponse {
impl HybridTransactionsResponse {
pub fn new(data: crate::models::HybridTransactionsResponseData) -> HybridTransactionsResponse {
HybridTransactionsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/hybrid_transactions_response_data.rs b/src/models/hybrid_transactions_response_data.rs
index b0b8143..a2b62d1 100644
--- a/src/models/hybrid_transactions_response_data.rs
+++ b/src/models/hybrid_transactions_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct HybridTransactionsResponseData {
#[serde(rename = "transactions")]
@@ -19,7 +20,7 @@ pub struct HybridTransactionsResponseData {
impl HybridTransactionsResponseData {
pub fn new(transactions: Vec<crate::models::HybridTransaction>) -> HybridTransactionsResponseData {
HybridTransactionsResponseData {
- transactions: transactions,
+ transactions,
}
}
}
diff --git a/src/models/mod.rs b/src/models/mod.rs
index 45b8f62..b8ec6a1 100644
--- a/src/models/mod.rs
+++ b/src/models/mod.rs
@@ -1,166 +1,166 @@
-mod account;
+pub mod account;
pub use self::account::Account;
-mod account_response;
+pub mod account_response;
pub use self::account_response::AccountResponse;
-mod account_response_data;
+pub mod account_response_data;
pub use self::account_response_data::AccountResponseData;
-mod accounts_response;
+pub mod accounts_response;
pub use self::accounts_response::AccountsResponse;
-mod accounts_response_data;
+pub mod accounts_response_data;
pub use self::accounts_response_data::AccountsResponseData;
-mod budget_detail;
+pub mod budget_detail;
pub use self::budget_detail::BudgetDetail;
-mod budget_detail_all_of;
+pub mod budget_detail_all_of;
pub use self::budget_detail_all_of::BudgetDetailAllOf;
-mod budget_detail_response;
+pub mod budget_detail_response;
pub use self::budget_detail_response::BudgetDetailResponse;
-mod budget_detail_response_data;
+pub mod budget_detail_response_data;
pub use self::budget_detail_response_data::BudgetDetailResponseData;
-mod budget_settings;
+pub mod budget_settings;
pub use self::budget_settings::BudgetSettings;
-mod budget_settings_response;
+pub mod budget_settings_response;
pub use self::budget_settings_response::BudgetSettingsResponse;
-mod budget_settings_response_data;
+pub mod budget_settings_response_data;
pub use self::budget_settings_response_data::BudgetSettingsResponseData;
-mod budget_summary;
+pub mod budget_summary;
pub use self::budget_summary::BudgetSummary;
-mod budget_summary_response;
+pub mod budget_summary_response;
pub use self::budget_summary_response::BudgetSummaryResponse;
-mod budget_summary_response_data;
+pub mod budget_summary_response_data;
pub use self::budget_summary_response_data::BudgetSummaryResponseData;
-mod bulk_response;
+pub mod bulk_response;
pub use self::bulk_response::BulkResponse;
-mod bulk_response_data;
+pub mod bulk_response_data;
pub use self::bulk_response_data::BulkResponseData;
-mod bulk_response_data_bulk;
+pub mod bulk_response_data_bulk;
pub use self::bulk_response_data_bulk::BulkResponseDataBulk;
-mod bulk_transactions;
+pub mod bulk_transactions;
pub use self::bulk_transactions::BulkTransactions;
-mod categories_response;
+pub mod categories_response;
pub use self::categories_response::CategoriesResponse;
-mod categories_response_data;
+pub mod categories_response_data;
pub use self::categories_response_data::CategoriesResponseData;
-mod category;
+pub mod category;
pub use self::category::Category;
-mod category_group;
+pub mod category_group;
pub use self::category_group::CategoryGroup;
-mod category_group_with_categories;
+pub mod category_group_with_categories;
pub use self::category_group_with_categories::CategoryGroupWithCategories;
-mod category_group_with_categories_all_of;
+pub mod category_group_with_categories_all_of;
pub use self::category_group_with_categories_all_of::CategoryGroupWithCategoriesAllOf;
-mod category_response;
+pub mod category_response;
pub use self::category_response::CategoryResponse;
-mod category_response_data;
+pub mod category_response_data;
pub use self::category_response_data::CategoryResponseData;
-mod currency_format;
+pub mod currency_format;
pub use self::currency_format::CurrencyFormat;
-mod date_format;
+pub mod date_format;
pub use self::date_format::DateFormat;
-mod error_detail;
+pub mod error_detail;
pub use self::error_detail::ErrorDetail;
-mod error_response;
+pub mod error_response;
pub use self::error_response::ErrorResponse;
-mod hybrid_transaction;
+pub mod hybrid_transaction;
pub use self::hybrid_transaction::HybridTransaction;
-mod hybrid_transaction_all_of;
+pub mod hybrid_transaction_all_of;
pub use self::hybrid_transaction_all_of::HybridTransactionAllOf;
-mod hybrid_transactions_response;
+pub mod hybrid_transactions_response;
pub use self::hybrid_transactions_response::HybridTransactionsResponse;
-mod hybrid_transactions_response_data;
+pub mod hybrid_transactions_response_data;
pub use self::hybrid_transactions_response_data::HybridTransactionsResponseData;
-mod month_detail;
+pub mod month_detail;
pub use self::month_detail::MonthDetail;
-mod month_detail_all_of;
+pub mod month_detail_all_of;
pub use self::month_detail_all_of::MonthDetailAllOf;
-mod month_detail_response;
+pub mod month_detail_response;
pub use self::month_detail_response::MonthDetailResponse;
-mod month_detail_response_data;
+pub mod month_detail_response_data;
pub use self::month_detail_response_data::MonthDetailResponseData;
-mod month_summaries_response;
+pub mod month_summaries_response;
pub use self::month_summaries_response::MonthSummariesResponse;
-mod month_summaries_response_data;
+pub mod month_summaries_response_data;
pub use self::month_summaries_response_data::MonthSummariesResponseData;
-mod month_summary;
+pub mod month_summary;
pub use self::month_summary::MonthSummary;
-mod payee;
+pub mod payee;
pub use self::payee::Payee;
-mod payee_location;
+pub mod payee_location;
pub use self::payee_location::PayeeLocation;
-mod payee_location_response;
+pub mod payee_location_response;
pub use self::payee_location_response::PayeeLocationResponse;
-mod payee_location_response_data;
+pub mod payee_location_response_data;
pub use self::payee_location_response_data::PayeeLocationResponseData;
-mod payee_locations_response;
+pub mod payee_locations_response;
pub use self::payee_locations_response::PayeeLocationsResponse;
-mod payee_locations_response_data;
+pub mod payee_locations_response_data;
pub use self::payee_locations_response_data::PayeeLocationsResponseData;
-mod payee_response;
+pub mod payee_response;
pub use self::payee_response::PayeeResponse;
-mod payee_response_data;
+pub mod payee_response_data;
pub use self::payee_response_data::PayeeResponseData;
-mod payees_response;
+pub mod payees_response;
pub use self::payees_response::PayeesResponse;
-mod payees_response_data;
+pub mod payees_response_data;
pub use self::payees_response_data::PayeesResponseData;
-mod save_category_response;
+pub mod save_category_response;
pub use self::save_category_response::SaveCategoryResponse;
-mod save_category_response_data;
+pub mod save_category_response_data;
pub use self::save_category_response_data::SaveCategoryResponseData;
-mod save_month_category;
+pub mod save_month_category;
pub use self::save_month_category::SaveMonthCategory;
-mod save_month_category_wrapper;
+pub mod save_month_category_wrapper;
pub use self::save_month_category_wrapper::SaveMonthCategoryWrapper;
-mod save_transaction;
+pub mod save_transaction;
pub use self::save_transaction::SaveTransaction;
-mod save_transaction_wrapper;
+pub mod save_transaction_wrapper;
pub use self::save_transaction_wrapper::SaveTransactionWrapper;
-mod save_transactions_response;
+pub mod save_transactions_response;
pub use self::save_transactions_response::SaveTransactionsResponse;
-mod save_transactions_response_data;
+pub mod save_transactions_response_data;
pub use self::save_transactions_response_data::SaveTransactionsResponseData;
-mod save_transactions_wrapper;
+pub mod save_transactions_wrapper;
pub use self::save_transactions_wrapper::SaveTransactionsWrapper;
-mod scheduled_sub_transaction;
+pub mod scheduled_sub_transaction;
pub use self::scheduled_sub_transaction::ScheduledSubTransaction;
-mod scheduled_transaction_detail;
+pub mod scheduled_transaction_detail;
pub use self::scheduled_transaction_detail::ScheduledTransactionDetail;
-mod scheduled_transaction_detail_all_of;
+pub mod scheduled_transaction_detail_all_of;
pub use self::scheduled_transaction_detail_all_of::ScheduledTransactionDetailAllOf;
-mod scheduled_transaction_response;
+pub mod scheduled_transaction_response;
pub use self::scheduled_transaction_response::ScheduledTransactionResponse;
-mod scheduled_transaction_response_data;
+pub mod scheduled_transaction_response_data;
pub use self::scheduled_transaction_response_data::ScheduledTransactionResponseData;
-mod scheduled_transaction_summary;
+pub mod scheduled_transaction_summary;
pub use self::scheduled_transaction_summary::ScheduledTransactionSummary;
-mod scheduled_transactions_response;
+pub mod scheduled_transactions_response;
pub use self::scheduled_transactions_response::ScheduledTransactionsResponse;
-mod scheduled_transactions_response_data;
+pub mod scheduled_transactions_response_data;
pub use self::scheduled_transactions_response_data::ScheduledTransactionsResponseData;
-mod sub_transaction;
+pub mod sub_transaction;
pub use self::sub_transaction::SubTransaction;
-mod transaction_detail;
+pub mod transaction_detail;
pub use self::transaction_detail::TransactionDetail;
-mod transaction_detail_all_of;
+pub mod transaction_detail_all_of;
pub use self::transaction_detail_all_of::TransactionDetailAllOf;
-mod transaction_response;
+pub mod transaction_response;
pub use self::transaction_response::TransactionResponse;
-mod transaction_response_data;
+pub mod transaction_response_data;
pub use self::transaction_response_data::TransactionResponseData;
-mod transaction_summary;
+pub mod transaction_summary;
pub use self::transaction_summary::TransactionSummary;
-mod transactions_response;
+pub mod transactions_response;
pub use self::transactions_response::TransactionsResponse;
-mod transactions_response_data;
+pub mod transactions_response_data;
pub use self::transactions_response_data::TransactionsResponseData;
-mod update_transaction;
+pub mod update_transaction;
pub use self::update_transaction::UpdateTransaction;
-mod update_transaction_all_of;
+pub mod update_transaction_all_of;
pub use self::update_transaction_all_of::UpdateTransactionAllOf;
-mod update_transactions_wrapper;
+pub mod update_transactions_wrapper;
pub use self::update_transactions_wrapper::UpdateTransactionsWrapper;
-mod user;
+pub mod user;
pub use self::user::User;
-mod user_response;
+pub mod user_response;
pub use self::user_response::UserResponse;
-mod user_response_data;
+pub mod user_response_data;
pub use self::user_response_data::UserResponseData;
diff --git a/src/models/month_detail.rs b/src/models/month_detail.rs
index 28b6d56..32b6f9e 100644
--- a/src/models/month_detail.rs
+++ b/src/models/month_detail.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthDetail {
#[serde(rename = "month")]
@@ -42,15 +43,15 @@ pub struct MonthDetail {
impl MonthDetail {
pub fn new(month: String, income: i64, budgeted: i64, activity: i64, to_be_budgeted: i64, deleted: bool, categories: Vec<crate::models::Category>) -> MonthDetail {
MonthDetail {
- month: month,
+ month,
note: None,
- income: income,
- budgeted: budgeted,
- activity: activity,
- to_be_budgeted: to_be_budgeted,
+ income,
+ budgeted,
+ activity,
+ to_be_budgeted,
age_of_money: None,
- deleted: deleted,
- categories: categories,
+ deleted,
+ categories,
}
}
}
diff --git a/src/models/month_detail_all_of.rs b/src/models/month_detail_all_of.rs
index a805bba..2d816a8 100644
--- a/src/models/month_detail_all_of.rs
+++ b/src/models/month_detail_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthDetailAllOf {
/// The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified.
@@ -20,7 +21,7 @@ pub struct MonthDetailAllOf {
impl MonthDetailAllOf {
pub fn new(categories: Vec<crate::models::Category>) -> MonthDetailAllOf {
MonthDetailAllOf {
- categories: categories,
+ categories,
}
}
}
diff --git a/src/models/month_detail_response.rs b/src/models/month_detail_response.rs
index 9c6d3b9..a0447a4 100644
--- a/src/models/month_detail_response.rs
+++ b/src/models/month_detail_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthDetailResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct MonthDetailResponse {
impl MonthDetailResponse {
pub fn new(data: crate::models::MonthDetailResponseData) -> MonthDetailResponse {
MonthDetailResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/month_detail_response_data.rs b/src/models/month_detail_response_data.rs
index 3a60eb5..703648d 100644
--- a/src/models/month_detail_response_data.rs
+++ b/src/models/month_detail_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthDetailResponseData {
#[serde(rename = "month")]
@@ -19,7 +20,7 @@ pub struct MonthDetailResponseData {
impl MonthDetailResponseData {
pub fn new(month: crate::models::MonthDetail) -> MonthDetailResponseData {
MonthDetailResponseData {
- month: month,
+ month,
}
}
}
diff --git a/src/models/month_summaries_response.rs b/src/models/month_summaries_response.rs
index 7158753..3f376f9 100644
--- a/src/models/month_summaries_response.rs
+++ b/src/models/month_summaries_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthSummariesResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct MonthSummariesResponse {
impl MonthSummariesResponse {
pub fn new(data: crate::models::MonthSummariesResponseData) -> MonthSummariesResponse {
MonthSummariesResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/month_summaries_response_data.rs b/src/models/month_summaries_response_data.rs
index 03ed9d5..4d32a69 100644
--- a/src/models/month_summaries_response_data.rs
+++ b/src/models/month_summaries_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthSummariesResponseData {
#[serde(rename = "months")]
@@ -22,8 +23,8 @@ pub struct MonthSummariesResponseData {
impl MonthSummariesResponseData {
pub fn new(months: Vec<crate::models::MonthSummary>, server_knowledge: i64) -> MonthSummariesResponseData {
MonthSummariesResponseData {
- months: months,
- server_knowledge: server_knowledge,
+ months,
+ server_knowledge,
}
}
}
diff --git a/src/models/month_summary.rs b/src/models/month_summary.rs
index f1efaee..b0d67e9 100644
--- a/src/models/month_summary.rs
+++ b/src/models/month_summary.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthSummary {
#[serde(rename = "month")]
@@ -39,14 +40,14 @@ pub struct MonthSummary {
impl MonthSummary {
pub fn new(month: String, income: i64, budgeted: i64, activity: i64, to_be_budgeted: i64, deleted: bool) -> MonthSummary {
MonthSummary {
- month: month,
+ month,
note: None,
- income: income,
- budgeted: budgeted,
- activity: activity,
- to_be_budgeted: to_be_budgeted,
+ income,
+ budgeted,
+ activity,
+ to_be_budgeted,
age_of_money: None,
- deleted: deleted,
+ deleted,
}
}
}
diff --git a/src/models/payee.rs b/src/models/payee.rs
index 0f17785..5822d85 100644
--- a/src/models/payee.rs
+++ b/src/models/payee.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Payee {
#[serde(rename = "id")]
@@ -27,10 +28,10 @@ pub struct Payee {
impl Payee {
pub fn new(id: String, name: String, deleted: bool) -> Payee {
Payee {
- id: id,
- name: name,
+ id,
+ name,
transfer_account_id: None,
- deleted: deleted,
+ deleted,
}
}
}
diff --git a/src/models/payee_location.rs b/src/models/payee_location.rs
index e40eea2..eca0584 100644
--- a/src/models/payee_location.rs
+++ b/src/models/payee_location.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeLocation {
#[serde(rename = "id")]
@@ -28,11 +29,11 @@ pub struct PayeeLocation {
impl PayeeLocation {
pub fn new(id: String, payee_id: String, latitude: String, longitude: String, deleted: bool) -> PayeeLocation {
PayeeLocation {
- id: id,
- payee_id: payee_id,
- latitude: latitude,
- longitude: longitude,
- deleted: deleted,
+ id,
+ payee_id,
+ latitude,
+ longitude,
+ deleted,
}
}
}
diff --git a/src/models/payee_location_response.rs b/src/models/payee_location_response.rs
index 66e2698..162d6d5 100644
--- a/src/models/payee_location_response.rs
+++ b/src/models/payee_location_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeLocationResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct PayeeLocationResponse {
impl PayeeLocationResponse {
pub fn new(data: crate::models::PayeeLocationResponseData) -> PayeeLocationResponse {
PayeeLocationResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/payee_location_response_data.rs b/src/models/payee_location_response_data.rs
index 0da3992..99101d4 100644
--- a/src/models/payee_location_response_data.rs
+++ b/src/models/payee_location_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeLocationResponseData {
#[serde(rename = "payee_location")]
@@ -19,7 +20,7 @@ pub struct PayeeLocationResponseData {
impl PayeeLocationResponseData {
pub fn new(payee_location: crate::models::PayeeLocation) -> PayeeLocationResponseData {
PayeeLocationResponseData {
- payee_location: payee_location,
+ payee_location,
}
}
}
diff --git a/src/models/payee_locations_response.rs b/src/models/payee_locations_response.rs
index ab05f6e..147904a 100644
--- a/src/models/payee_locations_response.rs
+++ b/src/models/payee_locations_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeLocationsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct PayeeLocationsResponse {
impl PayeeLocationsResponse {
pub fn new(data: crate::models::PayeeLocationsResponseData) -> PayeeLocationsResponse {
PayeeLocationsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/payee_locations_response_data.rs b/src/models/payee_locations_response_data.rs
index 32e061d..4557fac 100644
--- a/src/models/payee_locations_response_data.rs
+++ b/src/models/payee_locations_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeLocationsResponseData {
#[serde(rename = "payee_locations")]
@@ -19,7 +20,7 @@ pub struct PayeeLocationsResponseData {
impl PayeeLocationsResponseData {
pub fn new(payee_locations: Vec<crate::models::PayeeLocation>) -> PayeeLocationsResponseData {
PayeeLocationsResponseData {
- payee_locations: payee_locations,
+ payee_locations,
}
}
}
diff --git a/src/models/payee_response.rs b/src/models/payee_response.rs
index 650c90d..911fd18 100644
--- a/src/models/payee_response.rs
+++ b/src/models/payee_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct PayeeResponse {
impl PayeeResponse {
pub fn new(data: crate::models::PayeeResponseData) -> PayeeResponse {
PayeeResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/payee_response_data.rs b/src/models/payee_response_data.rs
index ff8e342..5c09b85 100644
--- a/src/models/payee_response_data.rs
+++ b/src/models/payee_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeeResponseData {
#[serde(rename = "payee")]
@@ -19,7 +20,7 @@ pub struct PayeeResponseData {
impl PayeeResponseData {
pub fn new(payee: crate::models::Payee) -> PayeeResponseData {
PayeeResponseData {
- payee: payee,
+ payee,
}
}
}
diff --git a/src/models/payees_response.rs b/src/models/payees_response.rs
index bd6d6e1..bbe713d 100644
--- a/src/models/payees_response.rs
+++ b/src/models/payees_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeesResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct PayeesResponse {
impl PayeesResponse {
pub fn new(data: crate::models::PayeesResponseData) -> PayeesResponse {
PayeesResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/payees_response_data.rs b/src/models/payees_response_data.rs
index efa3313..7ce35d9 100644
--- a/src/models/payees_response_data.rs
+++ b/src/models/payees_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct PayeesResponseData {
#[serde(rename = "payees")]
@@ -22,8 +23,8 @@ pub struct PayeesResponseData {
impl PayeesResponseData {
pub fn new(payees: Vec<crate::models::Payee>, server_knowledge: i64) -> PayeesResponseData {
PayeesResponseData {
- payees: payees,
- server_knowledge: server_knowledge,
+ payees,
+ server_knowledge,
}
}
}
diff --git a/src/models/save_category_response.rs b/src/models/save_category_response.rs
index 3d33509..153501c 100644
--- a/src/models/save_category_response.rs
+++ b/src/models/save_category_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveCategoryResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct SaveCategoryResponse {
impl SaveCategoryResponse {
pub fn new(data: crate::models::SaveCategoryResponseData) -> SaveCategoryResponse {
SaveCategoryResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/save_category_response_data.rs b/src/models/save_category_response_data.rs
index 536ba30..8f84251 100644
--- a/src/models/save_category_response_data.rs
+++ b/src/models/save_category_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveCategoryResponseData {
#[serde(rename = "category")]
@@ -22,8 +23,8 @@ pub struct SaveCategoryResponseData {
impl SaveCategoryResponseData {
pub fn new(category: crate::models::Category, server_knowledge: i64) -> SaveCategoryResponseData {
SaveCategoryResponseData {
- category: category,
- server_knowledge: server_knowledge,
+ category,
+ server_knowledge,
}
}
}
diff --git a/src/models/save_month_category.rs b/src/models/save_month_category.rs
index e2862eb..786f8ce 100644
--- a/src/models/save_month_category.rs
+++ b/src/models/save_month_category.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveMonthCategory {
/// Budgeted amount in milliunits format
@@ -20,7 +21,7 @@ pub struct SaveMonthCategory {
impl SaveMonthCategory {
pub fn new(budgeted: i64) -> SaveMonthCategory {
SaveMonthCategory {
- budgeted: budgeted,
+ budgeted,
}
}
}
diff --git a/src/models/save_month_category_wrapper.rs b/src/models/save_month_category_wrapper.rs
index ddd7154..9382cbf 100644
--- a/src/models/save_month_category_wrapper.rs
+++ b/src/models/save_month_category_wrapper.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveMonthCategoryWrapper {
#[serde(rename = "category")]
@@ -19,7 +20,7 @@ pub struct SaveMonthCategoryWrapper {
impl SaveMonthCategoryWrapper {
pub fn new(category: crate::models::SaveMonthCategory) -> SaveMonthCategoryWrapper {
SaveMonthCategoryWrapper {
- category: category,
+ category,
}
}
}
diff --git a/src/models/save_transaction.rs b/src/models/save_transaction.rs
index a864007..1031aca 100644
--- a/src/models/save_transaction.rs
+++ b/src/models/save_transaction.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveTransaction {
#[serde(rename = "account_id")]
@@ -33,13 +34,13 @@ pub struct SaveTransaction {
pub memo: Option<String>,
/// The cleared status of the transaction
#[serde(rename = "cleared", skip_serializing_if = "Option::is_none")]
- pub cleared: Option<String>,
+ pub cleared: Option<Cleared>,
/// Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.
#[serde(rename = "approved", skip_serializing_if = "Option::is_none")]
pub approved: Option<bool>,
/// The transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
/// If specified, the new transaction will be assigned this import_id and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
#[serde(rename = "import_id", skip_serializing_if = "Option::is_none")]
pub import_id: Option<String>,
@@ -48,9 +49,9 @@ pub struct SaveTransaction {
impl SaveTransaction {
pub fn new(account_id: String, date: String, amount: i64) -> SaveTransaction {
SaveTransaction {
- account_id: account_id,
- date: date,
- amount: amount,
+ account_id,
+ date,
+ amount,
payee_id: None,
payee_name: None,
category_id: None,
@@ -63,4 +64,30 @@ impl SaveTransaction {
}
}
+/// The cleared status of the transaction
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Cleared {
+ #[serde(rename = "cleared")]
+ Cleared,
+ #[serde(rename = "uncleared")]
+ Uncleared,
+ #[serde(rename = "reconciled")]
+ Reconciled,
+}
+/// The transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/save_transaction_wrapper.rs b/src/models/save_transaction_wrapper.rs
index 8152229..04b683a 100644
--- a/src/models/save_transaction_wrapper.rs
+++ b/src/models/save_transaction_wrapper.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveTransactionWrapper {
#[serde(rename = "transaction")]
@@ -19,7 +20,7 @@ pub struct SaveTransactionWrapper {
impl SaveTransactionWrapper {
pub fn new(transaction: crate::models::SaveTransaction) -> SaveTransactionWrapper {
SaveTransactionWrapper {
- transaction: transaction,
+ transaction,
}
}
}
diff --git a/src/models/save_transactions_response.rs b/src/models/save_transactions_response.rs
index 9617ee3..d8a201d 100644
--- a/src/models/save_transactions_response.rs
+++ b/src/models/save_transactions_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveTransactionsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct SaveTransactionsResponse {
impl SaveTransactionsResponse {
pub fn new(data: crate::models::SaveTransactionsResponseData) -> SaveTransactionsResponse {
SaveTransactionsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/save_transactions_response_data.rs b/src/models/save_transactions_response_data.rs
index 0b76b5e..737192b 100644
--- a/src/models/save_transactions_response_data.rs
+++ b/src/models/save_transactions_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveTransactionsResponseData {
/// The transaction ids that were saved
@@ -31,11 +32,11 @@ pub struct SaveTransactionsResponseData {
impl SaveTransactionsResponseData {
pub fn new(transaction_ids: Vec<String>, server_knowledge: i64) -> SaveTransactionsResponseData {
SaveTransactionsResponseData {
- transaction_ids: transaction_ids,
+ transaction_ids,
transaction: None,
transactions: None,
duplicate_import_ids: None,
- server_knowledge: server_knowledge,
+ server_knowledge,
}
}
}
diff --git a/src/models/save_transactions_wrapper.rs b/src/models/save_transactions_wrapper.rs
index cb6613f..f3ae055 100644
--- a/src/models/save_transactions_wrapper.rs
+++ b/src/models/save_transactions_wrapper.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SaveTransactionsWrapper {
#[serde(rename = "transaction", skip_serializing_if = "Option::is_none")]
diff --git a/src/models/scheduled_sub_transaction.rs b/src/models/scheduled_sub_transaction.rs
index 31a880f..d8da7d6 100644
--- a/src/models/scheduled_sub_transaction.rs
+++ b/src/models/scheduled_sub_transaction.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledSubTransaction {
#[serde(rename = "id")]
@@ -36,14 +37,14 @@ pub struct ScheduledSubTransaction {
impl ScheduledSubTransaction {
pub fn new(id: String, scheduled_transaction_id: String, amount: i64, deleted: bool) -> ScheduledSubTransaction {
ScheduledSubTransaction {
- id: id,
- scheduled_transaction_id: scheduled_transaction_id,
- amount: amount,
+ id,
+ scheduled_transaction_id,
+ amount,
memo: None,
payee_id: None,
category_id: None,
transfer_account_id: None,
- deleted: deleted,
+ deleted,
}
}
}
diff --git a/src/models/scheduled_transaction_detail.rs b/src/models/scheduled_transaction_detail.rs
index d553329..5cc2e65 100644
--- a/src/models/scheduled_transaction_detail.rs
+++ b/src/models/scheduled_transaction_detail.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionDetail {
#[serde(rename = "id")]
@@ -21,7 +22,7 @@ pub struct ScheduledTransactionDetail {
#[serde(rename = "date_next")]
pub date_next: String,
#[serde(rename = "frequency")]
- pub frequency: String,
+ pub frequency: Frequency,
/// The scheduled transaction amount in milliunits format
#[serde(rename = "amount")]
pub amount: i64,
@@ -29,7 +30,7 @@ pub struct ScheduledTransactionDetail {
pub memo: Option<String>,
/// The scheduled transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
@@ -54,26 +55,72 @@ pub struct ScheduledTransactionDetail {
}
impl ScheduledTransactionDetail {
- pub fn new(id: String, date_first: String, date_next: String, frequency: String, amount: i64, account_id: String, deleted: bool, account_name: String, subtransactions: Vec<crate::models::ScheduledSubTransaction>) -> ScheduledTransactionDetail {
+ pub fn new(id: String, date_first: String, date_next: String, frequency: Frequency, amount: i64, account_id: String, deleted: bool, account_name: String, subtransactions: Vec<crate::models::ScheduledSubTransaction>) -> ScheduledTransactionDetail {
ScheduledTransactionDetail {
- id: id,
- date_first: date_first,
- date_next: date_next,
- frequency: frequency,
- amount: amount,
+ id,
+ date_first,
+ date_next,
+ frequency,
+ amount,
memo: None,
flag_color: None,
- account_id: account_id,
+ account_id,
payee_id: None,
category_id: None,
transfer_account_id: None,
- deleted: deleted,
- account_name: account_name,
+ deleted,
+ account_name,
payee_name: None,
category_name: None,
- subtransactions: subtransactions,
+ subtransactions,
}
}
}
+///
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Frequency {
+ #[serde(rename = "never")]
+ Never,
+ #[serde(rename = "daily")]
+ Daily,
+ #[serde(rename = "weekly")]
+ Weekly,
+ #[serde(rename = "everyOtherWeek")]
+ EveryOtherWeek,
+ #[serde(rename = "twiceAMonth")]
+ TwiceAMonth,
+ #[serde(rename = "every4Weeks")]
+ Every4Weeks,
+ #[serde(rename = "monthly")]
+ Monthly,
+ #[serde(rename = "everyOtherMonth")]
+ EveryOtherMonth,
+ #[serde(rename = "every3Months")]
+ Every3Months,
+ #[serde(rename = "every4Months")]
+ Every4Months,
+ #[serde(rename = "twiceAYear")]
+ TwiceAYear,
+ #[serde(rename = "yearly")]
+ Yearly,
+ #[serde(rename = "everyOtherYear")]
+ EveryOtherYear,
+}
+/// The scheduled transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/scheduled_transaction_detail_all_of.rs b/src/models/scheduled_transaction_detail_all_of.rs
index b977afd..21cfca0 100644
--- a/src/models/scheduled_transaction_detail_all_of.rs
+++ b/src/models/scheduled_transaction_detail_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionDetailAllOf {
#[serde(rename = "account_name")]
@@ -26,10 +27,10 @@ pub struct ScheduledTransactionDetailAllOf {
impl ScheduledTransactionDetailAllOf {
pub fn new(account_name: String, subtransactions: Vec<crate::models::ScheduledSubTransaction>) -> ScheduledTransactionDetailAllOf {
ScheduledTransactionDetailAllOf {
- account_name: account_name,
+ account_name,
payee_name: None,
category_name: None,
- subtransactions: subtransactions,
+ subtransactions,
}
}
}
diff --git a/src/models/scheduled_transaction_response.rs b/src/models/scheduled_transaction_response.rs
index 232e09f..09720ac 100644
--- a/src/models/scheduled_transaction_response.rs
+++ b/src/models/scheduled_transaction_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct ScheduledTransactionResponse {
impl ScheduledTransactionResponse {
pub fn new(data: crate::models::ScheduledTransactionResponseData) -> ScheduledTransactionResponse {
ScheduledTransactionResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/scheduled_transaction_response_data.rs b/src/models/scheduled_transaction_response_data.rs
index 1cd7379..418dffb 100644
--- a/src/models/scheduled_transaction_response_data.rs
+++ b/src/models/scheduled_transaction_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionResponseData {
#[serde(rename = "scheduled_transaction")]
@@ -19,7 +20,7 @@ pub struct ScheduledTransactionResponseData {
impl ScheduledTransactionResponseData {
pub fn new(scheduled_transaction: crate::models::ScheduledTransactionDetail) -> ScheduledTransactionResponseData {
ScheduledTransactionResponseData {
- scheduled_transaction: scheduled_transaction,
+ scheduled_transaction,
}
}
}
diff --git a/src/models/scheduled_transaction_summary.rs b/src/models/scheduled_transaction_summary.rs
index b70d53c..d380efb 100644
--- a/src/models/scheduled_transaction_summary.rs
+++ b/src/models/scheduled_transaction_summary.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionSummary {
#[serde(rename = "id")]
@@ -21,7 +22,7 @@ pub struct ScheduledTransactionSummary {
#[serde(rename = "date_next")]
pub date_next: String,
#[serde(rename = "frequency")]
- pub frequency: String,
+ pub frequency: Frequency,
/// The scheduled transaction amount in milliunits format
#[serde(rename = "amount")]
pub amount: i64,
@@ -29,7 +30,7 @@ pub struct ScheduledTransactionSummary {
pub memo: Option<String>,
/// The scheduled transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
@@ -45,22 +46,68 @@ pub struct ScheduledTransactionSummary {
}
impl ScheduledTransactionSummary {
- pub fn new(id: String, date_first: String, date_next: String, frequency: String, amount: i64, account_id: String, deleted: bool) -> ScheduledTransactionSummary {
+ pub fn new(id: String, date_first: String, date_next: String, frequency: Frequency, amount: i64, account_id: String, deleted: bool) -> ScheduledTransactionSummary {
ScheduledTransactionSummary {
- id: id,
- date_first: date_first,
- date_next: date_next,
- frequency: frequency,
- amount: amount,
+ id,
+ date_first,
+ date_next,
+ frequency,
+ amount,
memo: None,
flag_color: None,
- account_id: account_id,
+ account_id,
payee_id: None,
category_id: None,
transfer_account_id: None,
- deleted: deleted,
+ deleted,
}
}
}
+///
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Frequency {
+ #[serde(rename = "never")]
+ Never,
+ #[serde(rename = "daily")]
+ Daily,
+ #[serde(rename = "weekly")]
+ Weekly,
+ #[serde(rename = "everyOtherWeek")]
+ EveryOtherWeek,
+ #[serde(rename = "twiceAMonth")]
+ TwiceAMonth,
+ #[serde(rename = "every4Weeks")]
+ Every4Weeks,
+ #[serde(rename = "monthly")]
+ Monthly,
+ #[serde(rename = "everyOtherMonth")]
+ EveryOtherMonth,
+ #[serde(rename = "every3Months")]
+ Every3Months,
+ #[serde(rename = "every4Months")]
+ Every4Months,
+ #[serde(rename = "twiceAYear")]
+ TwiceAYear,
+ #[serde(rename = "yearly")]
+ Yearly,
+ #[serde(rename = "everyOtherYear")]
+ EveryOtherYear,
+}
+/// The scheduled transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/scheduled_transactions_response.rs b/src/models/scheduled_transactions_response.rs
index 77d4376..f9731f0 100644
--- a/src/models/scheduled_transactions_response.rs
+++ b/src/models/scheduled_transactions_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct ScheduledTransactionsResponse {
impl ScheduledTransactionsResponse {
pub fn new(data: crate::models::ScheduledTransactionsResponseData) -> ScheduledTransactionsResponse {
ScheduledTransactionsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/scheduled_transactions_response_data.rs b/src/models/scheduled_transactions_response_data.rs
index a9072d4..eeac95c 100644
--- a/src/models/scheduled_transactions_response_data.rs
+++ b/src/models/scheduled_transactions_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ScheduledTransactionsResponseData {
#[serde(rename = "scheduled_transactions")]
@@ -22,8 +23,8 @@ pub struct ScheduledTransactionsResponseData {
impl ScheduledTransactionsResponseData {
pub fn new(scheduled_transactions: Vec<crate::models::ScheduledTransactionDetail>, server_knowledge: i64) -> ScheduledTransactionsResponseData {
ScheduledTransactionsResponseData {
- scheduled_transactions: scheduled_transactions,
- server_knowledge: server_knowledge,
+ scheduled_transactions,
+ server_knowledge,
}
}
}
diff --git a/src/models/sub_transaction.rs b/src/models/sub_transaction.rs
index 639d5e7..d1d7f48 100644
--- a/src/models/sub_transaction.rs
+++ b/src/models/sub_transaction.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SubTransaction {
#[serde(rename = "id")]
@@ -36,14 +37,14 @@ pub struct SubTransaction {
impl SubTransaction {
pub fn new(id: String, transaction_id: String, amount: i64, deleted: bool) -> SubTransaction {
SubTransaction {
- id: id,
- transaction_id: transaction_id,
- amount: amount,
+ id,
+ transaction_id,
+ amount,
memo: None,
payee_id: None,
category_id: None,
transfer_account_id: None,
- deleted: deleted,
+ deleted,
}
}
}
diff --git a/src/models/transaction_detail.rs b/src/models/transaction_detail.rs
index ca6be2e..b363b3b 100644
--- a/src/models/transaction_detail.rs
+++ b/src/models/transaction_detail.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionDetail {
#[serde(rename = "id")]
@@ -24,13 +25,13 @@ pub struct TransactionDetail {
pub memo: Option<String>,
/// The cleared status of the transaction
#[serde(rename = "cleared")]
- pub cleared: String,
+ pub cleared: Cleared,
/// Whether or not the transaction is approved
#[serde(rename = "approved")]
pub approved: bool,
/// The transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
@@ -64,29 +65,55 @@ pub struct TransactionDetail {
}
impl TransactionDetail {
- pub fn new(id: String, date: String, amount: i64, cleared: String, approved: bool, account_id: String, deleted: bool, account_name: String, subtransactions: Vec<crate::models::SubTransaction>) -> TransactionDetail {
+ pub fn new(id: String, date: String, amount: i64, cleared: Cleared, approved: bool, account_id: String, deleted: bool, account_name: String, subtransactions: Vec<crate::models::SubTransaction>) -> TransactionDetail {
TransactionDetail {
- id: id,
- date: date,
- amount: amount,
+ id,
+ date,
+ amount,
memo: None,
- cleared: cleared,
- approved: approved,
+ cleared,
+ approved,
flag_color: None,
- account_id: account_id,
+ account_id,
payee_id: None,
category_id: None,
transfer_account_id: None,
transfer_transaction_id: None,
matched_transaction_id: None,
import_id: None,
- deleted: deleted,
- account_name: account_name,
+ deleted,
+ account_name,
payee_name: None,
category_name: None,
- subtransactions: subtransactions,
+ subtransactions,
}
}
}
+/// The cleared status of the transaction
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Cleared {
+ #[serde(rename = "cleared")]
+ Cleared,
+ #[serde(rename = "uncleared")]
+ Uncleared,
+ #[serde(rename = "reconciled")]
+ Reconciled,
+}
+/// The transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/transaction_detail_all_of.rs b/src/models/transaction_detail_all_of.rs
index 68f2ebf..3c0df98 100644
--- a/src/models/transaction_detail_all_of.rs
+++ b/src/models/transaction_detail_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionDetailAllOf {
#[serde(rename = "account_name")]
@@ -26,10 +27,10 @@ pub struct TransactionDetailAllOf {
impl TransactionDetailAllOf {
pub fn new(account_name: String, subtransactions: Vec<crate::models::SubTransaction>) -> TransactionDetailAllOf {
TransactionDetailAllOf {
- account_name: account_name,
+ account_name,
payee_name: None,
category_name: None,
- subtransactions: subtransactions,
+ subtransactions,
}
}
}
diff --git a/src/models/transaction_response.rs b/src/models/transaction_response.rs
index 63ff8f1..13e87df 100644
--- a/src/models/transaction_response.rs
+++ b/src/models/transaction_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct TransactionResponse {
impl TransactionResponse {
pub fn new(data: crate::models::TransactionResponseData) -> TransactionResponse {
TransactionResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/transaction_response_data.rs b/src/models/transaction_response_data.rs
index e9af627..a026aad 100644
--- a/src/models/transaction_response_data.rs
+++ b/src/models/transaction_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionResponseData {
#[serde(rename = "transaction")]
@@ -19,7 +20,7 @@ pub struct TransactionResponseData {
impl TransactionResponseData {
pub fn new(transaction: crate::models::TransactionDetail) -> TransactionResponseData {
TransactionResponseData {
- transaction: transaction,
+ transaction,
}
}
}
diff --git a/src/models/transaction_summary.rs b/src/models/transaction_summary.rs
index 9bf4cbd..715b233 100644
--- a/src/models/transaction_summary.rs
+++ b/src/models/transaction_summary.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionSummary {
#[serde(rename = "id")]
@@ -24,13 +25,13 @@ pub struct TransactionSummary {
pub memo: Option<String>,
/// The cleared status of the transaction
#[serde(rename = "cleared")]
- pub cleared: String,
+ pub cleared: Cleared,
/// Whether or not the transaction is approved
#[serde(rename = "approved")]
pub approved: bool,
/// The transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
@@ -55,25 +56,51 @@ pub struct TransactionSummary {
}
impl TransactionSummary {
- pub fn new(id: String, date: String, amount: i64, cleared: String, approved: bool, account_id: String, deleted: bool) -> TransactionSummary {
+ pub fn new(id: String, date: String, amount: i64, cleared: Cleared, approved: bool, account_id: String, deleted: bool) -> TransactionSummary {
TransactionSummary {
- id: id,
- date: date,
- amount: amount,
+ id,
+ date,
+ amount,
memo: None,
- cleared: cleared,
- approved: approved,
+ cleared,
+ approved,
flag_color: None,
- account_id: account_id,
+ account_id,
payee_id: None,
category_id: None,
transfer_account_id: None,
transfer_transaction_id: None,
matched_transaction_id: None,
import_id: None,
- deleted: deleted,
+ deleted,
}
}
}
+/// The cleared status of the transaction
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Cleared {
+ #[serde(rename = "cleared")]
+ Cleared,
+ #[serde(rename = "uncleared")]
+ Uncleared,
+ #[serde(rename = "reconciled")]
+ Reconciled,
+}
+/// The transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/transactions_response.rs b/src/models/transactions_response.rs
index d3da899..33abb8e 100644
--- a/src/models/transactions_response.rs
+++ b/src/models/transactions_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionsResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct TransactionsResponse {
impl TransactionsResponse {
pub fn new(data: crate::models::TransactionsResponseData) -> TransactionsResponse {
TransactionsResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/transactions_response_data.rs b/src/models/transactions_response_data.rs
index 7c10090..da50e85 100644
--- a/src/models/transactions_response_data.rs
+++ b/src/models/transactions_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionsResponseData {
#[serde(rename = "transactions")]
@@ -22,8 +23,8 @@ pub struct TransactionsResponseData {
impl TransactionsResponseData {
pub fn new(transactions: Vec<crate::models::TransactionDetail>, server_knowledge: i64) -> TransactionsResponseData {
TransactionsResponseData {
- transactions: transactions,
- server_knowledge: server_knowledge,
+ transactions,
+ server_knowledge,
}
}
}
diff --git a/src/models/update_transaction.rs b/src/models/update_transaction.rs
index d14c8d4..00b8f9b 100644
--- a/src/models/update_transaction.rs
+++ b/src/models/update_transaction.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateTransaction {
#[serde(rename = "id")]
@@ -35,13 +36,13 @@ pub struct UpdateTransaction {
pub memo: Option<String>,
/// The cleared status of the transaction
#[serde(rename = "cleared", skip_serializing_if = "Option::is_none")]
- pub cleared: Option<String>,
+ pub cleared: Option<Cleared>,
/// Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.
#[serde(rename = "approved", skip_serializing_if = "Option::is_none")]
pub approved: Option<bool>,
/// The transaction flag
#[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
- pub flag_color: Option<String>,
+ pub flag_color: Option<FlagColor>,
/// If specified, the new transaction will be assigned this import_id and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
#[serde(rename = "import_id", skip_serializing_if = "Option::is_none")]
pub import_id: Option<String>,
@@ -50,10 +51,10 @@ pub struct UpdateTransaction {
impl UpdateTransaction {
pub fn new(id: String, account_id: String, date: String, amount: i64) -> UpdateTransaction {
UpdateTransaction {
- id: id,
- account_id: account_id,
- date: date,
- amount: amount,
+ id,
+ account_id,
+ date,
+ amount,
payee_id: None,
payee_name: None,
category_id: None,
@@ -66,4 +67,30 @@ impl UpdateTransaction {
}
}
+/// The cleared status of the transaction
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum Cleared {
+ #[serde(rename = "cleared")]
+ Cleared,
+ #[serde(rename = "uncleared")]
+ Uncleared,
+ #[serde(rename = "reconciled")]
+ Reconciled,
+}
+/// The transaction flag
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
+pub enum FlagColor {
+ #[serde(rename = "red")]
+ Red,
+ #[serde(rename = "orange")]
+ Orange,
+ #[serde(rename = "yellow")]
+ Yellow,
+ #[serde(rename = "green")]
+ Green,
+ #[serde(rename = "blue")]
+ Blue,
+ #[serde(rename = "purple")]
+ Purple,
+}
diff --git a/src/models/update_transaction_all_of.rs b/src/models/update_transaction_all_of.rs
index 774cc3f..2e3e0a7 100644
--- a/src/models/update_transaction_all_of.rs
+++ b/src/models/update_transaction_all_of.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateTransactionAllOf {
#[serde(rename = "id")]
@@ -19,7 +20,7 @@ pub struct UpdateTransactionAllOf {
impl UpdateTransactionAllOf {
pub fn new(id: String) -> UpdateTransactionAllOf {
UpdateTransactionAllOf {
- id: id,
+ id,
}
}
}
diff --git a/src/models/update_transactions_wrapper.rs b/src/models/update_transactions_wrapper.rs
index fde9957..6c04f35 100644
--- a/src/models/update_transactions_wrapper.rs
+++ b/src/models/update_transactions_wrapper.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateTransactionsWrapper {
#[serde(rename = "transactions")]
@@ -19,7 +20,7 @@ pub struct UpdateTransactionsWrapper {
impl UpdateTransactionsWrapper {
pub fn new(transactions: Vec<crate::models::UpdateTransaction>) -> UpdateTransactionsWrapper {
UpdateTransactionsWrapper {
- transactions: transactions,
+ transactions,
}
}
}
diff --git a/src/models/user.rs b/src/models/user.rs
index 6ff89bb..fc16aa0 100644
--- a/src/models/user.rs
+++ b/src/models/user.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct User {
#[serde(rename = "id")]
@@ -19,7 +20,7 @@ pub struct User {
impl User {
pub fn new(id: String) -> User {
User {
- id: id,
+ id,
}
}
}
diff --git a/src/models/user_response.rs b/src/models/user_response.rs
index cfa6be1..29d3986 100644
--- a/src/models/user_response.rs
+++ b/src/models/user_response.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct UserResponse {
#[serde(rename = "data")]
@@ -19,7 +20,7 @@ pub struct UserResponse {
impl UserResponse {
pub fn new(data: crate::models::UserResponseData) -> UserResponse {
UserResponse {
- data: data,
+ data,
}
}
}
diff --git a/src/models/user_response_data.rs b/src/models/user_response_data.rs
index 90c300f..c784409 100644
--- a/src/models/user_response_data.rs
+++ b/src/models/user_response_data.rs
@@ -10,6 +10,7 @@
+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct UserResponseData {
#[serde(rename = "user")]
@@ -19,7 +20,7 @@ pub struct UserResponseData {
impl UserResponseData {
pub fn new(user: crate::models::User) -> UserResponseData {
UserResponseData {
- user: user,
+ user,
}
}
}