ynab 3.2.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/Rakefile +6 -5
- data/config.yaml +11 -0
- data/docs/ExistingTransaction.md +1 -1
- data/docs/NewTransaction.md +1 -1
- data/docs/PostScheduledTransactionWrapper.md +8 -0
- data/docs/SaveScheduledTransaction.md +16 -0
- data/docs/SaveTransactionWithIdOrImportId.md +1 -1
- data/docs/SaveTransactionWithOptionalFields.md +1 -1
- data/docs/{SaveTransactionWithIdAllOf.md → ScheduledTransactionFrequency.md} +1 -2
- data/docs/ScheduledTransactionsApi.md +21 -0
- data/docs/TransactionsApi.md +25 -1
- data/lib/ynab/api/accounts_api.rb +1 -4
- data/lib/ynab/api/budgets_api.rb +1 -4
- data/lib/ynab/api/categories_api.rb +1 -4
- data/lib/ynab/api/months_api.rb +1 -4
- data/lib/ynab/api/payee_locations_api.rb +1 -4
- data/lib/ynab/api/payees_api.rb +1 -4
- data/lib/ynab/api/scheduled_transactions_api.rb +75 -4
- data/lib/ynab/api/transactions_api.rb +81 -6
- data/lib/ynab/api/user_api.rb +1 -4
- data/lib/ynab/api_client.rb +1 -4
- data/lib/ynab/api_error.rb +0 -12
- data/lib/ynab/configuration.rb +11 -4
- data/lib/ynab/models/account.rb +1 -4
- data/lib/ynab/models/account_response.rb +1 -4
- data/lib/ynab/models/account_response_data.rb +1 -4
- data/lib/ynab/models/account_type.rb +1 -4
- data/lib/ynab/models/accounts_response.rb +1 -4
- data/lib/ynab/models/accounts_response_data.rb +1 -4
- data/lib/ynab/models/budget_detail.rb +1 -4
- data/lib/ynab/models/budget_detail_response.rb +1 -4
- data/lib/ynab/models/budget_detail_response_data.rb +1 -4
- data/lib/ynab/models/budget_settings.rb +1 -4
- data/lib/ynab/models/budget_settings_response.rb +1 -4
- data/lib/ynab/models/budget_settings_response_data.rb +1 -4
- data/lib/ynab/models/budget_summary.rb +1 -4
- data/lib/ynab/models/budget_summary_response.rb +1 -4
- data/lib/ynab/models/budget_summary_response_data.rb +1 -4
- data/lib/ynab/models/bulk_response.rb +1 -4
- data/lib/ynab/models/bulk_response_data.rb +1 -4
- data/lib/ynab/models/bulk_response_data_bulk.rb +1 -4
- data/lib/ynab/models/bulk_transactions.rb +1 -4
- data/lib/ynab/models/categories_response.rb +1 -4
- data/lib/ynab/models/categories_response_data.rb +1 -4
- data/lib/ynab/models/category.rb +1 -4
- data/lib/ynab/models/category_group.rb +1 -4
- data/lib/ynab/models/category_group_with_categories.rb +1 -4
- data/lib/ynab/models/category_response.rb +1 -4
- data/lib/ynab/models/category_response_data.rb +1 -4
- data/lib/ynab/models/currency_format.rb +1 -4
- data/lib/ynab/models/date_format.rb +1 -4
- data/lib/ynab/models/error_detail.rb +1 -4
- data/lib/ynab/models/error_response.rb +1 -4
- data/lib/ynab/models/existing_transaction.rb +2 -5
- data/lib/ynab/models/hybrid_transaction.rb +1 -4
- data/lib/ynab/models/hybrid_transactions_response.rb +1 -4
- data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -4
- data/lib/ynab/models/month_detail.rb +1 -4
- data/lib/ynab/models/month_detail_response.rb +1 -4
- data/lib/ynab/models/month_detail_response_data.rb +1 -4
- data/lib/ynab/models/month_summaries_response.rb +1 -4
- data/lib/ynab/models/month_summaries_response_data.rb +1 -4
- data/lib/ynab/models/month_summary.rb +1 -4
- data/lib/ynab/models/new_transaction.rb +2 -5
- data/lib/ynab/models/patch_category_wrapper.rb +1 -4
- data/lib/ynab/models/patch_month_category_wrapper.rb +1 -4
- data/lib/ynab/models/patch_payee_wrapper.rb +1 -4
- data/lib/ynab/models/patch_transactions_wrapper.rb +1 -4
- data/lib/ynab/models/payee.rb +1 -4
- data/lib/ynab/models/payee_location.rb +1 -4
- data/lib/ynab/models/payee_location_response.rb +1 -4
- data/lib/ynab/models/payee_location_response_data.rb +1 -4
- data/lib/ynab/models/payee_locations_response.rb +1 -4
- data/lib/ynab/models/payee_locations_response_data.rb +1 -4
- data/lib/ynab/models/payee_response.rb +1 -4
- data/lib/ynab/models/payee_response_data.rb +1 -4
- data/lib/ynab/models/payees_response.rb +1 -4
- data/lib/ynab/models/payees_response_data.rb +1 -4
- data/lib/ynab/models/post_account_wrapper.rb +1 -4
- data/lib/ynab/models/{save_transaction_with_id_all_of.rb → post_scheduled_transaction_wrapper.rb} +23 -32
- data/lib/ynab/models/post_transactions_wrapper.rb +1 -4
- data/lib/ynab/models/put_transaction_wrapper.rb +1 -4
- data/lib/ynab/models/save_account.rb +1 -4
- data/lib/ynab/models/save_category.rb +1 -4
- data/lib/ynab/models/save_category_response.rb +1 -4
- data/lib/ynab/models/save_category_response_data.rb +1 -4
- data/lib/ynab/models/save_month_category.rb +1 -4
- data/lib/ynab/models/save_payee.rb +1 -4
- data/lib/ynab/models/save_payee_response.rb +1 -4
- data/lib/ynab/models/save_payee_response_data.rb +1 -4
- data/lib/ynab/models/{hybrid_transaction_all_of.rb → save_scheduled_transaction.rb} +99 -62
- data/lib/ynab/models/save_sub_transaction.rb +1 -4
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +2 -5
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +2 -5
- data/lib/ynab/models/save_transactions_response.rb +1 -4
- data/lib/ynab/models/save_transactions_response_data.rb +1 -4
- data/lib/ynab/models/scheduled_sub_transaction.rb +1 -4
- data/lib/ynab/models/scheduled_transaction_detail.rb +1 -4
- data/lib/ynab/models/scheduled_transaction_frequency.rb +48 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +1 -4
- data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -4
- data/lib/ynab/models/scheduled_transaction_summary.rb +1 -4
- data/lib/ynab/models/scheduled_transactions_response.rb +1 -4
- data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -4
- data/lib/ynab/models/sub_transaction.rb +1 -4
- data/lib/ynab/models/transaction_cleared_status.rb +1 -4
- data/lib/ynab/models/transaction_detail.rb +1 -4
- data/lib/ynab/models/transaction_flag_color.rb +1 -4
- data/lib/ynab/models/transaction_response.rb +1 -4
- data/lib/ynab/models/transaction_response_data.rb +1 -4
- data/lib/ynab/models/transaction_summary.rb +1 -4
- data/lib/ynab/models/transactions_import_response.rb +1 -4
- data/lib/ynab/models/transactions_import_response_data.rb +1 -4
- data/lib/ynab/models/transactions_response.rb +1 -4
- data/lib/ynab/models/transactions_response_data.rb +1 -4
- data/lib/ynab/models/user.rb +1 -4
- data/lib/ynab/models/user_response.rb +1 -4
- data/lib/ynab/models/user_response_data.rb +1 -4
- data/lib/ynab/overrides/transactions_api.rb +0 -12
- data/lib/ynab/version.rb +1 -13
- data/lib/ynab.rb +4 -4
- data/open_api_spec.yaml +190 -4
- data/spec/api/scheduled_transactions_spec.rb +20 -2
- data/spec/api/transactions_spec.rb +10 -0
- data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +63 -0
- data/spec/fixtures/vcr_cassettes/month_transactions.yml +46 -0
- data/templates/README.md +3 -0
- data/templates/api_info.mustache +9 -0
- data/templates/gemspec.mustache +41 -0
- data/ynab.gemspec +3 -6
- metadata +50 -84
- data/docs/AccountWrapper.md +0 -8
- data/docs/AccountsWrapper.md +0 -9
- data/docs/BudgetDetailAllOf.md +0 -17
- data/docs/BudgetDetailWrapper.md +0 -9
- data/docs/BudgetSettingsWrapper.md +0 -8
- data/docs/BudgetSummaryWrapper.md +0 -9
- data/docs/BulkIdWrapper.md +0 -8
- data/docs/BulkIds.md +0 -9
- data/docs/BulkTransactionCreateResponse.md +0 -8
- data/docs/BulkTransactionIds.md +0 -8
- data/docs/CategoryGroupWithCategoriesAllOf.md +0 -8
- data/docs/CategoryGroupsWrapper.md +0 -9
- data/docs/CategoryWrapper.md +0 -9
- data/docs/DeprecatedApi.md +0 -28
- data/docs/HybridTransactionAllOf.md +0 -12
- data/docs/HybridTransactionsWrapper.md +0 -8
- data/docs/LoanAccountPeriodicValue.md +0 -7
- data/docs/MonthDetailAllOf.md +0 -8
- data/docs/MonthDetailWrapper.md +0 -8
- data/docs/MonthSummariesWrapper.md +0 -9
- data/docs/PayeeLocationWrapper.md +0 -8
- data/docs/PayeeLocationsWrapper.md +0 -8
- data/docs/PayeeWrapper.md +0 -8
- data/docs/PayeesWrapper.md +0 -9
- data/docs/SaveAccountWrapper.md +0 -8
- data/docs/SaveMonthCategoryWrapper.md +0 -8
- data/docs/SaveTransaction.md +0 -19
- data/docs/SaveTransactionWithId.md +0 -20
- data/docs/SaveTransactionWrapper.md +0 -8
- data/docs/SaveTransactionsWrapper.md +0 -9
- data/docs/ScheduledTransactionDetailAllOf.md +0 -11
- data/docs/ScheduledTransactionWrapper.md +0 -8
- data/docs/ScheduledTransactionsWrapper.md +0 -8
- data/docs/TransactionDetailAllOf.md +0 -11
- data/docs/TransactionWrapper.md +0 -8
- data/docs/TransactionsWrapper.md +0 -9
- data/docs/UpdateTransaction.md +0 -20
- data/docs/UpdateTransactionsWrapper.md +0 -8
- data/docs/UserWrapper.md +0 -8
- data/lib/ynab/models/budget_detail_all_of.rb +0 -320
- data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -223
- data/lib/ynab/models/month_detail_all_of.rb +0 -223
- data/lib/ynab/models/save_transaction.rb +0 -401
- data/lib/ynab/models/save_transaction_with_id.rb +0 -411
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -254
- data/lib/ynab/models/transaction_detail_all_of.rb +0 -254
data/docs/SaveTransaction.md
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# YNAB::SaveTransaction
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **account_id** | **String** | | [optional] |
|
8
|
-
| **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] |
|
9
|
-
| **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] |
|
10
|
-
| **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `tranfer_payee_id` on the account resource. | [optional] |
|
11
|
-
| **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] |
|
12
|
-
| **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] |
|
13
|
-
| **memo** | **String** | | [optional] |
|
14
|
-
| **cleared** | **String** | The cleared status of the transaction | [optional] |
|
15
|
-
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
16
|
-
| **flag_color** | **String** | The transaction flag | [optional] |
|
17
|
-
| **import_id** | **String** | 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). | [optional] |
|
18
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
19
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# YNAB::SaveTransactionWithId
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **id** | **String** | | [optional] |
|
8
|
-
| **account_id** | **String** | | [optional] |
|
9
|
-
| **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] |
|
10
|
-
| **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] |
|
11
|
-
| **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `tranfer_payee_id` on the account resource. | [optional] |
|
12
|
-
| **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] |
|
13
|
-
| **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] |
|
14
|
-
| **memo** | **String** | | [optional] |
|
15
|
-
| **cleared** | **String** | The cleared status of the transaction | [optional] |
|
16
|
-
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
17
|
-
| **flag_color** | **String** | The transaction flag | [optional] |
|
18
|
-
| **import_id** | **String** | 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). | [optional] |
|
19
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
20
|
-
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# YNAB::SaveTransactionsWrapper
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**transaction** | [**SaveTransaction**](SaveTransaction.md) | | [optional]
|
7
|
-
**transactions** | [**Array<SaveTransaction>**](SaveTransaction.md) | | [optional]
|
8
|
-
|
9
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# YNAB::ScheduledTransactionDetailAllOf
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **account_name** | **String** | | |
|
8
|
-
| **payee_name** | **String** | | [optional] |
|
9
|
-
| **category_name** | **String** | The name of the category. If a split scheduled transaction, this will be 'Split'. | [optional] |
|
10
|
-
| **subtransactions** | [**Array<ScheduledSubTransaction>**](ScheduledSubTransaction.md) | If a split scheduled transaction, the subtransactions. | |
|
11
|
-
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# YNAB::ScheduledTransactionsWrapper
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**scheduled_transactions** | [**Array<ScheduledTransactionDetail>**](ScheduledTransactionDetail.md) | |
|
7
|
-
|
8
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# YNAB::TransactionDetailAllOf
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **account_name** | **String** | | |
|
8
|
-
| **payee_name** | **String** | | [optional] |
|
9
|
-
| **category_name** | **String** | The name of the category. If a split transaction, this will be 'Split'. | [optional] |
|
10
|
-
| **subtransactions** | [**Array<SubTransaction>**](SubTransaction.md) | If a split transaction, the subtransactions. | |
|
11
|
-
|
data/docs/TransactionWrapper.md
DELETED
data/docs/TransactionsWrapper.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# YNAB::TransactionsWrapper
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**transactions** | [**Array<TransactionDetail>**](TransactionDetail.md) | |
|
7
|
-
**server_knowledge** | **Integer** | The knowledge of the server |
|
8
|
-
|
9
|
-
|
data/docs/UpdateTransaction.md
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# YNAB::UpdateTransaction
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**account_id** | **String** | |
|
7
|
-
**date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. |
|
8
|
-
**amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. |
|
9
|
-
**payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `tranfer_payee_id` on the account resource. | [optional]
|
10
|
-
**payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional]
|
11
|
-
**category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional]
|
12
|
-
**memo** | **String** | | [optional]
|
13
|
-
**cleared** | **String** | The cleared status of the transaction | [optional]
|
14
|
-
**approved** | **BOOLEAN** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional]
|
15
|
-
**flag_color** | **String** | The transaction flag | [optional]
|
16
|
-
**import_id** | **String** | 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). | [optional]
|
17
|
-
**subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional]
|
18
|
-
**id** | **String** | |
|
19
|
-
|
20
|
-
|
data/docs/UserWrapper.md
DELETED
@@ -1,320 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#YNAB API Endpoints
|
3
|
-
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 6.6.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module YNAB
|
17
|
-
class BudgetDetailAllOf
|
18
|
-
attr_accessor :accounts
|
19
|
-
|
20
|
-
attr_accessor :payees
|
21
|
-
|
22
|
-
attr_accessor :payee_locations
|
23
|
-
|
24
|
-
attr_accessor :category_groups
|
25
|
-
|
26
|
-
attr_accessor :categories
|
27
|
-
|
28
|
-
attr_accessor :months
|
29
|
-
|
30
|
-
attr_accessor :transactions
|
31
|
-
|
32
|
-
attr_accessor :subtransactions
|
33
|
-
|
34
|
-
attr_accessor :scheduled_transactions
|
35
|
-
|
36
|
-
attr_accessor :scheduled_subtransactions
|
37
|
-
|
38
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
-
def self.attribute_map
|
40
|
-
{
|
41
|
-
:'accounts' => :'accounts',
|
42
|
-
:'payees' => :'payees',
|
43
|
-
:'payee_locations' => :'payee_locations',
|
44
|
-
:'category_groups' => :'category_groups',
|
45
|
-
:'categories' => :'categories',
|
46
|
-
:'months' => :'months',
|
47
|
-
:'transactions' => :'transactions',
|
48
|
-
:'subtransactions' => :'subtransactions',
|
49
|
-
:'scheduled_transactions' => :'scheduled_transactions',
|
50
|
-
:'scheduled_subtransactions' => :'scheduled_subtransactions'
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
# Returns all the JSON keys this model knows about
|
55
|
-
def self.acceptable_attributes
|
56
|
-
attribute_map.values
|
57
|
-
end
|
58
|
-
|
59
|
-
# Attribute type mapping.
|
60
|
-
def self.openapi_types
|
61
|
-
{
|
62
|
-
:'accounts' => :'Array<Account>',
|
63
|
-
:'payees' => :'Array<Payee>',
|
64
|
-
:'payee_locations' => :'Array<PayeeLocation>',
|
65
|
-
:'category_groups' => :'Array<CategoryGroup>',
|
66
|
-
:'categories' => :'Array<Category>',
|
67
|
-
:'months' => :'Array<MonthDetail>',
|
68
|
-
:'transactions' => :'Array<TransactionSummary>',
|
69
|
-
:'subtransactions' => :'Array<SubTransaction>',
|
70
|
-
:'scheduled_transactions' => :'Array<ScheduledTransactionSummary>',
|
71
|
-
:'scheduled_subtransactions' => :'Array<ScheduledSubTransaction>'
|
72
|
-
}
|
73
|
-
end
|
74
|
-
|
75
|
-
# List of attributes with nullable: true
|
76
|
-
def self.openapi_nullable
|
77
|
-
Set.new([
|
78
|
-
])
|
79
|
-
end
|
80
|
-
|
81
|
-
# Initializes the object
|
82
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
-
def initialize(attributes = {})
|
84
|
-
if (!attributes.is_a?(Hash))
|
85
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::BudgetDetailAllOf` initialize method"
|
86
|
-
end
|
87
|
-
|
88
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::BudgetDetailAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
-
end
|
93
|
-
h[k.to_sym] = v
|
94
|
-
}
|
95
|
-
|
96
|
-
if attributes.key?(:'accounts')
|
97
|
-
if (value = attributes[:'accounts']).is_a?(Array)
|
98
|
-
self.accounts = value
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'payees')
|
103
|
-
if (value = attributes[:'payees']).is_a?(Array)
|
104
|
-
self.payees = value
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
if attributes.key?(:'payee_locations')
|
109
|
-
if (value = attributes[:'payee_locations']).is_a?(Array)
|
110
|
-
self.payee_locations = value
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
if attributes.key?(:'category_groups')
|
115
|
-
if (value = attributes[:'category_groups']).is_a?(Array)
|
116
|
-
self.category_groups = value
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
if attributes.key?(:'categories')
|
121
|
-
if (value = attributes[:'categories']).is_a?(Array)
|
122
|
-
self.categories = value
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
if attributes.key?(:'months')
|
127
|
-
if (value = attributes[:'months']).is_a?(Array)
|
128
|
-
self.months = value
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
if attributes.key?(:'transactions')
|
133
|
-
if (value = attributes[:'transactions']).is_a?(Array)
|
134
|
-
self.transactions = value
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
if attributes.key?(:'subtransactions')
|
139
|
-
if (value = attributes[:'subtransactions']).is_a?(Array)
|
140
|
-
self.subtransactions = value
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
if attributes.key?(:'scheduled_transactions')
|
145
|
-
if (value = attributes[:'scheduled_transactions']).is_a?(Array)
|
146
|
-
self.scheduled_transactions = value
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.key?(:'scheduled_subtransactions')
|
151
|
-
if (value = attributes[:'scheduled_subtransactions']).is_a?(Array)
|
152
|
-
self.scheduled_subtransactions = value
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
158
|
-
# @return Array for valid properties with the reasons
|
159
|
-
def list_invalid_properties
|
160
|
-
invalid_properties = Array.new
|
161
|
-
invalid_properties
|
162
|
-
end
|
163
|
-
|
164
|
-
# Check to see if the all the properties in the model are valid
|
165
|
-
# @return true if the model is valid
|
166
|
-
def valid?
|
167
|
-
true
|
168
|
-
end
|
169
|
-
|
170
|
-
# Checks equality by comparing each attribute.
|
171
|
-
# @param [Object] Object to be compared
|
172
|
-
def ==(o)
|
173
|
-
return true if self.equal?(o)
|
174
|
-
self.class == o.class &&
|
175
|
-
accounts == o.accounts &&
|
176
|
-
payees == o.payees &&
|
177
|
-
payee_locations == o.payee_locations &&
|
178
|
-
category_groups == o.category_groups &&
|
179
|
-
categories == o.categories &&
|
180
|
-
months == o.months &&
|
181
|
-
transactions == o.transactions &&
|
182
|
-
subtransactions == o.subtransactions &&
|
183
|
-
scheduled_transactions == o.scheduled_transactions &&
|
184
|
-
scheduled_subtransactions == o.scheduled_subtransactions
|
185
|
-
end
|
186
|
-
|
187
|
-
# @see the `==` method
|
188
|
-
# @param [Object] Object to be compared
|
189
|
-
def eql?(o)
|
190
|
-
self == o
|
191
|
-
end
|
192
|
-
|
193
|
-
# Calculates hash code according to all attributes.
|
194
|
-
# @return [Integer] Hash code
|
195
|
-
def hash
|
196
|
-
[accounts, payees, payee_locations, category_groups, categories, months, transactions, subtransactions, scheduled_transactions, scheduled_subtransactions].hash
|
197
|
-
end
|
198
|
-
|
199
|
-
# Builds the object from hash
|
200
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
201
|
-
# @return [Object] Returns the model itself
|
202
|
-
def self.build_from_hash(attributes)
|
203
|
-
new.build_from_hash(attributes)
|
204
|
-
end
|
205
|
-
|
206
|
-
# Builds the object from hash
|
207
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
208
|
-
# @return [Object] Returns the model itself
|
209
|
-
def build_from_hash(attributes)
|
210
|
-
return nil unless attributes.is_a?(Hash)
|
211
|
-
attributes = attributes.transform_keys(&:to_sym)
|
212
|
-
self.class.openapi_types.each_pair do |key, type|
|
213
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
214
|
-
self.send("#{key}=", nil)
|
215
|
-
elsif type =~ /\AArray<(.*)>/i
|
216
|
-
# check to ensure the input is an array given that the attribute
|
217
|
-
# is documented as an array but the input is not
|
218
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
219
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
220
|
-
end
|
221
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
222
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
self
|
227
|
-
end
|
228
|
-
|
229
|
-
# Deserializes the data based on type
|
230
|
-
# @param string type Data type
|
231
|
-
# @param string value Value to be deserialized
|
232
|
-
# @return [Object] Deserialized data
|
233
|
-
def _deserialize(type, value)
|
234
|
-
case type.to_sym
|
235
|
-
when :Time
|
236
|
-
Time.parse(value)
|
237
|
-
when :Date
|
238
|
-
Date.parse(value)
|
239
|
-
when :String
|
240
|
-
value.to_s
|
241
|
-
when :Integer
|
242
|
-
value.to_i
|
243
|
-
when :Float
|
244
|
-
value.to_f
|
245
|
-
when :Boolean
|
246
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
247
|
-
true
|
248
|
-
else
|
249
|
-
false
|
250
|
-
end
|
251
|
-
when :Object
|
252
|
-
# generic object (usually a Hash), return directly
|
253
|
-
value
|
254
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
255
|
-
inner_type = Regexp.last_match[:inner_type]
|
256
|
-
value.map { |v| _deserialize(inner_type, v) }
|
257
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
258
|
-
k_type = Regexp.last_match[:k_type]
|
259
|
-
v_type = Regexp.last_match[:v_type]
|
260
|
-
{}.tap do |hash|
|
261
|
-
value.each do |k, v|
|
262
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
263
|
-
end
|
264
|
-
end
|
265
|
-
else # model
|
266
|
-
# models (e.g. Pet) or oneOf
|
267
|
-
klass = YNAB.const_get(type)
|
268
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
# Returns the string representation of the object
|
273
|
-
# @return [String] String presentation of the object
|
274
|
-
def to_s
|
275
|
-
to_hash.to_s
|
276
|
-
end
|
277
|
-
|
278
|
-
# to_body is an alias to to_hash (backward compatibility)
|
279
|
-
# @return [Hash] Returns the object in the form of hash
|
280
|
-
def to_body
|
281
|
-
to_hash
|
282
|
-
end
|
283
|
-
|
284
|
-
# Returns the object in the form of hash
|
285
|
-
# @return [Hash] Returns the object in the form of hash
|
286
|
-
def to_hash
|
287
|
-
hash = {}
|
288
|
-
self.class.attribute_map.each_pair do |attr, param|
|
289
|
-
value = self.send(attr)
|
290
|
-
if value.nil?
|
291
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
292
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
293
|
-
end
|
294
|
-
|
295
|
-
hash[param] = _to_hash(value)
|
296
|
-
end
|
297
|
-
hash
|
298
|
-
end
|
299
|
-
|
300
|
-
# Outputs non-array value in the form of hash
|
301
|
-
# For object, use to_hash. Otherwise, just return the value
|
302
|
-
# @param [Object] value Any valid value
|
303
|
-
# @return [Hash] Returns the value in the form of hash
|
304
|
-
def _to_hash(value)
|
305
|
-
if value.is_a?(Array)
|
306
|
-
value.compact.map { |v| _to_hash(v) }
|
307
|
-
elsif value.is_a?(Hash)
|
308
|
-
{}.tap do |hash|
|
309
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
310
|
-
end
|
311
|
-
elsif value.respond_to? :to_hash
|
312
|
-
value.to_hash
|
313
|
-
else
|
314
|
-
value
|
315
|
-
end
|
316
|
-
end
|
317
|
-
|
318
|
-
end
|
319
|
-
|
320
|
-
end
|