From 4a3c5ad84406f90b80aa23d694886daddbad5a96 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 28 Apr 2019 19:15:52 -0700 Subject: [PATCH 01/14] Add instructions for generation. --- .swagger-codegen/VERSION | 2 +- README.md | 64 +- README_GENERATION.md | 10 + docs/Account.md | 11 +- docs/AccountResponse.md | 1 - docs/AccountWrapper.md | 1 - docs/AccountsApi.md | 19 +- docs/AccountsResponse.md | 1 - docs/AccountsWrapper.md | 2 +- docs/BudgetDetail.md | 6 - docs/BudgetDetailResponse.md | 1 - docs/BudgetDetailWrapper.md | 3 +- docs/BudgetSummary.md | 3 +- docs/BudgetSummaryResponse.md | 1 - docs/BudgetSummaryWrapper.md | 1 - docs/BudgetsApi.md | 66 +- docs/BulkIdWrapper.md | 1 - docs/BulkIds.md | 3 +- docs/BulkResponse.md | 1 - docs/BulkTransactions.md | 1 - docs/CategoriesApi.md | 143 ++- docs/CategoriesResponse.md | 1 - docs/Category.md | 14 +- docs/CategoryGroup.md | 2 +- docs/CategoryGroupWithCategories.md | 6 +- docs/CategoryGroupsWrapper.md | 2 +- docs/CategoryResponse.md | 1 - docs/CategoryWrapper.md | 1 - docs/CurrencyFormat.md | 3 +- docs/DateFormat.md | 1 - docs/ErrorDetail.md | 1 - docs/ErrorResponse.md | 1 - docs/HybridTransaction.md | 13 - docs/HybridTransactionsResponse.md | 1 - docs/HybridTransactionsWrapper.md | 1 - docs/MonthDetail.md | 7 +- docs/MonthDetailResponse.md | 1 - docs/MonthDetailWrapper.md | 1 - docs/MonthSummariesResponse.md | 1 - docs/MonthSummariesWrapper.md | 2 +- docs/MonthSummary.md | 9 +- docs/MonthsApi.md | 19 +- docs/Payee.md | 2 +- docs/PayeeLocation.md | 2 +- docs/PayeeLocationResponse.md | 1 - docs/PayeeLocationWrapper.md | 1 - docs/PayeeLocationsApi.md | 21 +- docs/PayeeLocationsResponse.md | 1 - docs/PayeeLocationsWrapper.md | 1 - docs/PayeeResponse.md | 1 - docs/PayeeWrapper.md | 1 - docs/PayeesApi.md | 19 +- docs/PayeesResponse.md | 1 - docs/PayeesWrapper.md | 2 +- docs/SaveTransaction.md | 13 +- docs/SaveTransactionWrapper.md | 1 - docs/ScheduledSubTransaction.md | 6 +- docs/ScheduledTransactionDetail.md | 12 - docs/ScheduledTransactionResponse.md | 1 - docs/ScheduledTransactionSummary.md | 4 +- docs/ScheduledTransactionWrapper.md | 1 - docs/ScheduledTransactionsApi.md | 13 +- docs/ScheduledTransactionsResponse.md | 1 - docs/ScheduledTransactionsWrapper.md | 1 - docs/SubTransaction.md | 4 +- docs/TransactionDetail.md | 13 - docs/TransactionResponse.md | 1 - docs/TransactionSummary.md | 12 +- docs/TransactionWrapper.md | 1 - docs/TransactionsApi.md | 201 ++-- docs/TransactionsResponse.md | 1 - docs/TransactionsWrapper.md | 2 +- docs/User.md | 1 - docs/UserApi.md | 3 +- docs/UserResponse.md | 1 - docs/UserWrapper.md | 1 - setup.py | 3 +- swagger-codegen-python-config.json | 5 + test/test_account.py | 1 - test/test_account_response.py | 1 - test/test_account_wrapper.py | 1 - test/test_accounts_api.py | 5 +- test/test_accounts_response.py | 1 - test/test_accounts_wrapper.py | 1 - test/test_budget_detail.py | 1 - test/test_budget_detail_response.py | 1 - test/test_budget_detail_wrapper.py | 1 - test/test_budget_summary.py | 1 - test/test_budget_summary_response.py | 1 - test/test_budget_summary_wrapper.py | 1 - test/test_budgets_api.py | 12 +- test/test_bulk_id_wrapper.py | 1 - test/test_bulk_ids.py | 1 - test/test_bulk_response.py | 1 - test/test_bulk_transactions.py | 1 - test/test_categories_api.py | 19 +- test/test_categories_response.py | 1 - test/test_category.py | 1 - test/test_category_group.py | 1 - test/test_category_group_with_categories.py | 1 - test/test_category_groups_wrapper.py | 1 - test/test_category_response.py | 1 - test/test_category_wrapper.py | 1 - test/test_currency_format.py | 1 - test/test_date_format.py | 1 - test/test_error_detail.py | 1 - test/test_error_response.py | 1 - test/test_hybrid_transaction.py | 1 - test/test_hybrid_transactions_response.py | 1 - test/test_hybrid_transactions_wrapper.py | 1 - test/test_month_detail.py | 1 - test/test_month_detail_response.py | 1 - test/test_month_detail_wrapper.py | 1 - test/test_month_summaries_response.py | 1 - test/test_month_summaries_wrapper.py | 1 - test/test_month_summary.py | 1 - test/test_months_api.py | 5 +- test/test_payee.py | 1 - test/test_payee_location.py | 1 - test/test_payee_location_response.py | 1 - test/test_payee_location_wrapper.py | 1 - test/test_payee_locations_api.py | 5 +- test/test_payee_locations_response.py | 1 - test/test_payee_locations_wrapper.py | 1 - test/test_payee_response.py | 1 - test/test_payee_wrapper.py | 1 - test/test_payees_api.py | 5 +- test/test_payees_response.py | 1 - test/test_payees_wrapper.py | 1 - test/test_save_transaction.py | 1 - test/test_save_transaction_wrapper.py | 1 - test/test_scheduled_sub_transaction.py | 1 - test/test_scheduled_transaction_detail.py | 1 - test/test_scheduled_transaction_response.py | 1 - test/test_scheduled_transaction_summary.py | 1 - test/test_scheduled_transaction_wrapper.py | 1 - test/test_scheduled_transactions_api.py | 5 +- test/test_scheduled_transactions_response.py | 1 - test/test_scheduled_transactions_wrapper.py | 1 - test/test_sub_transaction.py | 1 - test/test_transaction_detail.py | 1 - test/test_transaction_response.py | 1 - test/test_transaction_summary.py | 1 - test/test_transaction_wrapper.py | 1 - test/test_transactions_api.py | 31 +- test/test_transactions_response.py | 1 - test/test_transactions_wrapper.py | 1 - test/test_user.py | 1 - test/test_user_api.py | 5 +- test/test_user_response.py | 1 - test/test_user_wrapper.py | 1 - tox.ini | 4 +- ynab/__init__.py | 40 +- ynab/api_client.py | 37 +- ynab/configuration.py | 5 +- ynab/models/__init__.py | 20 +- ynab/models/account.py | 94 +- ynab/models/account_response.py | 8 +- ynab/models/account_wrapper.py | 8 +- ynab/models/accounts_response.py | 8 +- ynab/models/accounts_wrapper.py | 43 +- ynab/models/budget_detail.py | 146 +-- ynab/models/budget_detail_response.py | 8 +- ynab/models/budget_detail_wrapper.py | 14 +- ynab/models/budget_summary.py | 66 +- ynab/models/budget_summary_response.py | 8 +- ynab/models/budget_summary_wrapper.py | 8 +- ynab/models/bulk_id_wrapper.py | 8 +- ynab/models/bulk_ids.py | 11 +- ynab/models/bulk_response.py | 8 +- ynab/models/bulk_transactions.py | 8 +- ynab/models/categories_response.py | 8 +- ynab/models/category.py | 252 ++++- ynab/models/category_group.py | 42 +- ynab/models/category_group_with_categories.py | 99 +- ynab/models/category_groups_wrapper.py | 43 +- ynab/models/category_response.py | 8 +- ynab/models/category_wrapper.py | 8 +- ynab/models/currency_format.py | 13 +- ynab/models/date_format.py | 7 +- ynab/models/error_detail.py | 7 +- ynab/models/error_response.py | 8 +- ynab/models/hybrid_transaction.py | 358 +------ ynab/models/hybrid_transactions_response.py | 8 +- ynab/models/hybrid_transactions_wrapper.py | 8 +- ynab/models/month_detail.py | 123 +-- ynab/models/month_detail_response.py | 8 +- ynab/models/month_detail_wrapper.py | 8 +- ynab/models/month_summaries_response.py | 8 +- ynab/models/month_summaries_wrapper.py | 43 +- ynab/models/month_summary.py | 148 ++- ynab/models/payee.py | 42 +- ynab/models/payee_location.py | 42 +- ynab/models/payee_location_response.py | 8 +- ynab/models/payee_location_wrapper.py | 8 +- ynab/models/payee_locations_response.py | 8 +- ynab/models/payee_locations_wrapper.py | 8 +- ynab/models/payee_response.py | 8 +- ynab/models/payee_wrapper.py | 8 +- ynab/models/payees_response.py | 8 +- ynab/models/payees_wrapper.py | 43 +- ynab/models/save_transaction.py | 61 +- ynab/models/save_transaction_wrapper.py | 8 +- ynab/models/scheduled_sub_transaction.py | 52 +- ynab/models/scheduled_transaction_detail.py | 331 +------ ynab/models/scheduled_transaction_response.py | 8 +- ynab/models/scheduled_transaction_summary.py | 48 +- ynab/models/scheduled_transaction_wrapper.py | 8 +- .../models/scheduled_transactions_response.py | 8 +- ynab/models/scheduled_transactions_wrapper.py | 8 +- ynab/models/sub_transaction.py | 48 +- ynab/models/transaction_detail.py | 358 +------ ynab/models/transaction_response.py | 8 +- ynab/models/transaction_summary.py | 138 ++- ynab/models/transaction_wrapper.py | 8 +- ynab/models/transactions_response.py | 8 +- ynab/models/transactions_wrapper.py | 43 +- ynab/models/user.py | 7 +- ynab/models/user_response.py | 8 +- ynab/models/user_wrapper.py | 8 +- ynab/rest.py | 1 - ynab/ynab/__init__.py | 14 - ynab/ynab/accounts_api.py | 232 ----- ynab/ynab/budgets_api.py | 220 ----- ynab/ynab/categories_api.py | 232 ----- ynab/ynab/months_api.py | 232 ----- ynab/ynab/payee_locations_api.py | 335 ------- ynab/ynab/payees_api.py | 232 ----- ynab/ynab/scheduled_transactions_api.py | 232 ----- ynab/ynab/transactions_api.py | 878 ------------------ ynab/ynab/user_api.py | 121 --- 231 files changed, 1783 insertions(+), 4994 deletions(-) create mode 100644 README_GENERATION.md create mode 100644 swagger-codegen-python-config.json delete mode 100644 ynab/ynab/__init__.py delete mode 100644 ynab/ynab/accounts_api.py delete mode 100644 ynab/ynab/budgets_api.py delete mode 100644 ynab/ynab/categories_api.py delete mode 100644 ynab/ynab/months_api.py delete mode 100644 ynab/ynab/payee_locations_api.py delete mode 100644 ynab/ynab/payees_api.py delete mode 100644 ynab/ynab/scheduled_transactions_api.py delete mode 100644 ynab/ynab/transactions_api.py delete mode 100644 ynab/ynab/user_api.py diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index a625450..e46454b 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +3.0.8 \ No newline at end of file diff --git a/README.md b/README.md index 75d0b91..df0477d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,11 @@ # ynab-python - -**No gaurentees this works as expected. It's just a place for me to play around to see if I can get something usable with the YNAB API. Other implementations so far don't seem to have optional fields.** - 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.youneedabudget.com This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.languages.PythonClientCodegen +- Package version: 1.0.1 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen ## Requirements. @@ -56,14 +53,14 @@ from pprint import pprint # Configure API key authorization: bearer configuration = ynab.Configuration() - configuration.api_key['Authorization'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['Authorization'] = 'Bearer' + # create an instance of the API class -api_instance = ynab.AccountsApi() -budget_id = 'budget_id_example' # str | The ID of the Budget. -account_id = 'account_id_example' # str | The ID of the Account. +api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # str | The id of the account try: # Single account @@ -72,6 +69,23 @@ try: except ApiException as e: print("Exception when calling AccountsApi->get_account_by_id: %s\n" % e) +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) + +try: + # Account list + api_response = api_instance.get_accounts(budget_id, last_knowledge_of_server=last_knowledge_of_server) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountsApi->get_accounts: %s\n" % e) ``` ## Documentation for API Endpoints @@ -83,9 +97,13 @@ Class | Method | HTTP request | Description *AccountsApi* | [**get_account_by_id**](docs/AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account *AccountsApi* | [**get_accounts**](docs/AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list *BudgetsApi* | [**get_budget_by_id**](docs/BudgetsApi.md#get_budget_by_id) | **GET** /budgets/{budget_id} | Single budget +*BudgetsApi* | [**get_budget_settings_by_id**](docs/BudgetsApi.md#get_budget_settings_by_id) | **GET** /budgets/{budget_id}/settings | Budget Settings *BudgetsApi* | [**get_budgets**](docs/BudgetsApi.md#get_budgets) | **GET** /budgets | List budgets *CategoriesApi* | [**get_categories**](docs/CategoriesApi.md#get_categories) | **GET** /budgets/{budget_id}/categories | List categories *CategoriesApi* | [**get_category_by_id**](docs/CategoriesApi.md#get_category_by_id) | **GET** /budgets/{budget_id}/categories/{category_id} | Single category +*CategoriesApi* | [**get_month_category_by_id**](docs/CategoriesApi.md#get_month_category_by_id) | **GET** /budgets/{budget_id}/months/{month}/categories/{category_id} | Single category for a specific budget month +*CategoriesApi* | [**update_month_category**](docs/CategoriesApi.md#update_month_category) | **PATCH** /budgets/{budget_id}/months/{month}/categories/{category_id} | Update a category for a specific month +*DeprecatedApi* | [**bulk_create_transactions**](docs/DeprecatedApi.md#bulk_create_transactions) | **POST** /budgets/{budget_id}/transactions/bulk | Bulk create transactions *MonthsApi* | [**get_budget_month**](docs/MonthsApi.md#get_budget_month) | **GET** /budgets/{budget_id}/months/{month} | Single budget month *MonthsApi* | [**get_budget_months**](docs/MonthsApi.md#get_budget_months) | **GET** /budgets/{budget_id}/months | List budget months *PayeeLocationsApi* | [**get_payee_location_by_id**](docs/PayeeLocationsApi.md#get_payee_location_by_id) | **GET** /budgets/{budget_id}/payee_locations/{payee_location_id} | Single payee location @@ -95,17 +113,16 @@ Class | Method | HTTP request | Description *PayeesApi* | [**get_payees**](docs/PayeesApi.md#get_payees) | **GET** /budgets/{budget_id}/payees | List payees *ScheduledTransactionsApi* | [**get_scheduled_transaction_by_id**](docs/ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction *ScheduledTransactionsApi* | [**get_scheduled_transactions**](docs/ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{budget_id}/scheduled_transactions | List scheduled transactions -*TransactionsApi* | [**bulk_create_transactions**](docs/TransactionsApi.md#bulk_create_transactions) | **POST** /budgets/{budget_id}/transactions/bulk | Bulk create transactions -*TransactionsApi* | [**create_transaction**](docs/TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create new transaction +*TransactionsApi* | [**create_transaction**](docs/TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create a single transaction or multiple transactions +*TransactionsApi* | [**get_transaction_by_id**](docs/TransactionsApi.md#get_transaction_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction *TransactionsApi* | [**get_transactions**](docs/TransactionsApi.md#get_transactions) | **GET** /budgets/{budget_id}/transactions | List transactions *TransactionsApi* | [**get_transactions_by_account**](docs/TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions *TransactionsApi* | [**get_transactions_by_category**](docs/TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions -*TransactionsApi* | [**get_transactions_by_id**](docs/TransactionsApi.md#get_transactions_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction *TransactionsApi* | [**get_transactions_by_payee**](docs/TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions *TransactionsApi* | [**update_transaction**](docs/TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction +*TransactionsApi* | [**update_transactions**](docs/TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions *UserApi* | [**get_user**](docs/UserApi.md#get_user) | **GET** /user | User info - ## Documentation For Models - [Account](docs/Account.md) @@ -113,8 +130,12 @@ Class | Method | HTTP request | Description - [AccountWrapper](docs/AccountWrapper.md) - [AccountsResponse](docs/AccountsResponse.md) - [AccountsWrapper](docs/AccountsWrapper.md) + - [BudgetDetail](docs/BudgetDetail.md) - [BudgetDetailResponse](docs/BudgetDetailResponse.md) - [BudgetDetailWrapper](docs/BudgetDetailWrapper.md) + - [BudgetSettings](docs/BudgetSettings.md) + - [BudgetSettingsResponse](docs/BudgetSettingsResponse.md) + - [BudgetSettingsWrapper](docs/BudgetSettingsWrapper.md) - [BudgetSummary](docs/BudgetSummary.md) - [BudgetSummaryResponse](docs/BudgetSummaryResponse.md) - [BudgetSummaryWrapper](docs/BudgetSummaryWrapper.md) @@ -125,6 +146,7 @@ Class | Method | HTTP request | Description - [CategoriesResponse](docs/CategoriesResponse.md) - [Category](docs/Category.md) - [CategoryGroup](docs/CategoryGroup.md) + - [CategoryGroupWithCategories](docs/CategoryGroupWithCategories.md) - [CategoryGroupsWrapper](docs/CategoryGroupsWrapper.md) - [CategoryResponse](docs/CategoryResponse.md) - [CategoryWrapper](docs/CategoryWrapper.md) @@ -132,8 +154,10 @@ Class | Method | HTTP request | Description - [DateFormat](docs/DateFormat.md) - [ErrorDetail](docs/ErrorDetail.md) - [ErrorResponse](docs/ErrorResponse.md) + - [HybridTransaction](docs/HybridTransaction.md) - [HybridTransactionsResponse](docs/HybridTransactionsResponse.md) - [HybridTransactionsWrapper](docs/HybridTransactionsWrapper.md) + - [MonthDetail](docs/MonthDetail.md) - [MonthDetailResponse](docs/MonthDetailResponse.md) - [MonthDetailWrapper](docs/MonthDetailWrapper.md) - [MonthSummariesResponse](docs/MonthSummariesResponse.md) @@ -149,15 +173,21 @@ Class | Method | HTTP request | Description - [PayeeWrapper](docs/PayeeWrapper.md) - [PayeesResponse](docs/PayeesResponse.md) - [PayeesWrapper](docs/PayeesWrapper.md) + - [SaveMonthCategory](docs/SaveMonthCategory.md) + - [SaveMonthCategoryWrapper](docs/SaveMonthCategoryWrapper.md) - [SaveTransaction](docs/SaveTransaction.md) - [SaveTransactionWrapper](docs/SaveTransactionWrapper.md) + - [SaveTransactionsResponse](docs/SaveTransactionsResponse.md) + - [SaveTransactionsWrapper](docs/SaveTransactionsWrapper.md) - [ScheduledSubTransaction](docs/ScheduledSubTransaction.md) + - [ScheduledTransactionDetail](docs/ScheduledTransactionDetail.md) - [ScheduledTransactionResponse](docs/ScheduledTransactionResponse.md) - [ScheduledTransactionSummary](docs/ScheduledTransactionSummary.md) - [ScheduledTransactionWrapper](docs/ScheduledTransactionWrapper.md) - [ScheduledTransactionsResponse](docs/ScheduledTransactionsResponse.md) - [ScheduledTransactionsWrapper](docs/ScheduledTransactionsWrapper.md) - [SubTransaction](docs/SubTransaction.md) + - [TransactionDetail](docs/TransactionDetail.md) - [TransactionResponse](docs/TransactionResponse.md) - [TransactionSummary](docs/TransactionSummary.md) - [TransactionWrapper](docs/TransactionWrapper.md) @@ -166,13 +196,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [UserResponse](docs/UserResponse.md) - [UserWrapper](docs/UserWrapper.md) - - [BudgetDetail](docs/BudgetDetail.md) - - [CategoryGroupWithCategories](docs/CategoryGroupWithCategories.md) - - [HybridTransaction](docs/HybridTransaction.md) - - [MonthDetail](docs/MonthDetail.md) - - [ScheduledTransactionDetail](docs/ScheduledTransactionDetail.md) - - [TransactionDetail](docs/TransactionDetail.md) - ## Documentation For Authorization @@ -187,4 +210,3 @@ Class | Method | HTTP request | Description ## Author - diff --git a/README_GENERATION.md b/README_GENERATION.md new file mode 100644 index 0000000..09a13b2 --- /dev/null +++ b/README_GENERATION.md @@ -0,0 +1,10 @@ +SWAGGER GENERATION INSTRUCTIONS + +1. Install swagger-codegen +1. Change into the ynab-python directory +1. Remove all the test files with `rm -r test/` +1. Bump the version in swagger-codegen-python-config.js +1. Generate new fixtures with `swagger-codegen generate -i https://api.youneedabudget.com/papi/spec-v1-swagger.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python` +1. Manually fix up the tests to call `ynab.api` and `ynab.models` for imports +1. Install the test requirements with `pip install -r test-requirements.txt` +1. Run the tests with `nosetests` diff --git a/docs/Account.md b/docs/Account.md index 7b008f1..c2900bd 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -5,14 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **name** | **str** | | -**type** | **str** | | +**type** | **str** | The type of account. Note: payPal, merchantAccount, investmentAccount, and mortgage types have been deprecated and will be removed in the future. | **on_budget** | **bool** | Whether this account is on budget or not | **closed** | **bool** | Whether this account is closed or not | **note** | **str** | | -**balance** | **float** | The current balance of the account in milliunits format | -**cleared_balance** | **float** | The current cleared balance of the account in milliunits format | -**uncleared_balance** | **float** | The current uncleared balance of the account in milliunits format | +**balance** | **int** | The current balance of the account in milliunits format | +**cleared_balance** | **int** | The current cleared balance of the account in milliunits format | +**uncleared_balance** | **int** | The current uncleared balance of the account in milliunits format | +**transfer_payee_id** | **str** | The payee id which should be used when transferring to this account | +**deleted** | **bool** | Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountResponse.md b/docs/AccountResponse.md index 5418630..c80c863 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountWrapper.md b/docs/AccountWrapper.md index cfe11ac..cb8363f 100644 --- a/docs/AccountWrapper.md +++ b/docs/AccountWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountsApi.md b/docs/AccountsApi.md index 58d0f9e..41d2fb3 100644 --- a/docs/AccountsApi.md +++ b/docs/AccountsApi.md @@ -7,7 +7,6 @@ Method | HTTP request | Description [**get_account_by_id**](AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account [**get_accounts**](AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list - # **get_account_by_id** > AccountResponse get_account_by_id(budget_id, account_id) @@ -31,8 +30,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -account_id = 'account_id_example' # str | The ID of the Account. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # str | The id of the account try: # Single account @@ -46,8 +45,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **account_id** | [**str**](.md)| The ID of the Account. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **account_id** | [**str**](.md)| The id of the account | ### Return type @@ -65,7 +64,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_accounts** -> AccountsResponse get_accounts(budget_id) +> AccountsResponse get_accounts(budget_id, last_knowledge_of_server=last_knowledge_of_server) Account list @@ -87,11 +86,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # Account list - api_response = api_instance.get_accounts(budget_id) + api_response = api_instance.get_accounts(budget_id, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->get_accounts: %s\n" % e) @@ -101,7 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type diff --git a/docs/AccountsResponse.md b/docs/AccountsResponse.md index 1d026e0..ebbc2f8 100644 --- a/docs/AccountsResponse.md +++ b/docs/AccountsResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountsWrapper.md b/docs/AccountsWrapper.md index be0ef49..9431d7d 100644 --- a/docs/AccountsWrapper.md +++ b/docs/AccountsWrapper.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **accounts** | [**list[Account]**](Account.md) | | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetDetail.md b/docs/BudgetDetail.md index 6e4d728..901afb0 100644 --- a/docs/BudgetDetail.md +++ b/docs/BudgetDetail.md @@ -3,11 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**name** | **str** | | -**last_modified_on** | **datetime** | The last time any changes were made to the budget from either a web or mobile client. | [optional] -**date_format** | [**DateFormat**](DateFormat.md) | | [optional] -**currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] **accounts** | [**list[Account]**](Account.md) | | [optional] **payees** | [**list[Payee]**](Payee.md) | | [optional] **payee_locations** | [**list[PayeeLocation]**](PayeeLocation.md) | | [optional] @@ -21,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetDetailResponse.md b/docs/BudgetDetailResponse.md index 2eb7cff..9b08942 100644 --- a/docs/BudgetDetailResponse.md +++ b/docs/BudgetDetailResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetDetailWrapper.md b/docs/BudgetDetailWrapper.md index 61ede97..de1ea96 100644 --- a/docs/BudgetDetailWrapper.md +++ b/docs/BudgetDetailWrapper.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **budget** | [**BudgetDetail**](BudgetDetail.md) | | -**server_knowledge** | **float** | The knowledge of the server | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetSummary.md b/docs/BudgetSummary.md index 6a2da86..a69a6b1 100644 --- a/docs/BudgetSummary.md +++ b/docs/BudgetSummary.md @@ -6,9 +6,10 @@ Name | Type | Description | Notes **id** | **str** | | **name** | **str** | | **last_modified_on** | **datetime** | The last time any changes were made to the budget from either a web or mobile client. | [optional] +**first_month** | **date** | The earliest budget month. | [optional] +**last_month** | **date** | The latest budget month. | [optional] **date_format** | [**DateFormat**](DateFormat.md) | | [optional] **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetSummaryResponse.md b/docs/BudgetSummaryResponse.md index 1bb36d5..50f633e 100644 --- a/docs/BudgetSummaryResponse.md +++ b/docs/BudgetSummaryResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetSummaryWrapper.md b/docs/BudgetSummaryWrapper.md index f19dfa1..67494a6 100644 --- a/docs/BudgetSummaryWrapper.md +++ b/docs/BudgetSummaryWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BudgetsApi.md b/docs/BudgetsApi.md index e8322c2..5dab434 100644 --- a/docs/BudgetsApi.md +++ b/docs/BudgetsApi.md @@ -5,9 +5,9 @@ All URIs are relative to *https://api.youneedabudget.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_budget_by_id**](BudgetsApi.md#get_budget_by_id) | **GET** /budgets/{budget_id} | Single budget +[**get_budget_settings_by_id**](BudgetsApi.md#get_budget_settings_by_id) | **GET** /budgets/{budget_id}/settings | Budget Settings [**get_budgets**](BudgetsApi.md#get_budgets) | **GET** /budgets | List budgets - # **get_budget_by_id** > BudgetDetailResponse get_budget_by_id(budget_id, last_knowledge_of_server=last_knowledge_of_server) @@ -31,8 +31,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.BudgetsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -last_knowledge_of_server = 8.14 # float | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # Single budget @@ -46,8 +46,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **last_knowledge_of_server** | **float**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type @@ -64,12 +64,66 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_budget_settings_by_id** +> BudgetSettingsResponse get_budget_settings_by_id(budget_id) + +Budget Settings + +Returns settings for a budget + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.BudgetsApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) + +try: + # Budget Settings + api_response = api_instance.get_budget_settings_by_id(budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling BudgetsApi->get_budget_settings_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + +### Return type + +[**BudgetSettingsResponse**](BudgetSettingsResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_budgets** > BudgetSummaryResponse get_budgets() List budgets -Returns budgets list with summary information. +Returns budgets list with summary information ### Example ```python diff --git a/docs/BulkIdWrapper.md b/docs/BulkIdWrapper.md index 684ce68..fae26bd 100644 --- a/docs/BulkIdWrapper.md +++ b/docs/BulkIdWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkIds.md b/docs/BulkIds.md index cdfe489..76599c4 100644 --- a/docs/BulkIds.md +++ b/docs/BulkIds.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**transaction_ids** | **list[str]** | The list of Transaction IDs that were created. | +**transaction_ids** | **list[str]** | The list of Transaction ids that were created. | **duplicate_import_ids** | **list[str]** | If any Transactions were not created because they had an import_id matching a transaction already on the same account, the specified import_id(s) will be included in this list. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkResponse.md b/docs/BulkResponse.md index 5d381b3..1af81aa 100644 --- a/docs/BulkResponse.md +++ b/docs/BulkResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkTransactions.md b/docs/BulkTransactions.md index e101fa0..e4445c0 100644 --- a/docs/BulkTransactions.md +++ b/docs/BulkTransactions.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoriesApi.md b/docs/CategoriesApi.md index 2b77b21..c67792b 100644 --- a/docs/CategoriesApi.md +++ b/docs/CategoriesApi.md @@ -6,14 +6,15 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**get_categories**](CategoriesApi.md#get_categories) | **GET** /budgets/{budget_id}/categories | List categories [**get_category_by_id**](CategoriesApi.md#get_category_by_id) | **GET** /budgets/{budget_id}/categories/{category_id} | Single category - +[**get_month_category_by_id**](CategoriesApi.md#get_month_category_by_id) | **GET** /budgets/{budget_id}/months/{month}/categories/{category_id} | Single category for a specific budget month +[**update_month_category**](CategoriesApi.md#update_month_category) | **PATCH** /budgets/{budget_id}/months/{month}/categories/{category_id} | Update a category for a specific month # **get_categories** -> CategoriesResponse get_categories(budget_id) +> CategoriesResponse get_categories(budget_id, last_knowledge_of_server=last_knowledge_of_server) List categories -Returns all categories grouped by category group. +Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). ### Example ```python @@ -31,11 +32,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List categories - api_response = api_instance.get_categories(budget_id) + api_response = api_instance.get_categories(budget_id, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling CategoriesApi->get_categories: %s\n" % e) @@ -45,7 +47,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type @@ -67,7 +70,7 @@ Name | Type | Description | Notes Single category -Returns a single category +Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). ### Example ```python @@ -85,8 +88,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -category_id = 'category_id_example' # str | The ID of the Category. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +category_id = 'category_id_example' # str | The id of the category try: # Single category @@ -100,8 +103,66 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **category_id** | [**str**](.md)| The ID of the Category. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **category_id** | **str**| The id of the category | + +### Return type + +[**CategoryResponse**](CategoryResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_month_category_by_id** +> CategoryResponse get_month_category_by_id(budget_id, month, category_id) + +Single category for a specific budget month + +Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) +category_id = 'category_id_example' # str | The id of the category + +try: + # Single category for a specific budget month + api_response = api_instance.get_month_category_by_id(budget_id, month, category_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CategoriesApi->get_month_category_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | + **category_id** | **str**| The id of the category | ### Return type @@ -118,3 +179,63 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_month_category** +> CategoryResponse update_month_category(body, budget_id, month, category_id) + +Update a category for a specific month + +Update a category for a specific month + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) +body = ynab.SaveMonthCategoryWrapper() # SaveMonthCategoryWrapper | The category to update +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) +category_id = 'category_id_example' # str | The id of the category + +try: + # Update a category for a specific month + api_response = api_instance.update_month_category(body, budget_id, month, category_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CategoriesApi->update_month_category: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SaveMonthCategoryWrapper**](SaveMonthCategoryWrapper.md)| The category to update | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | + **category_id** | **str**| The id of the category | + +### Return type + +[**CategoryResponse**](CategoryResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/CategoriesResponse.md b/docs/CategoriesResponse.md index 0d9bd92..1c5d65b 100644 --- a/docs/CategoriesResponse.md +++ b/docs/CategoriesResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Category.md b/docs/Category.md index f820303..b14ef01 100644 --- a/docs/Category.md +++ b/docs/Category.md @@ -7,11 +7,17 @@ Name | Type | Description | Notes **category_group_id** | **str** | | **name** | **str** | | **hidden** | **bool** | Whether or not the category is hidden | +**original_category_group_id** | **str** | If category is hidden this is the id of the category group it originally belonged to before it was hidden. | [optional] **note** | **str** | | -**budgeted** | **float** | Budgeted amount in current month in milliunits format | -**activity** | **float** | Activity amount in current month in milliunits format | -**balance** | **float** | Balance in current month in milliunits format | +**budgeted** | **int** | Budgeted amount in milliunits format | +**activity** | **int** | Activity amount in milliunits format | +**balance** | **int** | Balance in milliunits format | +**goal_type** | **str** | The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) | +**goal_creation_month** | **date** | The month a goal was created | +**goal_target** | **int** | The goal target amount in milliunits | +**goal_target_month** | **date** | If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed | +**goal_percentage_complete** | **int** | The percentage completion of the goal | +**deleted** | **bool** | Whether or not the category has been deleted. Deleted categories will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoryGroup.md b/docs/CategoryGroup.md index af4f181..f18b43a 100644 --- a/docs/CategoryGroup.md +++ b/docs/CategoryGroup.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **id** | **str** | | **name** | **str** | | **hidden** | **bool** | Whether or not the category group is hidden | +**deleted** | **bool** | Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoryGroupWithCategories.md b/docs/CategoryGroupWithCategories.md index df0f653..3403d29 100644 --- a/docs/CategoryGroupWithCategories.md +++ b/docs/CategoryGroupWithCategories.md @@ -3,11 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**name** | **str** | | -**hidden** | **bool** | Whether or not the category group is hidden | -**categories** | [**list[Category]**](Category.md) | Category group categories | +**categories** | [**list[Category]**](Category.md) | Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoryGroupsWrapper.md b/docs/CategoryGroupsWrapper.md index 14cd2f6..20730ed 100644 --- a/docs/CategoryGroupsWrapper.md +++ b/docs/CategoryGroupsWrapper.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **category_groups** | [**list[CategoryGroupWithCategories]**](CategoryGroupWithCategories.md) | | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoryResponse.md b/docs/CategoryResponse.md index 3b179f6..8a60d37 100644 --- a/docs/CategoryResponse.md +++ b/docs/CategoryResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CategoryWrapper.md b/docs/CategoryWrapper.md index eadb832..17c6068 100644 --- a/docs/CategoryWrapper.md +++ b/docs/CategoryWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/CurrencyFormat.md b/docs/CurrencyFormat.md index 78a5207..32ff00a 100644 --- a/docs/CurrencyFormat.md +++ b/docs/CurrencyFormat.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **iso_code** | **str** | | **example_format** | **str** | | -**decimal_digits** | **float** | | +**decimal_digits** | **int** | | **decimal_separator** | **str** | | **symbol_first** | **bool** | | **group_separator** | **str** | | @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/DateFormat.md b/docs/DateFormat.md index 86c127c..1918ca4 100644 --- a/docs/DateFormat.md +++ b/docs/DateFormat.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ErrorDetail.md b/docs/ErrorDetail.md index 1b99cf5..6f1b337 100644 --- a/docs/ErrorDetail.md +++ b/docs/ErrorDetail.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index 7bd29d0..d30ab24 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/HybridTransaction.md b/docs/HybridTransaction.md index 5bc0c38..5fdfd0e 100644 --- a/docs/HybridTransaction.md +++ b/docs/HybridTransaction.md @@ -3,18 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**date** | **date** | | -**amount** | **float** | The transaction amount in milliunits format | -**memo** | **str** | | -**cleared** | **str** | The cleared status of the transaction | -**approved** | **bool** | Whether or not the transaction is approved | -**flag_color** | **str** | The transaction flag | -**account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | | -**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | **type** | **str** | Whether the hybrid transaction represents a regular transaction or a subtransaction | **parent_transaction_id** | **str** | For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null. | **account_name** | **str** | | @@ -23,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/HybridTransactionsResponse.md b/docs/HybridTransactionsResponse.md index df868d1..130c7b3 100644 --- a/docs/HybridTransactionsResponse.md +++ b/docs/HybridTransactionsResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/HybridTransactionsWrapper.md b/docs/HybridTransactionsWrapper.md index 6c49ed2..9ff7d00 100644 --- a/docs/HybridTransactionsWrapper.md +++ b/docs/HybridTransactionsWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthDetail.md b/docs/MonthDetail.md index c13f502..25055e6 100644 --- a/docs/MonthDetail.md +++ b/docs/MonthDetail.md @@ -3,12 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**month** | **date** | | -**note** | **str** | | -**to_be_budgeted** | **float** | The current balance of the account in milliunits format | -**age_of_money** | **float** | | -**categories** | [**list[Category]**](Category.md) | The budget month categories | +**categories** | [**list[Category]**](Category.md) | The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthDetailResponse.md b/docs/MonthDetailResponse.md index 5ce21ac..5a4d693 100644 --- a/docs/MonthDetailResponse.md +++ b/docs/MonthDetailResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthDetailWrapper.md b/docs/MonthDetailWrapper.md index 94cf7dd..190941d 100644 --- a/docs/MonthDetailWrapper.md +++ b/docs/MonthDetailWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthSummariesResponse.md b/docs/MonthSummariesResponse.md index 73a40c2..58b69d7 100644 --- a/docs/MonthSummariesResponse.md +++ b/docs/MonthSummariesResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthSummariesWrapper.md b/docs/MonthSummariesWrapper.md index 0750b2a..984ed13 100644 --- a/docs/MonthSummariesWrapper.md +++ b/docs/MonthSummariesWrapper.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **months** | [**list[MonthSummary]**](MonthSummary.md) | | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthSummary.md b/docs/MonthSummary.md index d39126e..b617df6 100644 --- a/docs/MonthSummary.md +++ b/docs/MonthSummary.md @@ -5,9 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **month** | **date** | | **note** | **str** | | -**to_be_budgeted** | **float** | The current balance of the account in milliunits format | -**age_of_money** | **float** | | +**income** | **int** | The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month | +**budgeted** | **int** | The total amount budgeted in the month | +**activity** | **int** | The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' | +**to_be_budgeted** | **int** | The available amount for 'To be Budgeted' | +**age_of_money** | **int** | The Age of Money as of the month | +**deleted** | **bool** | Whether or not the month has been deleted. Deleted months will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MonthsApi.md b/docs/MonthsApi.md index 778b09e..71e0c1c 100644 --- a/docs/MonthsApi.md +++ b/docs/MonthsApi.md @@ -7,7 +7,6 @@ Method | HTTP request | Description [**get_budget_month**](MonthsApi.md#get_budget_month) | **GET** /budgets/{budget_id}/months/{month} | Single budget month [**get_budget_months**](MonthsApi.md#get_budget_months) | **GET** /budgets/{budget_id}/months | List budget months - # **get_budget_month** > MonthDetailResponse get_budget_month(budget_id, month) @@ -31,8 +30,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.MonthsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -month = '2013-10-20' # date | The Budget Month. \"current\" can also be used to specify the current calendar month (UTC). +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) try: # Single budget month @@ -46,8 +45,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **month** | **date**| The Budget Month. \"current\" can also be used to specify the current calendar month (UTC). | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | ### Return type @@ -65,7 +64,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_budget_months** -> MonthSummariesResponse get_budget_months(budget_id) +> MonthSummariesResponse get_budget_months(budget_id, last_knowledge_of_server=last_knowledge_of_server) List budget months @@ -87,11 +86,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.MonthsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List budget months - api_response = api_instance.get_budget_months(budget_id) + api_response = api_instance.get_budget_months(budget_id, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling MonthsApi->get_budget_months: %s\n" % e) @@ -101,7 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type diff --git a/docs/Payee.md b/docs/Payee.md index 2e83a5a..4d39a46 100644 --- a/docs/Payee.md +++ b/docs/Payee.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **id** | **str** | | **name** | **str** | | **transfer_account_id** | **str** | If a transfer payee, the account_id to which this payee transfers to | +**deleted** | **bool** | Whether or not the payee has been deleted. Deleted payees will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeLocation.md b/docs/PayeeLocation.md index 7291444..4f9a48f 100644 --- a/docs/PayeeLocation.md +++ b/docs/PayeeLocation.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **payee_id** | **str** | | **latitude** | **str** | | **longitude** | **str** | | +**deleted** | **bool** | Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeLocationResponse.md b/docs/PayeeLocationResponse.md index 5e30202..5f699c9 100644 --- a/docs/PayeeLocationResponse.md +++ b/docs/PayeeLocationResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeLocationWrapper.md b/docs/PayeeLocationWrapper.md index 0df4e14..c19cc85 100644 --- a/docs/PayeeLocationWrapper.md +++ b/docs/PayeeLocationWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeLocationsApi.md b/docs/PayeeLocationsApi.md index c6c62c6..7a6b881 100644 --- a/docs/PayeeLocationsApi.md +++ b/docs/PayeeLocationsApi.md @@ -8,7 +8,6 @@ Method | HTTP request | Description [**get_payee_locations**](PayeeLocationsApi.md#get_payee_locations) | **GET** /budgets/{budget_id}/payee_locations | List payee locations [**get_payee_locations_by_payee**](PayeeLocationsApi.md#get_payee_locations_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/payee_locations | List locations for a payee - # **get_payee_location_by_id** > PayeeLocationResponse get_payee_location_by_id(budget_id, payee_location_id) @@ -32,8 +31,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -payee_location_id = 'payee_location_id_example' # str | ID of payee location +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +payee_location_id = 'payee_location_id_example' # str | id of payee location try: # Single payee location @@ -47,8 +46,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **payee_location_id** | [**str**](.md)| ID of payee location | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **payee_location_id** | **str**| id of payee location | ### Return type @@ -88,7 +87,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) try: # List payee locations @@ -102,7 +101,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | ### Return type @@ -142,8 +141,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -payee_id = 'payee_id_example' # str | ID of payee +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +payee_id = 'payee_id_example' # str | id of payee try: # List locations for a payee @@ -157,8 +156,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **payee_id** | [**str**](.md)| ID of payee | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **payee_id** | **str**| id of payee | ### Return type diff --git a/docs/PayeeLocationsResponse.md b/docs/PayeeLocationsResponse.md index ebec63f..a092d6f 100644 --- a/docs/PayeeLocationsResponse.md +++ b/docs/PayeeLocationsResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeLocationsWrapper.md b/docs/PayeeLocationsWrapper.md index 2a8bcc4..ac1b045 100644 --- a/docs/PayeeLocationsWrapper.md +++ b/docs/PayeeLocationsWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeResponse.md b/docs/PayeeResponse.md index 9e735b4..9ce693f 100644 --- a/docs/PayeeResponse.md +++ b/docs/PayeeResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeeWrapper.md b/docs/PayeeWrapper.md index 7bdfcca..d28475c 100644 --- a/docs/PayeeWrapper.md +++ b/docs/PayeeWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeesApi.md b/docs/PayeesApi.md index 3e9b782..d2d2dde 100644 --- a/docs/PayeesApi.md +++ b/docs/PayeesApi.md @@ -7,7 +7,6 @@ Method | HTTP request | Description [**get_payee_by_id**](PayeesApi.md#get_payee_by_id) | **GET** /budgets/{budget_id}/payees/{payee_id} | Single payee [**get_payees**](PayeesApi.md#get_payees) | **GET** /budgets/{budget_id}/payees | List payees - # **get_payee_by_id** > PayeeResponse get_payee_by_id(budget_id, payee_id) @@ -31,8 +30,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -payee_id = 'payee_id_example' # str | The ID of the Payee. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +payee_id = 'payee_id_example' # str | The id of the payee try: # Single payee @@ -46,8 +45,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **payee_id** | [**str**](.md)| The ID of the Payee. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **payee_id** | **str**| The id of the payee | ### Return type @@ -65,7 +64,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_payees** -> PayeesResponse get_payees(budget_id) +> PayeesResponse get_payees(budget_id, last_knowledge_of_server=last_knowledge_of_server) List payees @@ -87,11 +86,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List payees - api_response = api_instance.get_payees(budget_id) + api_response = api_instance.get_payees(budget_id, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling PayeesApi->get_payees: %s\n" % e) @@ -101,7 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type diff --git a/docs/PayeesResponse.md b/docs/PayeesResponse.md index 5d14cb5..e21afc5 100644 --- a/docs/PayeesResponse.md +++ b/docs/PayeesResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/PayeesWrapper.md b/docs/PayeesWrapper.md index f652538..f6ff3c3 100644 --- a/docs/PayeesWrapper.md +++ b/docs/PayeesWrapper.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **payees** | [**list[Payee]**](Payee.md) | | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SaveTransaction.md b/docs/SaveTransaction.md index 6da8614..1a51eaa 100644 --- a/docs/SaveTransaction.md +++ b/docs/SaveTransaction.md @@ -4,17 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | | -**date** | **date** | | -**amount** | **float** | The transaction amount in milliunits format | -**payee_id** | **str** | The payee for the transaction. Transfer payees are not permitted and will be ignored if supplied. | [optional] -**payee_name** | **str** | The payee name. If a payee_name value is provided and payee_id is not included or has a null value, payee_name will be used to create or use an existing payee. | [optional] -**category_id** | **str** | The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] +**_date** | **date** | | +**amount** | **int** | The transaction amount in milliunits format | +**payee_id** | **str** | The payee for the transaction | [optional] +**payee_name** | **str** | 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] +**category_id** | **str** | The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. | [optional] **memo** | **str** | | [optional] **cleared** | **str** | The cleared status of the transaction | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] **flag_color** | **str** | The transaction flag | [optional] -**import_id** | **str** | If specified for a new transaction, the transaction will be treated as Imported and assigned this import_id. If another transaction on the same account with this same import_id is later attempted to be created, it will be skipped to prevent duplication. Transactions imported through File Based Import or Direct Import and 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. If import_id is specified as null, the transaction will be treated as a user entered transaction. | [optional] +**import_id** | **str** | If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.<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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SaveTransactionWrapper.md b/docs/SaveTransactionWrapper.md index 35dccb0..068e770 100644 --- a/docs/SaveTransactionWrapper.md +++ b/docs/SaveTransactionWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledSubTransaction.md b/docs/ScheduledSubTransaction.md index b3ecfc9..002cd26 100644 --- a/docs/ScheduledSubTransaction.md +++ b/docs/ScheduledSubTransaction.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **scheduled_transaction_id** | **str** | | -**amount** | **float** | The scheduled subtransaction amount in milliunits format | +**amount** | **int** | The scheduled subtransaction amount in milliunits format | **memo** | **str** | | **payee_id** | **str** | | **category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled sub transaction transfers to | +**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled subtransaction transfers to | +**deleted** | **bool** | Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionDetail.md b/docs/ScheduledTransactionDetail.md index e3305c5..7e359da 100644 --- a/docs/ScheduledTransactionDetail.md +++ b/docs/ScheduledTransactionDetail.md @@ -3,17 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**date_first** | **date** | The first date for which the Scheduled Transaction was scheduled. | -**date_next** | **date** | The next date for which the Scheduled Transaction is scheduled. | -**frequency** | **str** | | -**amount** | **float** | The scheduled transaction amount in milliunits format | -**memo** | **str** | | -**flag_color** | **str** | The scheduled transaction flag | -**account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled transaction transfers to | **account_name** | **str** | | **payee_name** | **str** | | **category_name** | **str** | | @@ -21,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionResponse.md b/docs/ScheduledTransactionResponse.md index b31265e..439f799 100644 --- a/docs/ScheduledTransactionResponse.md +++ b/docs/ScheduledTransactionResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionSummary.md b/docs/ScheduledTransactionSummary.md index f2e1d02..5082496 100644 --- a/docs/ScheduledTransactionSummary.md +++ b/docs/ScheduledTransactionSummary.md @@ -7,14 +7,14 @@ Name | Type | Description | Notes **date_first** | **date** | The first date for which the Scheduled Transaction was scheduled. | **date_next** | **date** | The next date for which the Scheduled Transaction is scheduled. | **frequency** | **str** | | -**amount** | **float** | The scheduled transaction amount in milliunits format | +**amount** | **int** | The scheduled transaction amount in milliunits format | **memo** | **str** | | **flag_color** | **str** | The scheduled transaction flag | **account_id** | **str** | | **payee_id** | **str** | | **category_id** | **str** | | **transfer_account_id** | **str** | If a transfer, the account_id which the scheduled transaction transfers to | +**deleted** | **bool** | Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionWrapper.md b/docs/ScheduledTransactionWrapper.md index b0ccbdd..495a429 100644 --- a/docs/ScheduledTransactionWrapper.md +++ b/docs/ScheduledTransactionWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionsApi.md b/docs/ScheduledTransactionsApi.md index 44fa56e..a6194be 100644 --- a/docs/ScheduledTransactionsApi.md +++ b/docs/ScheduledTransactionsApi.md @@ -7,7 +7,6 @@ Method | HTTP request | Description [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{budget_id}/scheduled_transactions | List scheduled transactions - # **get_scheduled_transaction_by_id** > ScheduledTransactionResponse get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id) @@ -31,8 +30,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The ID of the Scheduled Transaction. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The id of the scheduled transaction try: # Single scheduled transaction @@ -46,8 +45,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **scheduled_transaction_id** | [**str**](.md)| The ID of the Scheduled Transaction. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **scheduled_transaction_id** | **str**| The id of the scheduled transaction | ### Return type @@ -87,7 +86,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) try: # List scheduled transactions @@ -101,7 +100,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | ### Return type diff --git a/docs/ScheduledTransactionsResponse.md b/docs/ScheduledTransactionsResponse.md index 1ce9be7..7f79679 100644 --- a/docs/ScheduledTransactionsResponse.md +++ b/docs/ScheduledTransactionsResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ScheduledTransactionsWrapper.md b/docs/ScheduledTransactionsWrapper.md index 07be84f..36dde9d 100644 --- a/docs/ScheduledTransactionsWrapper.md +++ b/docs/ScheduledTransactionsWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubTransaction.md b/docs/SubTransaction.md index 6f104aa..cdc8593 100644 --- a/docs/SubTransaction.md +++ b/docs/SubTransaction.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **transaction_id** | **str** | | -**amount** | **float** | The subtransaction amount in milliunits format | +**amount** | **int** | The subtransaction amount in milliunits format | **memo** | **str** | | **payee_id** | **str** | | **category_id** | **str** | | **transfer_account_id** | **str** | If a transfer, the account_id which the subtransaction transfers to | +**deleted** | **bool** | Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionDetail.md b/docs/TransactionDetail.md index b8c6f28..5580479 100644 --- a/docs/TransactionDetail.md +++ b/docs/TransactionDetail.md @@ -3,18 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**date** | **date** | | -**amount** | **float** | The transaction amount in milliunits format | -**memo** | **str** | | -**cleared** | **str** | The cleared status of the transaction | -**approved** | **bool** | Whether or not the transaction is approved | -**flag_color** | **str** | The transaction flag | -**account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | | -**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | **account_name** | **str** | | **payee_name** | **str** | | **category_name** | **str** | | @@ -22,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionResponse.md b/docs/TransactionResponse.md index 2d46c5f..3b750a7 100644 --- a/docs/TransactionResponse.md +++ b/docs/TransactionResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionSummary.md b/docs/TransactionSummary.md index 7af3447..33e7595 100644 --- a/docs/TransactionSummary.md +++ b/docs/TransactionSummary.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**date** | **date** | | -**amount** | **float** | The transaction amount in milliunits format | +**_date** | **date** | | +**amount** | **int** | The transaction amount in milliunits format | **memo** | **str** | | **cleared** | **str** | The cleared status of the transaction | **approved** | **bool** | Whether or not the transaction is approved | @@ -13,9 +13,11 @@ Name | Type | Description | Notes **account_id** | **str** | | **payee_id** | **str** | | **category_id** | **str** | | -**transfer_account_id** | **str** | | -**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | +**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | +**transfer_transaction_id** | **str** | If a transfer transaction, the id of transaction on the other side of the transfer | +**matched_transaction_id** | **str** | If transaction is matched, the id of the matched transaction | +**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | +**deleted** | **bool** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionWrapper.md b/docs/TransactionWrapper.md index 29c2a74..10a22f9 100644 --- a/docs/TransactionWrapper.md +++ b/docs/TransactionWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionsApi.md b/docs/TransactionsApi.md index a9b4161..fe161b4 100644 --- a/docs/TransactionsApi.md +++ b/docs/TransactionsApi.md @@ -4,22 +4,21 @@ All URIs are relative to *https://api.youneedabudget.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**bulk_create_transactions**](TransactionsApi.md#bulk_create_transactions) | **POST** /budgets/{budget_id}/transactions/bulk | Bulk create transactions -[**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create new transaction +[**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create a single transaction or multiple transactions +[**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /budgets/{budget_id}/transactions | List transactions [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions -[**get_transactions_by_id**](TransactionsApi.md#get_transactions_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction +[**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions +# **create_transaction** +> SaveTransactionsResponse create_transaction(body, budget_id) -# **bulk_create_transactions** -> BulkResponse bulk_create_transactions(budget_id, transactions) - -Bulk create transactions +Create a single transaction or multiple transactions -Creates multiple transactions +Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. ### Example ```python @@ -37,27 +36,27 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -transactions = ynab.BulkTransactions() # BulkTransactions | The list of Transactions to create. +body = ynab.SaveTransactionsWrapper() # SaveTransactionsWrapper | The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) try: - # Bulk create transactions - api_response = api_instance.bulk_create_transactions(budget_id, transactions) + # Create a single transaction or multiple transactions + api_response = api_instance.create_transaction(body, budget_id) pprint(api_response) except ApiException as e: - print("Exception when calling TransactionsApi->bulk_create_transactions: %s\n" % e) + print("Exception when calling TransactionsApi->create_transaction: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **transactions** | [**BulkTransactions**](BulkTransactions.md)| The list of Transactions to create. | + **body** | [**SaveTransactionsWrapper**](SaveTransactionsWrapper.md)| The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | ### Return type -[**BulkResponse**](BulkResponse.md) +[**SaveTransactionsResponse**](SaveTransactionsResponse.md) ### Authorization @@ -65,17 +64,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_transaction** -> TransactionResponse create_transaction(budget_id, transaction) +# **get_transaction_by_id** +> TransactionResponse get_transaction_by_id(budget_id, transaction_id) -Create new transaction +Single transaction -Creates a transaction +Returns a single transaction ### Example ```python @@ -93,23 +92,23 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -transaction = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The Transaction to create. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +transaction_id = 'transaction_id_example' # str | The id of the transaction try: - # Create new transaction - api_response = api_instance.create_transaction(budget_id, transaction) + # Single transaction + api_response = api_instance.get_transaction_by_id(budget_id, transaction_id) pprint(api_response) except ApiException as e: - print("Exception when calling TransactionsApi->create_transaction: %s\n" % e) + print("Exception when calling TransactionsApi->get_transaction_by_id: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **transaction** | [**SaveTransactionWrapper**](SaveTransactionWrapper.md)| The Transaction to create. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **transaction_id** | **str**| The id of the transaction | ### Return type @@ -127,7 +126,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_transactions** -> TransactionsResponse get_transactions(budget_id, since_date=since_date, type=type) +> TransactionsResponse get_transactions(budget_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) List transactions @@ -149,13 +148,14 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional) -type = 'type_example' # str | Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') (optional) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List transactions - api_response = api_instance.get_transactions(budget_id, since_date=since_date, type=type) + api_response = api_instance.get_transactions(budget_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling TransactionsApi->get_transactions: %s\n" % e) @@ -165,9 +165,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **since_date** | **date**| Only return transactions on or after this date. | [optional] - **type** | **str**| Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') | [optional] + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type @@ -185,7 +186,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_transactions_by_account** -> TransactionsResponse get_transactions_by_account(budget_id, account_id, since_date=since_date) +> TransactionsResponse get_transactions_by_account(budget_id, account_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) List account transactions @@ -207,13 +208,15 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -account_id = 'account_id_example' # str | The ID of the Account. -since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +account_id = 'account_id_example' # str | The id of the account +since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List account transactions - api_response = api_instance.get_transactions_by_account(budget_id, account_id, since_date=since_date) + api_response = api_instance.get_transactions_by_account(budget_id, account_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling TransactionsApi->get_transactions_by_account: %s\n" % e) @@ -223,9 +226,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **account_id** | [**str**](.md)| The ID of the Account. | - **since_date** | **date**| Only return transactions on or after this date. | [optional] + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **account_id** | **str**| The id of the account | + **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type @@ -243,7 +248,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_transactions_by_category** -> HybridTransactionsResponse get_transactions_by_category(budget_id, category_id, since_date=since_date) +> HybridTransactionsResponse get_transactions_by_category(budget_id, category_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) List category transactions @@ -265,13 +270,15 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -category_id = 'category_id_example' # str | The ID of the Category. -since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional) +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +category_id = 'category_id_example' # str | The id of the category +since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: # List category transactions - api_response = api_instance.get_transactions_by_category(budget_id, category_id, since_date=since_date) + api_response = api_instance.get_transactions_by_category(budget_id, category_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling TransactionsApi->get_transactions_by_category: %s\n" % e) @@ -281,9 +288,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **category_id** | [**str**](.md)| The ID of the Category. | - **since_date** | **date**| Only return transactions on or after this date. | [optional] + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **category_id** | **str**| The id of the category | + **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type @@ -300,12 +309,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_transactions_by_id** -> TransactionResponse get_transactions_by_id(budget_id, transaction_id) +# **get_transactions_by_payee** +> HybridTransactionsResponse get_transactions_by_payee(budget_id, payee_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -Single transaction +List payee transactions -Returns a single transaction +Returns all transactions for a specified payee ### Example ```python @@ -323,27 +332,33 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -transaction_id = 'transaction_id_example' # str | The ID of the Transaction. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +payee_id = 'payee_id_example' # str | The id of the payee +since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) try: - # Single transaction - api_response = api_instance.get_transactions_by_id(budget_id, transaction_id) + # List payee transactions + api_response = api_instance.get_transactions_by_payee(budget_id, payee_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: - print("Exception when calling TransactionsApi->get_transactions_by_id: %s\n" % e) + print("Exception when calling TransactionsApi->get_transactions_by_payee: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **transaction_id** | [**str**](.md)| The ID of the Transaction. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **payee_id** | **str**| The id of the payee | + **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] ### Return type -[**TransactionResponse**](TransactionResponse.md) +[**HybridTransactionsResponse**](HybridTransactionsResponse.md) ### Authorization @@ -356,12 +371,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_transactions_by_payee** -> HybridTransactionsResponse get_transactions_by_payee(budget_id, payee_id, since_date=since_date) +# **update_transaction** +> TransactionResponse update_transaction(body, budget_id, transaction_id) -List payee transactions +Updates an existing transaction -Returns all transactions for a specified payee +Updates a transaction ### Example ```python @@ -379,29 +394,29 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -payee_id = 'payee_id_example' # str | The ID of the Payee. -since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional) +body = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The transaction to update +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +transaction_id = 'transaction_id_example' # str | The id of the transaction try: - # List payee transactions - api_response = api_instance.get_transactions_by_payee(budget_id, payee_id, since_date=since_date) + # Updates an existing transaction + api_response = api_instance.update_transaction(body, budget_id, transaction_id) pprint(api_response) except ApiException as e: - print("Exception when calling TransactionsApi->get_transactions_by_payee: %s\n" % e) + print("Exception when calling TransactionsApi->update_transaction: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **payee_id** | [**str**](.md)| The ID of the Payee. | - **since_date** | **date**| Only return transactions on or after this date. | [optional] + **body** | [**SaveTransactionWrapper**](SaveTransactionWrapper.md)| The transaction to update | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **transaction_id** | **str**| The id of the transaction | ### Return type -[**HybridTransactionsResponse**](HybridTransactionsResponse.md) +[**TransactionResponse**](TransactionResponse.md) ### Authorization @@ -409,17 +424,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_transaction** -> TransactionResponse update_transaction(budget_id, transaction_id, transaction) +# **update_transactions** +> SaveTransactionsResponse update_transactions(body, budget_id) -Updates an existing transaction +Update multiple transactions -Updates a transaction +Updates multiple transactions, by 'id' or 'import_id'. ### Example ```python @@ -437,29 +452,27 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The ID of the Budget. -transaction_id = 'transaction_id_example' # str | The ID of the Transaction. -transaction = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The Transaction to update. +body = ynab.SaveTransactionsWrapper() # SaveTransactionsWrapper | The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) try: - # Updates an existing transaction - api_response = api_instance.update_transaction(budget_id, transaction_id, transaction) + # Update multiple transactions + api_response = api_instance.update_transactions(body, budget_id) pprint(api_response) except ApiException as e: - print("Exception when calling TransactionsApi->update_transaction: %s\n" % e) + print("Exception when calling TransactionsApi->update_transactions: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | [**str**](.md)| The ID of the Budget. | - **transaction_id** | [**str**](.md)| The ID of the Transaction. | - **transaction** | [**SaveTransactionWrapper**](SaveTransactionWrapper.md)| The Transaction to update. | + **body** | [**SaveTransactionsWrapper**](SaveTransactionsWrapper.md)| The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | ### Return type -[**TransactionResponse**](TransactionResponse.md) +[**SaveTransactionsResponse**](SaveTransactionsResponse.md) ### Authorization @@ -467,7 +480,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/TransactionsResponse.md b/docs/TransactionsResponse.md index 8715a41..620297f 100644 --- a/docs/TransactionsResponse.md +++ b/docs/TransactionsResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionsWrapper.md b/docs/TransactionsWrapper.md index b5fa271..f6be124 100644 --- a/docs/TransactionsWrapper.md +++ b/docs/TransactionsWrapper.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **transactions** | [**list[TransactionDetail]**](TransactionDetail.md) | | +**server_knowledge** | **int** | The knowledge of the server | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/User.md b/docs/User.md index 5d78688..31a83cb 100644 --- a/docs/User.md +++ b/docs/User.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UserApi.md b/docs/UserApi.md index 273357f..ec99f57 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -6,13 +6,12 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**get_user**](UserApi.md#get_user) | **GET** /user | User info - # **get_user** > UserResponse get_user() User info -Returns authenticated user information. +Returns authenticated user information ### Example ```python diff --git a/docs/UserResponse.md b/docs/UserResponse.md index bc2761a..2fdac58 100644 --- a/docs/UserResponse.md +++ b/docs/UserResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UserWrapper.md b/docs/UserWrapper.md index 5ffdcf7..27a4efd 100644 --- a/docs/UserWrapper.md +++ b/docs/UserWrapper.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/setup.py b/setup.py index d181ce1..0f35dda 100644 --- a/setup.py +++ b/setup.py @@ -10,11 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from setuptools import setup, find_packages # noqa: H301 NAME = "ynab-python" -VERSION = "1.0.0" +VERSION = "1.0.1" # To install the library, run the following # # python setup.py install diff --git a/swagger-codegen-python-config.json b/swagger-codegen-python-config.json new file mode 100644 index 0000000..dda429d --- /dev/null +++ b/swagger-codegen-python-config.json @@ -0,0 +1,5 @@ +{ + "packageName" : "ynab", + "projectName" : "ynab-python", + "packageVersion" : "1.0.1" +} \ No newline at end of file diff --git a/test/test_account.py b/test/test_account.py index ad5e3d3..ac290ef 100644 --- a/test/test_account.py +++ b/test/test_account.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_account_response.py b/test/test_account_response.py index 84f4a31..01e044d 100644 --- a/test/test_account_response.py +++ b/test/test_account_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_account_wrapper.py b/test/test_account_wrapper.py index e8d7a58..f1e73fa 100644 --- a/test/test_account_wrapper.py +++ b/test/test_account_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_accounts_api.py b/test/test_accounts_api.py index 9d28aba..86dd7c7 100644 --- a/test/test_accounts_api.py +++ b/test/test_accounts_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.accounts_api import AccountsApi # noqa: E501 +from ynab.api.accounts_api import AccountsApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestAccountsApi(unittest.TestCase): """AccountsApi unit test stubs""" def setUp(self): - self.api = ynab.accounts_api.AccountsApi() # noqa: E501 + self.api = ynab.api.accounts_api.AccountsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_accounts_response.py b/test/test_accounts_response.py index 351a358..c23a0a3 100644 --- a/test/test_accounts_response.py +++ b/test/test_accounts_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_accounts_wrapper.py b/test/test_accounts_wrapper.py index 01cb010..f69ab68 100644 --- a/test/test_accounts_wrapper.py +++ b/test/test_accounts_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_detail.py b/test/test_budget_detail.py index 62c3755..e29fedd 100644 --- a/test/test_budget_detail.py +++ b/test/test_budget_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_detail_response.py b/test/test_budget_detail_response.py index 150eb15..1e34e38 100644 --- a/test/test_budget_detail_response.py +++ b/test/test_budget_detail_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_detail_wrapper.py b/test/test_budget_detail_wrapper.py index fbb16e9..eb212fd 100644 --- a/test/test_budget_detail_wrapper.py +++ b/test/test_budget_detail_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_summary.py b/test/test_budget_summary.py index 3ae3a8e..a526754 100644 --- a/test/test_budget_summary.py +++ b/test/test_budget_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_summary_response.py b/test/test_budget_summary_response.py index 18c644b..d304776 100644 --- a/test/test_budget_summary_response.py +++ b/test/test_budget_summary_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budget_summary_wrapper.py b/test/test_budget_summary_wrapper.py index 258a7fc..c0c7eeb 100644 --- a/test/test_budget_summary_wrapper.py +++ b/test/test_budget_summary_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_budgets_api.py b/test/test_budgets_api.py index 4630359..a606b67 100644 --- a/test/test_budgets_api.py +++ b/test/test_budgets_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.budgets_api import BudgetsApi # noqa: E501 +from ynab.api.budgets_api import BudgetsApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestBudgetsApi(unittest.TestCase): """BudgetsApi unit test stubs""" def setUp(self): - self.api = ynab.budgets_api.BudgetsApi() # noqa: E501 + self.api = ynab.api.budgets_api.BudgetsApi() # noqa: E501 def tearDown(self): pass @@ -36,6 +35,13 @@ def test_get_budget_by_id(self): """ pass + def test_get_budget_settings_by_id(self): + """Test case for get_budget_settings_by_id + + Budget Settings # noqa: E501 + """ + pass + def test_get_budgets(self): """Test case for get_budgets diff --git a/test/test_bulk_id_wrapper.py b/test/test_bulk_id_wrapper.py index 0279ba4..e3b6ba8 100644 --- a/test/test_bulk_id_wrapper.py +++ b/test/test_bulk_id_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_bulk_ids.py b/test/test_bulk_ids.py index cd6cb07..bd5ecd0 100644 --- a/test/test_bulk_ids.py +++ b/test/test_bulk_ids.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_bulk_response.py b/test/test_bulk_response.py index 3aeece4..f32d981 100644 --- a/test/test_bulk_response.py +++ b/test/test_bulk_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_bulk_transactions.py b/test/test_bulk_transactions.py index 76b088d..caf39d1 100644 --- a/test/test_bulk_transactions.py +++ b/test/test_bulk_transactions.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_categories_api.py b/test/test_categories_api.py index 4a0c7db..fd36bdc 100644 --- a/test/test_categories_api.py +++ b/test/test_categories_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.categories_api import CategoriesApi # noqa: E501 +from ynab.api.categories_api import CategoriesApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestCategoriesApi(unittest.TestCase): """CategoriesApi unit test stubs""" def setUp(self): - self.api = ynab.categories_api.CategoriesApi() # noqa: E501 + self.api = ynab.api.categories_api.CategoriesApi() # noqa: E501 def tearDown(self): pass @@ -43,6 +42,20 @@ def test_get_category_by_id(self): """ pass + def test_get_month_category_by_id(self): + """Test case for get_month_category_by_id + + Single category for a specific budget month # noqa: E501 + """ + pass + + def test_update_month_category(self): + """Test case for update_month_category + + Update a category for a specific month # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/test/test_categories_response.py b/test/test_categories_response.py index 5b8f433..5826dff 100644 --- a/test/test_categories_response.py +++ b/test/test_categories_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category.py b/test/test_category.py index c8b5ff5..f2b83cc 100644 --- a/test/test_category.py +++ b/test/test_category.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category_group.py b/test/test_category_group.py index ebb038c..ab58339 100644 --- a/test/test_category_group.py +++ b/test/test_category_group.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category_group_with_categories.py b/test/test_category_group_with_categories.py index bd63726..d7df06c 100644 --- a/test/test_category_group_with_categories.py +++ b/test/test_category_group_with_categories.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category_groups_wrapper.py b/test/test_category_groups_wrapper.py index 4cc25b9..ff4f523 100644 --- a/test/test_category_groups_wrapper.py +++ b/test/test_category_groups_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category_response.py b/test/test_category_response.py index 09386c8..164bdd0 100644 --- a/test/test_category_response.py +++ b/test/test_category_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_category_wrapper.py b/test/test_category_wrapper.py index 8ef57c7..18eda49 100644 --- a/test/test_category_wrapper.py +++ b/test/test_category_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_currency_format.py b/test/test_currency_format.py index d64300e..e6431fb 100644 --- a/test/test_currency_format.py +++ b/test/test_currency_format.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_date_format.py b/test/test_date_format.py index 5f072cd..35638d6 100644 --- a/test/test_date_format.py +++ b/test/test_date_format.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_error_detail.py b/test/test_error_detail.py index 4aeada4..1fcc27c 100644 --- a/test/test_error_detail.py +++ b/test/test_error_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_error_response.py b/test/test_error_response.py index b755fc9..6c40f2b 100644 --- a/test/test_error_response.py +++ b/test/test_error_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_hybrid_transaction.py b/test/test_hybrid_transaction.py index 5f8ec57..58c8eb2 100644 --- a/test/test_hybrid_transaction.py +++ b/test/test_hybrid_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_hybrid_transactions_response.py b/test/test_hybrid_transactions_response.py index 9ffda0e..e6954c7 100644 --- a/test/test_hybrid_transactions_response.py +++ b/test/test_hybrid_transactions_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_hybrid_transactions_wrapper.py b/test/test_hybrid_transactions_wrapper.py index 5488cee..0336a37 100644 --- a/test/test_hybrid_transactions_wrapper.py +++ b/test/test_hybrid_transactions_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_detail.py b/test/test_month_detail.py index a643ee4..772e140 100644 --- a/test/test_month_detail.py +++ b/test/test_month_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_detail_response.py b/test/test_month_detail_response.py index c49f279..982a535 100644 --- a/test/test_month_detail_response.py +++ b/test/test_month_detail_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_detail_wrapper.py b/test/test_month_detail_wrapper.py index e782a94..072ee06 100644 --- a/test/test_month_detail_wrapper.py +++ b/test/test_month_detail_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_summaries_response.py b/test/test_month_summaries_response.py index 36b0588..9e2b2fe 100644 --- a/test/test_month_summaries_response.py +++ b/test/test_month_summaries_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_summaries_wrapper.py b/test/test_month_summaries_wrapper.py index 2b6d97d..8f4db0f 100644 --- a/test/test_month_summaries_wrapper.py +++ b/test/test_month_summaries_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_month_summary.py b/test/test_month_summary.py index 98f3260..383ab08 100644 --- a/test/test_month_summary.py +++ b/test/test_month_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_months_api.py b/test/test_months_api.py index 37dec3a..85a5e82 100644 --- a/test/test_months_api.py +++ b/test/test_months_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.months_api import MonthsApi # noqa: E501 +from ynab.api.months_api import MonthsApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestMonthsApi(unittest.TestCase): """MonthsApi unit test stubs""" def setUp(self): - self.api = ynab.months_api.MonthsApi() # noqa: E501 + self.api = ynab.api.months_api.MonthsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payee.py b/test/test_payee.py index 7040391..54e0477 100644 --- a/test/test_payee.py +++ b/test/test_payee.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_location.py b/test/test_payee_location.py index bf4a6c2..f4406b8 100644 --- a/test/test_payee_location.py +++ b/test/test_payee_location.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_location_response.py b/test/test_payee_location_response.py index df71fba..2e7408d 100644 --- a/test/test_payee_location_response.py +++ b/test/test_payee_location_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_location_wrapper.py b/test/test_payee_location_wrapper.py index 75d4b3c..31a7302 100644 --- a/test/test_payee_location_wrapper.py +++ b/test/test_payee_location_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_locations_api.py b/test/test_payee_locations_api.py index 5d92fdb..aa2b3b9 100644 --- a/test/test_payee_locations_api.py +++ b/test/test_payee_locations_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.payee_locations_api import PayeeLocationsApi # noqa: E501 +from ynab.api.payee_locations_api import PayeeLocationsApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestPayeeLocationsApi(unittest.TestCase): """PayeeLocationsApi unit test stubs""" def setUp(self): - self.api = ynab.payee_locations_api.PayeeLocationsApi() # noqa: E501 + self.api = ynab.api.payee_locations_api.PayeeLocationsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payee_locations_response.py b/test/test_payee_locations_response.py index 1fce984..6e60e1f 100644 --- a/test/test_payee_locations_response.py +++ b/test/test_payee_locations_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_locations_wrapper.py b/test/test_payee_locations_wrapper.py index 9e46ffe..d6cff0e 100644 --- a/test/test_payee_locations_wrapper.py +++ b/test/test_payee_locations_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_response.py b/test/test_payee_response.py index 4744d0b..2ee77b1 100644 --- a/test/test_payee_response.py +++ b/test/test_payee_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payee_wrapper.py b/test/test_payee_wrapper.py index 98461a7..05da610 100644 --- a/test/test_payee_wrapper.py +++ b/test/test_payee_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payees_api.py b/test/test_payees_api.py index 48d1912..422296f 100644 --- a/test/test_payees_api.py +++ b/test/test_payees_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.payees_api import PayeesApi # noqa: E501 +from ynab.api.payees_api import PayeesApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestPayeesApi(unittest.TestCase): """PayeesApi unit test stubs""" def setUp(self): - self.api = ynab.payees_api.PayeesApi() # noqa: E501 + self.api = ynab.api.payees_api.PayeesApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payees_response.py b/test/test_payees_response.py index db05f21..272395c 100644 --- a/test/test_payees_response.py +++ b/test/test_payees_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_payees_wrapper.py b/test/test_payees_wrapper.py index eca578a..fd54e5d 100644 --- a/test/test_payees_wrapper.py +++ b/test/test_payees_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_save_transaction.py b/test/test_save_transaction.py index 19fa9b6..d0f1e4e 100644 --- a/test/test_save_transaction.py +++ b/test/test_save_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_save_transaction_wrapper.py b/test/test_save_transaction_wrapper.py index e315fe1..6882257 100644 --- a/test/test_save_transaction_wrapper.py +++ b/test/test_save_transaction_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_sub_transaction.py b/test/test_scheduled_sub_transaction.py index ec7d018..773fbe7 100644 --- a/test/test_scheduled_sub_transaction.py +++ b/test/test_scheduled_sub_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transaction_detail.py b/test/test_scheduled_transaction_detail.py index df49f50..40f9e2d 100644 --- a/test/test_scheduled_transaction_detail.py +++ b/test/test_scheduled_transaction_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transaction_response.py b/test/test_scheduled_transaction_response.py index a8a71a2..839e258 100644 --- a/test/test_scheduled_transaction_response.py +++ b/test/test_scheduled_transaction_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transaction_summary.py b/test/test_scheduled_transaction_summary.py index d8d19dc..5497741 100644 --- a/test/test_scheduled_transaction_summary.py +++ b/test/test_scheduled_transaction_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transaction_wrapper.py b/test/test_scheduled_transaction_wrapper.py index 204b6f6..63ab589 100644 --- a/test/test_scheduled_transaction_wrapper.py +++ b/test/test_scheduled_transaction_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transactions_api.py b/test/test_scheduled_transactions_api.py index 933f0f3..808f8a5 100644 --- a/test/test_scheduled_transactions_api.py +++ b/test/test_scheduled_transactions_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.scheduled_transactions_api import ScheduledTransactionsApi # noqa: E501 +from ynab.api.scheduled_transactions_api import ScheduledTransactionsApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestScheduledTransactionsApi(unittest.TestCase): """ScheduledTransactionsApi unit test stubs""" def setUp(self): - self.api = ynab.scheduled_transactions_api.ScheduledTransactionsApi() # noqa: E501 + self.api = ynab.api.scheduled_transactions_api.ScheduledTransactionsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_scheduled_transactions_response.py b/test/test_scheduled_transactions_response.py index c3339eb..b220927 100644 --- a/test/test_scheduled_transactions_response.py +++ b/test/test_scheduled_transactions_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_scheduled_transactions_wrapper.py b/test/test_scheduled_transactions_wrapper.py index 85e0a76..843076c 100644 --- a/test/test_scheduled_transactions_wrapper.py +++ b/test/test_scheduled_transactions_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_sub_transaction.py b/test/test_sub_transaction.py index 12fc443..5f6590a 100644 --- a/test/test_sub_transaction.py +++ b/test/test_sub_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transaction_detail.py b/test/test_transaction_detail.py index 0b3787d..20dd095 100644 --- a/test/test_transaction_detail.py +++ b/test/test_transaction_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transaction_response.py b/test/test_transaction_response.py index b8552ec..9a52978 100644 --- a/test/test_transaction_response.py +++ b/test/test_transaction_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transaction_summary.py b/test/test_transaction_summary.py index 43d025e..d8e3e46 100644 --- a/test/test_transaction_summary.py +++ b/test/test_transaction_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transaction_wrapper.py b/test/test_transaction_wrapper.py index c9d8163..279e3a1 100644 --- a/test/test_transaction_wrapper.py +++ b/test/test_transaction_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transactions_api.py b/test/test_transactions_api.py index 6f55789..3c201a7 100644 --- a/test/test_transactions_api.py +++ b/test/test_transactions_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.transactions_api import TransactionsApi # noqa: E501 +from ynab.api.transactions_api import TransactionsApi # noqa: E501 from ynab.rest import ApiException @@ -24,22 +23,22 @@ class TestTransactionsApi(unittest.TestCase): """TransactionsApi unit test stubs""" def setUp(self): - self.api = ynab.transactions_api.TransactionsApi() # noqa: E501 + self.api = ynab.api.transactions_api.TransactionsApi() # noqa: E501 def tearDown(self): pass - def test_bulk_create_transactions(self): - """Test case for bulk_create_transactions + def test_create_transaction(self): + """Test case for create_transaction - Bulk create transactions # noqa: E501 + Create a single transaction or multiple transactions # noqa: E501 """ pass - def test_create_transaction(self): - """Test case for create_transaction + def test_get_transaction_by_id(self): + """Test case for get_transaction_by_id - Create new transaction # noqa: E501 + Single transaction # noqa: E501 """ pass @@ -64,13 +63,6 @@ def test_get_transactions_by_category(self): """ pass - def test_get_transactions_by_id(self): - """Test case for get_transactions_by_id - - Single transaction # noqa: E501 - """ - pass - def test_get_transactions_by_payee(self): """Test case for get_transactions_by_payee @@ -85,6 +77,13 @@ def test_update_transaction(self): """ pass + def test_update_transactions(self): + """Test case for update_transactions + + Update multiple transactions # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/test/test_transactions_response.py b/test/test_transactions_response.py index aff971e..980f045 100644 --- a/test/test_transactions_response.py +++ b/test/test_transactions_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_transactions_wrapper.py b/test/test_transactions_wrapper.py index f5540b8..180b7a6 100644 --- a/test/test_transactions_wrapper.py +++ b/test/test_transactions_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_user.py b/test/test_user.py index adf5f0a..83b3fa9 100644 --- a/test/test_user.py +++ b/test/test_user.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_user_api.py b/test/test_user_api.py index 179abaf..d9f0718 100644 --- a/test/test_user_api.py +++ b/test/test_user_api.py @@ -10,13 +10,12 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest import ynab -from ynab.user_api import UserApi # noqa: E501 +from ynab.api.user_api import UserApi # noqa: E501 from ynab.rest import ApiException @@ -24,7 +23,7 @@ class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" def setUp(self): - self.api = ynab.user_api.UserApi() # noqa: E501 + self.api = ynab.api.user_api.UserApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_user_response.py b/test/test_user_response.py index c893330..5ebcef5 100644 --- a/test/test_user_response.py +++ b/test/test_user_response.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/test/test_user_wrapper.py b/test/test_user_wrapper.py index 2fba080..0da7618 100644 --- a/test/test_user_wrapper.py +++ b/test/test_user_wrapper.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/tox.ini b/tox.ini index 1cf0829..3d0be61 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = py27, py3 [testenv] deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - + commands= nosetests \ - [] \ No newline at end of file + [] diff --git a/ynab/__init__.py b/ynab/__init__.py index 602b62a..08ea5ee 100644 --- a/ynab/__init__.py +++ b/ynab/__init__.py @@ -12,20 +12,19 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import apis into sdk package -from ynab.ynab.accounts_api import AccountsApi -from ynab.ynab.budgets_api import BudgetsApi -from ynab.ynab.categories_api import CategoriesApi -from ynab.ynab.months_api import MonthsApi -from ynab.ynab.payee_locations_api import PayeeLocationsApi -from ynab.ynab.payees_api import PayeesApi -from ynab.ynab.scheduled_transactions_api import ScheduledTransactionsApi -from ynab.ynab.transactions_api import TransactionsApi -from ynab.ynab.user_api import UserApi - +from ynab.api.accounts_api import AccountsApi +from ynab.api.budgets_api import BudgetsApi +from ynab.api.categories_api import CategoriesApi +from ynab.api.deprecated_api import DeprecatedApi +from ynab.api.months_api import MonthsApi +from ynab.api.payee_locations_api import PayeeLocationsApi +from ynab.api.payees_api import PayeesApi +from ynab.api.scheduled_transactions_api import ScheduledTransactionsApi +from ynab.api.transactions_api import TransactionsApi +from ynab.api.user_api import UserApi # import ApiClient from ynab.api_client import ApiClient from ynab.configuration import Configuration @@ -35,8 +34,12 @@ from ynab.models.account_wrapper import AccountWrapper from ynab.models.accounts_response import AccountsResponse from ynab.models.accounts_wrapper import AccountsWrapper +from ynab.models.budget_detail import BudgetDetail from ynab.models.budget_detail_response import BudgetDetailResponse from ynab.models.budget_detail_wrapper import BudgetDetailWrapper +from ynab.models.budget_settings import BudgetSettings +from ynab.models.budget_settings_response import BudgetSettingsResponse +from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper from ynab.models.budget_summary import BudgetSummary from ynab.models.budget_summary_response import BudgetSummaryResponse from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper @@ -47,6 +50,7 @@ from ynab.models.categories_response import CategoriesResponse from ynab.models.category import Category from ynab.models.category_group import CategoryGroup +from ynab.models.category_group_with_categories import CategoryGroupWithCategories from ynab.models.category_groups_wrapper import CategoryGroupsWrapper from ynab.models.category_response import CategoryResponse from ynab.models.category_wrapper import CategoryWrapper @@ -54,8 +58,10 @@ from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse +from ynab.models.hybrid_transaction import HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper +from ynab.models.month_detail import MonthDetail from ynab.models.month_detail_response import MonthDetailResponse from ynab.models.month_detail_wrapper import MonthDetailWrapper from ynab.models.month_summaries_response import MonthSummariesResponse @@ -71,15 +77,21 @@ from ynab.models.payee_wrapper import PayeeWrapper from ynab.models.payees_response import PayeesResponse from ynab.models.payees_wrapper import PayeesWrapper +from ynab.models.save_month_category import SaveMonthCategory +from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper from ynab.models.save_transaction import SaveTransaction from ynab.models.save_transaction_wrapper import SaveTransactionWrapper +from ynab.models.save_transactions_response import SaveTransactionsResponse +from ynab.models.save_transactions_wrapper import SaveTransactionsWrapper from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction +from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail from ynab.models.scheduled_transaction_response import ScheduledTransactionResponse from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper from ynab.models.scheduled_transactions_response import ScheduledTransactionsResponse from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper from ynab.models.sub_transaction import SubTransaction +from ynab.models.transaction_detail import TransactionDetail from ynab.models.transaction_response import TransactionResponse from ynab.models.transaction_summary import TransactionSummary from ynab.models.transaction_wrapper import TransactionWrapper @@ -88,9 +100,3 @@ from ynab.models.user import User from ynab.models.user_response import UserResponse from ynab.models.user_wrapper import UserWrapper -from ynab.models.budget_detail import BudgetDetail -from ynab.models.category_group_with_categories import CategoryGroupWithCategories -from ynab.models.hybrid_transaction import HybridTransaction -from ynab.models.month_detail import MonthDetail -from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail -from ynab.models.transaction_detail import TransactionDetail diff --git a/ynab/api_client.py b/ynab/api_client.py index bc9416d..2e2ce0e 100644 --- a/ynab/api_client.py +++ b/ynab/api_client.py @@ -5,10 +5,9 @@ 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.youneedabudget.com # noqa: E501 OpenAPI spec version: 1.0.0 - + Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import datetime @@ -73,7 +72,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/1.0.0/python' + self.user_agent = 'Swagger-Codegen/1.0.1/python' def __del__(self): self.pool.close() @@ -245,12 +244,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} @@ -274,12 +273,12 @@ def __deserialize(self, data, klass): def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, use_async=None, + response_type=None, auth_settings=None, async_req=None, _return_http_data_only=None, collection_formats=None, _preload_content=True, _request_timeout=None): """Makes the HTTP request (synchronous) and returns deserialized data. - To make an async request, set the use_async parameter. + To make an async request, set the async_req parameter. :param resource_path: Path to method endpoint. :param method: Method to call. @@ -294,7 +293,7 @@ def call_api(self, resource_path, method, :param response: Response data type. :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. - :param use_async bool: execute request asynchronously + :param async_req bool: execute request asynchronously :param _return_http_data_only: response data without head status code and headers :param collection_formats: dict of collection formats for path, query, @@ -307,13 +306,13 @@ def call_api(self, resource_path, method, timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: - If use_async parameter is True, + If async_req parameter is True, the request will be called asynchronously. The method will return the request thread. - If parameter use_async is False or missing, + If parameter async_req is False or missing, then the method will return the response directly. """ - if not use_async: + if not async_req: return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, @@ -541,7 +540,7 @@ def __deserialize_primitive(self, data, klass): try: return klass(data) except UnicodeEncodeError: - return six.u(data) + return six.text_type(data) except TypeError: return data @@ -591,6 +590,9 @@ def __deserialize_datatime(self, string): ) ) + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. @@ -599,8 +601,7 @@ def __deserialize_model(self, data, klass): :return: model object. """ - if not klass.swagger_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): return data kwargs = {} @@ -614,7 +615,13 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/ynab/configuration.py b/ynab/configuration.py index c354b07..c6e575c 100644 --- a/ynab/configuration.py +++ b/ynab/configuration.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import copy @@ -60,7 +59,6 @@ def __init__(self): self.username = "" # Password for HTTP basic authentication self.password = "" - # Logging Settings self.logger = {} self.logger["package_logger"] = logging.getLogger("ynab") @@ -231,7 +229,6 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_api_key_with_prefix('Authorization') }, - } def to_debug_report(self): @@ -243,5 +240,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ + "SDK Package Version: 1.0.1".\ format(env=sys.platform, pyversion=sys.version) diff --git a/ynab/models/__init__.py b/ynab/models/__init__.py index eff9612..dac19b8 100644 --- a/ynab/models/__init__.py +++ b/ynab/models/__init__.py @@ -11,7 +11,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import models into model package @@ -20,8 +19,12 @@ from ynab.models.account_wrapper import AccountWrapper from ynab.models.accounts_response import AccountsResponse from ynab.models.accounts_wrapper import AccountsWrapper +from ynab.models.budget_detail import BudgetDetail from ynab.models.budget_detail_response import BudgetDetailResponse from ynab.models.budget_detail_wrapper import BudgetDetailWrapper +from ynab.models.budget_settings import BudgetSettings +from ynab.models.budget_settings_response import BudgetSettingsResponse +from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper from ynab.models.budget_summary import BudgetSummary from ynab.models.budget_summary_response import BudgetSummaryResponse from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper @@ -32,6 +35,7 @@ from ynab.models.categories_response import CategoriesResponse from ynab.models.category import Category from ynab.models.category_group import CategoryGroup +from ynab.models.category_group_with_categories import CategoryGroupWithCategories from ynab.models.category_groups_wrapper import CategoryGroupsWrapper from ynab.models.category_response import CategoryResponse from ynab.models.category_wrapper import CategoryWrapper @@ -39,8 +43,10 @@ from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse +from ynab.models.hybrid_transaction import HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper +from ynab.models.month_detail import MonthDetail from ynab.models.month_detail_response import MonthDetailResponse from ynab.models.month_detail_wrapper import MonthDetailWrapper from ynab.models.month_summaries_response import MonthSummariesResponse @@ -56,15 +62,21 @@ from ynab.models.payee_wrapper import PayeeWrapper from ynab.models.payees_response import PayeesResponse from ynab.models.payees_wrapper import PayeesWrapper +from ynab.models.save_month_category import SaveMonthCategory +from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper from ynab.models.save_transaction import SaveTransaction from ynab.models.save_transaction_wrapper import SaveTransactionWrapper +from ynab.models.save_transactions_response import SaveTransactionsResponse +from ynab.models.save_transactions_wrapper import SaveTransactionsWrapper from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction +from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail from ynab.models.scheduled_transaction_response import ScheduledTransactionResponse from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper from ynab.models.scheduled_transactions_response import ScheduledTransactionsResponse from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper from ynab.models.sub_transaction import SubTransaction +from ynab.models.transaction_detail import TransactionDetail from ynab.models.transaction_response import TransactionResponse from ynab.models.transaction_summary import TransactionSummary from ynab.models.transaction_wrapper import TransactionWrapper @@ -73,9 +85,3 @@ from ynab.models.user import User from ynab.models.user_response import UserResponse from ynab.models.user_wrapper import UserWrapper -from ynab.models.budget_detail import BudgetDetail -from ynab.models.category_group_with_categories import CategoryGroupWithCategories -from ynab.models.hybrid_transaction import HybridTransaction -from ynab.models.month_detail import MonthDetail -from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail -from ynab.models.transaction_detail import TransactionDetail diff --git a/ynab/models/account.py b/ynab/models/account.py index 9cc8c6c..74806a8 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class Account(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -37,9 +35,11 @@ class Account(object): 'on_budget': 'bool', 'closed': 'bool', 'note': 'str', - 'balance': 'float', - 'cleared_balance': 'float', - 'uncleared_balance': 'float' + 'balance': 'int', + 'cleared_balance': 'int', + 'uncleared_balance': 'int', + 'transfer_payee_id': 'str', + 'deleted': 'bool' } attribute_map = { @@ -51,12 +51,13 @@ class Account(object): 'note': 'note', 'balance': 'balance', 'cleared_balance': 'cleared_balance', - 'uncleared_balance': 'uncleared_balance' + 'uncleared_balance': 'uncleared_balance', + 'transfer_payee_id': 'transfer_payee_id', + 'deleted': 'deleted' } - def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, note=None, balance=None, cleared_balance=None, uncleared_balance=None): # noqa: E501 + def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, note=None, balance=None, cleared_balance=None, uncleared_balance=None, transfer_payee_id=None, deleted=None): # noqa: E501 """Account - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._type = None @@ -66,8 +67,9 @@ def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, n self._balance = None self._cleared_balance = None self._uncleared_balance = None + self._transfer_payee_id = None + self._deleted = None self.discriminator = None - self.id = id self.name = name self.type = type @@ -77,6 +79,8 @@ def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, n self.balance = balance self.cleared_balance = cleared_balance self.uncleared_balance = uncleared_balance + self.transfer_payee_id = transfer_payee_id + self.deleted = deleted @property def id(self): @@ -128,6 +132,7 @@ def name(self, name): def type(self): """Gets the type of this Account. # noqa: E501 + The type of account. Note: payPal, merchantAccount, investmentAccount, and mortgage types have been deprecated and will be removed in the future. # noqa: E501 :return: The type of this Account. # noqa: E501 :rtype: str @@ -138,13 +143,14 @@ def type(self): def type(self, type): """Sets the type of this Account. + The type of account. Note: payPal, merchantAccount, investmentAccount, and mortgage types have been deprecated and will be removed in the future. # noqa: E501 :param type: The type of this Account. # noqa: E501 :type: str """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["checking", "savings", "creditCard", "cash", "lineOfCredit", "merchantAccount", "payPal", "investmentAccount", "mortgage", "otherAsset", "otherLiability"] # noqa: E501 + allowed_values = ["checking", "savings", "cash", "creditCard", "lineOfCredit", "otherAsset", "otherLiability", "payPal", "merchantAccount", "investmentAccount", "mortgage"] # noqa: E501 if type not in allowed_values: raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 @@ -221,6 +227,9 @@ def note(self, note): :param note: The note of this Account. # noqa: E501 :type: str """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note @property @@ -230,7 +239,7 @@ def balance(self): The current balance of the account in milliunits format # noqa: E501 :return: The balance of this Account. # noqa: E501 - :rtype: float + :rtype: int """ return self._balance @@ -241,7 +250,7 @@ def balance(self, balance): The current balance of the account in milliunits format # noqa: E501 :param balance: The balance of this Account. # noqa: E501 - :type: float + :type: int """ if balance is None: raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 @@ -255,7 +264,7 @@ def cleared_balance(self): The current cleared balance of the account in milliunits format # noqa: E501 :return: The cleared_balance of this Account. # noqa: E501 - :rtype: float + :rtype: int """ return self._cleared_balance @@ -266,7 +275,7 @@ def cleared_balance(self, cleared_balance): The current cleared balance of the account in milliunits format # noqa: E501 :param cleared_balance: The cleared_balance of this Account. # noqa: E501 - :type: float + :type: int """ if cleared_balance is None: raise ValueError("Invalid value for `cleared_balance`, must not be `None`") # noqa: E501 @@ -280,7 +289,7 @@ def uncleared_balance(self): The current uncleared balance of the account in milliunits format # noqa: E501 :return: The uncleared_balance of this Account. # noqa: E501 - :rtype: float + :rtype: int """ return self._uncleared_balance @@ -291,13 +300,63 @@ def uncleared_balance(self, uncleared_balance): The current uncleared balance of the account in milliunits format # noqa: E501 :param uncleared_balance: The uncleared_balance of this Account. # noqa: E501 - :type: float + :type: int """ if uncleared_balance is None: raise ValueError("Invalid value for `uncleared_balance`, must not be `None`") # noqa: E501 self._uncleared_balance = uncleared_balance + @property + def transfer_payee_id(self): + """Gets the transfer_payee_id of this Account. # noqa: E501 + + The payee id which should be used when transferring to this account # noqa: E501 + + :return: The transfer_payee_id of this Account. # noqa: E501 + :rtype: str + """ + return self._transfer_payee_id + + @transfer_payee_id.setter + def transfer_payee_id(self, transfer_payee_id): + """Sets the transfer_payee_id of this Account. + + The payee id which should be used when transferring to this account # noqa: E501 + + :param transfer_payee_id: The transfer_payee_id of this Account. # noqa: E501 + :type: str + """ + if transfer_payee_id is None: + raise ValueError("Invalid value for `transfer_payee_id`, must not be `None`") # noqa: E501 + + self._transfer_payee_id = transfer_payee_id + + @property + def deleted(self): + """Gets the deleted of this Account. # noqa: E501 + + Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. # noqa: E501 + + :return: The deleted of this Account. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this Account. + + Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this Account. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -319,6 +378,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Account, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 7fdb5cb..120131d 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.account_wrapper import AccountWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class AccountResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class AccountResponse(object): def __init__(self, data=None): # noqa: E501 """AccountResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AccountResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/account_wrapper.py b/ynab/models/account_wrapper.py index 796922c..2a8b46e 100644 --- a/ynab/models/account_wrapper.py +++ b/ynab/models/account_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.account import Account # noqa: F401,E501 @@ -24,7 +22,6 @@ class AccountWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class AccountWrapper(object): def __init__(self, account=None): # noqa: E501 """AccountWrapper - a model defined in Swagger""" # noqa: E501 - self._account = None self.discriminator = None - self.account = account @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AccountWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index a8e9edc..9258ec7 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.accounts_wrapper import AccountsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class AccountsResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class AccountsResponse(object): def __init__(self, data=None): # noqa: E501 """AccountsResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AccountsResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/accounts_wrapper.py b/ynab/models/accounts_wrapper.py index e6757f6..54454a8 100644 --- a/ynab/models/accounts_wrapper.py +++ b/ynab/models/accounts_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.account import Account # noqa: F401,E501 @@ -24,7 +22,6 @@ class AccountsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,20 +30,22 @@ class AccountsWrapper(object): and the value is json key in definition. """ swagger_types = { - 'accounts': 'list[Account]' + 'accounts': 'list[Account]', + 'server_knowledge': 'int' } attribute_map = { - 'accounts': 'accounts' + 'accounts': 'accounts', + 'server_knowledge': 'server_knowledge' } - def __init__(self, accounts=None): # noqa: E501 + def __init__(self, accounts=None, server_knowledge=None): # noqa: E501 """AccountsWrapper - a model defined in Swagger""" # noqa: E501 - self._accounts = None + self._server_knowledge = None self.discriminator = None - self.accounts = accounts + self.server_knowledge = server_knowledge @property def accounts(self): @@ -71,6 +70,31 @@ def accounts(self, accounts): self._accounts = accounts + @property + def server_knowledge(self): + """Gets the server_knowledge of this AccountsWrapper. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this AccountsWrapper. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this AccountsWrapper. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this AccountsWrapper. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -92,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(AccountsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_detail.py b/ynab/models/budget_detail.py index 1a558d9..0615d24 100644 --- a/ynab/models/budget_detail.py +++ b/ynab/models/budget_detail.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.account import Account # noqa: F401,E501 from ynab.models.budget_summary import BudgetSummary # noqa: F401,E501 from ynab.models.category import Category # noqa: F401,E501 @@ -31,12 +29,11 @@ from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 -class BudgetDetail(object): +class BudgetDetail(BudgetSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -45,11 +42,6 @@ class BudgetDetail(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'name': 'str', - 'last_modified_on': 'datetime', - 'date_format': 'DateFormat', - 'currency_format': 'CurrencyFormat', 'accounts': 'list[Account]', 'payees': 'list[Payee]', 'payee_locations': 'list[PayeeLocation]', @@ -63,11 +55,6 @@ class BudgetDetail(object): } attribute_map = { - 'id': 'id', - 'name': 'name', - 'last_modified_on': 'last_modified_on', - 'date_format': 'date_format', - 'currency_format': 'currency_format', 'accounts': 'accounts', 'payees': 'payees', 'payee_locations': 'payee_locations', @@ -80,14 +67,8 @@ class BudgetDetail(object): 'scheduled_subtransactions': 'scheduled_subtransactions' } - def __init__(self, id=None, name=None, last_modified_on=None, date_format=None, currency_format=None, accounts=None, payees=None, payee_locations=None, category_groups=None, categories=None, months=None, transactions=None, subtransactions=None, scheduled_transactions=None, scheduled_subtransactions=None): # noqa: E501 + def __init__(self, accounts=None, payees=None, payee_locations=None, category_groups=None, categories=None, months=None, transactions=None, subtransactions=None, scheduled_transactions=None, scheduled_subtransactions=None): # noqa: E501 """BudgetDetail - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._name = None - self._last_modified_on = None - self._date_format = None - self._currency_format = None self._accounts = None self._payees = None self._payee_locations = None @@ -99,15 +80,6 @@ def __init__(self, id=None, name=None, last_modified_on=None, date_format=None, self._scheduled_transactions = None self._scheduled_subtransactions = None self.discriminator = None - - self.id = id - self.name = name - if last_modified_on is not None: - self.last_modified_on = last_modified_on - if date_format is not None: - self.date_format = date_format - if currency_format is not None: - self.currency_format = currency_format if accounts is not None: self.accounts = accounts if payees is not None: @@ -129,117 +101,6 @@ def __init__(self, id=None, name=None, last_modified_on=None, date_format=None, if scheduled_subtransactions is not None: self.scheduled_subtransactions = scheduled_subtransactions - @property - def id(self): - """Gets the id of this BudgetDetail. # noqa: E501 - - - :return: The id of this BudgetDetail. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this BudgetDetail. - - - :param id: The id of this BudgetDetail. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def name(self): - """Gets the name of this BudgetDetail. # noqa: E501 - - - :return: The name of this BudgetDetail. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this BudgetDetail. - - - :param name: The name of this BudgetDetail. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def last_modified_on(self): - """Gets the last_modified_on of this BudgetDetail. # noqa: E501 - - The last time any changes were made to the budget from either a web or mobile client. # noqa: E501 - - :return: The last_modified_on of this BudgetDetail. # noqa: E501 - :rtype: datetime - """ - return self._last_modified_on - - @last_modified_on.setter - def last_modified_on(self, last_modified_on): - """Sets the last_modified_on of this BudgetDetail. - - The last time any changes were made to the budget from either a web or mobile client. # noqa: E501 - - :param last_modified_on: The last_modified_on of this BudgetDetail. # noqa: E501 - :type: datetime - """ - - self._last_modified_on = last_modified_on - - @property - def date_format(self): - """Gets the date_format of this BudgetDetail. # noqa: E501 - - - :return: The date_format of this BudgetDetail. # noqa: E501 - :rtype: DateFormat - """ - return self._date_format - - @date_format.setter - def date_format(self, date_format): - """Sets the date_format of this BudgetDetail. - - - :param date_format: The date_format of this BudgetDetail. # noqa: E501 - :type: DateFormat - """ - - self._date_format = date_format - - @property - def currency_format(self): - """Gets the currency_format of this BudgetDetail. # noqa: E501 - - - :return: The currency_format of this BudgetDetail. # noqa: E501 - :rtype: CurrencyFormat - """ - return self._currency_format - - @currency_format.setter - def currency_format(self, currency_format): - """Sets the currency_format of this BudgetDetail. - - - :param currency_format: The currency_format of this BudgetDetail. # noqa: E501 - :type: CurrencyFormat - """ - - self._currency_format = currency_format - @property def accounts(self): """Gets the accounts of this BudgetDetail. # noqa: E501 @@ -471,6 +332,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetDetail, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index f020f1f..1e9b5b6 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.budget_detail_wrapper import BudgetDetailWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class BudgetDetailResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BudgetDetailResponse(object): def __init__(self, data=None): # noqa: E501 """BudgetDetailResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetDetailResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_detail_wrapper.py b/ynab/models/budget_detail_wrapper.py index b5e1f75..349d5b9 100644 --- a/ynab/models/budget_detail_wrapper.py +++ b/ynab/models/budget_detail_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.budget_detail import BudgetDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class BudgetDetailWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,7 +31,7 @@ class BudgetDetailWrapper(object): """ swagger_types = { 'budget': 'BudgetDetail', - 'server_knowledge': 'float' + 'server_knowledge': 'int' } attribute_map = { @@ -44,11 +41,9 @@ class BudgetDetailWrapper(object): def __init__(self, budget=None, server_knowledge=None): # noqa: E501 """BudgetDetailWrapper - a model defined in Swagger""" # noqa: E501 - self._budget = None self._server_knowledge = None self.discriminator = None - self.budget = budget self.server_knowledge = server_knowledge @@ -82,7 +77,7 @@ def server_knowledge(self): The knowledge of the server # noqa: E501 :return: The server_knowledge of this BudgetDetailWrapper. # noqa: E501 - :rtype: float + :rtype: int """ return self._server_knowledge @@ -93,7 +88,7 @@ def server_knowledge(self, server_knowledge): The knowledge of the server # noqa: E501 :param server_knowledge: The server_knowledge of this BudgetDetailWrapper. # noqa: E501 - :type: float + :type: int """ if server_knowledge is None: raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 @@ -121,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetDetailWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index 9adb640..d18f584 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 from ynab.models.date_format import DateFormat # noqa: F401,E501 @@ -25,7 +23,6 @@ class BudgetSummary(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -37,6 +34,8 @@ class BudgetSummary(object): 'id': 'str', 'name': 'str', 'last_modified_on': 'datetime', + 'first_month': 'date', + 'last_month': 'date', 'date_format': 'DateFormat', 'currency_format': 'CurrencyFormat' } @@ -45,24 +44,30 @@ class BudgetSummary(object): 'id': 'id', 'name': 'name', 'last_modified_on': 'last_modified_on', + 'first_month': 'first_month', + 'last_month': 'last_month', 'date_format': 'date_format', 'currency_format': 'currency_format' } - def __init__(self, id=None, name=None, last_modified_on=None, date_format=None, currency_format=None): # noqa: E501 + def __init__(self, id=None, name=None, last_modified_on=None, first_month=None, last_month=None, date_format=None, currency_format=None): # noqa: E501 """BudgetSummary - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._last_modified_on = None + self._first_month = None + self._last_month = None self._date_format = None self._currency_format = None self.discriminator = None - self.id = id self.name = name if last_modified_on is not None: self.last_modified_on = last_modified_on + if first_month is not None: + self.first_month = first_month + if last_month is not None: + self.last_month = last_month if date_format is not None: self.date_format = date_format if currency_format is not None: @@ -137,6 +142,52 @@ def last_modified_on(self, last_modified_on): self._last_modified_on = last_modified_on + @property + def first_month(self): + """Gets the first_month of this BudgetSummary. # noqa: E501 + + The earliest budget month. # noqa: E501 + + :return: The first_month of this BudgetSummary. # noqa: E501 + :rtype: date + """ + return self._first_month + + @first_month.setter + def first_month(self, first_month): + """Sets the first_month of this BudgetSummary. + + The earliest budget month. # noqa: E501 + + :param first_month: The first_month of this BudgetSummary. # noqa: E501 + :type: date + """ + + self._first_month = first_month + + @property + def last_month(self): + """Gets the last_month of this BudgetSummary. # noqa: E501 + + The latest budget month. # noqa: E501 + + :return: The last_month of this BudgetSummary. # noqa: E501 + :rtype: date + """ + return self._last_month + + @last_month.setter + def last_month(self, last_month): + """Sets the last_month of this BudgetSummary. + + The latest budget month. # noqa: E501 + + :param last_month: The last_month of this BudgetSummary. # noqa: E501 + :type: date + """ + + self._last_month = last_month + @property def date_format(self): """Gets the date_format of this BudgetSummary. # noqa: E501 @@ -200,6 +251,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetSummary, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index bedb0ae..75b6940 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class BudgetSummaryResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BudgetSummaryResponse(object): def __init__(self, data=None): # noqa: E501 """BudgetSummaryResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetSummaryResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/budget_summary_wrapper.py b/ynab/models/budget_summary_wrapper.py index a45abdc..a0e1aa6 100644 --- a/ynab/models/budget_summary_wrapper.py +++ b/ynab/models/budget_summary_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.budget_summary import BudgetSummary # noqa: F401,E501 @@ -24,7 +22,6 @@ class BudgetSummaryWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BudgetSummaryWrapper(object): def __init__(self, budgets=None): # noqa: E501 """BudgetSummaryWrapper - a model defined in Swagger""" # noqa: E501 - self._budgets = None self.discriminator = None - self.budgets = budgets @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BudgetSummaryWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/bulk_id_wrapper.py b/ynab/models/bulk_id_wrapper.py index f8df22d..971281b 100644 --- a/ynab/models/bulk_id_wrapper.py +++ b/ynab/models/bulk_id_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.bulk_ids import BulkIds # noqa: F401,E501 @@ -24,7 +22,6 @@ class BulkIdWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BulkIdWrapper(object): def __init__(self, bulk=None): # noqa: E501 """BulkIdWrapper - a model defined in Swagger""" # noqa: E501 - self._bulk = None self.discriminator = None - self.bulk = bulk @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BulkIdWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/bulk_ids.py b/ynab/models/bulk_ids.py index 7c45c3d..91c6fe3 100644 --- a/ynab/models/bulk_ids.py +++ b/ynab/models/bulk_ids.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class BulkIds(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +40,9 @@ class BulkIds(object): def __init__(self, transaction_ids=None, duplicate_import_ids=None): # noqa: E501 """BulkIds - a model defined in Swagger""" # noqa: E501 - self._transaction_ids = None self._duplicate_import_ids = None self.discriminator = None - self.transaction_ids = transaction_ids self.duplicate_import_ids = duplicate_import_ids @@ -54,7 +50,7 @@ def __init__(self, transaction_ids=None, duplicate_import_ids=None): # noqa: E5 def transaction_ids(self): """Gets the transaction_ids of this BulkIds. # noqa: E501 - The list of Transaction IDs that were created. # noqa: E501 + The list of Transaction ids that were created. # noqa: E501 :return: The transaction_ids of this BulkIds. # noqa: E501 :rtype: list[str] @@ -65,7 +61,7 @@ def transaction_ids(self): def transaction_ids(self, transaction_ids): """Sets the transaction_ids of this BulkIds. - The list of Transaction IDs that were created. # noqa: E501 + The list of Transaction ids that were created. # noqa: E501 :param transaction_ids: The transaction_ids of this BulkIds. # noqa: E501 :type: list[str] @@ -121,6 +117,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BulkIds, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index eb90a05..2f3ab4a 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.bulk_id_wrapper import BulkIdWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class BulkResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BulkResponse(object): def __init__(self, data=None): # noqa: E501 """BulkResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BulkResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index c94005d..ea51532 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 @@ -24,7 +22,6 @@ class BulkTransactions(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class BulkTransactions(object): def __init__(self, transactions=None): # noqa: E501 """BulkTransactions - a model defined in Swagger""" # noqa: E501 - self._transactions = None self.discriminator = None - self.transactions = transactions @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(BulkTransactions, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 8c7ce6b..acbc7cf 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category_groups_wrapper import CategoryGroupsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class CategoriesResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class CategoriesResponse(object): def __init__(self, data=None): # noqa: E501 """CategoriesResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoriesResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category.py b/ynab/models/category.py index f9381f4..1959d33 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class Category(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -35,10 +33,17 @@ class Category(object): 'category_group_id': 'str', 'name': 'str', 'hidden': 'bool', + 'original_category_group_id': 'str', 'note': 'str', - 'budgeted': 'float', - 'activity': 'float', - 'balance': 'float' + 'budgeted': 'int', + 'activity': 'int', + 'balance': 'int', + 'goal_type': 'str', + 'goal_creation_month': 'date', + 'goal_target': 'int', + 'goal_target_month': 'date', + 'goal_percentage_complete': 'int', + 'deleted': 'bool' } attribute_map = { @@ -46,33 +51,53 @@ class Category(object): 'category_group_id': 'category_group_id', 'name': 'name', 'hidden': 'hidden', + 'original_category_group_id': 'original_category_group_id', 'note': 'note', 'budgeted': 'budgeted', 'activity': 'activity', - 'balance': 'balance' + 'balance': 'balance', + 'goal_type': 'goal_type', + 'goal_creation_month': 'goal_creation_month', + 'goal_target': 'goal_target', + 'goal_target_month': 'goal_target_month', + 'goal_percentage_complete': 'goal_percentage_complete', + 'deleted': 'deleted' } - def __init__(self, id=None, category_group_id=None, name=None, hidden=None, note=None, budgeted=None, activity=None, balance=None): # noqa: E501 + def __init__(self, id=None, category_group_id=None, name=None, hidden=None, original_category_group_id=None, note=None, budgeted=None, activity=None, balance=None, goal_type=None, goal_creation_month=None, goal_target=None, goal_target_month=None, goal_percentage_complete=None, deleted=None): # noqa: E501 """Category - a model defined in Swagger""" # noqa: E501 - self._id = None self._category_group_id = None self._name = None self._hidden = None + self._original_category_group_id = None self._note = None self._budgeted = None self._activity = None self._balance = None + self._goal_type = None + self._goal_creation_month = None + self._goal_target = None + self._goal_target_month = None + self._goal_percentage_complete = None + self._deleted = None self.discriminator = None - self.id = id self.category_group_id = category_group_id self.name = name self.hidden = hidden + if original_category_group_id is not None: + self.original_category_group_id = original_category_group_id self.note = note self.budgeted = budgeted self.activity = activity self.balance = balance + self.goal_type = goal_type + self.goal_creation_month = goal_creation_month + self.goal_target = goal_target + self.goal_target_month = goal_target_month + self.goal_percentage_complete = goal_percentage_complete + self.deleted = deleted @property def id(self): @@ -168,6 +193,29 @@ def hidden(self, hidden): self._hidden = hidden + @property + def original_category_group_id(self): + """Gets the original_category_group_id of this Category. # noqa: E501 + + If category is hidden this is the id of the category group it originally belonged to before it was hidden. # noqa: E501 + + :return: The original_category_group_id of this Category. # noqa: E501 + :rtype: str + """ + return self._original_category_group_id + + @original_category_group_id.setter + def original_category_group_id(self, original_category_group_id): + """Sets the original_category_group_id of this Category. + + If category is hidden this is the id of the category group it originally belonged to before it was hidden. # noqa: E501 + + :param original_category_group_id: The original_category_group_id of this Category. # noqa: E501 + :type: str + """ + + self._original_category_group_id = original_category_group_id + @property def note(self): """Gets the note of this Category. # noqa: E501 @@ -186,16 +234,19 @@ def note(self, note): :param note: The note of this Category. # noqa: E501 :type: str """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note @property def budgeted(self): """Gets the budgeted of this Category. # noqa: E501 - Budgeted amount in current month in milliunits format # noqa: E501 + Budgeted amount in milliunits format # noqa: E501 :return: The budgeted of this Category. # noqa: E501 - :rtype: float + :rtype: int """ return self._budgeted @@ -203,10 +254,10 @@ def budgeted(self): def budgeted(self, budgeted): """Sets the budgeted of this Category. - Budgeted amount in current month in milliunits format # noqa: E501 + Budgeted amount in milliunits format # noqa: E501 :param budgeted: The budgeted of this Category. # noqa: E501 - :type: float + :type: int """ if budgeted is None: raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 @@ -217,10 +268,10 @@ def budgeted(self, budgeted): def activity(self): """Gets the activity of this Category. # noqa: E501 - Activity amount in current month in milliunits format # noqa: E501 + Activity amount in milliunits format # noqa: E501 :return: The activity of this Category. # noqa: E501 - :rtype: float + :rtype: int """ return self._activity @@ -228,10 +279,10 @@ def activity(self): def activity(self, activity): """Sets the activity of this Category. - Activity amount in current month in milliunits format # noqa: E501 + Activity amount in milliunits format # noqa: E501 :param activity: The activity of this Category. # noqa: E501 - :type: float + :type: int """ if activity is None: raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 @@ -242,10 +293,10 @@ def activity(self, activity): def balance(self): """Gets the balance of this Category. # noqa: E501 - Balance in current month in milliunits format # noqa: E501 + Balance in milliunits format # noqa: E501 :return: The balance of this Category. # noqa: E501 - :rtype: float + :rtype: int """ return self._balance @@ -253,16 +304,172 @@ def balance(self): def balance(self, balance): """Sets the balance of this Category. - Balance in current month in milliunits format # noqa: E501 + Balance in milliunits format # noqa: E501 :param balance: The balance of this Category. # noqa: E501 - :type: float + :type: int """ if balance is None: raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 self._balance = balance + @property + def goal_type(self): + """Gets the goal_type of this Category. # noqa: E501 + + The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) # noqa: E501 + + :return: The goal_type of this Category. # noqa: E501 + :rtype: str + """ + return self._goal_type + + @goal_type.setter + def goal_type(self, goal_type): + """Sets the goal_type of this Category. + + The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) # noqa: E501 + + :param goal_type: The goal_type of this Category. # noqa: E501 + :type: str + """ + if goal_type is None: + raise ValueError("Invalid value for `goal_type`, must not be `None`") # noqa: E501 + allowed_values = ["TB", "TBD", "MF"] # noqa: E501 + if goal_type not in allowed_values: + raise ValueError( + "Invalid value for `goal_type` ({0}), must be one of {1}" # noqa: E501 + .format(goal_type, allowed_values) + ) + + self._goal_type = goal_type + + @property + def goal_creation_month(self): + """Gets the goal_creation_month of this Category. # noqa: E501 + + The month a goal was created # noqa: E501 + + :return: The goal_creation_month of this Category. # noqa: E501 + :rtype: date + """ + return self._goal_creation_month + + @goal_creation_month.setter + def goal_creation_month(self, goal_creation_month): + """Sets the goal_creation_month of this Category. + + The month a goal was created # noqa: E501 + + :param goal_creation_month: The goal_creation_month of this Category. # noqa: E501 + :type: date + """ + if goal_creation_month is None: + raise ValueError("Invalid value for `goal_creation_month`, must not be `None`") # noqa: E501 + + self._goal_creation_month = goal_creation_month + + @property + def goal_target(self): + """Gets the goal_target of this Category. # noqa: E501 + + The goal target amount in milliunits # noqa: E501 + + :return: The goal_target of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_target + + @goal_target.setter + def goal_target(self, goal_target): + """Sets the goal_target of this Category. + + The goal target amount in milliunits # noqa: E501 + + :param goal_target: The goal_target of this Category. # noqa: E501 + :type: int + """ + if goal_target is None: + raise ValueError("Invalid value for `goal_target`, must not be `None`") # noqa: E501 + + self._goal_target = goal_target + + @property + def goal_target_month(self): + """Gets the goal_target_month of this Category. # noqa: E501 + + If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed # noqa: E501 + + :return: The goal_target_month of this Category. # noqa: E501 + :rtype: date + """ + return self._goal_target_month + + @goal_target_month.setter + def goal_target_month(self, goal_target_month): + """Sets the goal_target_month of this Category. + + If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed # noqa: E501 + + :param goal_target_month: The goal_target_month of this Category. # noqa: E501 + :type: date + """ + if goal_target_month is None: + raise ValueError("Invalid value for `goal_target_month`, must not be `None`") # noqa: E501 + + self._goal_target_month = goal_target_month + + @property + def goal_percentage_complete(self): + """Gets the goal_percentage_complete of this Category. # noqa: E501 + + The percentage completion of the goal # noqa: E501 + + :return: The goal_percentage_complete of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_percentage_complete + + @goal_percentage_complete.setter + def goal_percentage_complete(self, goal_percentage_complete): + """Sets the goal_percentage_complete of this Category. + + The percentage completion of the goal # noqa: E501 + + :param goal_percentage_complete: The goal_percentage_complete of this Category. # noqa: E501 + :type: int + """ + if goal_percentage_complete is None: + raise ValueError("Invalid value for `goal_percentage_complete`, must not be `None`") # noqa: E501 + + self._goal_percentage_complete = goal_percentage_complete + + @property + def deleted(self): + """Gets the deleted of this Category. # noqa: E501 + + Whether or not the category has been deleted. Deleted categories will only be included in delta requests. # noqa: E501 + + :return: The deleted of this Category. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this Category. + + Whether or not the category has been deleted. Deleted categories will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this Category. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -284,6 +491,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Category, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index 93ffe84..00c817a 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class CategoryGroup(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,26 +31,28 @@ class CategoryGroup(object): swagger_types = { 'id': 'str', 'name': 'str', - 'hidden': 'bool' + 'hidden': 'bool', + 'deleted': 'bool' } attribute_map = { 'id': 'id', 'name': 'name', - 'hidden': 'hidden' + 'hidden': 'hidden', + 'deleted': 'deleted' } - def __init__(self, id=None, name=None, hidden=None): # noqa: E501 + def __init__(self, id=None, name=None, hidden=None, deleted=None): # noqa: E501 """CategoryGroup - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._hidden = None + self._deleted = None self.discriminator = None - self.id = id self.name = name self.hidden = hidden + self.deleted = deleted @property def id(self): @@ -125,6 +125,31 @@ def hidden(self, hidden): self._hidden = hidden + @property + def deleted(self): + """Gets the deleted of this CategoryGroup. # noqa: E501 + + Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. # noqa: E501 + + :return: The deleted of this CategoryGroup. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this CategoryGroup. + + Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this CategoryGroup. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -146,6 +171,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoryGroup, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index cc5d191..b36c8b3 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -10,22 +10,19 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category import Category # noqa: F401,E501 from ynab.models.category_group import CategoryGroup # noqa: F401,E501 -class CategoryGroupWithCategories(object): +class CategoryGroupWithCategories(CategoryGroup): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,109 +31,24 @@ class CategoryGroupWithCategories(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'name': 'str', - 'hidden': 'bool', 'categories': 'list[Category]' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'hidden': 'hidden', 'categories': 'categories' } - def __init__(self, id=None, name=None, hidden=None, categories=None): # noqa: E501 + def __init__(self, categories=None): # noqa: E501 """CategoryGroupWithCategories - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._name = None - self._hidden = None self._categories = None self.discriminator = None - - self.id = id - self.name = name - self.hidden = hidden self.categories = categories - @property - def id(self): - """Gets the id of this CategoryGroupWithCategories. # noqa: E501 - - - :return: The id of this CategoryGroupWithCategories. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CategoryGroupWithCategories. - - - :param id: The id of this CategoryGroupWithCategories. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def name(self): - """Gets the name of this CategoryGroupWithCategories. # noqa: E501 - - - :return: The name of this CategoryGroupWithCategories. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CategoryGroupWithCategories. - - - :param name: The name of this CategoryGroupWithCategories. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def hidden(self): - """Gets the hidden of this CategoryGroupWithCategories. # noqa: E501 - - Whether or not the category group is hidden # noqa: E501 - - :return: The hidden of this CategoryGroupWithCategories. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this CategoryGroupWithCategories. - - Whether or not the category group is hidden # noqa: E501 - - :param hidden: The hidden of this CategoryGroupWithCategories. # noqa: E501 - :type: bool - """ - if hidden is None: - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def categories(self): """Gets the categories of this CategoryGroupWithCategories. # noqa: E501 - Category group categories # noqa: E501 + Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 :return: The categories of this CategoryGroupWithCategories. # noqa: E501 :rtype: list[Category] @@ -147,7 +59,7 @@ def categories(self): def categories(self, categories): """Sets the categories of this CategoryGroupWithCategories. - Category group categories # noqa: E501 + Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 :param categories: The categories of this CategoryGroupWithCategories. # noqa: E501 :type: list[Category] @@ -178,6 +90,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoryGroupWithCategories, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category_groups_wrapper.py b/ynab/models/category_groups_wrapper.py index 6ed6bb5..b8d9c4f 100644 --- a/ynab/models/category_groups_wrapper.py +++ b/ynab/models/category_groups_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category_group_with_categories import CategoryGroupWithCategories # noqa: F401,E501 @@ -24,7 +22,6 @@ class CategoryGroupsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,20 +30,22 @@ class CategoryGroupsWrapper(object): and the value is json key in definition. """ swagger_types = { - 'category_groups': 'list[CategoryGroupWithCategories]' + 'category_groups': 'list[CategoryGroupWithCategories]', + 'server_knowledge': 'int' } attribute_map = { - 'category_groups': 'category_groups' + 'category_groups': 'category_groups', + 'server_knowledge': 'server_knowledge' } - def __init__(self, category_groups=None): # noqa: E501 + def __init__(self, category_groups=None, server_knowledge=None): # noqa: E501 """CategoryGroupsWrapper - a model defined in Swagger""" # noqa: E501 - self._category_groups = None + self._server_knowledge = None self.discriminator = None - self.category_groups = category_groups + self.server_knowledge = server_knowledge @property def category_groups(self): @@ -71,6 +70,31 @@ def category_groups(self, category_groups): self._category_groups = category_groups + @property + def server_knowledge(self): + """Gets the server_knowledge of this CategoryGroupsWrapper. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this CategoryGroupsWrapper. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this CategoryGroupsWrapper. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this CategoryGroupsWrapper. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -92,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoryGroupsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index bfffa81..2c0a3fb 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category_wrapper import CategoryWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class CategoryResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class CategoryResponse(object): def __init__(self, data=None): # noqa: E501 """CategoryResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoryResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/category_wrapper.py b/ynab/models/category_wrapper.py index ad0629f..52261eb 100644 --- a/ynab/models/category_wrapper.py +++ b/ynab/models/category_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category import Category # noqa: F401,E501 @@ -24,7 +22,6 @@ class CategoryWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class CategoryWrapper(object): def __init__(self, category=None): # noqa: E501 """CategoryWrapper - a model defined in Swagger""" # noqa: E501 - self._category = None self.discriminator = None - self.category = category @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CategoryWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index f9a01d2..f4ceac7 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class CurrencyFormat(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,7 +31,7 @@ class CurrencyFormat(object): swagger_types = { 'iso_code': 'str', 'example_format': 'str', - 'decimal_digits': 'float', + 'decimal_digits': 'int', 'decimal_separator': 'str', 'symbol_first': 'bool', 'group_separator': 'str', @@ -54,7 +52,6 @@ class CurrencyFormat(object): def __init__(self, iso_code=None, example_format=None, decimal_digits=None, decimal_separator=None, symbol_first=None, group_separator=None, currency_symbol=None, display_symbol=None): # noqa: E501 """CurrencyFormat - a model defined in Swagger""" # noqa: E501 - self._iso_code = None self._example_format = None self._decimal_digits = None @@ -64,7 +61,6 @@ def __init__(self, iso_code=None, example_format=None, decimal_digits=None, deci self._currency_symbol = None self._display_symbol = None self.discriminator = None - self.iso_code = iso_code self.example_format = example_format self.decimal_digits = decimal_digits @@ -126,7 +122,7 @@ def decimal_digits(self): :return: The decimal_digits of this CurrencyFormat. # noqa: E501 - :rtype: float + :rtype: int """ return self._decimal_digits @@ -136,7 +132,7 @@ def decimal_digits(self, decimal_digits): :param decimal_digits: The decimal_digits of this CurrencyFormat. # noqa: E501 - :type: float + :type: int """ if decimal_digits is None: raise ValueError("Invalid value for `decimal_digits`, must not be `None`") # noqa: E501 @@ -279,6 +275,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(CurrencyFormat, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index 966dcf5..7699851 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class DateFormat(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +38,8 @@ class DateFormat(object): def __init__(self, format=None): # noqa: E501 """DateFormat - a model defined in Swagger""" # noqa: E501 - self._format = None self.discriminator = None - self.format = format @property @@ -90,6 +86,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(DateFormat, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index 1751760..447f643 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class ErrorDetail(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +42,10 @@ class ErrorDetail(object): def __init__(self, id=None, name=None, detail=None): # noqa: E501 """ErrorDetail - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._detail = None self.discriminator = None - self.id = id self.name = name self.detail = detail @@ -144,6 +140,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ErrorDetail, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index 94a6458..3bc6b61 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.error_detail import ErrorDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class ErrorResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class ErrorResponse(object): def __init__(self, error=None): # noqa: E501 """ErrorResponse - a model defined in Swagger""" # noqa: E501 - self._error = None self.discriminator = None - self.error = error @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ErrorResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index b198820..55ce726 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -10,21 +10,18 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 -class HybridTransaction(object): +class HybridTransaction(TransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,18 +30,6 @@ class HybridTransaction(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'date': 'date', - 'amount': 'float', - 'memo': 'str', - 'cleared': 'str', - 'approved': 'bool', - 'flag_color': 'str', - 'account_id': 'str', - 'payee_id': 'str', - 'category_id': 'str', - 'transfer_account_id': 'str', - 'import_id': 'str', 'type': 'str', 'parent_transaction_id': 'str', 'account_name': 'str', @@ -53,18 +38,6 @@ class HybridTransaction(object): } attribute_map = { - 'id': 'id', - 'date': 'date', - 'amount': 'amount', - 'memo': 'memo', - 'cleared': 'cleared', - 'approved': 'approved', - 'flag_color': 'flag_color', - 'account_id': 'account_id', - 'payee_id': 'payee_id', - 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id', - 'import_id': 'import_id', 'type': 'type', 'parent_transaction_id': 'parent_transaction_id', 'account_name': 'account_name', @@ -72,344 +45,20 @@ class HybridTransaction(object): 'category_name': 'category_name' } - def __init__(self, id=None, date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, import_id=None, type=None, parent_transaction_id=None, account_name=None, payee_name=None, category_name=None): # noqa: E501 + def __init__(self, type=None, parent_transaction_id=None, account_name=None, payee_name=None, category_name=None): # noqa: E501 """HybridTransaction - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._date = None - self._amount = None - self._memo = None - self._cleared = None - self._approved = None - self._flag_color = None - self._account_id = None - self._payee_id = None - self._category_id = None - self._transfer_account_id = None - self._import_id = None self._type = None self._parent_transaction_id = None self._account_name = None self._payee_name = None self._category_name = None self.discriminator = None - - self.id = id - self.date = date - self.amount = amount - self.memo = memo - self.cleared = cleared - self.approved = approved - self.flag_color = flag_color - self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id - self.import_id = import_id self.type = type self.parent_transaction_id = parent_transaction_id self.account_name = account_name self.payee_name = payee_name self.category_name = category_name - @property - def id(self): - """Gets the id of this HybridTransaction. # noqa: E501 - - - :return: The id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this HybridTransaction. - - - :param id: The id of this HybridTransaction. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def date(self): - """Gets the date of this HybridTransaction. # noqa: E501 - - - :return: The date of this HybridTransaction. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this HybridTransaction. - - - :param date: The date of this HybridTransaction. # noqa: E501 - :type: date - """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def amount(self): - """Gets the amount of this HybridTransaction. # noqa: E501 - - The transaction amount in milliunits format # noqa: E501 - - :return: The amount of this HybridTransaction. # noqa: E501 - :rtype: float - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this HybridTransaction. - - The transaction amount in milliunits format # noqa: E501 - - :param amount: The amount of this HybridTransaction. # noqa: E501 - :type: float - """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - - self._amount = amount - - @property - def memo(self): - """Gets the memo of this HybridTransaction. # noqa: E501 - - - :return: The memo of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._memo - - @memo.setter - def memo(self, memo): - """Sets the memo of this HybridTransaction. - - - :param memo: The memo of this HybridTransaction. # noqa: E501 - :type: str - """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 - - self._memo = memo - - @property - def cleared(self): - """Gets the cleared of this HybridTransaction. # noqa: E501 - - The cleared status of the transaction # noqa: E501 - - :return: The cleared of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._cleared - - @cleared.setter - def cleared(self, cleared): - """Sets the cleared of this HybridTransaction. - - The cleared status of the transaction # noqa: E501 - - :param cleared: The cleared of this HybridTransaction. # noqa: E501 - :type: str - """ - if cleared is None: - raise ValueError("Invalid value for `cleared`, must not be `None`") # noqa: E501 - allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 - if cleared not in allowed_values: - raise ValueError( - "Invalid value for `cleared` ({0}), must be one of {1}" # noqa: E501 - .format(cleared, allowed_values) - ) - - self._cleared = cleared - - @property - def approved(self): - """Gets the approved of this HybridTransaction. # noqa: E501 - - Whether or not the transaction is approved # noqa: E501 - - :return: The approved of this HybridTransaction. # noqa: E501 - :rtype: bool - """ - return self._approved - - @approved.setter - def approved(self, approved): - """Sets the approved of this HybridTransaction. - - Whether or not the transaction is approved # noqa: E501 - - :param approved: The approved of this HybridTransaction. # noqa: E501 - :type: bool - """ - if approved is None: - raise ValueError("Invalid value for `approved`, must not be `None`") # noqa: E501 - - self._approved = approved - - @property - def flag_color(self): - """Gets the flag_color of this HybridTransaction. # noqa: E501 - - The transaction flag # noqa: E501 - - :return: The flag_color of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._flag_color - - @flag_color.setter - def flag_color(self, flag_color): - """Sets the flag_color of this HybridTransaction. - - The transaction flag # noqa: E501 - - :param flag_color: The flag_color of this HybridTransaction. # noqa: E501 - :type: str - """ - if flag_color is None: - raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501 - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 - if flag_color not in allowed_values: - raise ValueError( - "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 - .format(flag_color, allowed_values) - ) - - self._flag_color = flag_color - - @property - def account_id(self): - """Gets the account_id of this HybridTransaction. # noqa: E501 - - - :return: The account_id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._account_id - - @account_id.setter - def account_id(self, account_id): - """Sets the account_id of this HybridTransaction. - - - :param account_id: The account_id of this HybridTransaction. # noqa: E501 - :type: str - """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 - - self._account_id = account_id - - @property - def payee_id(self): - """Gets the payee_id of this HybridTransaction. # noqa: E501 - - - :return: The payee_id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._payee_id - - @payee_id.setter - def payee_id(self, payee_id): - """Sets the payee_id of this HybridTransaction. - - - :param payee_id: The payee_id of this HybridTransaction. # noqa: E501 - :type: str - """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 - - self._payee_id = payee_id - - @property - def category_id(self): - """Gets the category_id of this HybridTransaction. # noqa: E501 - - - :return: The category_id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._category_id - - @category_id.setter - def category_id(self, category_id): - """Sets the category_id of this HybridTransaction. - - - :param category_id: The category_id of this HybridTransaction. # noqa: E501 - :type: str - """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 - - self._category_id = category_id - - @property - def transfer_account_id(self): - """Gets the transfer_account_id of this HybridTransaction. # noqa: E501 - - - :return: The transfer_account_id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._transfer_account_id - - @transfer_account_id.setter - def transfer_account_id(self, transfer_account_id): - """Sets the transfer_account_id of this HybridTransaction. - - - :param transfer_account_id: The transfer_account_id of this HybridTransaction. # noqa: E501 - :type: str - """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 - - self._transfer_account_id = transfer_account_id - - @property - def import_id(self): - """Gets the import_id of this HybridTransaction. # noqa: E501 - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :return: The import_id of this HybridTransaction. # noqa: E501 - :rtype: str - """ - return self._import_id - - @import_id.setter - def import_id(self, import_id): - """Sets the import_id of this HybridTransaction. - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :param import_id: The import_id of this HybridTransaction. # noqa: E501 - :type: str - """ - if import_id is None: - raise ValueError("Invalid value for `import_id`, must not be `None`") # noqa: E501 - - self._import_id = import_id - @property def type(self): """Gets the type of this HybridTransaction. # noqa: E501 @@ -556,6 +205,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(HybridTransaction, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index 7bd795c..36d959e 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class HybridTransactionsResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class HybridTransactionsResponse(object): def __init__(self, data=None): # noqa: E501 """HybridTransactionsResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(HybridTransactionsResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/hybrid_transactions_wrapper.py b/ynab/models/hybrid_transactions_wrapper.py index 14e7fad..bd8616c 100644 --- a/ynab/models/hybrid_transactions_wrapper.py +++ b/ynab/models/hybrid_transactions_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.hybrid_transaction import HybridTransaction # noqa: F401,E501 @@ -24,7 +22,6 @@ class HybridTransactionsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class HybridTransactionsWrapper(object): def __init__(self, transactions=None): # noqa: E501 """HybridTransactionsWrapper - a model defined in Swagger""" # noqa: E501 - self._transactions = None self.discriminator = None - self.transactions = transactions @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(HybridTransactionsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index e277e48..3854c5a 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -10,22 +10,19 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.category import Category # noqa: F401,E501 from ynab.models.month_summary import MonthSummary # noqa: F401,E501 -class MonthDetail(object): +class MonthDetail(MonthSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,133 +31,24 @@ class MonthDetail(object): and the value is json key in definition. """ swagger_types = { - 'month': 'date', - 'note': 'str', - 'to_be_budgeted': 'float', - 'age_of_money': 'float', 'categories': 'list[Category]' } attribute_map = { - 'month': 'month', - 'note': 'note', - 'to_be_budgeted': 'to_be_budgeted', - 'age_of_money': 'age_of_money', 'categories': 'categories' } - def __init__(self, month=None, note=None, to_be_budgeted=None, age_of_money=None, categories=None): # noqa: E501 + def __init__(self, categories=None): # noqa: E501 """MonthDetail - a model defined in Swagger""" # noqa: E501 - - self._month = None - self._note = None - self._to_be_budgeted = None - self._age_of_money = None self._categories = None self.discriminator = None - - self.month = month - self.note = note - self.to_be_budgeted = to_be_budgeted - self.age_of_money = age_of_money self.categories = categories - @property - def month(self): - """Gets the month of this MonthDetail. # noqa: E501 - - - :return: The month of this MonthDetail. # noqa: E501 - :rtype: date - """ - return self._month - - @month.setter - def month(self, month): - """Sets the month of this MonthDetail. - - - :param month: The month of this MonthDetail. # noqa: E501 - :type: date - """ - if month is None: - raise ValueError("Invalid value for `month`, must not be `None`") # noqa: E501 - - self._month = month - - @property - def note(self): - """Gets the note of this MonthDetail. # noqa: E501 - - - :return: The note of this MonthDetail. # noqa: E501 - :rtype: str - """ - return self._note - - @note.setter - def note(self, note): - """Sets the note of this MonthDetail. - - - :param note: The note of this MonthDetail. # noqa: E501 - :type: str - """ - self._note = note - - @property - def to_be_budgeted(self): - """Gets the to_be_budgeted of this MonthDetail. # noqa: E501 - - The current balance of the account in milliunits format # noqa: E501 - - :return: The to_be_budgeted of this MonthDetail. # noqa: E501 - :rtype: float - """ - return self._to_be_budgeted - - @to_be_budgeted.setter - def to_be_budgeted(self, to_be_budgeted): - """Sets the to_be_budgeted of this MonthDetail. - - The current balance of the account in milliunits format # noqa: E501 - - :param to_be_budgeted: The to_be_budgeted of this MonthDetail. # noqa: E501 - :type: float - """ - if to_be_budgeted is None: - raise ValueError("Invalid value for `to_be_budgeted`, must not be `None`") # noqa: E501 - - self._to_be_budgeted = to_be_budgeted - - @property - def age_of_money(self): - """Gets the age_of_money of this MonthDetail. # noqa: E501 - - - :return: The age_of_money of this MonthDetail. # noqa: E501 - :rtype: float - """ - return self._age_of_money - - @age_of_money.setter - def age_of_money(self, age_of_money): - """Sets the age_of_money of this MonthDetail. - - - :param age_of_money: The age_of_money of this MonthDetail. # noqa: E501 - :type: float - """ - if age_of_money is None: - raise ValueError("Invalid value for `age_of_money`, must not be `None`") # noqa: E501 - - self._age_of_money = age_of_money - @property def categories(self): """Gets the categories of this MonthDetail. # noqa: E501 - The budget month categories # noqa: E501 + The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. # noqa: E501 :return: The categories of this MonthDetail. # noqa: E501 :rtype: list[Category] @@ -171,7 +59,7 @@ def categories(self): def categories(self, categories): """Sets the categories of this MonthDetail. - The budget month categories # noqa: E501 + The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. # noqa: E501 :param categories: The categories of this MonthDetail. # noqa: E501 :type: list[Category] @@ -202,6 +90,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthDetail, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index d391c14..1469b5e 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.month_detail_wrapper import MonthDetailWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class MonthDetailResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class MonthDetailResponse(object): def __init__(self, data=None): # noqa: E501 """MonthDetailResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthDetailResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_detail_wrapper.py b/ynab/models/month_detail_wrapper.py index bc9c98c..bf10560 100644 --- a/ynab/models/month_detail_wrapper.py +++ b/ynab/models/month_detail_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.month_detail import MonthDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class MonthDetailWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class MonthDetailWrapper(object): def __init__(self, month=None): # noqa: E501 """MonthDetailWrapper - a model defined in Swagger""" # noqa: E501 - self._month = None self.discriminator = None - self.month = month @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthDetailWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index c57bd48..b39a6c7 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.month_summaries_wrapper import MonthSummariesWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class MonthSummariesResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class MonthSummariesResponse(object): def __init__(self, data=None): # noqa: E501 """MonthSummariesResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthSummariesResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_summaries_wrapper.py b/ynab/models/month_summaries_wrapper.py index ee9c750..c9604c5 100644 --- a/ynab/models/month_summaries_wrapper.py +++ b/ynab/models/month_summaries_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.month_summary import MonthSummary # noqa: F401,E501 @@ -24,7 +22,6 @@ class MonthSummariesWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,20 +30,22 @@ class MonthSummariesWrapper(object): and the value is json key in definition. """ swagger_types = { - 'months': 'list[MonthSummary]' + 'months': 'list[MonthSummary]', + 'server_knowledge': 'int' } attribute_map = { - 'months': 'months' + 'months': 'months', + 'server_knowledge': 'server_knowledge' } - def __init__(self, months=None): # noqa: E501 + def __init__(self, months=None, server_knowledge=None): # noqa: E501 """MonthSummariesWrapper - a model defined in Swagger""" # noqa: E501 - self._months = None + self._server_knowledge = None self.discriminator = None - self.months = months + self.server_knowledge = server_knowledge @property def months(self): @@ -71,6 +70,31 @@ def months(self, months): self._months = months + @property + def server_knowledge(self): + """Gets the server_knowledge of this MonthSummariesWrapper. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this MonthSummariesWrapper. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this MonthSummariesWrapper. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this MonthSummariesWrapper. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -92,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthSummariesWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 633a98f..4d4bc59 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class MonthSummary(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,30 +31,44 @@ class MonthSummary(object): swagger_types = { 'month': 'date', 'note': 'str', - 'to_be_budgeted': 'float', - 'age_of_money': 'float' + 'income': 'int', + 'budgeted': 'int', + 'activity': 'int', + 'to_be_budgeted': 'int', + 'age_of_money': 'int', + 'deleted': 'bool' } attribute_map = { 'month': 'month', 'note': 'note', + 'income': 'income', + 'budgeted': 'budgeted', + 'activity': 'activity', 'to_be_budgeted': 'to_be_budgeted', - 'age_of_money': 'age_of_money' + 'age_of_money': 'age_of_money', + 'deleted': 'deleted' } - def __init__(self, month=None, note=None, to_be_budgeted=None, age_of_money=None): # noqa: E501 + def __init__(self, month=None, note=None, income=None, budgeted=None, activity=None, to_be_budgeted=None, age_of_money=None, deleted=None): # noqa: E501 """MonthSummary - a model defined in Swagger""" # noqa: E501 - self._month = None self._note = None + self._income = None + self._budgeted = None + self._activity = None self._to_be_budgeted = None self._age_of_money = None + self._deleted = None self.discriminator = None - self.month = month self.note = note + self.income = income + self.budgeted = budgeted + self.activity = activity self.to_be_budgeted = to_be_budgeted self.age_of_money = age_of_money + self.deleted = deleted @property def month(self): @@ -99,16 +111,94 @@ def note(self, note): :param note: The note of this MonthSummary. # noqa: E501 :type: str """ + if note is None: + raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note + @property + def income(self): + """Gets the income of this MonthSummary. # noqa: E501 + + The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month # noqa: E501 + + :return: The income of this MonthSummary. # noqa: E501 + :rtype: int + """ + return self._income + + @income.setter + def income(self, income): + """Sets the income of this MonthSummary. + + The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month # noqa: E501 + + :param income: The income of this MonthSummary. # noqa: E501 + :type: int + """ + if income is None: + raise ValueError("Invalid value for `income`, must not be `None`") # noqa: E501 + + self._income = income + + @property + def budgeted(self): + """Gets the budgeted of this MonthSummary. # noqa: E501 + + The total amount budgeted in the month # noqa: E501 + + :return: The budgeted of this MonthSummary. # noqa: E501 + :rtype: int + """ + return self._budgeted + + @budgeted.setter + def budgeted(self, budgeted): + """Sets the budgeted of this MonthSummary. + + The total amount budgeted in the month # noqa: E501 + + :param budgeted: The budgeted of this MonthSummary. # noqa: E501 + :type: int + """ + if budgeted is None: + raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 + + self._budgeted = budgeted + + @property + def activity(self): + """Gets the activity of this MonthSummary. # noqa: E501 + + The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' # noqa: E501 + + :return: The activity of this MonthSummary. # noqa: E501 + :rtype: int + """ + return self._activity + + @activity.setter + def activity(self, activity): + """Sets the activity of this MonthSummary. + + The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' # noqa: E501 + + :param activity: The activity of this MonthSummary. # noqa: E501 + :type: int + """ + if activity is None: + raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 + + self._activity = activity + @property def to_be_budgeted(self): """Gets the to_be_budgeted of this MonthSummary. # noqa: E501 - The current balance of the account in milliunits format # noqa: E501 + The available amount for 'To be Budgeted' # noqa: E501 :return: The to_be_budgeted of this MonthSummary. # noqa: E501 - :rtype: float + :rtype: int """ return self._to_be_budgeted @@ -116,10 +206,10 @@ def to_be_budgeted(self): def to_be_budgeted(self, to_be_budgeted): """Sets the to_be_budgeted of this MonthSummary. - The current balance of the account in milliunits format # noqa: E501 + The available amount for 'To be Budgeted' # noqa: E501 :param to_be_budgeted: The to_be_budgeted of this MonthSummary. # noqa: E501 - :type: float + :type: int """ if to_be_budgeted is None: raise ValueError("Invalid value for `to_be_budgeted`, must not be `None`") # noqa: E501 @@ -130,9 +220,10 @@ def to_be_budgeted(self, to_be_budgeted): def age_of_money(self): """Gets the age_of_money of this MonthSummary. # noqa: E501 + The Age of Money as of the month # noqa: E501 :return: The age_of_money of this MonthSummary. # noqa: E501 - :rtype: float + :rtype: int """ return self._age_of_money @@ -140,15 +231,41 @@ def age_of_money(self): def age_of_money(self, age_of_money): """Sets the age_of_money of this MonthSummary. + The Age of Money as of the month # noqa: E501 :param age_of_money: The age_of_money of this MonthSummary. # noqa: E501 - :type: float + :type: int """ if age_of_money is None: raise ValueError("Invalid value for `age_of_money`, must not be `None`") # noqa: E501 self._age_of_money = age_of_money + @property + def deleted(self): + """Gets the deleted of this MonthSummary. # noqa: E501 + + Whether or not the month has been deleted. Deleted months will only be included in delta requests. # noqa: E501 + + :return: The deleted of this MonthSummary. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this MonthSummary. + + Whether or not the month has been deleted. Deleted months will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this MonthSummary. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -170,6 +287,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(MonthSummary, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 20dea35..7eca7d0 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class Payee(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,26 +31,28 @@ class Payee(object): swagger_types = { 'id': 'str', 'name': 'str', - 'transfer_account_id': 'str' + 'transfer_account_id': 'str', + 'deleted': 'bool' } attribute_map = { 'id': 'id', 'name': 'name', - 'transfer_account_id': 'transfer_account_id' + 'transfer_account_id': 'transfer_account_id', + 'deleted': 'deleted' } - def __init__(self, id=None, name=None, transfer_account_id=None): # noqa: E501 + def __init__(self, id=None, name=None, transfer_account_id=None, deleted=None): # noqa: E501 """Payee - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._transfer_account_id = None + self._deleted = None self.discriminator = None - self.id = id self.name = name self.transfer_account_id = transfer_account_id + self.deleted = deleted @property def id(self): @@ -125,6 +125,31 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def deleted(self): + """Gets the deleted of this Payee. # noqa: E501 + + Whether or not the payee has been deleted. Deleted payees will only be included in delta requests. # noqa: E501 + + :return: The deleted of this Payee. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this Payee. + + Whether or not the payee has been deleted. Deleted payees will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this Payee. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -146,6 +171,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Payee, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 18f2152..4ed224c 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class PayeeLocation(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,29 +32,31 @@ class PayeeLocation(object): 'id': 'str', 'payee_id': 'str', 'latitude': 'str', - 'longitude': 'str' + 'longitude': 'str', + 'deleted': 'bool' } attribute_map = { 'id': 'id', 'payee_id': 'payee_id', 'latitude': 'latitude', - 'longitude': 'longitude' + 'longitude': 'longitude', + 'deleted': 'deleted' } - def __init__(self, id=None, payee_id=None, latitude=None, longitude=None): # noqa: E501 + def __init__(self, id=None, payee_id=None, latitude=None, longitude=None, deleted=None): # noqa: E501 """PayeeLocation - a model defined in Swagger""" # noqa: E501 - self._id = None self._payee_id = None self._latitude = None self._longitude = None + self._deleted = None self.discriminator = None - self.id = id self.payee_id = payee_id self.latitude = latitude self.longitude = longitude + self.deleted = deleted @property def id(self): @@ -150,6 +150,31 @@ def longitude(self, longitude): self._longitude = longitude + @property + def deleted(self): + """Gets the deleted of this PayeeLocation. # noqa: E501 + + Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests. # noqa: E501 + + :return: The deleted of this PayeeLocation. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this PayeeLocation. + + Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this PayeeLocation. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -171,6 +196,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeLocation, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index a96cf90..73c46fe 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee_location_wrapper import PayeeLocationWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeLocationResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeLocationResponse(object): def __init__(self, data=None): # noqa: E501 """PayeeLocationResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeLocationResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_location_wrapper.py b/ynab/models/payee_location_wrapper.py index e31c5f9..9cf6678 100644 --- a/ynab/models/payee_location_wrapper.py +++ b/ynab/models/payee_location_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee_location import PayeeLocation # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeLocationWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeLocationWrapper(object): def __init__(self, payee_location=None): # noqa: E501 """PayeeLocationWrapper - a model defined in Swagger""" # noqa: E501 - self._payee_location = None self.discriminator = None - self.payee_location = payee_location @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeLocationWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index 98d1bec..a0b0e48 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee_locations_wrapper import PayeeLocationsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeLocationsResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeLocationsResponse(object): def __init__(self, data=None): # noqa: E501 """PayeeLocationsResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeLocationsResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_locations_wrapper.py b/ynab/models/payee_locations_wrapper.py index 4838899..63e6ee3 100644 --- a/ynab/models/payee_locations_wrapper.py +++ b/ynab/models/payee_locations_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee_location import PayeeLocation # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeLocationsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeLocationsWrapper(object): def __init__(self, payee_locations=None): # noqa: E501 """PayeeLocationsWrapper - a model defined in Swagger""" # noqa: E501 - self._payee_locations = None self.discriminator = None - self.payee_locations = payee_locations @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeLocationsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 95d8609..1e956a4 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee_wrapper import PayeeWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeResponse(object): def __init__(self, data=None): # noqa: E501 """PayeeResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payee_wrapper.py b/ynab/models/payee_wrapper.py index a05f0cd..5d406cd 100644 --- a/ynab/models/payee_wrapper.py +++ b/ynab/models/payee_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee import Payee # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeeWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeeWrapper(object): def __init__(self, payee=None): # noqa: E501 """PayeeWrapper - a model defined in Swagger""" # noqa: E501 - self._payee = None self.discriminator = None - self.payee = payee @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeeWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index 6502c7b..1484d67 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payees_wrapper import PayeesWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeesResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class PayeesResponse(object): def __init__(self, data=None): # noqa: E501 """PayeesResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeesResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/payees_wrapper.py b/ynab/models/payees_wrapper.py index 64c1707..72d87ee 100644 --- a/ynab/models/payees_wrapper.py +++ b/ynab/models/payees_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.payee import Payee # noqa: F401,E501 @@ -24,7 +22,6 @@ class PayeesWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,20 +30,22 @@ class PayeesWrapper(object): and the value is json key in definition. """ swagger_types = { - 'payees': 'list[Payee]' + 'payees': 'list[Payee]', + 'server_knowledge': 'int' } attribute_map = { - 'payees': 'payees' + 'payees': 'payees', + 'server_knowledge': 'server_knowledge' } - def __init__(self, payees=None): # noqa: E501 + def __init__(self, payees=None, server_knowledge=None): # noqa: E501 """PayeesWrapper - a model defined in Swagger""" # noqa: E501 - self._payees = None + self._server_knowledge = None self.discriminator = None - self.payees = payees + self.server_knowledge = server_knowledge @property def payees(self): @@ -71,6 +70,31 @@ def payees(self, payees): self._payees = payees + @property + def server_knowledge(self): + """Gets the server_knowledge of this PayeesWrapper. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this PayeesWrapper. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this PayeesWrapper. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this PayeesWrapper. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -92,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(PayeesWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index b6451bb..9454b18 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class SaveTransaction(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,8 +30,8 @@ class SaveTransaction(object): """ swagger_types = { 'account_id': 'str', - 'date': 'date', - 'amount': 'float', + '_date': 'date', + 'amount': 'int', 'payee_id': 'str', 'payee_name': 'str', 'category_id': 'str', @@ -46,7 +44,7 @@ class SaveTransaction(object): attribute_map = { 'account_id': 'account_id', - 'date': 'date', + '_date': 'date', 'amount': 'amount', 'payee_id': 'payee_id', 'payee_name': 'payee_name', @@ -58,11 +56,10 @@ class SaveTransaction(object): 'import_id': 'import_id' } - def __init__(self, account_id=None, date=None, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None, cleared=None, approved=None, flag_color=None, import_id=None): # noqa: E501 + def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None, cleared=None, approved=None, flag_color=None, import_id=None): # noqa: E501 """SaveTransaction - a model defined in Swagger""" # noqa: E501 - self._account_id = None - self._date = None + self.__date = None self._amount = None self._payee_id = None self._payee_name = None @@ -73,9 +70,8 @@ def __init__(self, account_id=None, date=None, amount=None, payee_id=None, payee self._flag_color = None self._import_id = None self.discriminator = None - self.account_id = account_id - self.date = date + self._date = _date self.amount = amount if payee_id is not None: self.payee_id = payee_id @@ -118,27 +114,27 @@ def account_id(self, account_id): self._account_id = account_id @property - def date(self): - """Gets the date of this SaveTransaction. # noqa: E501 + def _date(self): + """Gets the _date of this SaveTransaction. # noqa: E501 - :return: The date of this SaveTransaction. # noqa: E501 + :return: The _date of this SaveTransaction. # noqa: E501 :rtype: date """ - return self._date + return self.__date - @date.setter - def date(self, date): - """Sets the date of this SaveTransaction. + @_date.setter + def _date(self, _date): + """Sets the _date of this SaveTransaction. - :param date: The date of this SaveTransaction. # noqa: E501 + :param _date: The _date of this SaveTransaction. # noqa: E501 :type: date """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - self._date = date + self.__date = _date @property def amount(self): @@ -147,7 +143,7 @@ def amount(self): The transaction amount in milliunits format # noqa: E501 :return: The amount of this SaveTransaction. # noqa: E501 - :rtype: float + :rtype: int """ return self._amount @@ -158,7 +154,7 @@ def amount(self, amount): The transaction amount in milliunits format # noqa: E501 :param amount: The amount of this SaveTransaction. # noqa: E501 - :type: float + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -169,7 +165,7 @@ def amount(self, amount): def payee_id(self): """Gets the payee_id of this SaveTransaction. # noqa: E501 - The payee for the transaction. Transfer payees are not permitted and will be ignored if supplied. # noqa: E501 + The payee for the transaction # noqa: E501 :return: The payee_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -180,7 +176,7 @@ def payee_id(self): def payee_id(self, payee_id): """Sets the payee_id of this SaveTransaction. - The payee for the transaction. Transfer payees are not permitted and will be ignored if supplied. # noqa: E501 + The payee for the transaction # noqa: E501 :param payee_id: The payee_id of this SaveTransaction. # noqa: E501 :type: str @@ -192,7 +188,7 @@ def payee_id(self, payee_id): def payee_name(self): """Gets the payee_name of this SaveTransaction. # noqa: E501 - The payee name. If a payee_name value is provided and payee_id is not included or has a null value, payee_name will be used to create or use an existing payee. # noqa: E501 + 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. # noqa: E501 :return: The payee_name of this SaveTransaction. # noqa: E501 :rtype: str @@ -203,7 +199,7 @@ def payee_name(self): def payee_name(self, payee_name): """Sets the payee_name of this SaveTransaction. - The payee name. If a payee_name value is provided and payee_id is not included or has a null value, payee_name will be used to create or use an existing payee. # noqa: E501 + 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. # noqa: E501 :param payee_name: The payee_name of this SaveTransaction. # noqa: E501 :type: str @@ -215,7 +211,7 @@ def payee_name(self, payee_name): def category_id(self): """Gets the category_id of this SaveTransaction. # noqa: E501 - The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. # noqa: E501 + The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. # noqa: E501 :return: The category_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -226,7 +222,7 @@ def category_id(self): def category_id(self, category_id): """Sets the category_id of this SaveTransaction. - The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. # noqa: E501 + The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. # noqa: E501 :param category_id: The category_id of this SaveTransaction. # noqa: E501 :type: str @@ -340,7 +336,7 @@ def flag_color(self, flag_color): def import_id(self): """Gets the import_id of this SaveTransaction. # noqa: E501 - If specified for a new transaction, the transaction will be treated as Imported and assigned this import_id. If another transaction on the same account with this same import_id is later attempted to be created, it will be skipped to prevent duplication. Transactions imported through File Based Import or Direct Import and 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. If import_id is specified as null, the transaction will be treated as a user entered transaction. # noqa: E501 + If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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). # noqa: E501 :return: The import_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -351,7 +347,7 @@ def import_id(self): def import_id(self, import_id): """Sets the import_id of this SaveTransaction. - If specified for a new transaction, the transaction will be treated as Imported and assigned this import_id. If another transaction on the same account with this same import_id is later attempted to be created, it will be skipped to prevent duplication. Transactions imported through File Based Import or Direct Import and 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. If import_id is specified as null, the transaction will be treated as a user entered transaction. # noqa: E501 + If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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). # noqa: E501 :param import_id: The import_id of this SaveTransaction. # noqa: E501 :type: str @@ -380,6 +376,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(SaveTransaction, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/save_transaction_wrapper.py b/ynab/models/save_transaction_wrapper.py index f1b111f..5fd21d0 100644 --- a/ynab/models/save_transaction_wrapper.py +++ b/ynab/models/save_transaction_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 @@ -24,7 +22,6 @@ class SaveTransactionWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class SaveTransactionWrapper(object): def __init__(self, transaction=None): # noqa: E501 """SaveTransactionWrapper - a model defined in Swagger""" # noqa: E501 - self._transaction = None self.discriminator = None - self.transaction = transaction @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(SaveTransactionWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index 08c8324..e1e949f 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class ScheduledSubTransaction(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,11 +31,12 @@ class ScheduledSubTransaction(object): swagger_types = { 'id': 'str', 'scheduled_transaction_id': 'str', - 'amount': 'float', + 'amount': 'int', 'memo': 'str', 'payee_id': 'str', 'category_id': 'str', - 'transfer_account_id': 'str' + 'transfer_account_id': 'str', + 'deleted': 'bool' } attribute_map = { @@ -47,12 +46,12 @@ class ScheduledSubTransaction(object): 'memo': 'memo', 'payee_id': 'payee_id', 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id' + 'transfer_account_id': 'transfer_account_id', + 'deleted': 'deleted' } - def __init__(self, id=None, scheduled_transaction_id=None, amount=None, memo=None, payee_id=None, category_id=None, transfer_account_id=None): # noqa: E501 + def __init__(self, id=None, scheduled_transaction_id=None, amount=None, memo=None, payee_id=None, category_id=None, transfer_account_id=None, deleted=None): # noqa: E501 """ScheduledSubTransaction - a model defined in Swagger""" # noqa: E501 - self._id = None self._scheduled_transaction_id = None self._amount = None @@ -60,8 +59,8 @@ def __init__(self, id=None, scheduled_transaction_id=None, amount=None, memo=Non self._payee_id = None self._category_id = None self._transfer_account_id = None + self._deleted = None self.discriminator = None - self.id = id self.scheduled_transaction_id = scheduled_transaction_id self.amount = amount @@ -69,6 +68,7 @@ def __init__(self, id=None, scheduled_transaction_id=None, amount=None, memo=Non self.payee_id = payee_id self.category_id = category_id self.transfer_account_id = transfer_account_id + self.deleted = deleted @property def id(self): @@ -123,7 +123,7 @@ def amount(self): The scheduled subtransaction amount in milliunits format # noqa: E501 :return: The amount of this ScheduledSubTransaction. # noqa: E501 - :rtype: float + :rtype: int """ return self._amount @@ -134,7 +134,7 @@ def amount(self, amount): The scheduled subtransaction amount in milliunits format # noqa: E501 :param amount: The amount of this ScheduledSubTransaction. # noqa: E501 - :type: float + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -214,7 +214,7 @@ def category_id(self, category_id): def transfer_account_id(self): """Gets the transfer_account_id of this ScheduledSubTransaction. # noqa: E501 - If a transfer, the account_id which the scheduled sub transaction transfers to # noqa: E501 + If a transfer, the account_id which the scheduled subtransaction transfers to # noqa: E501 :return: The transfer_account_id of this ScheduledSubTransaction. # noqa: E501 :rtype: str @@ -225,7 +225,7 @@ def transfer_account_id(self): def transfer_account_id(self, transfer_account_id): """Sets the transfer_account_id of this ScheduledSubTransaction. - If a transfer, the account_id which the scheduled sub transaction transfers to # noqa: E501 + If a transfer, the account_id which the scheduled subtransaction transfers to # noqa: E501 :param transfer_account_id: The transfer_account_id of this ScheduledSubTransaction. # noqa: E501 :type: str @@ -235,6 +235,31 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def deleted(self): + """Gets the deleted of this ScheduledSubTransaction. # noqa: E501 + + Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. # noqa: E501 + + :return: The deleted of this ScheduledSubTransaction. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this ScheduledSubTransaction. + + Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this ScheduledSubTransaction. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -256,6 +281,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledSubTransaction, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index f0f9076..4e648cb 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -10,22 +10,19 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction # noqa: F401,E501 from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary # noqa: F401,E501 -class ScheduledTransactionDetail(object): +class ScheduledTransactionDetail(ScheduledTransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,17 +31,6 @@ class ScheduledTransactionDetail(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'date_first': 'date', - 'date_next': 'date', - 'frequency': 'str', - 'amount': 'float', - 'memo': 'str', - 'flag_color': 'str', - 'account_id': 'str', - 'payee_id': 'str', - 'category_id': 'str', - 'transfer_account_id': 'str', 'account_name': 'str', 'payee_name': 'str', 'category_name': 'str', @@ -52,334 +38,24 @@ class ScheduledTransactionDetail(object): } attribute_map = { - 'id': 'id', - 'date_first': 'date_first', - 'date_next': 'date_next', - 'frequency': 'frequency', - 'amount': 'amount', - 'memo': 'memo', - 'flag_color': 'flag_color', - 'account_id': 'account_id', - 'payee_id': 'payee_id', - 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id', 'account_name': 'account_name', 'payee_name': 'payee_name', 'category_name': 'category_name', 'subtransactions': 'subtransactions' } - def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amount=None, memo=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 """ScheduledTransactionDetail - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._date_first = None - self._date_next = None - self._frequency = None - self._amount = None - self._memo = None - self._flag_color = None - self._account_id = None - self._payee_id = None - self._category_id = None - self._transfer_account_id = None self._account_name = None self._payee_name = None self._category_name = None self._subtransactions = None self.discriminator = None - - self.id = id - self.date_first = date_first - self.date_next = date_next - self.frequency = frequency - self.amount = amount - self.memo = memo - self.flag_color = flag_color - self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id self.account_name = account_name self.payee_name = payee_name self.category_name = category_name self.subtransactions = subtransactions - @property - def id(self): - """Gets the id of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The id of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this ScheduledTransactionDetail. - - - :param id: The id of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def date_first(self): - """Gets the date_first of this ScheduledTransactionDetail. # noqa: E501 - - The first date for which the Scheduled Transaction was scheduled. # noqa: E501 - - :return: The date_first of this ScheduledTransactionDetail. # noqa: E501 - :rtype: date - """ - return self._date_first - - @date_first.setter - def date_first(self, date_first): - """Sets the date_first of this ScheduledTransactionDetail. - - The first date for which the Scheduled Transaction was scheduled. # noqa: E501 - - :param date_first: The date_first of this ScheduledTransactionDetail. # noqa: E501 - :type: date - """ - if date_first is None: - raise ValueError("Invalid value for `date_first`, must not be `None`") # noqa: E501 - - self._date_first = date_first - - @property - def date_next(self): - """Gets the date_next of this ScheduledTransactionDetail. # noqa: E501 - - The next date for which the Scheduled Transaction is scheduled. # noqa: E501 - - :return: The date_next of this ScheduledTransactionDetail. # noqa: E501 - :rtype: date - """ - return self._date_next - - @date_next.setter - def date_next(self, date_next): - """Sets the date_next of this ScheduledTransactionDetail. - - The next date for which the Scheduled Transaction is scheduled. # noqa: E501 - - :param date_next: The date_next of this ScheduledTransactionDetail. # noqa: E501 - :type: date - """ - if date_next is None: - raise ValueError("Invalid value for `date_next`, must not be `None`") # noqa: E501 - - self._date_next = date_next - - @property - def frequency(self): - """Gets the frequency of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The frequency of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._frequency - - @frequency.setter - def frequency(self, frequency): - """Sets the frequency of this ScheduledTransactionDetail. - - - :param frequency: The frequency of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if frequency is None: - raise ValueError("Invalid value for `frequency`, must not be `None`") # noqa: E501 - allowed_values = ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"] # noqa: E501 - if frequency not in allowed_values: - raise ValueError( - "Invalid value for `frequency` ({0}), must be one of {1}" # noqa: E501 - .format(frequency, allowed_values) - ) - - self._frequency = frequency - - @property - def amount(self): - """Gets the amount of this ScheduledTransactionDetail. # noqa: E501 - - The scheduled transaction amount in milliunits format # noqa: E501 - - :return: The amount of this ScheduledTransactionDetail. # noqa: E501 - :rtype: float - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this ScheduledTransactionDetail. - - The scheduled transaction amount in milliunits format # noqa: E501 - - :param amount: The amount of this ScheduledTransactionDetail. # noqa: E501 - :type: float - """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - - self._amount = amount - - @property - def memo(self): - """Gets the memo of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The memo of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._memo - - @memo.setter - def memo(self, memo): - """Sets the memo of this ScheduledTransactionDetail. - - - :param memo: The memo of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 - - self._memo = memo - - @property - def flag_color(self): - """Gets the flag_color of this ScheduledTransactionDetail. # noqa: E501 - - The scheduled transaction flag # noqa: E501 - - :return: The flag_color of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._flag_color - - @flag_color.setter - def flag_color(self, flag_color): - """Sets the flag_color of this ScheduledTransactionDetail. - - The scheduled transaction flag # noqa: E501 - - :param flag_color: The flag_color of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if flag_color is None: - raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501 - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 - if flag_color not in allowed_values: - raise ValueError( - "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 - .format(flag_color, allowed_values) - ) - - self._flag_color = flag_color - - @property - def account_id(self): - """Gets the account_id of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The account_id of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._account_id - - @account_id.setter - def account_id(self, account_id): - """Sets the account_id of this ScheduledTransactionDetail. - - - :param account_id: The account_id of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 - - self._account_id = account_id - - @property - def payee_id(self): - """Gets the payee_id of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The payee_id of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._payee_id - - @payee_id.setter - def payee_id(self, payee_id): - """Sets the payee_id of this ScheduledTransactionDetail. - - - :param payee_id: The payee_id of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 - - self._payee_id = payee_id - - @property - def category_id(self): - """Gets the category_id of this ScheduledTransactionDetail. # noqa: E501 - - - :return: The category_id of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._category_id - - @category_id.setter - def category_id(self, category_id): - """Sets the category_id of this ScheduledTransactionDetail. - - - :param category_id: The category_id of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 - - self._category_id = category_id - - @property - def transfer_account_id(self): - """Gets the transfer_account_id of this ScheduledTransactionDetail. # noqa: E501 - - If a transfer, the account_id which the scheduled transaction transfers to # noqa: E501 - - :return: The transfer_account_id of this ScheduledTransactionDetail. # noqa: E501 - :rtype: str - """ - return self._transfer_account_id - - @transfer_account_id.setter - def transfer_account_id(self, transfer_account_id): - """Sets the transfer_account_id of this ScheduledTransactionDetail. - - If a transfer, the account_id which the scheduled transaction transfers to # noqa: E501 - - :param transfer_account_id: The transfer_account_id of this ScheduledTransactionDetail. # noqa: E501 - :type: str - """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 - - self._transfer_account_id = transfer_account_id - @property def account_name(self): """Gets the account_name of this ScheduledTransactionDetail. # noqa: E501 @@ -495,6 +171,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionDetail, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index 624cedd..2bf6567 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class ScheduledTransactionResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class ScheduledTransactionResponse(object): def __init__(self, data=None): # noqa: E501 """ScheduledTransactionResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index a4d2feb..fe69821 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class ScheduledTransactionSummary(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -35,13 +33,14 @@ class ScheduledTransactionSummary(object): 'date_first': 'date', 'date_next': 'date', 'frequency': 'str', - 'amount': 'float', + 'amount': 'int', 'memo': 'str', 'flag_color': 'str', 'account_id': 'str', 'payee_id': 'str', 'category_id': 'str', - 'transfer_account_id': 'str' + 'transfer_account_id': 'str', + 'deleted': 'bool' } attribute_map = { @@ -55,12 +54,12 @@ class ScheduledTransactionSummary(object): 'account_id': 'account_id', 'payee_id': 'payee_id', 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id' + 'transfer_account_id': 'transfer_account_id', + 'deleted': 'deleted' } - def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amount=None, memo=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None): # noqa: E501 + def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amount=None, memo=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, deleted=None): # noqa: E501 """ScheduledTransactionSummary - a model defined in Swagger""" # noqa: E501 - self._id = None self._date_first = None self._date_next = None @@ -72,8 +71,8 @@ def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amo self._payee_id = None self._category_id = None self._transfer_account_id = None + self._deleted = None self.discriminator = None - self.id = id self.date_first = date_first self.date_next = date_next @@ -85,6 +84,7 @@ def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amo self.payee_id = payee_id self.category_id = category_id self.transfer_account_id = transfer_account_id + self.deleted = deleted @property def id(self): @@ -195,7 +195,7 @@ def amount(self): The scheduled transaction amount in milliunits format # noqa: E501 :return: The amount of this ScheduledTransactionSummary. # noqa: E501 - :rtype: float + :rtype: int """ return self._amount @@ -206,7 +206,7 @@ def amount(self, amount): The scheduled transaction amount in milliunits format # noqa: E501 :param amount: The amount of this ScheduledTransactionSummary. # noqa: E501 - :type: float + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -361,6 +361,31 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def deleted(self): + """Gets the deleted of this ScheduledTransactionSummary. # noqa: E501 + + Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. # noqa: E501 + + :return: The deleted of this ScheduledTransactionSummary. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this ScheduledTransactionSummary. + + Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this ScheduledTransactionSummary. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -382,6 +407,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionSummary, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transaction_wrapper.py b/ynab/models/scheduled_transaction_wrapper.py index 5343e7b..8fe10c8 100644 --- a/ynab/models/scheduled_transaction_wrapper.py +++ b/ynab/models/scheduled_transaction_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class ScheduledTransactionWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class ScheduledTransactionWrapper(object): def __init__(self, scheduled_transaction=None): # noqa: E501 """ScheduledTransactionWrapper - a model defined in Swagger""" # noqa: E501 - self._scheduled_transaction = None self.discriminator = None - self.scheduled_transaction = scheduled_transaction @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index 20c79f1..e4fb903 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class ScheduledTransactionsResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class ScheduledTransactionsResponse(object): def __init__(self, data=None): # noqa: E501 """ScheduledTransactionsResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionsResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/scheduled_transactions_wrapper.py b/ynab/models/scheduled_transactions_wrapper.py index 78b465e..b2b18cf 100644 --- a/ynab/models/scheduled_transactions_wrapper.py +++ b/ynab/models/scheduled_transactions_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class ScheduledTransactionsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class ScheduledTransactionsWrapper(object): def __init__(self, scheduled_transactions=None): # noqa: E501 """ScheduledTransactionsWrapper - a model defined in Swagger""" # noqa: E501 - self._scheduled_transactions = None self.discriminator = None - self.scheduled_transactions = scheduled_transactions @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(ScheduledTransactionsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index 80ced1e..6adfcd1 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class SubTransaction(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,11 +31,12 @@ class SubTransaction(object): swagger_types = { 'id': 'str', 'transaction_id': 'str', - 'amount': 'float', + 'amount': 'int', 'memo': 'str', 'payee_id': 'str', 'category_id': 'str', - 'transfer_account_id': 'str' + 'transfer_account_id': 'str', + 'deleted': 'bool' } attribute_map = { @@ -47,12 +46,12 @@ class SubTransaction(object): 'memo': 'memo', 'payee_id': 'payee_id', 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id' + 'transfer_account_id': 'transfer_account_id', + 'deleted': 'deleted' } - def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_id=None, category_id=None, transfer_account_id=None): # noqa: E501 + def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_id=None, category_id=None, transfer_account_id=None, deleted=None): # noqa: E501 """SubTransaction - a model defined in Swagger""" # noqa: E501 - self._id = None self._transaction_id = None self._amount = None @@ -60,8 +59,8 @@ def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_i self._payee_id = None self._category_id = None self._transfer_account_id = None + self._deleted = None self.discriminator = None - self.id = id self.transaction_id = transaction_id self.amount = amount @@ -69,6 +68,7 @@ def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_i self.payee_id = payee_id self.category_id = category_id self.transfer_account_id = transfer_account_id + self.deleted = deleted @property def id(self): @@ -123,7 +123,7 @@ def amount(self): The subtransaction amount in milliunits format # noqa: E501 :return: The amount of this SubTransaction. # noqa: E501 - :rtype: float + :rtype: int """ return self._amount @@ -134,7 +134,7 @@ def amount(self, amount): The subtransaction amount in milliunits format # noqa: E501 :param amount: The amount of this SubTransaction. # noqa: E501 - :type: float + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -235,6 +235,31 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def deleted(self): + """Gets the deleted of this SubTransaction. # noqa: E501 + + Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. # noqa: E501 + + :return: The deleted of this SubTransaction. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this SubTransaction. + + Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this SubTransaction. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -256,6 +281,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(SubTransaction, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index f705bb7..5633482 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -10,22 +10,19 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.sub_transaction import SubTransaction # noqa: F401,E501 from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 -class TransactionDetail(object): +class TransactionDetail(TransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,18 +31,6 @@ class TransactionDetail(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'date': 'date', - 'amount': 'float', - 'memo': 'str', - 'cleared': 'str', - 'approved': 'bool', - 'flag_color': 'str', - 'account_id': 'str', - 'payee_id': 'str', - 'category_id': 'str', - 'transfer_account_id': 'str', - 'import_id': 'str', 'account_name': 'str', 'payee_name': 'str', 'category_name': 'str', @@ -53,360 +38,24 @@ class TransactionDetail(object): } attribute_map = { - 'id': 'id', - 'date': 'date', - 'amount': 'amount', - 'memo': 'memo', - 'cleared': 'cleared', - 'approved': 'approved', - 'flag_color': 'flag_color', - 'account_id': 'account_id', - 'payee_id': 'payee_id', - 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id', - 'import_id': 'import_id', 'account_name': 'account_name', 'payee_name': 'payee_name', 'category_name': 'category_name', 'subtransactions': 'subtransactions' } - def __init__(self, id=None, date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, import_id=None, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 """TransactionDetail - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._date = None - self._amount = None - self._memo = None - self._cleared = None - self._approved = None - self._flag_color = None - self._account_id = None - self._payee_id = None - self._category_id = None - self._transfer_account_id = None - self._import_id = None self._account_name = None self._payee_name = None self._category_name = None self._subtransactions = None self.discriminator = None - - self.id = id - self.date = date - self.amount = amount - self.memo = memo - self.cleared = cleared - self.approved = approved - self.flag_color = flag_color - self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id - self.import_id = import_id self.account_name = account_name self.payee_name = payee_name self.category_name = category_name self.subtransactions = subtransactions - @property - def id(self): - """Gets the id of this TransactionDetail. # noqa: E501 - - - :return: The id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this TransactionDetail. - - - :param id: The id of this TransactionDetail. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def date(self): - """Gets the date of this TransactionDetail. # noqa: E501 - - - :return: The date of this TransactionDetail. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this TransactionDetail. - - - :param date: The date of this TransactionDetail. # noqa: E501 - :type: date - """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def amount(self): - """Gets the amount of this TransactionDetail. # noqa: E501 - - The transaction amount in milliunits format # noqa: E501 - - :return: The amount of this TransactionDetail. # noqa: E501 - :rtype: float - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this TransactionDetail. - - The transaction amount in milliunits format # noqa: E501 - - :param amount: The amount of this TransactionDetail. # noqa: E501 - :type: float - """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - - self._amount = amount - - @property - def memo(self): - """Gets the memo of this TransactionDetail. # noqa: E501 - - - :return: The memo of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._memo - - @memo.setter - def memo(self, memo): - """Sets the memo of this TransactionDetail. - - - :param memo: The memo of this TransactionDetail. # noqa: E501 - :type: str - """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 - - self._memo = memo - - @property - def cleared(self): - """Gets the cleared of this TransactionDetail. # noqa: E501 - - The cleared status of the transaction # noqa: E501 - - :return: The cleared of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._cleared - - @cleared.setter - def cleared(self, cleared): - """Sets the cleared of this TransactionDetail. - - The cleared status of the transaction # noqa: E501 - - :param cleared: The cleared of this TransactionDetail. # noqa: E501 - :type: str - """ - if cleared is None: - raise ValueError("Invalid value for `cleared`, must not be `None`") # noqa: E501 - allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 - if cleared not in allowed_values: - raise ValueError( - "Invalid value for `cleared` ({0}), must be one of {1}" # noqa: E501 - .format(cleared, allowed_values) - ) - - self._cleared = cleared - - @property - def approved(self): - """Gets the approved of this TransactionDetail. # noqa: E501 - - Whether or not the transaction is approved # noqa: E501 - - :return: The approved of this TransactionDetail. # noqa: E501 - :rtype: bool - """ - return self._approved - - @approved.setter - def approved(self, approved): - """Sets the approved of this TransactionDetail. - - Whether or not the transaction is approved # noqa: E501 - - :param approved: The approved of this TransactionDetail. # noqa: E501 - :type: bool - """ - if approved is None: - raise ValueError("Invalid value for `approved`, must not be `None`") # noqa: E501 - - self._approved = approved - - @property - def flag_color(self): - """Gets the flag_color of this TransactionDetail. # noqa: E501 - - The transaction flag # noqa: E501 - - :return: The flag_color of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._flag_color - - @flag_color.setter - def flag_color(self, flag_color): - """Sets the flag_color of this TransactionDetail. - - The transaction flag # noqa: E501 - - :param flag_color: The flag_color of this TransactionDetail. # noqa: E501 - :type: str - """ - if flag_color is None: - raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501 - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 - if flag_color not in allowed_values: - raise ValueError( - "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 - .format(flag_color, allowed_values) - ) - - self._flag_color = flag_color - - @property - def account_id(self): - """Gets the account_id of this TransactionDetail. # noqa: E501 - - - :return: The account_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._account_id - - @account_id.setter - def account_id(self, account_id): - """Sets the account_id of this TransactionDetail. - - - :param account_id: The account_id of this TransactionDetail. # noqa: E501 - :type: str - """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 - - self._account_id = account_id - - @property - def payee_id(self): - """Gets the payee_id of this TransactionDetail. # noqa: E501 - - - :return: The payee_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._payee_id - - @payee_id.setter - def payee_id(self, payee_id): - """Sets the payee_id of this TransactionDetail. - - - :param payee_id: The payee_id of this TransactionDetail. # noqa: E501 - :type: str - """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 - - self._payee_id = payee_id - - @property - def category_id(self): - """Gets the category_id of this TransactionDetail. # noqa: E501 - - - :return: The category_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._category_id - - @category_id.setter - def category_id(self, category_id): - """Sets the category_id of this TransactionDetail. - - - :param category_id: The category_id of this TransactionDetail. # noqa: E501 - :type: str - """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 - - self._category_id = category_id - - @property - def transfer_account_id(self): - """Gets the transfer_account_id of this TransactionDetail. # noqa: E501 - - - :return: The transfer_account_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._transfer_account_id - - @transfer_account_id.setter - def transfer_account_id(self, transfer_account_id): - """Sets the transfer_account_id of this TransactionDetail. - - - :param transfer_account_id: The transfer_account_id of this TransactionDetail. # noqa: E501 - :type: str - """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 - - self._transfer_account_id = transfer_account_id - - @property - def import_id(self): - """Gets the import_id of this TransactionDetail. # noqa: E501 - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :return: The import_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._import_id - - @import_id.setter - def import_id(self, import_id): - """Sets the import_id of this TransactionDetail. - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :param import_id: The import_id of this TransactionDetail. # noqa: E501 - :type: str - """ - if import_id is None: - raise ValueError("Invalid value for `import_id`, must not be `None`") # noqa: E501 - - self._import_id = import_id - @property def account_name(self): """Gets the account_name of this TransactionDetail. # noqa: E501 @@ -522,6 +171,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionDetail, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index e34d83b..b7909ec 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.transaction_wrapper import TransactionWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class TransactionResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class TransactionResponse(object): def __init__(self, data=None): # noqa: E501 """TransactionResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index 2d01ea8..72ccb4f 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class TransactionSummary(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,8 +30,8 @@ class TransactionSummary(object): """ swagger_types = { 'id': 'str', - 'date': 'date', - 'amount': 'float', + '_date': 'date', + 'amount': 'int', 'memo': 'str', 'cleared': 'str', 'approved': 'bool', @@ -42,12 +40,15 @@ class TransactionSummary(object): 'payee_id': 'str', 'category_id': 'str', 'transfer_account_id': 'str', - 'import_id': 'str' + 'transfer_transaction_id': 'str', + 'matched_transaction_id': 'str', + 'import_id': 'str', + 'deleted': 'bool' } attribute_map = { 'id': 'id', - 'date': 'date', + '_date': 'date', 'amount': 'amount', 'memo': 'memo', 'cleared': 'cleared', @@ -57,14 +58,16 @@ class TransactionSummary(object): 'payee_id': 'payee_id', 'category_id': 'category_id', 'transfer_account_id': 'transfer_account_id', - 'import_id': 'import_id' + 'transfer_transaction_id': 'transfer_transaction_id', + 'matched_transaction_id': 'matched_transaction_id', + 'import_id': 'import_id', + 'deleted': 'deleted' } - def __init__(self, id=None, date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, import_id=None): # noqa: E501 + def __init__(self, id=None, _date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, transfer_transaction_id=None, matched_transaction_id=None, import_id=None, deleted=None): # noqa: E501 """TransactionSummary - a model defined in Swagger""" # noqa: E501 - self._id = None - self._date = None + self.__date = None self._amount = None self._memo = None self._cleared = None @@ -74,11 +77,13 @@ def __init__(self, id=None, date=None, amount=None, memo=None, cleared=None, app self._payee_id = None self._category_id = None self._transfer_account_id = None + self._transfer_transaction_id = None + self._matched_transaction_id = None self._import_id = None + self._deleted = None self.discriminator = None - self.id = id - self.date = date + self._date = _date self.amount = amount self.memo = memo self.cleared = cleared @@ -88,7 +93,10 @@ def __init__(self, id=None, date=None, amount=None, memo=None, cleared=None, app self.payee_id = payee_id self.category_id = category_id self.transfer_account_id = transfer_account_id + self.transfer_transaction_id = transfer_transaction_id + self.matched_transaction_id = matched_transaction_id self.import_id = import_id + self.deleted = deleted @property def id(self): @@ -114,27 +122,27 @@ def id(self, id): self._id = id @property - def date(self): - """Gets the date of this TransactionSummary. # noqa: E501 + def _date(self): + """Gets the _date of this TransactionSummary. # noqa: E501 - :return: The date of this TransactionSummary. # noqa: E501 + :return: The _date of this TransactionSummary. # noqa: E501 :rtype: date """ - return self._date + return self.__date - @date.setter - def date(self, date): - """Sets the date of this TransactionSummary. + @_date.setter + def _date(self, _date): + """Sets the _date of this TransactionSummary. - :param date: The date of this TransactionSummary. # noqa: E501 + :param _date: The _date of this TransactionSummary. # noqa: E501 :type: date """ - if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - self._date = date + self.__date = _date @property def amount(self): @@ -143,7 +151,7 @@ def amount(self): The transaction amount in milliunits format # noqa: E501 :return: The amount of this TransactionSummary. # noqa: E501 - :rtype: float + :rtype: int """ return self._amount @@ -154,7 +162,7 @@ def amount(self, amount): The transaction amount in milliunits format # noqa: E501 :param amount: The amount of this TransactionSummary. # noqa: E501 - :type: float + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -344,6 +352,7 @@ def category_id(self, category_id): def transfer_account_id(self): """Gets the transfer_account_id of this TransactionSummary. # noqa: E501 + If a transfer transaction, the account to which it transfers # noqa: E501 :return: The transfer_account_id of this TransactionSummary. # noqa: E501 :rtype: str @@ -354,6 +363,7 @@ def transfer_account_id(self): def transfer_account_id(self, transfer_account_id): """Sets the transfer_account_id of this TransactionSummary. + If a transfer transaction, the account to which it transfers # noqa: E501 :param transfer_account_id: The transfer_account_id of this TransactionSummary. # noqa: E501 :type: str @@ -363,6 +373,56 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def transfer_transaction_id(self): + """Gets the transfer_transaction_id of this TransactionSummary. # noqa: E501 + + If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 + + :return: The transfer_transaction_id of this TransactionSummary. # noqa: E501 + :rtype: str + """ + return self._transfer_transaction_id + + @transfer_transaction_id.setter + def transfer_transaction_id(self, transfer_transaction_id): + """Sets the transfer_transaction_id of this TransactionSummary. + + If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 + + :param transfer_transaction_id: The transfer_transaction_id of this TransactionSummary. # noqa: E501 + :type: str + """ + if transfer_transaction_id is None: + raise ValueError("Invalid value for `transfer_transaction_id`, must not be `None`") # noqa: E501 + + self._transfer_transaction_id = transfer_transaction_id + + @property + def matched_transaction_id(self): + """Gets the matched_transaction_id of this TransactionSummary. # noqa: E501 + + If transaction is matched, the id of the matched transaction # noqa: E501 + + :return: The matched_transaction_id of this TransactionSummary. # noqa: E501 + :rtype: str + """ + return self._matched_transaction_id + + @matched_transaction_id.setter + def matched_transaction_id(self, matched_transaction_id): + """Sets the matched_transaction_id of this TransactionSummary. + + If transaction is matched, the id of the matched transaction # noqa: E501 + + :param matched_transaction_id: The matched_transaction_id of this TransactionSummary. # noqa: E501 + :type: str + """ + if matched_transaction_id is None: + raise ValueError("Invalid value for `matched_transaction_id`, must not be `None`") # noqa: E501 + + self._matched_transaction_id = matched_transaction_id + @property def import_id(self): """Gets the import_id of this TransactionSummary. # noqa: E501 @@ -388,6 +448,31 @@ def import_id(self, import_id): self._import_id = import_id + @property + def deleted(self): + """Gets the deleted of this TransactionSummary. # noqa: E501 + + Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 + + :return: The deleted of this TransactionSummary. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this TransactionSummary. + + Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this TransactionSummary. # noqa: E501 + :type: bool + """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -409,6 +494,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionSummary, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transaction_wrapper.py b/ynab/models/transaction_wrapper.py index da07931..f7670f0 100644 --- a/ynab/models/transaction_wrapper.py +++ b/ynab/models/transaction_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.transaction_detail import TransactionDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class TransactionWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class TransactionWrapper(object): def __init__(self, transaction=None): # noqa: E501 """TransactionWrapper - a model defined in Swagger""" # noqa: E501 - self._transaction = None self.discriminator = None - self.transaction = transaction @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index cfaa41a..68056de 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.transactions_wrapper import TransactionsWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class TransactionsResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class TransactionsResponse(object): def __init__(self, data=None): # noqa: E501 """TransactionsResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionsResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/transactions_wrapper.py b/ynab/models/transactions_wrapper.py index 3cbb13b..839936b 100644 --- a/ynab/models/transactions_wrapper.py +++ b/ynab/models/transactions_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.transaction_detail import TransactionDetail # noqa: F401,E501 @@ -24,7 +22,6 @@ class TransactionsWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,20 +30,22 @@ class TransactionsWrapper(object): and the value is json key in definition. """ swagger_types = { - 'transactions': 'list[TransactionDetail]' + 'transactions': 'list[TransactionDetail]', + 'server_knowledge': 'int' } attribute_map = { - 'transactions': 'transactions' + 'transactions': 'transactions', + 'server_knowledge': 'server_knowledge' } - def __init__(self, transactions=None): # noqa: E501 + def __init__(self, transactions=None, server_knowledge=None): # noqa: E501 """TransactionsWrapper - a model defined in Swagger""" # noqa: E501 - self._transactions = None + self._server_knowledge = None self.discriminator = None - self.transactions = transactions + self.server_knowledge = server_knowledge @property def transactions(self): @@ -71,6 +70,31 @@ def transactions(self, transactions): self._transactions = transactions + @property + def server_knowledge(self): + """Gets the server_knowledge of this TransactionsWrapper. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this TransactionsWrapper. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this TransactionsWrapper. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this TransactionsWrapper. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -92,6 +116,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(TransactionsWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/user.py b/ynab/models/user.py index 1c6382d..c008432 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 @@ -22,7 +21,6 @@ class User(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +38,8 @@ class User(object): def __init__(self, id=None): # noqa: E501 """User - a model defined in Swagger""" # noqa: E501 - self._id = None self.discriminator = None - self.id = id @property @@ -90,6 +86,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index ee4fd80..12359cd 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.user_wrapper import UserWrapper # noqa: F401,E501 @@ -24,7 +22,6 @@ class UserResponse(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class UserResponse(object): def __init__(self, data=None): # noqa: E501 """UserResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self.discriminator = None - self.data = data @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(UserResponse, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/models/user_wrapper.py b/ynab/models/user_wrapper.py index cc6a3ba..8f9d41b 100644 --- a/ynab/models/user_wrapper.py +++ b/ynab/models/user_wrapper.py @@ -10,12 +10,10 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - from ynab.models.user import User # noqa: F401,E501 @@ -24,7 +22,6 @@ class UserWrapper(object): Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +39,8 @@ class UserWrapper(object): def __init__(self, user=None): # noqa: E501 """UserWrapper - a model defined in Swagger""" # noqa: E501 - self._user = None self.discriminator = None - self.user = user @property @@ -92,6 +87,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(UserWrapper, dict): + for key, value in self.items(): + result[key] = value return result diff --git a/ynab/rest.py b/ynab/rest.py index 0a38fe6..702bdc2 100644 --- a/ynab/rest.py +++ b/ynab/rest.py @@ -10,7 +10,6 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import io diff --git a/ynab/ynab/__init__.py b/ynab/ynab/__init__.py deleted file mode 100644 index da52f1b..0000000 --- a/ynab/ynab/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from ynab.ynab.accounts_api import AccountsApi -from ynab.ynab.budgets_api import BudgetsApi -from ynab.ynab.categories_api import CategoriesApi -from ynab.ynab.months_api import MonthsApi -from ynab.ynab.payee_locations_api import PayeeLocationsApi -from ynab.ynab.payees_api import PayeesApi -from ynab.ynab.scheduled_transactions_api import ScheduledTransactionsApi -from ynab.ynab.transactions_api import TransactionsApi -from ynab.ynab.user_api import UserApi diff --git a/ynab/ynab/accounts_api.py b/ynab/ynab/accounts_api.py deleted file mode 100644 index 0f9f237..0000000 --- a/ynab/ynab/accounts_api.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class AccountsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_account_by_id(self, budget_id, account_id, **kwargs): # noqa: E501 - """Single account # noqa: E501 - - Returns a single account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_account_by_id(budget_id, account_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str account_id: The ID of the Account. (required) - :return: AccountResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_account_by_id_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 - else: - (data) = self.get_account_by_id_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 - return data - - def get_account_by_id_with_http_info(self, budget_id, account_id, **kwargs): # noqa: E501 - """Single account # noqa: E501 - - Returns a single account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_account_by_id_with_http_info(budget_id, account_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str account_id: The ID of the Account. (required) - :return: AccountResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'account_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_account_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_account_by_id`") # noqa: E501 - # verify the required parameter 'account_id' is set - if ('account_id' not in params or - params['account_id'] is None): - raise ValueError("Missing the required parameter `account_id` when calling `get_account_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'account_id' in params: - path_params['account_id'] = params['account_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/accounts/{account_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AccountResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_accounts(self, budget_id, **kwargs): # noqa: E501 - """Account list # noqa: E501 - - Returns all accounts # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_accounts(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: AccountsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_accounts_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_accounts_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_accounts_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """Account list # noqa: E501 - - Returns all accounts # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_accounts_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: AccountsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_accounts" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_accounts`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/accounts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AccountsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/budgets_api.py b/ynab/ynab/budgets_api.py deleted file mode 100644 index f34d7aa..0000000 --- a/ynab/ynab/budgets_api.py +++ /dev/null @@ -1,220 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class BudgetsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_budget_by_id(self, budget_id, **kwargs): # noqa: E501 - """Single budget # noqa: E501 - - Returns a single budget with all related entities. This resource is effectively a full budget export. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_by_id(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param float last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. - :return: BudgetDetailResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_budget_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_budget_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_budget_by_id_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """Single budget # noqa: E501 - - Returns a single budget with all related entities. This resource is effectively a full budget export. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_by_id_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param float last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. - :return: BudgetDetailResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_budget_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - if 'last_knowledge_of_server' in params: - query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BudgetDetailResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_budgets(self, **kwargs): # noqa: E501 - """List budgets # noqa: E501 - - Returns budgets list with summary information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budgets(use_async=True) - >>> result = thread.get() - - :param async bool - :return: BudgetSummaryResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_budgets_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_budgets_with_http_info(**kwargs) # noqa: E501 - return data - - def get_budgets_with_http_info(self, **kwargs): # noqa: E501 - """List budgets # noqa: E501 - - Returns budgets list with summary information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budgets_with_http_info(use_async=True) - >>> result = thread.get() - - :param async bool - :return: BudgetSummaryResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_budgets" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BudgetSummaryResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/categories_api.py b/ynab/ynab/categories_api.py deleted file mode 100644 index 6434f65..0000000 --- a/ynab/ynab/categories_api.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class CategoriesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_categories(self, budget_id, **kwargs): # noqa: E501 - """List categories # noqa: E501 - - Returns all categories grouped by category group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_categories(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: CategoriesResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_categories_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_categories_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_categories_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List categories # noqa: E501 - - Returns all categories grouped by category group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_categories_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: CategoriesResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_categories" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_categories`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/categories', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CategoriesResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_category_by_id(self, budget_id, category_id, **kwargs): # noqa: E501 - """Single category # noqa: E501 - - Returns a single category # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_category_by_id(budget_id, category_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str category_id: The ID of the Category. (required) - :return: CategoryResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_category_by_id_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 - else: - (data) = self.get_category_by_id_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 - return data - - def get_category_by_id_with_http_info(self, budget_id, category_id, **kwargs): # noqa: E501 - """Single category # noqa: E501 - - Returns a single category # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_category_by_id_with_http_info(budget_id, category_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str category_id: The ID of the Category. (required) - :return: CategoryResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'category_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_category_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_category_by_id`") # noqa: E501 - # verify the required parameter 'category_id' is set - if ('category_id' not in params or - params['category_id'] is None): - raise ValueError("Missing the required parameter `category_id` when calling `get_category_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'category_id' in params: - path_params['category_id'] = params['category_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/categories/{category_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CategoryResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/months_api.py b/ynab/ynab/months_api.py deleted file mode 100644 index 3fb64c1..0000000 --- a/ynab/ynab/months_api.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class MonthsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_budget_month(self, budget_id, month, **kwargs): # noqa: E501 - """Single budget month # noqa: E501 - - Returns a single budget month # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_month(budget_id, month, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param date month: The Budget Month. \"current\" can also be used to specify the current calendar month (UTC). (required) - :return: MonthDetailResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_budget_month_with_http_info(budget_id, month, **kwargs) # noqa: E501 - else: - (data) = self.get_budget_month_with_http_info(budget_id, month, **kwargs) # noqa: E501 - return data - - def get_budget_month_with_http_info(self, budget_id, month, **kwargs): # noqa: E501 - """Single budget month # noqa: E501 - - Returns a single budget month # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_month_with_http_info(budget_id, month, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param date month: The Budget Month. \"current\" can also be used to specify the current calendar month (UTC). (required) - :return: MonthDetailResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'month'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_budget_month" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_month`") # noqa: E501 - # verify the required parameter 'month' is set - if ('month' not in params or - params['month'] is None): - raise ValueError("Missing the required parameter `month` when calling `get_budget_month`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'month' in params: - path_params['month'] = params['month'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/months/{month}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MonthDetailResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_budget_months(self, budget_id, **kwargs): # noqa: E501 - """List budget months # noqa: E501 - - Returns all budget months # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_months(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: MonthSummariesResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_budget_months_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_budget_months_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_budget_months_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List budget months # noqa: E501 - - Returns all budget months # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_budget_months_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: MonthSummariesResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_budget_months" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_months`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/months', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MonthSummariesResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/payee_locations_api.py b/ynab/ynab/payee_locations_api.py deleted file mode 100644 index baefaf4..0000000 --- a/ynab/ynab/payee_locations_api.py +++ /dev/null @@ -1,335 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class PayeeLocationsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_payee_location_by_id(self, budget_id, payee_location_id, **kwargs): # noqa: E501 - """Single payee location # noqa: E501 - - Returns a single payee location # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_location_by_id(budget_id, payee_location_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_location_id: ID of payee location (required) - :return: PayeeLocationResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, **kwargs) # noqa: E501 - else: - (data) = self.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, **kwargs) # noqa: E501 - return data - - def get_payee_location_by_id_with_http_info(self, budget_id, payee_location_id, **kwargs): # noqa: E501 - """Single payee location # noqa: E501 - - Returns a single payee location # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_location_id: ID of payee location (required) - :return: PayeeLocationResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'payee_location_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_payee_location_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_location_by_id`") # noqa: E501 - # verify the required parameter 'payee_location_id' is set - if ('payee_location_id' not in params or - params['payee_location_id'] is None): - raise ValueError("Missing the required parameter `payee_location_id` when calling `get_payee_location_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'payee_location_id' in params: - path_params['payee_location_id'] = params['payee_location_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payee_locations/{payee_location_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PayeeLocationResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_payee_locations(self, budget_id, **kwargs): # noqa: E501 - """List payee locations # noqa: E501 - - Returns all payee locations # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_locations(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: PayeeLocationsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_payee_locations_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_payee_locations_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_payee_locations_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List payee locations # noqa: E501 - - Returns all payee locations # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_locations_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: PayeeLocationsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_payee_locations" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_locations`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payee_locations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PayeeLocationsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_payee_locations_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E501 - """List locations for a payee # noqa: E501 - - Returns all payee locations for the specified payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_locations_by_payee(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: ID of payee (required) - :return: PayeeLocationsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - else: - (data) = self.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - return data - - def get_payee_locations_by_payee_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 - """List locations for a payee # noqa: E501 - - Returns all payee locations for the specified payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: ID of payee (required) - :return: PayeeLocationsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'payee_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_payee_locations_by_payee" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_locations_by_payee`") # noqa: E501 - # verify the required parameter 'payee_id' is set - if ('payee_id' not in params or - params['payee_id'] is None): - raise ValueError("Missing the required parameter `payee_id` when calling `get_payee_locations_by_payee`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'payee_id' in params: - path_params['payee_id'] = params['payee_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payees/{payee_id}/payee_locations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PayeeLocationsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/payees_api.py b/ynab/ynab/payees_api.py deleted file mode 100644 index d4caae8..0000000 --- a/ynab/ynab/payees_api.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class PayeesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_payee_by_id(self, budget_id, payee_id, **kwargs): # noqa: E501 - """Single payee # noqa: E501 - - Returns single payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_by_id(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: The ID of the Payee. (required) - :return: PayeeResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_payee_by_id_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - else: - (data) = self.get_payee_by_id_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - return data - - def get_payee_by_id_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 - """Single payee # noqa: E501 - - Returns single payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payee_by_id_with_http_info(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: The ID of the Payee. (required) - :return: PayeeResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'payee_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_payee_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_by_id`") # noqa: E501 - # verify the required parameter 'payee_id' is set - if ('payee_id' not in params or - params['payee_id'] is None): - raise ValueError("Missing the required parameter `payee_id` when calling `get_payee_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'payee_id' in params: - path_params['payee_id'] = params['payee_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payees/{payee_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PayeeResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_payees(self, budget_id, **kwargs): # noqa: E501 - """List payees # noqa: E501 - - Returns all payees # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payees(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: PayeesResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_payees_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_payees_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_payees_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List payees # noqa: E501 - - Returns all payees # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_payees_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: PayeesResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_payees" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_payees`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payees', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PayeesResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/scheduled_transactions_api.py b/ynab/ynab/scheduled_transactions_api.py deleted file mode 100644 index 5688332..0000000 --- a/ynab/ynab/scheduled_transactions_api.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class ScheduledTransactionsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_scheduled_transaction_by_id(self, budget_id, scheduled_transaction_id, **kwargs): # noqa: E501 - """Single scheduled transaction # noqa: E501 - - Returns a single scheduled transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str scheduled_transaction_id: The ID of the Scheduled Transaction. (required) - :return: ScheduledTransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, **kwargs) # noqa: E501 - return data - - def get_scheduled_transaction_by_id_with_http_info(self, budget_id, scheduled_transaction_id, **kwargs): # noqa: E501 - """Single scheduled transaction # noqa: E501 - - Returns a single scheduled transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str scheduled_transaction_id: The ID of the Scheduled Transaction. (required) - :return: ScheduledTransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'scheduled_transaction_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_scheduled_transaction_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_scheduled_transaction_by_id`") # noqa: E501 - # verify the required parameter 'scheduled_transaction_id' is set - if ('scheduled_transaction_id' not in params or - params['scheduled_transaction_id'] is None): - raise ValueError("Missing the required parameter `scheduled_transaction_id` when calling `get_scheduled_transaction_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'scheduled_transaction_id' in params: - path_params['scheduled_transaction_id'] = params['scheduled_transaction_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ScheduledTransactionResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_scheduled_transactions(self, budget_id, **kwargs): # noqa: E501 - """List scheduled transactions # noqa: E501 - - Returns all scheduled transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_scheduled_transactions(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: ScheduledTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_scheduled_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scheduled_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_scheduled_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List scheduled transactions # noqa: E501 - - Returns all scheduled transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_scheduled_transactions_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :return: ScheduledTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_scheduled_transactions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_scheduled_transactions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/scheduled_transactions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ScheduledTransactionsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/transactions_api.py b/ynab/ynab/transactions_api.py deleted file mode 100644 index e7a1821..0000000 --- a/ynab/ynab/transactions_api.py +++ /dev/null @@ -1,878 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class TransactionsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def bulk_create_transactions(self, budget_id, transactions, **kwargs): # noqa: E501 - """Bulk create transactions # noqa: E501 - - Creates multiple transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.bulk_create_transactions(budget_id, transactions, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param BulkTransactions transactions: The list of Transactions to create. (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.bulk_create_transactions_with_http_info(budget_id, transactions, **kwargs) # noqa: E501 - else: - (data) = self.bulk_create_transactions_with_http_info(budget_id, transactions, **kwargs) # noqa: E501 - return data - - def bulk_create_transactions_with_http_info(self, budget_id, transactions, **kwargs): # noqa: E501 - """Bulk create transactions # noqa: E501 - - Creates multiple transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.bulk_create_transactions_with_http_info(budget_id, transactions, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param BulkTransactions transactions: The list of Transactions to create. (required) - :return: BulkResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'transactions'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method bulk_create_transactions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `bulk_create_transactions`") # noqa: E501 - # verify the required parameter 'transactions' is set - if ('transactions' not in params or - params['transactions'] is None): - raise ValueError("Missing the required parameter `transactions` when calling `bulk_create_transactions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'transactions' in params: - body_params = params['transactions'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/transactions/bulk', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BulkResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_transaction(self, budget_id, transaction, **kwargs): # noqa: E501 - """Create new transaction # noqa: E501 - - Creates a transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.create_transaction(budget_id, transaction, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param SaveTransactionWrapper transaction: The Transaction to create. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.create_transaction_with_http_info(budget_id, transaction, **kwargs) # noqa: E501 - else: - (data) = self.create_transaction_with_http_info(budget_id, transaction, **kwargs) # noqa: E501 - return data - - def create_transaction_with_http_info(self, budget_id, transaction, **kwargs): # noqa: E501 - """Create new transaction # noqa: E501 - - Creates a transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.create_transaction_with_http_info(budget_id, transaction, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param SaveTransactionWrapper transaction: The Transaction to create. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'transaction'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_transaction" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `create_transaction`") # noqa: E501 - # verify the required parameter 'transaction' is set - if ('transaction' not in params or - params['transaction'] is None): - raise ValueError("Missing the required parameter `transaction` when calling `create_transaction`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'transaction' in params: - body_params = params['transaction'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/transactions', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_transactions(self, budget_id, **kwargs): # noqa: E501 - """List transactions # noqa: E501 - - Returns budget transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param date since_date: Only return transactions on or after this date. - :param str type: Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') - :return: TransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 - else: - (data) = self.get_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 - return data - - def get_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 - """List transactions # noqa: E501 - - Returns budget transactions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_with_http_info(budget_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param date since_date: Only return transactions on or after this date. - :param str type: Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') - :return: TransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'since_date', 'type'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_transactions" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - - query_params = [] - if 'since_date' in params: - query_params.append(('since_date', params['since_date'])) # noqa: E501 - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/transactions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_transactions_by_account(self, budget_id, account_id, **kwargs): # noqa: E501 - """List account transactions # noqa: E501 - - Returns all transactions for a specified account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_account(budget_id, account_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str account_id: The ID of the Account. (required) - :param date since_date: Only return transactions on or after this date. - :return: TransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_transactions_by_account_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 - else: - (data) = self.get_transactions_by_account_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 - return data - - def get_transactions_by_account_with_http_info(self, budget_id, account_id, **kwargs): # noqa: E501 - """List account transactions # noqa: E501 - - Returns all transactions for a specified account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_account_with_http_info(budget_id, account_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str account_id: The ID of the Account. (required) - :param date since_date: Only return transactions on or after this date. - :return: TransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'account_id', 'since_date'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_transactions_by_account" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_account`") # noqa: E501 - # verify the required parameter 'account_id' is set - if ('account_id' not in params or - params['account_id'] is None): - raise ValueError("Missing the required parameter `account_id` when calling `get_transactions_by_account`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'account_id' in params: - path_params['account_id'] = params['account_id'] # noqa: E501 - - query_params = [] - if 'since_date' in params: - query_params.append(('since_date', params['since_date'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/accounts/{account_id}/transactions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_transactions_by_category(self, budget_id, category_id, **kwargs): # noqa: E501 - """List category transactions # noqa: E501 - - Returns all transactions for a specified category # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_category(budget_id, category_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str category_id: The ID of the Category. (required) - :param date since_date: Only return transactions on or after this date. - :return: HybridTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_transactions_by_category_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 - else: - (data) = self.get_transactions_by_category_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 - return data - - def get_transactions_by_category_with_http_info(self, budget_id, category_id, **kwargs): # noqa: E501 - """List category transactions # noqa: E501 - - Returns all transactions for a specified category # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_category_with_http_info(budget_id, category_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str category_id: The ID of the Category. (required) - :param date since_date: Only return transactions on or after this date. - :return: HybridTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'category_id', 'since_date'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_transactions_by_category" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_category`") # noqa: E501 - # verify the required parameter 'category_id' is set - if ('category_id' not in params or - params['category_id'] is None): - raise ValueError("Missing the required parameter `category_id` when calling `get_transactions_by_category`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'category_id' in params: - path_params['category_id'] = params['category_id'] # noqa: E501 - - query_params = [] - if 'since_date' in params: - query_params.append(('since_date', params['since_date'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/categories/{category_id}/transactions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='HybridTransactionsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_transactions_by_id(self, budget_id, transaction_id, **kwargs): # noqa: E501 - """Single transaction # noqa: E501 - - Returns a single transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_id(budget_id, transaction_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str transaction_id: The ID of the Transaction. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_transactions_by_id_with_http_info(budget_id, transaction_id, **kwargs) # noqa: E501 - else: - (data) = self.get_transactions_by_id_with_http_info(budget_id, transaction_id, **kwargs) # noqa: E501 - return data - - def get_transactions_by_id_with_http_info(self, budget_id, transaction_id, **kwargs): # noqa: E501 - """Single transaction # noqa: E501 - - Returns a single transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_id_with_http_info(budget_id, transaction_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str transaction_id: The ID of the Transaction. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'transaction_id'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_transactions_by_id" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_id`") # noqa: E501 - # verify the required parameter 'transaction_id' is set - if ('transaction_id' not in params or - params['transaction_id'] is None): - raise ValueError("Missing the required parameter `transaction_id` when calling `get_transactions_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'transaction_id' in params: - path_params['transaction_id'] = params['transaction_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/transactions/{transaction_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_transactions_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E501 - """List payee transactions # noqa: E501 - - Returns all transactions for a specified payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_payee(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: The ID of the Payee. (required) - :param date since_date: Only return transactions on or after this date. - :return: HybridTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_transactions_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - else: - (data) = self.get_transactions_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 - return data - - def get_transactions_by_payee_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 - """List payee transactions # noqa: E501 - - Returns all transactions for a specified payee # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_transactions_by_payee_with_http_info(budget_id, payee_id, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str payee_id: The ID of the Payee. (required) - :param date since_date: Only return transactions on or after this date. - :return: HybridTransactionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'payee_id', 'since_date'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_transactions_by_payee" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_payee`") # noqa: E501 - # verify the required parameter 'payee_id' is set - if ('payee_id' not in params or - params['payee_id'] is None): - raise ValueError("Missing the required parameter `payee_id` when calling `get_transactions_by_payee`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'payee_id' in params: - path_params['payee_id'] = params['payee_id'] # noqa: E501 - - query_params = [] - if 'since_date' in params: - query_params.append(('since_date', params['since_date'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/payees/{payee_id}/transactions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='HybridTransactionsResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_transaction(self, budget_id, transaction_id, transaction, **kwargs): # noqa: E501 - """Updates an existing transaction # noqa: E501 - - Updates a transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.update_transaction(budget_id, transaction_id, transaction, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str transaction_id: The ID of the Transaction. (required) - :param SaveTransactionWrapper transaction: The Transaction to update. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.update_transaction_with_http_info(budget_id, transaction_id, transaction, **kwargs) # noqa: E501 - else: - (data) = self.update_transaction_with_http_info(budget_id, transaction_id, transaction, **kwargs) # noqa: E501 - return data - - def update_transaction_with_http_info(self, budget_id, transaction_id, transaction, **kwargs): # noqa: E501 - """Updates an existing transaction # noqa: E501 - - Updates a transaction # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.update_transaction_with_http_info(budget_id, transaction_id, transaction, use_async=True) - >>> result = thread.get() - - :param async bool - :param str budget_id: The ID of the Budget. (required) - :param str transaction_id: The ID of the Transaction. (required) - :param SaveTransactionWrapper transaction: The Transaction to update. (required) - :return: TransactionResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['budget_id', 'transaction_id', 'transaction'] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_transaction" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'budget_id' is set - if ('budget_id' not in params or - params['budget_id'] is None): - raise ValueError("Missing the required parameter `budget_id` when calling `update_transaction`") # noqa: E501 - # verify the required parameter 'transaction_id' is set - if ('transaction_id' not in params or - params['transaction_id'] is None): - raise ValueError("Missing the required parameter `transaction_id` when calling `update_transaction`") # noqa: E501 - # verify the required parameter 'transaction' is set - if ('transaction' not in params or - params['transaction'] is None): - raise ValueError("Missing the required parameter `transaction` when calling `update_transaction`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'budget_id' in params: - path_params['budget_id'] = params['budget_id'] # noqa: E501 - if 'transaction_id' in params: - path_params['transaction_id'] = params['transaction_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'transaction' in params: - body_params = params['transaction'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/budgets/{budget_id}/transactions/{transaction_id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/ynab/ynab/user_api.py b/ynab/ynab/user_api.py deleted file mode 100644 index d68aaa5..0000000 --- a/ynab/ynab/user_api.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from ynab.api_client import ApiClient - - -class UserApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_user(self, **kwargs): # noqa: E501 - """User info # noqa: E501 - - Returns authenticated user information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_user(use_async=True) - >>> result = thread.get() - - :param async bool - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async'): - return self.get_user_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_user_with_http_info(**kwargs) # noqa: E501 - return data - - def get_user_with_http_info(self, **kwargs): # noqa: E501 - """User info # noqa: E501 - - Returns authenticated user information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass use_async=True - >>> thread = api.get_user_with_http_info(use_async=True) - >>> result = thread.get() - - :param async bool - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearer'] # noqa: E501 - - return self.api_client.call_api( - '/user', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserResponse', # noqa: E501 - auth_settings=auth_settings, - use_async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) From 572388255efa2efe6004af97b3c8ded331a99f67 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 28 Apr 2019 19:19:12 -0700 Subject: [PATCH 02/14] Updated to latest Swagger spec, including PATCH commands. --- docs/BudgetSettings.md | 10 + docs/BudgetSettingsResponse.md | 9 + docs/BudgetSettingsWrapper.md | 9 + docs/DeprecatedApi.md | 64 ++ docs/SaveMonthCategory.md | 9 + docs/SaveMonthCategoryWrapper.md | 9 + docs/SaveTransactionsResponse.md | 9 + docs/SaveTransactionsWrapper.md | 10 + test/test_budget_settings.py | 39 + test/test_budget_settings_response.py | 39 + test/test_budget_settings_wrapper.py | 39 + test/test_deprecated_api.py | 40 + test/test_save_month_category.py | 39 + test/test_save_month_category_wrapper.py | 39 + test/test_save_transactions_response.py | 39 + test/test_save_transactions_wrapper.py | 39 + ynab/api/__init__.py | 15 + ynab/api/accounts_api.py | 235 ++++++ ynab/api/budgets_api.py | 314 +++++++ ynab/api/categories_api.py | 469 +++++++++++ ynab/api/deprecated_api.py | 140 ++++ ynab/api/months_api.py | 235 ++++++ ynab/api/payee_locations_api.py | 334 ++++++++ ynab/api/payees_api.py | 235 ++++++ ynab/api/scheduled_transactions_api.py | 231 ++++++ ynab/api/transactions_api.py | 917 +++++++++++++++++++++ ynab/api/user_api.py | 120 +++ ynab/models/budget_settings.py | 141 ++++ ynab/models/budget_settings_response.py | 113 +++ ynab/models/budget_settings_wrapper.py | 113 +++ ynab/models/save_month_category.py | 114 +++ ynab/models/save_month_category_wrapper.py | 113 +++ ynab/models/save_transactions_response.py | 112 +++ ynab/models/save_transactions_wrapper.py | 138 ++++ 34 files changed, 4531 insertions(+) create mode 100644 docs/BudgetSettings.md create mode 100644 docs/BudgetSettingsResponse.md create mode 100644 docs/BudgetSettingsWrapper.md create mode 100644 docs/DeprecatedApi.md create mode 100644 docs/SaveMonthCategory.md create mode 100644 docs/SaveMonthCategoryWrapper.md create mode 100644 docs/SaveTransactionsResponse.md create mode 100644 docs/SaveTransactionsWrapper.md create mode 100644 test/test_budget_settings.py create mode 100644 test/test_budget_settings_response.py create mode 100644 test/test_budget_settings_wrapper.py create mode 100644 test/test_deprecated_api.py create mode 100644 test/test_save_month_category.py create mode 100644 test/test_save_month_category_wrapper.py create mode 100644 test/test_save_transactions_response.py create mode 100644 test/test_save_transactions_wrapper.py create mode 100644 ynab/api/__init__.py create mode 100644 ynab/api/accounts_api.py create mode 100644 ynab/api/budgets_api.py create mode 100644 ynab/api/categories_api.py create mode 100644 ynab/api/deprecated_api.py create mode 100644 ynab/api/months_api.py create mode 100644 ynab/api/payee_locations_api.py create mode 100644 ynab/api/payees_api.py create mode 100644 ynab/api/scheduled_transactions_api.py create mode 100644 ynab/api/transactions_api.py create mode 100644 ynab/api/user_api.py create mode 100644 ynab/models/budget_settings.py create mode 100644 ynab/models/budget_settings_response.py create mode 100644 ynab/models/budget_settings_wrapper.py create mode 100644 ynab/models/save_month_category.py create mode 100644 ynab/models/save_month_category_wrapper.py create mode 100644 ynab/models/save_transactions_response.py create mode 100644 ynab/models/save_transactions_wrapper.py diff --git a/docs/BudgetSettings.md b/docs/BudgetSettings.md new file mode 100644 index 0000000..ceda4a1 --- /dev/null +++ b/docs/BudgetSettings.md @@ -0,0 +1,10 @@ +# BudgetSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date_format** | [**DateFormat**](DateFormat.md) | | +**currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BudgetSettingsResponse.md b/docs/BudgetSettingsResponse.md new file mode 100644 index 0000000..15f5800 --- /dev/null +++ b/docs/BudgetSettingsResponse.md @@ -0,0 +1,9 @@ +# BudgetSettingsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**BudgetSettingsWrapper**](BudgetSettingsWrapper.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BudgetSettingsWrapper.md b/docs/BudgetSettingsWrapper.md new file mode 100644 index 0000000..e3ca77f --- /dev/null +++ b/docs/BudgetSettingsWrapper.md @@ -0,0 +1,9 @@ +# BudgetSettingsWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**BudgetSettings**](BudgetSettings.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DeprecatedApi.md b/docs/DeprecatedApi.md new file mode 100644 index 0000000..06709e5 --- /dev/null +++ b/docs/DeprecatedApi.md @@ -0,0 +1,64 @@ +# ynab.DeprecatedApi + +All URIs are relative to *https://api.youneedabudget.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulk_create_transactions**](DeprecatedApi.md#bulk_create_transactions) | **POST** /budgets/{budget_id}/transactions/bulk | Bulk create transactions + +# **bulk_create_transactions** +> BulkResponse bulk_create_transactions(body, budget_id) + +Bulk create transactions + +Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.DeprecatedApi(ynab.ApiClient(configuration)) +body = ynab.BulkTransactions() # BulkTransactions | The list of transactions to create +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) + +try: + # Bulk create transactions + api_response = api_instance.bulk_create_transactions(body, budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DeprecatedApi->bulk_create_transactions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BulkTransactions**](BulkTransactions.md)| The list of transactions to create | + **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + +### Return type + +[**BulkResponse**](BulkResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SaveMonthCategory.md b/docs/SaveMonthCategory.md new file mode 100644 index 0000000..3df4365 --- /dev/null +++ b/docs/SaveMonthCategory.md @@ -0,0 +1,9 @@ +# SaveMonthCategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budgeted** | **int** | Budgeted amount in milliunits format | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveMonthCategoryWrapper.md b/docs/SaveMonthCategoryWrapper.md new file mode 100644 index 0000000..7a70cfd --- /dev/null +++ b/docs/SaveMonthCategoryWrapper.md @@ -0,0 +1,9 @@ +# SaveMonthCategoryWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**SaveMonthCategory**](SaveMonthCategory.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveTransactionsResponse.md b/docs/SaveTransactionsResponse.md new file mode 100644 index 0000000..bdb7fa7 --- /dev/null +++ b/docs/SaveTransactionsResponse.md @@ -0,0 +1,9 @@ +# SaveTransactionsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveTransactionsWrapper.md b/docs/SaveTransactionsWrapper.md new file mode 100644 index 0000000..3682dfc --- /dev/null +++ b/docs/SaveTransactionsWrapper.md @@ -0,0 +1,10 @@ +# SaveTransactionsWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction** | [**SaveTransaction**](SaveTransaction.md) | | [optional] +**transactions** | [**list[SaveTransaction]**](SaveTransaction.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/test/test_budget_settings.py b/test/test_budget_settings.py new file mode 100644 index 0000000..10ea7e7 --- /dev/null +++ b/test/test_budget_settings.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_settings import BudgetSettings # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetSettings(unittest.TestCase): + """BudgetSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetSettings(self): + """Test BudgetSettings""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_settings.BudgetSettings() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_settings_response.py b/test/test_budget_settings_response.py new file mode 100644 index 0000000..1cd78d6 --- /dev/null +++ b/test/test_budget_settings_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_settings_response import BudgetSettingsResponse # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetSettingsResponse(unittest.TestCase): + """BudgetSettingsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetSettingsResponse(self): + """Test BudgetSettingsResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_settings_response.BudgetSettingsResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_settings_wrapper.py b/test/test_budget_settings_wrapper.py new file mode 100644 index 0000000..1f511a1 --- /dev/null +++ b/test/test_budget_settings_wrapper.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetSettingsWrapper(unittest.TestCase): + """BudgetSettingsWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetSettingsWrapper(self): + """Test BudgetSettingsWrapper""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_settings_wrapper.BudgetSettingsWrapper() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_deprecated_api.py b/test/test_deprecated_api.py new file mode 100644 index 0000000..c31748d --- /dev/null +++ b/test/test_deprecated_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.api.deprecated_api import DeprecatedApi # noqa: E501 +from ynab.rest import ApiException + + +class TestDeprecatedApi(unittest.TestCase): + """DeprecatedApi unit test stubs""" + + def setUp(self): + self.api = ynab.api.deprecated_api.DeprecatedApi() # noqa: E501 + + def tearDown(self): + pass + + def test_bulk_create_transactions(self): + """Test case for bulk_create_transactions + + Bulk create transactions # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_month_category.py b/test/test_save_month_category.py new file mode 100644 index 0000000..2c71d3a --- /dev/null +++ b/test/test_save_month_category.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_month_category import SaveMonthCategory # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveMonthCategory(unittest.TestCase): + """SaveMonthCategory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveMonthCategory(self): + """Test SaveMonthCategory""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_month_category.SaveMonthCategory() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_month_category_wrapper.py b/test/test_save_month_category_wrapper.py new file mode 100644 index 0000000..5342eb5 --- /dev/null +++ b/test/test_save_month_category_wrapper.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveMonthCategoryWrapper(unittest.TestCase): + """SaveMonthCategoryWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveMonthCategoryWrapper(self): + """Test SaveMonthCategoryWrapper""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_month_category_wrapper.SaveMonthCategoryWrapper() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_transactions_response.py b/test/test_save_transactions_response.py new file mode 100644 index 0000000..ddd83c5 --- /dev/null +++ b/test/test_save_transactions_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_transactions_response import SaveTransactionsResponse # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveTransactionsResponse(unittest.TestCase): + """SaveTransactionsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveTransactionsResponse(self): + """Test SaveTransactionsResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_transactions_response.SaveTransactionsResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_transactions_wrapper.py b/test/test_save_transactions_wrapper.py new file mode 100644 index 0000000..1cbb113 --- /dev/null +++ b/test/test_save_transactions_wrapper.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_transactions_wrapper import SaveTransactionsWrapper # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveTransactionsWrapper(unittest.TestCase): + """SaveTransactionsWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveTransactionsWrapper(self): + """Test SaveTransactionsWrapper""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_transactions_wrapper.SaveTransactionsWrapper() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/ynab/api/__init__.py b/ynab/api/__init__.py new file mode 100644 index 0000000..7e37bb1 --- /dev/null +++ b/ynab/api/__init__.py @@ -0,0 +1,15 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from ynab.api.accounts_api import AccountsApi +from ynab.api.budgets_api import BudgetsApi +from ynab.api.categories_api import CategoriesApi +from ynab.api.deprecated_api import DeprecatedApi +from ynab.api.months_api import MonthsApi +from ynab.api.payee_locations_api import PayeeLocationsApi +from ynab.api.payees_api import PayeesApi +from ynab.api.scheduled_transactions_api import ScheduledTransactionsApi +from ynab.api.transactions_api import TransactionsApi +from ynab.api.user_api import UserApi diff --git a/ynab/api/accounts_api.py b/ynab/api/accounts_api.py new file mode 100644 index 0000000..1bd689f --- /dev/null +++ b/ynab/api/accounts_api.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class AccountsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_account_by_id(self, budget_id, account_id, **kwargs): # noqa: E501 + """Single account # noqa: E501 + + Returns a single account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_account_by_id(budget_id, account_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str account_id: The id of the account (required) + :return: AccountResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_account_by_id_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 + else: + (data) = self.get_account_by_id_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 + return data + + def get_account_by_id_with_http_info(self, budget_id, account_id, **kwargs): # noqa: E501 + """Single account # noqa: E501 + + Returns a single account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_account_by_id_with_http_info(budget_id, account_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str account_id: The id of the account (required) + :return: AccountResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'account_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_account_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_account_by_id`") # noqa: E501 + # verify the required parameter 'account_id' is set + if ('account_id' not in params or + params['account_id'] is None): + raise ValueError("Missing the required parameter `account_id` when calling `get_account_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'account_id' in params: + path_params['account_id'] = params['account_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/accounts/{account_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AccountResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_accounts(self, budget_id, **kwargs): # noqa: E501 + """Account list # noqa: E501 + + Returns all accounts # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_accounts(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: AccountsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_accounts_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_accounts_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_accounts_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """Account list # noqa: E501 + + Returns all accounts # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_accounts_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: AccountsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_accounts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_accounts`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AccountsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/budgets_api.py b/ynab/api/budgets_api.py new file mode 100644 index 0000000..2b4ed77 --- /dev/null +++ b/ynab/api/budgets_api.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class BudgetsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_budget_by_id(self, budget_id, **kwargs): # noqa: E501 + """Single budget # noqa: E501 + + Returns a single budget with all related entities. This resource is effectively a full budget export. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_by_id(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: BudgetDetailResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_budget_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_budget_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_budget_by_id_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """Single budget # noqa: E501 + + Returns a single budget with all related entities. This resource is effectively a full budget export. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_by_id_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: BudgetDetailResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_budget_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BudgetDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_budget_settings_by_id(self, budget_id, **kwargs): # noqa: E501 + """Budget Settings # noqa: E501 + + Returns settings for a budget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_settings_by_id(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: BudgetSettingsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_budget_settings_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_budget_settings_by_id_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_budget_settings_by_id_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """Budget Settings # noqa: E501 + + Returns settings for a budget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_settings_by_id_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: BudgetSettingsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_budget_settings_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_settings_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/settings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BudgetSettingsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_budgets(self, **kwargs): # noqa: E501 + """List budgets # noqa: E501 + + Returns budgets list with summary information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budgets(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: BudgetSummaryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_budgets_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_budgets_with_http_info(**kwargs) # noqa: E501 + return data + + def get_budgets_with_http_info(self, **kwargs): # noqa: E501 + """List budgets # noqa: E501 + + Returns budgets list with summary information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budgets_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: BudgetSummaryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_budgets" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BudgetSummaryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/categories_api.py b/ynab/api/categories_api.py new file mode 100644 index 0000000..5ebf9b8 --- /dev/null +++ b/ynab/api/categories_api.py @@ -0,0 +1,469 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class CategoriesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_categories(self, budget_id, **kwargs): # noqa: E501 + """List categories # noqa: E501 + + Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_categories(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: CategoriesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_categories_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_categories_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_categories_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List categories # noqa: E501 + + Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_categories_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: CategoriesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_categories" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_categories`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/categories', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoriesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_category_by_id(self, budget_id, category_id, **kwargs): # noqa: E501 + """Single category # noqa: E501 + + Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_category_by_id(budget_id, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_category_by_id_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 + else: + (data) = self.get_category_by_id_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 + return data + + def get_category_by_id_with_http_info(self, budget_id, category_id, **kwargs): # noqa: E501 + """Single category # noqa: E501 + + Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_category_by_id_with_http_info(budget_id, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'category_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_category_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_category_by_id`") # noqa: E501 + # verify the required parameter 'category_id' is set + if ('category_id' not in params or + params['category_id'] is None): + raise ValueError("Missing the required parameter `category_id` when calling `get_category_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'category_id' in params: + path_params['category_id'] = params['category_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/categories/{category_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_month_category_by_id(self, budget_id, month, category_id, **kwargs): # noqa: E501 + """Single category for a specific budget month # noqa: E501 + + Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_month_category_by_id(budget_id, month, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_month_category_by_id_with_http_info(budget_id, month, category_id, **kwargs) # noqa: E501 + else: + (data) = self.get_month_category_by_id_with_http_info(budget_id, month, category_id, **kwargs) # noqa: E501 + return data + + def get_month_category_by_id_with_http_info(self, budget_id, month, category_id, **kwargs): # noqa: E501 + """Single category for a specific budget month # noqa: E501 + + Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_month_category_by_id_with_http_info(budget_id, month, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'month', 'category_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_month_category_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_month_category_by_id`") # noqa: E501 + # verify the required parameter 'month' is set + if ('month' not in params or + params['month'] is None): + raise ValueError("Missing the required parameter `month` when calling `get_month_category_by_id`") # noqa: E501 + # verify the required parameter 'category_id' is set + if ('category_id' not in params or + params['category_id'] is None): + raise ValueError("Missing the required parameter `category_id` when calling `get_month_category_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'month' in params: + path_params['month'] = params['month'] # noqa: E501 + if 'category_id' in params: + path_params['category_id'] = params['category_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/months/{month}/categories/{category_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_month_category(self, body, budget_id, month, category_id, **kwargs): # noqa: E501 + """Update a category for a specific month # noqa: E501 + + Update a category for a specific month # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_month_category(body, budget_id, month, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveMonthCategoryWrapper body: The category to update (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_month_category_with_http_info(body, budget_id, month, category_id, **kwargs) # noqa: E501 + else: + (data) = self.update_month_category_with_http_info(body, budget_id, month, category_id, **kwargs) # noqa: E501 + return data + + def update_month_category_with_http_info(self, body, budget_id, month, category_id, **kwargs): # noqa: E501 + """Update a category for a specific month # noqa: E501 + + Update a category for a specific month # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_month_category_with_http_info(body, budget_id, month, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveMonthCategoryWrapper body: The category to update (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :param str category_id: The id of the category (required) + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id', 'month', 'category_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_month_category" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_month_category`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `update_month_category`") # noqa: E501 + # verify the required parameter 'month' is set + if ('month' not in params or + params['month'] is None): + raise ValueError("Missing the required parameter `month` when calling `update_month_category`") # noqa: E501 + # verify the required parameter 'category_id' is set + if ('category_id' not in params or + params['category_id'] is None): + raise ValueError("Missing the required parameter `category_id` when calling `update_month_category`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'month' in params: + path_params['month'] = params['month'] # noqa: E501 + if 'category_id' in params: + path_params['category_id'] = params['category_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/months/{month}/categories/{category_id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/deprecated_api.py b/ynab/api/deprecated_api.py new file mode 100644 index 0000000..28a5b98 --- /dev/null +++ b/ynab/api/deprecated_api.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class DeprecatedApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def bulk_create_transactions(self, body, budget_id, **kwargs): # noqa: E501 + """Bulk create transactions # noqa: E501 + + Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_create_transactions(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param BulkTransactions body: The list of transactions to create (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.bulk_create_transactions_with_http_info(body, budget_id, **kwargs) # noqa: E501 + else: + (data) = self.bulk_create_transactions_with_http_info(body, budget_id, **kwargs) # noqa: E501 + return data + + def bulk_create_transactions_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 + """Bulk create transactions # noqa: E501 + + Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_create_transactions_with_http_info(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param BulkTransactions body: The list of transactions to create (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: BulkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method bulk_create_transactions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `bulk_create_transactions`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `bulk_create_transactions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions/bulk', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BulkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/months_api.py b/ynab/api/months_api.py new file mode 100644 index 0000000..24e19f9 --- /dev/null +++ b/ynab/api/months_api.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class MonthsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_budget_month(self, budget_id, month, **kwargs): # noqa: E501 + """Single budget month # noqa: E501 + + Returns a single budget month # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_month(budget_id, month, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :return: MonthDetailResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_budget_month_with_http_info(budget_id, month, **kwargs) # noqa: E501 + else: + (data) = self.get_budget_month_with_http_info(budget_id, month, **kwargs) # noqa: E501 + return data + + def get_budget_month_with_http_info(self, budget_id, month, **kwargs): # noqa: E501 + """Single budget month # noqa: E501 + + Returns a single budget month # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_month_with_http_info(budget_id, month, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :return: MonthDetailResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'month'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_budget_month" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_month`") # noqa: E501 + # verify the required parameter 'month' is set + if ('month' not in params or + params['month'] is None): + raise ValueError("Missing the required parameter `month` when calling `get_budget_month`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'month' in params: + path_params['month'] = params['month'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/months/{month}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonthDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_budget_months(self, budget_id, **kwargs): # noqa: E501 + """List budget months # noqa: E501 + + Returns all budget months # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_months(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: MonthSummariesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_budget_months_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_budget_months_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_budget_months_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List budget months # noqa: E501 + + Returns all budget months # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_budget_months_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: MonthSummariesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_budget_months" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_budget_months`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/months', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonthSummariesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/payee_locations_api.py b/ynab/api/payee_locations_api.py new file mode 100644 index 0000000..7afb4f7 --- /dev/null +++ b/ynab/api/payee_locations_api.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class PayeeLocationsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_payee_location_by_id(self, budget_id, payee_location_id, **kwargs): # noqa: E501 + """Single payee location # noqa: E501 + + Returns a single payee location # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_location_by_id(budget_id, payee_location_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_location_id: id of payee location (required) + :return: PayeeLocationResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, **kwargs) # noqa: E501 + else: + (data) = self.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, **kwargs) # noqa: E501 + return data + + def get_payee_location_by_id_with_http_info(self, budget_id, payee_location_id, **kwargs): # noqa: E501 + """Single payee location # noqa: E501 + + Returns a single payee location # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_location_by_id_with_http_info(budget_id, payee_location_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_location_id: id of payee location (required) + :return: PayeeLocationResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'payee_location_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payee_location_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_location_by_id`") # noqa: E501 + # verify the required parameter 'payee_location_id' is set + if ('payee_location_id' not in params or + params['payee_location_id'] is None): + raise ValueError("Missing the required parameter `payee_location_id` when calling `get_payee_location_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'payee_location_id' in params: + path_params['payee_location_id'] = params['payee_location_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payee_locations/{payee_location_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayeeLocationResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_payee_locations(self, budget_id, **kwargs): # noqa: E501 + """List payee locations # noqa: E501 + + Returns all payee locations # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_locations(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: PayeeLocationsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payee_locations_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_payee_locations_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_payee_locations_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List payee locations # noqa: E501 + + Returns all payee locations # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_locations_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: PayeeLocationsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payee_locations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_locations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payee_locations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayeeLocationsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_payee_locations_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E501 + """List locations for a payee # noqa: E501 + + Returns all payee locations for the specified payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_locations_by_payee(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: id of payee (required) + :return: PayeeLocationsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + else: + (data) = self.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + return data + + def get_payee_locations_by_payee_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 + """List locations for a payee # noqa: E501 + + Returns all payee locations for the specified payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: id of payee (required) + :return: PayeeLocationsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'payee_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payee_locations_by_payee" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_locations_by_payee`") # noqa: E501 + # verify the required parameter 'payee_id' is set + if ('payee_id' not in params or + params['payee_id'] is None): + raise ValueError("Missing the required parameter `payee_id` when calling `get_payee_locations_by_payee`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'payee_id' in params: + path_params['payee_id'] = params['payee_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payees/{payee_id}/payee_locations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayeeLocationsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/payees_api.py b/ynab/api/payees_api.py new file mode 100644 index 0000000..06124f5 --- /dev/null +++ b/ynab/api/payees_api.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class PayeesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_payee_by_id(self, budget_id, payee_id, **kwargs): # noqa: E501 + """Single payee # noqa: E501 + + Returns single payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_by_id(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: The id of the payee (required) + :return: PayeeResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payee_by_id_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + else: + (data) = self.get_payee_by_id_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + return data + + def get_payee_by_id_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 + """Single payee # noqa: E501 + + Returns single payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payee_by_id_with_http_info(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: The id of the payee (required) + :return: PayeeResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'payee_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payee_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_payee_by_id`") # noqa: E501 + # verify the required parameter 'payee_id' is set + if ('payee_id' not in params or + params['payee_id'] is None): + raise ValueError("Missing the required parameter `payee_id` when calling `get_payee_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'payee_id' in params: + path_params['payee_id'] = params['payee_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payees/{payee_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayeeResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_payees(self, budget_id, **kwargs): # noqa: E501 + """List payees # noqa: E501 + + Returns all payees # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payees(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: PayeesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payees_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_payees_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_payees_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List payees # noqa: E501 + + Returns all payees # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payees_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: PayeesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payees" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_payees`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payees', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayeesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/scheduled_transactions_api.py b/ynab/api/scheduled_transactions_api.py new file mode 100644 index 0000000..1f1cf64 --- /dev/null +++ b/ynab/api/scheduled_transactions_api.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class ScheduledTransactionsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_scheduled_transaction_by_id(self, budget_id, scheduled_transaction_id, **kwargs): # noqa: E501 + """Single scheduled transaction # noqa: E501 + + Returns a single scheduled transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str scheduled_transaction_id: The id of the scheduled transaction (required) + :return: ScheduledTransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, **kwargs) # noqa: E501 + else: + (data) = self.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, **kwargs) # noqa: E501 + return data + + def get_scheduled_transaction_by_id_with_http_info(self, budget_id, scheduled_transaction_id, **kwargs): # noqa: E501 + """Single scheduled transaction # noqa: E501 + + Returns a single scheduled transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_scheduled_transaction_by_id_with_http_info(budget_id, scheduled_transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str scheduled_transaction_id: The id of the scheduled transaction (required) + :return: ScheduledTransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'scheduled_transaction_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_scheduled_transaction_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_scheduled_transaction_by_id`") # noqa: E501 + # verify the required parameter 'scheduled_transaction_id' is set + if ('scheduled_transaction_id' not in params or + params['scheduled_transaction_id'] is None): + raise ValueError("Missing the required parameter `scheduled_transaction_id` when calling `get_scheduled_transaction_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'scheduled_transaction_id' in params: + path_params['scheduled_transaction_id'] = params['scheduled_transaction_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ScheduledTransactionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_scheduled_transactions(self, budget_id, **kwargs): # noqa: E501 + """List scheduled transactions # noqa: E501 + + Returns all scheduled transactions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_scheduled_transactions(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: ScheduledTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_scheduled_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_scheduled_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_scheduled_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List scheduled transactions # noqa: E501 + + Returns all scheduled transactions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_scheduled_transactions_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: ScheduledTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_scheduled_transactions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_scheduled_transactions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/scheduled_transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ScheduledTransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/transactions_api.py b/ynab/api/transactions_api.py new file mode 100644 index 0000000..abcb62c --- /dev/null +++ b/ynab/api/transactions_api.py @@ -0,0 +1,917 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class TransactionsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_transaction(self, body, budget_id, **kwargs): # noqa: E501 + """Create a single transaction or multiple transactions # noqa: E501 + + Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_transaction(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: SaveTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_transaction_with_http_info(body, budget_id, **kwargs) # noqa: E501 + else: + (data) = self.create_transaction_with_http_info(body, budget_id, **kwargs) # noqa: E501 + return data + + def create_transaction_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 + """Create a single transaction or multiple transactions # noqa: E501 + + Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_transaction_with_http_info(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: SaveTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_transaction" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_transaction`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `create_transaction`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SaveTransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_transaction_by_id(self, budget_id, transaction_id, **kwargs): # noqa: E501 + """Single transaction # noqa: E501 + + Returns a single transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transaction_by_id(budget_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str transaction_id: The id of the transaction (required) + :return: TransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_transaction_by_id_with_http_info(budget_id, transaction_id, **kwargs) # noqa: E501 + else: + (data) = self.get_transaction_by_id_with_http_info(budget_id, transaction_id, **kwargs) # noqa: E501 + return data + + def get_transaction_by_id_with_http_info(self, budget_id, transaction_id, **kwargs): # noqa: E501 + """Single transaction # noqa: E501 + + Returns a single transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transaction_by_id_with_http_info(budget_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str transaction_id: The id of the transaction (required) + :return: TransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'transaction_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transaction_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_transaction_by_id`") # noqa: E501 + # verify the required parameter 'transaction_id' is set + if ('transaction_id' not in params or + params['transaction_id'] is None): + raise ValueError("Missing the required parameter `transaction_id` when calling `get_transaction_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'transaction_id' in params: + path_params['transaction_id'] = params['transaction_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions/{transaction_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_transactions(self, budget_id, **kwargs): # noqa: E501 + """List transactions # noqa: E501 + + Returns budget transactions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: TransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.get_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def get_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """List transactions # noqa: E501 + + Returns budget transactions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: TransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'since_date', 'type', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transactions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + if 'since_date' in params: + query_params.append(('since_date', params['since_date'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_transactions_by_account(self, budget_id, account_id, **kwargs): # noqa: E501 + """List account transactions # noqa: E501 + + Returns all transactions for a specified account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_account(budget_id, account_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str account_id: The id of the account (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: TransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_transactions_by_account_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 + else: + (data) = self.get_transactions_by_account_with_http_info(budget_id, account_id, **kwargs) # noqa: E501 + return data + + def get_transactions_by_account_with_http_info(self, budget_id, account_id, **kwargs): # noqa: E501 + """List account transactions # noqa: E501 + + Returns all transactions for a specified account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_account_with_http_info(budget_id, account_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str account_id: The id of the account (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: TransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'account_id', 'since_date', 'type', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transactions_by_account" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_account`") # noqa: E501 + # verify the required parameter 'account_id' is set + if ('account_id' not in params or + params['account_id'] is None): + raise ValueError("Missing the required parameter `account_id` when calling `get_transactions_by_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'account_id' in params: + path_params['account_id'] = params['account_id'] # noqa: E501 + + query_params = [] + if 'since_date' in params: + query_params.append(('since_date', params['since_date'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/accounts/{account_id}/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_transactions_by_category(self, budget_id, category_id, **kwargs): # noqa: E501 + """List category transactions # noqa: E501 + + Returns all transactions for a specified category # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_category(budget_id, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str category_id: The id of the category (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: HybridTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_transactions_by_category_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 + else: + (data) = self.get_transactions_by_category_with_http_info(budget_id, category_id, **kwargs) # noqa: E501 + return data + + def get_transactions_by_category_with_http_info(self, budget_id, category_id, **kwargs): # noqa: E501 + """List category transactions # noqa: E501 + + Returns all transactions for a specified category # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_category_with_http_info(budget_id, category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str category_id: The id of the category (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: HybridTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'category_id', 'since_date', 'type', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transactions_by_category" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_category`") # noqa: E501 + # verify the required parameter 'category_id' is set + if ('category_id' not in params or + params['category_id'] is None): + raise ValueError("Missing the required parameter `category_id` when calling `get_transactions_by_category`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'category_id' in params: + path_params['category_id'] = params['category_id'] # noqa: E501 + + query_params = [] + if 'since_date' in params: + query_params.append(('since_date', params['since_date'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/categories/{category_id}/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='HybridTransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_transactions_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E501 + """List payee transactions # noqa: E501 + + Returns all transactions for a specified payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_payee(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: The id of the payee (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: HybridTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_transactions_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + else: + (data) = self.get_transactions_by_payee_with_http_info(budget_id, payee_id, **kwargs) # noqa: E501 + return data + + def get_transactions_by_payee_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 + """List payee transactions # noqa: E501 + + Returns all transactions for a specified payee # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transactions_by_payee_with_http_info(budget_id, payee_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str payee_id: The id of the payee (required) + :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). + :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :return: HybridTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id', 'payee_id', 'since_date', 'type', 'last_knowledge_of_server'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transactions_by_payee" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `get_transactions_by_payee`") # noqa: E501 + # verify the required parameter 'payee_id' is set + if ('payee_id' not in params or + params['payee_id'] is None): + raise ValueError("Missing the required parameter `payee_id` when calling `get_transactions_by_payee`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'payee_id' in params: + path_params['payee_id'] = params['payee_id'] # noqa: E501 + + query_params = [] + if 'since_date' in params: + query_params.append(('since_date', params['since_date'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/payees/{payee_id}/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='HybridTransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_transaction(self, body, budget_id, transaction_id, **kwargs): # noqa: E501 + """Updates an existing transaction # noqa: E501 + + Updates a transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_transaction(body, budget_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionWrapper body: The transaction to update (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str transaction_id: The id of the transaction (required) + :return: TransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_transaction_with_http_info(body, budget_id, transaction_id, **kwargs) # noqa: E501 + else: + (data) = self.update_transaction_with_http_info(body, budget_id, transaction_id, **kwargs) # noqa: E501 + return data + + def update_transaction_with_http_info(self, body, budget_id, transaction_id, **kwargs): # noqa: E501 + """Updates an existing transaction # noqa: E501 + + Updates a transaction # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_transaction_with_http_info(body, budget_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionWrapper body: The transaction to update (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str transaction_id: The id of the transaction (required) + :return: TransactionResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id', 'transaction_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_transaction" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_transaction`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `update_transaction`") # noqa: E501 + # verify the required parameter 'transaction_id' is set + if ('transaction_id' not in params or + params['transaction_id'] is None): + raise ValueError("Missing the required parameter `transaction_id` when calling `update_transaction`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + if 'transaction_id' in params: + path_params['transaction_id'] = params['transaction_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions/{transaction_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_transactions(self, body, budget_id, **kwargs): # noqa: E501 + """Update multiple transactions # noqa: E501 + + Updates multiple transactions, by 'id' or 'import_id'. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_transactions(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionsWrapper body: The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: SaveTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_transactions_with_http_info(body, budget_id, **kwargs) # noqa: E501 + else: + (data) = self.update_transactions_with_http_info(body, budget_id, **kwargs) # noqa: E501 + return data + + def update_transactions_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 + """Update multiple transactions # noqa: E501 + + Updates multiple transactions, by 'id' or 'import_id'. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_transactions_with_http_info(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveTransactionsWrapper body: The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. (required) + :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :return: SaveTransactionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_transactions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_transactions`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `update_transactions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SaveTransactionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/api/user_api.py b/ynab/api/user_api.py new file mode 100644 index 0000000..182084a --- /dev/null +++ b/ynab/api/user_api.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from ynab.api_client import ApiClient + + +class UserApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_user(self, **kwargs): # noqa: E501 + """User info # noqa: E501 + + Returns authenticated user information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: UserResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_user_with_http_info(**kwargs) # noqa: E501 + return data + + def get_user_with_http_info(self, **kwargs): # noqa: E501 + """User info # noqa: E501 + + Returns authenticated user information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: UserResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/user', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py new file mode 100644 index 0000000..7f86bca --- /dev/null +++ b/ynab/models/budget_settings.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 +from ynab.models.date_format import DateFormat # noqa: F401,E501 + + +class BudgetSettings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'date_format': 'DateFormat', + 'currency_format': 'CurrencyFormat' + } + + attribute_map = { + 'date_format': 'date_format', + 'currency_format': 'currency_format' + } + + def __init__(self, date_format=None, currency_format=None): # noqa: E501 + """BudgetSettings - a model defined in Swagger""" # noqa: E501 + self._date_format = None + self._currency_format = None + self.discriminator = None + self.date_format = date_format + self.currency_format = currency_format + + @property + def date_format(self): + """Gets the date_format of this BudgetSettings. # noqa: E501 + + + :return: The date_format of this BudgetSettings. # noqa: E501 + :rtype: DateFormat + """ + return self._date_format + + @date_format.setter + def date_format(self, date_format): + """Sets the date_format of this BudgetSettings. + + + :param date_format: The date_format of this BudgetSettings. # noqa: E501 + :type: DateFormat + """ + if date_format is None: + raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 + + self._date_format = date_format + + @property + def currency_format(self): + """Gets the currency_format of this BudgetSettings. # noqa: E501 + + + :return: The currency_format of this BudgetSettings. # noqa: E501 + :rtype: CurrencyFormat + """ + return self._currency_format + + @currency_format.setter + def currency_format(self, currency_format): + """Sets the currency_format of this BudgetSettings. + + + :param currency_format: The currency_format of this BudgetSettings. # noqa: E501 + :type: CurrencyFormat + """ + if currency_format is None: + raise ValueError("Invalid value for `currency_format`, must not be `None`") # noqa: E501 + + self._currency_format = currency_format + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetSettings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetSettings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py new file mode 100644 index 0000000..e0c5d24 --- /dev/null +++ b/ynab/models/budget_settings_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper # noqa: F401,E501 + + +class BudgetSettingsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'BudgetSettingsWrapper' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """BudgetSettingsResponse - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + self.data = data + + @property + def data(self): + """Gets the data of this BudgetSettingsResponse. # noqa: E501 + + + :return: The data of this BudgetSettingsResponse. # noqa: E501 + :rtype: BudgetSettingsWrapper + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this BudgetSettingsResponse. + + + :param data: The data of this BudgetSettingsResponse. # noqa: E501 + :type: BudgetSettingsWrapper + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetSettingsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetSettingsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/budget_settings_wrapper.py b/ynab/models/budget_settings_wrapper.py new file mode 100644 index 0000000..fef291f --- /dev/null +++ b/ynab/models/budget_settings_wrapper.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.budget_settings import BudgetSettings # noqa: F401,E501 + + +class BudgetSettingsWrapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'settings': 'BudgetSettings' + } + + attribute_map = { + 'settings': 'settings' + } + + def __init__(self, settings=None): # noqa: E501 + """BudgetSettingsWrapper - a model defined in Swagger""" # noqa: E501 + self._settings = None + self.discriminator = None + self.settings = settings + + @property + def settings(self): + """Gets the settings of this BudgetSettingsWrapper. # noqa: E501 + + + :return: The settings of this BudgetSettingsWrapper. # noqa: E501 + :rtype: BudgetSettings + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this BudgetSettingsWrapper. + + + :param settings: The settings of this BudgetSettingsWrapper. # noqa: E501 + :type: BudgetSettings + """ + if settings is None: + raise ValueError("Invalid value for `settings`, must not be `None`") # noqa: E501 + + self._settings = settings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetSettingsWrapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetSettingsWrapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py new file mode 100644 index 0000000..5c09dae --- /dev/null +++ b/ynab/models/save_month_category.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SaveMonthCategory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'budgeted': 'int' + } + + attribute_map = { + 'budgeted': 'budgeted' + } + + def __init__(self, budgeted=None): # noqa: E501 + """SaveMonthCategory - a model defined in Swagger""" # noqa: E501 + self._budgeted = None + self.discriminator = None + self.budgeted = budgeted + + @property + def budgeted(self): + """Gets the budgeted of this SaveMonthCategory. # noqa: E501 + + Budgeted amount in milliunits format # noqa: E501 + + :return: The budgeted of this SaveMonthCategory. # noqa: E501 + :rtype: int + """ + return self._budgeted + + @budgeted.setter + def budgeted(self, budgeted): + """Sets the budgeted of this SaveMonthCategory. + + Budgeted amount in milliunits format # noqa: E501 + + :param budgeted: The budgeted of this SaveMonthCategory. # noqa: E501 + :type: int + """ + if budgeted is None: + raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 + + self._budgeted = budgeted + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveMonthCategory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveMonthCategory): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_month_category_wrapper.py b/ynab/models/save_month_category_wrapper.py new file mode 100644 index 0000000..9512403 --- /dev/null +++ b/ynab/models/save_month_category_wrapper.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.save_month_category import SaveMonthCategory # noqa: F401,E501 + + +class SaveMonthCategoryWrapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'SaveMonthCategory' + } + + attribute_map = { + 'category': 'category' + } + + def __init__(self, category=None): # noqa: E501 + """SaveMonthCategoryWrapper - a model defined in Swagger""" # noqa: E501 + self._category = None + self.discriminator = None + self.category = category + + @property + def category(self): + """Gets the category of this SaveMonthCategoryWrapper. # noqa: E501 + + + :return: The category of this SaveMonthCategoryWrapper. # noqa: E501 + :rtype: SaveMonthCategory + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this SaveMonthCategoryWrapper. + + + :param category: The category of this SaveMonthCategoryWrapper. # noqa: E501 + :type: SaveMonthCategory + """ + if category is None: + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + + self._category = category + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveMonthCategoryWrapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveMonthCategoryWrapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py new file mode 100644 index 0000000..a044a9f --- /dev/null +++ b/ynab/models/save_transactions_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SaveTransactionsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'object' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """SaveTransactionsResponse - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + self.data = data + + @property + def data(self): + """Gets the data of this SaveTransactionsResponse. # noqa: E501 + + + :return: The data of this SaveTransactionsResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SaveTransactionsResponse. + + + :param data: The data of this SaveTransactionsResponse. # noqa: E501 + :type: object + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveTransactionsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveTransactionsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_transactions_wrapper.py b/ynab/models/save_transactions_wrapper.py new file mode 100644 index 0000000..636dfd9 --- /dev/null +++ b/ynab/models/save_transactions_wrapper.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 + + +class SaveTransactionsWrapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transaction': 'SaveTransaction', + 'transactions': 'list[SaveTransaction]' + } + + attribute_map = { + 'transaction': 'transaction', + 'transactions': 'transactions' + } + + def __init__(self, transaction=None, transactions=None): # noqa: E501 + """SaveTransactionsWrapper - a model defined in Swagger""" # noqa: E501 + self._transaction = None + self._transactions = None + self.discriminator = None + if transaction is not None: + self.transaction = transaction + if transactions is not None: + self.transactions = transactions + + @property + def transaction(self): + """Gets the transaction of this SaveTransactionsWrapper. # noqa: E501 + + + :return: The transaction of this SaveTransactionsWrapper. # noqa: E501 + :rtype: SaveTransaction + """ + return self._transaction + + @transaction.setter + def transaction(self, transaction): + """Sets the transaction of this SaveTransactionsWrapper. + + + :param transaction: The transaction of this SaveTransactionsWrapper. # noqa: E501 + :type: SaveTransaction + """ + + self._transaction = transaction + + @property + def transactions(self): + """Gets the transactions of this SaveTransactionsWrapper. # noqa: E501 + + + :return: The transactions of this SaveTransactionsWrapper. # noqa: E501 + :rtype: list[SaveTransaction] + """ + return self._transactions + + @transactions.setter + def transactions(self, transactions): + """Sets the transactions of this SaveTransactionsWrapper. + + + :param transactions: The transactions of this SaveTransactionsWrapper. # noqa: E501 + :type: list[SaveTransaction] + """ + + self._transactions = transactions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveTransactionsWrapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveTransactionsWrapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From ef253713e73043a7c30e5fd5f235d8469fc18c16 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Mon, 27 May 2019 18:08:09 -0700 Subject: [PATCH 03/14] Added script to generate code and fix the tests import issues. --- generate_code.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 generate_code.sh diff --git a/generate_code.sh b/generate_code.sh new file mode 100755 index 0000000..98db936 --- /dev/null +++ b/generate_code.sh @@ -0,0 +1,19 @@ +#! /bin/bash + +# Remove all of the test files because swagger-codegen does not regenerate them if they exist +rm -rf test/* + +# Generate the code +swagger-codegen generate -i https://api.youneedabudget.com/papi/spec-v1-swagger.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python + +# Fix the models module path +git grep -lz test | xargs -0 sed -i '' 's/from models\./from ynab\.models\./g' + +# Fix the api module path +git grep -lz test | xargs -0 sed -i '' 's/from api\./from ynab\.api\./g' + +# Fix the api function call path +git grep -lz test | xargs -0 sed -i '' 's/self\.api = api\./self\.api = ynab\.api\./g' + +# Run the tests +nosetests \ No newline at end of file From 17017a738f7b0a2260f7e28bab1cc29514646ce1 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Mon, 27 May 2019 18:16:32 -0700 Subject: [PATCH 04/14] Make all fields optional because swagger-codegen is busted. --- ynab/models/account.py | 33 +++++--------- ynab/models/account_response.py | 3 +- ynab/models/account_wrapper.py | 3 +- ynab/models/accounts_response.py | 3 +- ynab/models/accounts_wrapper.py | 6 +-- ynab/models/budget_detail_response.py | 3 +- ynab/models/budget_detail_wrapper.py | 6 +-- ynab/models/budget_settings.py | 6 +-- ynab/models/budget_settings_response.py | 3 +- ynab/models/budget_settings_wrapper.py | 3 +- ynab/models/budget_summary.py | 6 +-- ynab/models/budget_summary_response.py | 3 +- ynab/models/budget_summary_wrapper.py | 3 +- ynab/models/bulk_id_wrapper.py | 3 +- ynab/models/bulk_ids.py | 6 +-- ynab/models/bulk_response.py | 3 +- ynab/models/bulk_transactions.py | 3 +- ynab/models/categories_response.py | 3 +- ynab/models/category.py | 42 ++++++----------- ynab/models/category_group.py | 12 ++--- ynab/models/category_group_with_categories.py | 3 +- ynab/models/category_groups_wrapper.py | 6 +-- ynab/models/category_response.py | 3 +- ynab/models/category_wrapper.py | 3 +- ynab/models/currency_format.py | 24 ++++------ ynab/models/date_format.py | 3 +- ynab/models/error_detail.py | 9 ++-- ynab/models/error_response.py | 3 +- ynab/models/hybrid_transaction.py | 15 +++---- ynab/models/hybrid_transactions_response.py | 3 +- ynab/models/hybrid_transactions_wrapper.py | 3 +- ynab/models/month_detail.py | 3 +- ynab/models/month_detail_response.py | 3 +- ynab/models/month_detail_wrapper.py | 3 +- ynab/models/month_summaries_response.py | 3 +- ynab/models/month_summaries_wrapper.py | 6 +-- ynab/models/month_summary.py | 24 ++++------ ynab/models/payee.py | 12 ++--- ynab/models/payee_location.py | 15 +++---- ynab/models/payee_location_response.py | 3 +- ynab/models/payee_location_wrapper.py | 3 +- ynab/models/payee_locations_response.py | 3 +- ynab/models/payee_locations_wrapper.py | 3 +- ynab/models/payee_response.py | 3 +- ynab/models/payee_wrapper.py | 3 +- ynab/models/payees_response.py | 3 +- ynab/models/payees_wrapper.py | 6 +-- ynab/models/save_month_category.py | 3 +- ynab/models/save_month_category_wrapper.py | 3 +- ynab/models/save_transaction.py | 9 ++-- ynab/models/save_transaction_wrapper.py | 3 +- ynab/models/save_transactions_response.py | 3 +- ynab/models/scheduled_sub_transaction.py | 24 ++++------ ynab/models/scheduled_transaction_detail.py | 12 ++--- ynab/models/scheduled_transaction_response.py | 3 +- ynab/models/scheduled_transaction_summary.py | 36 +++++---------- ynab/models/scheduled_transaction_wrapper.py | 3 +- .../models/scheduled_transactions_response.py | 3 +- ynab/models/scheduled_transactions_wrapper.py | 3 +- ynab/models/sub_transaction.py | 24 ++++------ ynab/models/transaction_detail.py | 12 ++--- ynab/models/transaction_response.py | 3 +- ynab/models/transaction_summary.py | 45 +++++++------------ ynab/models/transaction_wrapper.py | 3 +- ynab/models/transactions_response.py | 3 +- ynab/models/transactions_wrapper.py | 6 +-- ynab/models/user.py | 3 +- ynab/models/user_response.py | 3 +- ynab/models/user_wrapper.py | 3 +- 69 files changed, 178 insertions(+), 356 deletions(-) diff --git a/ynab/models/account.py b/ynab/models/account.py index 74806a8..73ea818 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -100,8 +100,7 @@ def id(self, id): :param id: The id of this Account. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -123,8 +122,7 @@ def name(self, name): :param name: The name of this Account. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name @@ -148,8 +146,7 @@ def type(self, type): :param type: The type of this Account. # noqa: E501 :type: str """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["checking", "savings", "cash", "creditCard", "lineOfCredit", "otherAsset", "otherLiability", "payPal", "merchantAccount", "investmentAccount", "mortgage"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -179,8 +176,7 @@ def on_budget(self, on_budget): :param on_budget: The on_budget of this Account. # noqa: E501 :type: bool """ - if on_budget is None: - raise ValueError("Invalid value for `on_budget`, must not be `None`") # noqa: E501 + self._on_budget = on_budget @@ -204,8 +200,7 @@ def closed(self, closed): :param closed: The closed of this Account. # noqa: E501 :type: bool """ - if closed is None: - raise ValueError("Invalid value for `closed`, must not be `None`") # noqa: E501 + self._closed = closed @@ -227,8 +222,7 @@ def note(self, note): :param note: The note of this Account. # noqa: E501 :type: str """ - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note @@ -252,8 +246,7 @@ def balance(self, balance): :param balance: The balance of this Account. # noqa: E501 :type: int """ - if balance is None: - raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + self._balance = balance @@ -277,8 +270,7 @@ def cleared_balance(self, cleared_balance): :param cleared_balance: The cleared_balance of this Account. # noqa: E501 :type: int """ - if cleared_balance is None: - raise ValueError("Invalid value for `cleared_balance`, must not be `None`") # noqa: E501 + self._cleared_balance = cleared_balance @@ -302,8 +294,7 @@ def uncleared_balance(self, uncleared_balance): :param uncleared_balance: The uncleared_balance of this Account. # noqa: E501 :type: int """ - if uncleared_balance is None: - raise ValueError("Invalid value for `uncleared_balance`, must not be `None`") # noqa: E501 + self._uncleared_balance = uncleared_balance @@ -327,8 +318,7 @@ def transfer_payee_id(self, transfer_payee_id): :param transfer_payee_id: The transfer_payee_id of this Account. # noqa: E501 :type: str """ - if transfer_payee_id is None: - raise ValueError("Invalid value for `transfer_payee_id`, must not be `None`") # noqa: E501 + self._transfer_payee_id = transfer_payee_id @@ -352,8 +342,7 @@ def deleted(self, deleted): :param deleted: The deleted of this Account. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 120131d..8babcf1 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this AccountResponse. # noqa: E501 :type: AccountWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/account_wrapper.py b/ynab/models/account_wrapper.py index 2a8b46e..ca71330 100644 --- a/ynab/models/account_wrapper.py +++ b/ynab/models/account_wrapper.py @@ -61,8 +61,7 @@ def account(self, account): :param account: The account of this AccountWrapper. # noqa: E501 :type: Account """ - if account is None: - raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 + self._account = account diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index 9258ec7..1153f95 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this AccountsResponse. # noqa: E501 :type: AccountsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/accounts_wrapper.py b/ynab/models/accounts_wrapper.py index 54454a8..84a91cb 100644 --- a/ynab/models/accounts_wrapper.py +++ b/ynab/models/accounts_wrapper.py @@ -65,8 +65,7 @@ def accounts(self, accounts): :param accounts: The accounts of this AccountsWrapper. # noqa: E501 :type: list[Account] """ - if accounts is None: - raise ValueError("Invalid value for `accounts`, must not be `None`") # noqa: E501 + self._accounts = accounts @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this AccountsWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index 1e9b5b6..6526b18 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this BudgetDetailResponse. # noqa: E501 :type: BudgetDetailWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/budget_detail_wrapper.py b/ynab/models/budget_detail_wrapper.py index 349d5b9..16ac879 100644 --- a/ynab/models/budget_detail_wrapper.py +++ b/ynab/models/budget_detail_wrapper.py @@ -65,8 +65,7 @@ def budget(self, budget): :param budget: The budget of this BudgetDetailWrapper. # noqa: E501 :type: BudgetDetail """ - if budget is None: - raise ValueError("Invalid value for `budget`, must not be `None`") # noqa: E501 + self._budget = budget @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this BudgetDetailWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py index 7f86bca..1830698 100644 --- a/ynab/models/budget_settings.py +++ b/ynab/models/budget_settings.py @@ -66,8 +66,7 @@ def date_format(self, date_format): :param date_format: The date_format of this BudgetSettings. # noqa: E501 :type: DateFormat """ - if date_format is None: - raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 + self._date_format = date_format @@ -89,8 +88,7 @@ def currency_format(self, currency_format): :param currency_format: The currency_format of this BudgetSettings. # noqa: E501 :type: CurrencyFormat """ - if currency_format is None: - raise ValueError("Invalid value for `currency_format`, must not be `None`") # noqa: E501 + self._currency_format = currency_format diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index e0c5d24..58d75e6 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this BudgetSettingsResponse. # noqa: E501 :type: BudgetSettingsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/budget_settings_wrapper.py b/ynab/models/budget_settings_wrapper.py index fef291f..ea126d4 100644 --- a/ynab/models/budget_settings_wrapper.py +++ b/ynab/models/budget_settings_wrapper.py @@ -61,8 +61,7 @@ def settings(self, settings): :param settings: The settings of this BudgetSettingsWrapper. # noqa: E501 :type: BudgetSettings """ - if settings is None: - raise ValueError("Invalid value for `settings`, must not be `None`") # noqa: E501 + self._settings = settings diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index d18f584..533578f 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -91,8 +91,7 @@ def id(self, id): :param id: The id of this BudgetSummary. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -114,8 +113,7 @@ def name(self, name): :param name: The name of this BudgetSummary. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index 75b6940..a735572 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this BudgetSummaryResponse. # noqa: E501 :type: BudgetSummaryWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/budget_summary_wrapper.py b/ynab/models/budget_summary_wrapper.py index a0e1aa6..a6fe6c6 100644 --- a/ynab/models/budget_summary_wrapper.py +++ b/ynab/models/budget_summary_wrapper.py @@ -61,8 +61,7 @@ def budgets(self, budgets): :param budgets: The budgets of this BudgetSummaryWrapper. # noqa: E501 :type: list[BudgetSummary] """ - if budgets is None: - raise ValueError("Invalid value for `budgets`, must not be `None`") # noqa: E501 + self._budgets = budgets diff --git a/ynab/models/bulk_id_wrapper.py b/ynab/models/bulk_id_wrapper.py index 971281b..cd2bf03 100644 --- a/ynab/models/bulk_id_wrapper.py +++ b/ynab/models/bulk_id_wrapper.py @@ -61,8 +61,7 @@ def bulk(self, bulk): :param bulk: The bulk of this BulkIdWrapper. # noqa: E501 :type: BulkIds """ - if bulk is None: - raise ValueError("Invalid value for `bulk`, must not be `None`") # noqa: E501 + self._bulk = bulk diff --git a/ynab/models/bulk_ids.py b/ynab/models/bulk_ids.py index 91c6fe3..bd60c99 100644 --- a/ynab/models/bulk_ids.py +++ b/ynab/models/bulk_ids.py @@ -66,8 +66,7 @@ def transaction_ids(self, transaction_ids): :param transaction_ids: The transaction_ids of this BulkIds. # noqa: E501 :type: list[str] """ - if transaction_ids is None: - raise ValueError("Invalid value for `transaction_ids`, must not be `None`") # noqa: E501 + self._transaction_ids = transaction_ids @@ -91,8 +90,7 @@ def duplicate_import_ids(self, duplicate_import_ids): :param duplicate_import_ids: The duplicate_import_ids of this BulkIds. # noqa: E501 :type: list[str] """ - if duplicate_import_ids is None: - raise ValueError("Invalid value for `duplicate_import_ids`, must not be `None`") # noqa: E501 + self._duplicate_import_ids = duplicate_import_ids diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index 2f3ab4a..2352363 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this BulkResponse. # noqa: E501 :type: BulkIdWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index ea51532..9110865 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -61,8 +61,7 @@ def transactions(self, transactions): :param transactions: The transactions of this BulkTransactions. # noqa: E501 :type: list[SaveTransaction] """ - if transactions is None: - raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + self._transactions = transactions diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index acbc7cf..84a952b 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this CategoriesResponse. # noqa: E501 :type: CategoryGroupsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/category.py b/ynab/models/category.py index 1959d33..6bd26a8 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -117,8 +117,7 @@ def id(self, id): :param id: The id of this Category. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -140,8 +139,7 @@ def category_group_id(self, category_group_id): :param category_group_id: The category_group_id of this Category. # noqa: E501 :type: str """ - if category_group_id is None: - raise ValueError("Invalid value for `category_group_id`, must not be `None`") # noqa: E501 + self._category_group_id = category_group_id @@ -163,8 +161,7 @@ def name(self, name): :param name: The name of this Category. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name @@ -188,8 +185,7 @@ def hidden(self, hidden): :param hidden: The hidden of this Category. # noqa: E501 :type: bool """ - if hidden is None: - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + self._hidden = hidden @@ -234,8 +230,7 @@ def note(self, note): :param note: The note of this Category. # noqa: E501 :type: str """ - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note @@ -259,8 +254,7 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this Category. # noqa: E501 :type: int """ - if budgeted is None: - raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 + self._budgeted = budgeted @@ -284,8 +278,7 @@ def activity(self, activity): :param activity: The activity of this Category. # noqa: E501 :type: int """ - if activity is None: - raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 + self._activity = activity @@ -309,8 +302,7 @@ def balance(self, balance): :param balance: The balance of this Category. # noqa: E501 :type: int """ - if balance is None: - raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + self._balance = balance @@ -334,8 +326,7 @@ def goal_type(self, goal_type): :param goal_type: The goal_type of this Category. # noqa: E501 :type: str """ - if goal_type is None: - raise ValueError("Invalid value for `goal_type`, must not be `None`") # noqa: E501 + allowed_values = ["TB", "TBD", "MF"] # noqa: E501 if goal_type not in allowed_values: raise ValueError( @@ -365,8 +356,7 @@ def goal_creation_month(self, goal_creation_month): :param goal_creation_month: The goal_creation_month of this Category. # noqa: E501 :type: date """ - if goal_creation_month is None: - raise ValueError("Invalid value for `goal_creation_month`, must not be `None`") # noqa: E501 + self._goal_creation_month = goal_creation_month @@ -390,8 +380,7 @@ def goal_target(self, goal_target): :param goal_target: The goal_target of this Category. # noqa: E501 :type: int """ - if goal_target is None: - raise ValueError("Invalid value for `goal_target`, must not be `None`") # noqa: E501 + self._goal_target = goal_target @@ -415,8 +404,7 @@ def goal_target_month(self, goal_target_month): :param goal_target_month: The goal_target_month of this Category. # noqa: E501 :type: date """ - if goal_target_month is None: - raise ValueError("Invalid value for `goal_target_month`, must not be `None`") # noqa: E501 + self._goal_target_month = goal_target_month @@ -440,8 +428,7 @@ def goal_percentage_complete(self, goal_percentage_complete): :param goal_percentage_complete: The goal_percentage_complete of this Category. # noqa: E501 :type: int """ - if goal_percentage_complete is None: - raise ValueError("Invalid value for `goal_percentage_complete`, must not be `None`") # noqa: E501 + self._goal_percentage_complete = goal_percentage_complete @@ -465,8 +452,7 @@ def deleted(self, deleted): :param deleted: The deleted of this Category. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index 00c817a..8db81ba 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -72,8 +72,7 @@ def id(self, id): :param id: The id of this CategoryGroup. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -95,8 +94,7 @@ def name(self, name): :param name: The name of this CategoryGroup. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name @@ -120,8 +118,7 @@ def hidden(self, hidden): :param hidden: The hidden of this CategoryGroup. # noqa: E501 :type: bool """ - if hidden is None: - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + self._hidden = hidden @@ -145,8 +142,7 @@ def deleted(self, deleted): :param deleted: The deleted of this CategoryGroup. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index b36c8b3..ed2345f 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -64,8 +64,7 @@ def categories(self, categories): :param categories: The categories of this CategoryGroupWithCategories. # noqa: E501 :type: list[Category] """ - if categories is None: - raise ValueError("Invalid value for `categories`, must not be `None`") # noqa: E501 + self._categories = categories diff --git a/ynab/models/category_groups_wrapper.py b/ynab/models/category_groups_wrapper.py index b8d9c4f..4c26176 100644 --- a/ynab/models/category_groups_wrapper.py +++ b/ynab/models/category_groups_wrapper.py @@ -65,8 +65,7 @@ def category_groups(self, category_groups): :param category_groups: The category_groups of this CategoryGroupsWrapper. # noqa: E501 :type: list[CategoryGroupWithCategories] """ - if category_groups is None: - raise ValueError("Invalid value for `category_groups`, must not be `None`") # noqa: E501 + self._category_groups = category_groups @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this CategoryGroupsWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index 2c0a3fb..1948b6c 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this CategoryResponse. # noqa: E501 :type: CategoryWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/category_wrapper.py b/ynab/models/category_wrapper.py index 52261eb..ab4b0ac 100644 --- a/ynab/models/category_wrapper.py +++ b/ynab/models/category_wrapper.py @@ -61,8 +61,7 @@ def category(self, category): :param category: The category of this CategoryWrapper. # noqa: E501 :type: Category """ - if category is None: - raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + self._category = category diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index f4ceac7..6e62a69 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -88,8 +88,7 @@ def iso_code(self, iso_code): :param iso_code: The iso_code of this CurrencyFormat. # noqa: E501 :type: str """ - if iso_code is None: - raise ValueError("Invalid value for `iso_code`, must not be `None`") # noqa: E501 + self._iso_code = iso_code @@ -111,8 +110,7 @@ def example_format(self, example_format): :param example_format: The example_format of this CurrencyFormat. # noqa: E501 :type: str """ - if example_format is None: - raise ValueError("Invalid value for `example_format`, must not be `None`") # noqa: E501 + self._example_format = example_format @@ -134,8 +132,7 @@ def decimal_digits(self, decimal_digits): :param decimal_digits: The decimal_digits of this CurrencyFormat. # noqa: E501 :type: int """ - if decimal_digits is None: - raise ValueError("Invalid value for `decimal_digits`, must not be `None`") # noqa: E501 + self._decimal_digits = decimal_digits @@ -157,8 +154,7 @@ def decimal_separator(self, decimal_separator): :param decimal_separator: The decimal_separator of this CurrencyFormat. # noqa: E501 :type: str """ - if decimal_separator is None: - raise ValueError("Invalid value for `decimal_separator`, must not be `None`") # noqa: E501 + self._decimal_separator = decimal_separator @@ -180,8 +176,7 @@ def symbol_first(self, symbol_first): :param symbol_first: The symbol_first of this CurrencyFormat. # noqa: E501 :type: bool """ - if symbol_first is None: - raise ValueError("Invalid value for `symbol_first`, must not be `None`") # noqa: E501 + self._symbol_first = symbol_first @@ -203,8 +198,7 @@ def group_separator(self, group_separator): :param group_separator: The group_separator of this CurrencyFormat. # noqa: E501 :type: str """ - if group_separator is None: - raise ValueError("Invalid value for `group_separator`, must not be `None`") # noqa: E501 + self._group_separator = group_separator @@ -226,8 +220,7 @@ def currency_symbol(self, currency_symbol): :param currency_symbol: The currency_symbol of this CurrencyFormat. # noqa: E501 :type: str """ - if currency_symbol is None: - raise ValueError("Invalid value for `currency_symbol`, must not be `None`") # noqa: E501 + self._currency_symbol = currency_symbol @@ -249,8 +242,7 @@ def display_symbol(self, display_symbol): :param display_symbol: The display_symbol of this CurrencyFormat. # noqa: E501 :type: bool """ - if display_symbol is None: - raise ValueError("Invalid value for `display_symbol`, must not be `None`") # noqa: E501 + self._display_symbol = display_symbol diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index 7699851..a30ef03 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -60,8 +60,7 @@ def format(self, format): :param format: The format of this DateFormat. # noqa: E501 :type: str """ - if format is None: - raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + self._format = format diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index 447f643..8c05c1e 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -68,8 +68,7 @@ def id(self, id): :param id: The id of this ErrorDetail. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -91,8 +90,7 @@ def name(self, name): :param name: The name of this ErrorDetail. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name @@ -114,8 +112,7 @@ def detail(self, detail): :param detail: The detail of this ErrorDetail. # noqa: E501 :type: str """ - if detail is None: - raise ValueError("Invalid value for `detail`, must not be `None`") # noqa: E501 + self._detail = detail diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index 3bc6b61..54a9da7 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -61,8 +61,7 @@ def error(self, error): :param error: The error of this ErrorResponse. # noqa: E501 :type: ErrorDetail """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + self._error = error diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index 55ce726..cd94acf 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -79,8 +79,7 @@ def type(self, type): :param type: The type of this HybridTransaction. # noqa: E501 :type: str """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["transaction", "subtransaction"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -110,8 +109,7 @@ def parent_transaction_id(self, parent_transaction_id): :param parent_transaction_id: The parent_transaction_id of this HybridTransaction. # noqa: E501 :type: str """ - if parent_transaction_id is None: - raise ValueError("Invalid value for `parent_transaction_id`, must not be `None`") # noqa: E501 + self._parent_transaction_id = parent_transaction_id @@ -133,8 +131,7 @@ def account_name(self, account_name): :param account_name: The account_name of this HybridTransaction. # noqa: E501 :type: str """ - if account_name is None: - raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 + self._account_name = account_name @@ -156,8 +153,7 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this HybridTransaction. # noqa: E501 :type: str """ - if payee_name is None: - raise ValueError("Invalid value for `payee_name`, must not be `None`") # noqa: E501 + self._payee_name = payee_name @@ -179,8 +175,7 @@ def category_name(self, category_name): :param category_name: The category_name of this HybridTransaction. # noqa: E501 :type: str """ - if category_name is None: - raise ValueError("Invalid value for `category_name`, must not be `None`") # noqa: E501 + self._category_name = category_name diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index 36d959e..6a570e5 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this HybridTransactionsResponse. # noqa: E501 :type: HybridTransactionsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/hybrid_transactions_wrapper.py b/ynab/models/hybrid_transactions_wrapper.py index bd8616c..2024f3e 100644 --- a/ynab/models/hybrid_transactions_wrapper.py +++ b/ynab/models/hybrid_transactions_wrapper.py @@ -61,8 +61,7 @@ def transactions(self, transactions): :param transactions: The transactions of this HybridTransactionsWrapper. # noqa: E501 :type: list[HybridTransaction] """ - if transactions is None: - raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + self._transactions = transactions diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index 3854c5a..2bed276 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -64,8 +64,7 @@ def categories(self, categories): :param categories: The categories of this MonthDetail. # noqa: E501 :type: list[Category] """ - if categories is None: - raise ValueError("Invalid value for `categories`, must not be `None`") # noqa: E501 + self._categories = categories diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index 1469b5e..b1d36ae 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this MonthDetailResponse. # noqa: E501 :type: MonthDetailWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/month_detail_wrapper.py b/ynab/models/month_detail_wrapper.py index bf10560..7810779 100644 --- a/ynab/models/month_detail_wrapper.py +++ b/ynab/models/month_detail_wrapper.py @@ -61,8 +61,7 @@ def month(self, month): :param month: The month of this MonthDetailWrapper. # noqa: E501 :type: MonthDetail """ - if month is None: - raise ValueError("Invalid value for `month`, must not be `None`") # noqa: E501 + self._month = month diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index b39a6c7..d728e77 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this MonthSummariesResponse. # noqa: E501 :type: MonthSummariesWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/month_summaries_wrapper.py b/ynab/models/month_summaries_wrapper.py index c9604c5..102de5b 100644 --- a/ynab/models/month_summaries_wrapper.py +++ b/ynab/models/month_summaries_wrapper.py @@ -65,8 +65,7 @@ def months(self, months): :param months: The months of this MonthSummariesWrapper. # noqa: E501 :type: list[MonthSummary] """ - if months is None: - raise ValueError("Invalid value for `months`, must not be `None`") # noqa: E501 + self._months = months @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this MonthSummariesWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 4d4bc59..300121c 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -88,8 +88,7 @@ def month(self, month): :param month: The month of this MonthSummary. # noqa: E501 :type: date """ - if month is None: - raise ValueError("Invalid value for `month`, must not be `None`") # noqa: E501 + self._month = month @@ -111,8 +110,7 @@ def note(self, note): :param note: The note of this MonthSummary. # noqa: E501 :type: str """ - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 + self._note = note @@ -136,8 +134,7 @@ def income(self, income): :param income: The income of this MonthSummary. # noqa: E501 :type: int """ - if income is None: - raise ValueError("Invalid value for `income`, must not be `None`") # noqa: E501 + self._income = income @@ -161,8 +158,7 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this MonthSummary. # noqa: E501 :type: int """ - if budgeted is None: - raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 + self._budgeted = budgeted @@ -186,8 +182,7 @@ def activity(self, activity): :param activity: The activity of this MonthSummary. # noqa: E501 :type: int """ - if activity is None: - raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 + self._activity = activity @@ -211,8 +206,7 @@ def to_be_budgeted(self, to_be_budgeted): :param to_be_budgeted: The to_be_budgeted of this MonthSummary. # noqa: E501 :type: int """ - if to_be_budgeted is None: - raise ValueError("Invalid value for `to_be_budgeted`, must not be `None`") # noqa: E501 + self._to_be_budgeted = to_be_budgeted @@ -236,8 +230,7 @@ def age_of_money(self, age_of_money): :param age_of_money: The age_of_money of this MonthSummary. # noqa: E501 :type: int """ - if age_of_money is None: - raise ValueError("Invalid value for `age_of_money`, must not be `None`") # noqa: E501 + self._age_of_money = age_of_money @@ -261,8 +254,7 @@ def deleted(self, deleted): :param deleted: The deleted of this MonthSummary. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 7eca7d0..892e139 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -72,8 +72,7 @@ def id(self, id): :param id: The id of this Payee. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -95,8 +94,7 @@ def name(self, name): :param name: The name of this Payee. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + self._name = name @@ -120,8 +118,7 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this Payee. # noqa: E501 :type: str """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 + self._transfer_account_id = transfer_account_id @@ -145,8 +142,7 @@ def deleted(self, deleted): :param deleted: The deleted of this Payee. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 4ed224c..268ac67 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -76,8 +76,7 @@ def id(self, id): :param id: The id of this PayeeLocation. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -99,8 +98,7 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this PayeeLocation. # noqa: E501 :type: str """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 + self._payee_id = payee_id @@ -122,8 +120,7 @@ def latitude(self, latitude): :param latitude: The latitude of this PayeeLocation. # noqa: E501 :type: str """ - if latitude is None: - raise ValueError("Invalid value for `latitude`, must not be `None`") # noqa: E501 + self._latitude = latitude @@ -145,8 +142,7 @@ def longitude(self, longitude): :param longitude: The longitude of this PayeeLocation. # noqa: E501 :type: str """ - if longitude is None: - raise ValueError("Invalid value for `longitude`, must not be `None`") # noqa: E501 + self._longitude = longitude @@ -170,8 +166,7 @@ def deleted(self, deleted): :param deleted: The deleted of this PayeeLocation. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 73c46fe..00175cc 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this PayeeLocationResponse. # noqa: E501 :type: PayeeLocationWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/payee_location_wrapper.py b/ynab/models/payee_location_wrapper.py index 9cf6678..51c27d0 100644 --- a/ynab/models/payee_location_wrapper.py +++ b/ynab/models/payee_location_wrapper.py @@ -61,8 +61,7 @@ def payee_location(self, payee_location): :param payee_location: The payee_location of this PayeeLocationWrapper. # noqa: E501 :type: PayeeLocation """ - if payee_location is None: - raise ValueError("Invalid value for `payee_location`, must not be `None`") # noqa: E501 + self._payee_location = payee_location diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index a0b0e48..b12169b 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this PayeeLocationsResponse. # noqa: E501 :type: PayeeLocationsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/payee_locations_wrapper.py b/ynab/models/payee_locations_wrapper.py index 63e6ee3..76c0256 100644 --- a/ynab/models/payee_locations_wrapper.py +++ b/ynab/models/payee_locations_wrapper.py @@ -61,8 +61,7 @@ def payee_locations(self, payee_locations): :param payee_locations: The payee_locations of this PayeeLocationsWrapper. # noqa: E501 :type: list[PayeeLocation] """ - if payee_locations is None: - raise ValueError("Invalid value for `payee_locations`, must not be `None`") # noqa: E501 + self._payee_locations = payee_locations diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 1e956a4..3b8bfe8 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this PayeeResponse. # noqa: E501 :type: PayeeWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/payee_wrapper.py b/ynab/models/payee_wrapper.py index 5d406cd..e13542e 100644 --- a/ynab/models/payee_wrapper.py +++ b/ynab/models/payee_wrapper.py @@ -61,8 +61,7 @@ def payee(self, payee): :param payee: The payee of this PayeeWrapper. # noqa: E501 :type: Payee """ - if payee is None: - raise ValueError("Invalid value for `payee`, must not be `None`") # noqa: E501 + self._payee = payee diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index 1484d67..b95d38e 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this PayeesResponse. # noqa: E501 :type: PayeesWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/payees_wrapper.py b/ynab/models/payees_wrapper.py index 72d87ee..a032b1f 100644 --- a/ynab/models/payees_wrapper.py +++ b/ynab/models/payees_wrapper.py @@ -65,8 +65,7 @@ def payees(self, payees): :param payees: The payees of this PayeesWrapper. # noqa: E501 :type: list[Payee] """ - if payees is None: - raise ValueError("Invalid value for `payees`, must not be `None`") # noqa: E501 + self._payees = payees @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this PayeesWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py index 5c09dae..4a91aeb 100644 --- a/ynab/models/save_month_category.py +++ b/ynab/models/save_month_category.py @@ -62,8 +62,7 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this SaveMonthCategory. # noqa: E501 :type: int """ - if budgeted is None: - raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 + self._budgeted = budgeted diff --git a/ynab/models/save_month_category_wrapper.py b/ynab/models/save_month_category_wrapper.py index 9512403..00a587b 100644 --- a/ynab/models/save_month_category_wrapper.py +++ b/ynab/models/save_month_category_wrapper.py @@ -61,8 +61,7 @@ def category(self, category): :param category: The category of this SaveMonthCategoryWrapper. # noqa: E501 :type: SaveMonthCategory """ - if category is None: - raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + self._category = category diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index 9454b18..5fee9c0 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -108,8 +108,7 @@ def account_id(self, account_id): :param account_id: The account_id of this SaveTransaction. # noqa: E501 :type: str """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 + self._account_id = account_id @@ -131,8 +130,7 @@ def _date(self, _date): :param _date: The _date of this SaveTransaction. # noqa: E501 :type: date """ - if _date is None: - raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 + self.__date = _date @@ -156,8 +154,7 @@ def amount(self, amount): :param amount: The amount of this SaveTransaction. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + self._amount = amount diff --git a/ynab/models/save_transaction_wrapper.py b/ynab/models/save_transaction_wrapper.py index 5fd21d0..dedddbb 100644 --- a/ynab/models/save_transaction_wrapper.py +++ b/ynab/models/save_transaction_wrapper.py @@ -61,8 +61,7 @@ def transaction(self, transaction): :param transaction: The transaction of this SaveTransactionWrapper. # noqa: E501 :type: SaveTransaction """ - if transaction is None: - raise ValueError("Invalid value for `transaction`, must not be `None`") # noqa: E501 + self._transaction = transaction diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py index a044a9f..907fecc 100644 --- a/ynab/models/save_transactions_response.py +++ b/ynab/models/save_transactions_response.py @@ -60,8 +60,7 @@ def data(self, data): :param data: The data of this SaveTransactionsResponse. # noqa: E501 :type: object """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index e1e949f..667c43b 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -88,8 +88,7 @@ def id(self, id): :param id: The id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -111,8 +110,7 @@ def scheduled_transaction_id(self, scheduled_transaction_id): :param scheduled_transaction_id: The scheduled_transaction_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if scheduled_transaction_id is None: - raise ValueError("Invalid value for `scheduled_transaction_id`, must not be `None`") # noqa: E501 + self._scheduled_transaction_id = scheduled_transaction_id @@ -136,8 +134,7 @@ def amount(self, amount): :param amount: The amount of this ScheduledSubTransaction. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + self._amount = amount @@ -159,8 +156,7 @@ def memo(self, memo): :param memo: The memo of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 + self._memo = memo @@ -182,8 +178,7 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 + self._payee_id = payee_id @@ -205,8 +200,7 @@ def category_id(self, category_id): :param category_id: The category_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 + self._category_id = category_id @@ -230,8 +224,7 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 + self._transfer_account_id = transfer_account_id @@ -255,8 +248,7 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledSubTransaction. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index 4e648cb..dbb4c23 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -74,8 +74,7 @@ def account_name(self, account_name): :param account_name: The account_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - if account_name is None: - raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 + self._account_name = account_name @@ -97,8 +96,7 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - if payee_name is None: - raise ValueError("Invalid value for `payee_name`, must not be `None`") # noqa: E501 + self._payee_name = payee_name @@ -120,8 +118,7 @@ def category_name(self, category_name): :param category_name: The category_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - if category_name is None: - raise ValueError("Invalid value for `category_name`, must not be `None`") # noqa: E501 + self._category_name = category_name @@ -145,8 +142,7 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this ScheduledTransactionDetail. # noqa: E501 :type: list[ScheduledSubTransaction] """ - if subtransactions is None: - raise ValueError("Invalid value for `subtransactions`, must not be `None`") # noqa: E501 + self._subtransactions = subtransactions diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index 2bf6567..c51d260 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionResponse. # noqa: E501 :type: ScheduledTransactionWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index fe69821..401564f 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -104,8 +104,7 @@ def id(self, id): :param id: The id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -129,8 +128,7 @@ def date_first(self, date_first): :param date_first: The date_first of this ScheduledTransactionSummary. # noqa: E501 :type: date """ - if date_first is None: - raise ValueError("Invalid value for `date_first`, must not be `None`") # noqa: E501 + self._date_first = date_first @@ -154,8 +152,7 @@ def date_next(self, date_next): :param date_next: The date_next of this ScheduledTransactionSummary. # noqa: E501 :type: date """ - if date_next is None: - raise ValueError("Invalid value for `date_next`, must not be `None`") # noqa: E501 + self._date_next = date_next @@ -177,8 +174,7 @@ def frequency(self, frequency): :param frequency: The frequency of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if frequency is None: - raise ValueError("Invalid value for `frequency`, must not be `None`") # noqa: E501 + allowed_values = ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"] # noqa: E501 if frequency not in allowed_values: raise ValueError( @@ -208,8 +204,7 @@ def amount(self, amount): :param amount: The amount of this ScheduledTransactionSummary. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + self._amount = amount @@ -231,8 +226,7 @@ def memo(self, memo): :param memo: The memo of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 + self._memo = memo @@ -256,8 +250,7 @@ def flag_color(self, flag_color): :param flag_color: The flag_color of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if flag_color is None: - raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501 + allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 if flag_color not in allowed_values: raise ValueError( @@ -285,8 +278,7 @@ def account_id(self, account_id): :param account_id: The account_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 + self._account_id = account_id @@ -308,8 +300,7 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 + self._payee_id = payee_id @@ -331,8 +322,7 @@ def category_id(self, category_id): :param category_id: The category_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 + self._category_id = category_id @@ -356,8 +346,7 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 + self._transfer_account_id = transfer_account_id @@ -381,8 +370,7 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledTransactionSummary. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/scheduled_transaction_wrapper.py b/ynab/models/scheduled_transaction_wrapper.py index 8fe10c8..27d9cf7 100644 --- a/ynab/models/scheduled_transaction_wrapper.py +++ b/ynab/models/scheduled_transaction_wrapper.py @@ -61,8 +61,7 @@ def scheduled_transaction(self, scheduled_transaction): :param scheduled_transaction: The scheduled_transaction of this ScheduledTransactionWrapper. # noqa: E501 :type: ScheduledTransactionDetail """ - if scheduled_transaction is None: - raise ValueError("Invalid value for `scheduled_transaction`, must not be `None`") # noqa: E501 + self._scheduled_transaction = scheduled_transaction diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index e4fb903..b5b0eb4 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionsResponse. # noqa: E501 :type: ScheduledTransactionsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/scheduled_transactions_wrapper.py b/ynab/models/scheduled_transactions_wrapper.py index b2b18cf..e39f1ec 100644 --- a/ynab/models/scheduled_transactions_wrapper.py +++ b/ynab/models/scheduled_transactions_wrapper.py @@ -61,8 +61,7 @@ def scheduled_transactions(self, scheduled_transactions): :param scheduled_transactions: The scheduled_transactions of this ScheduledTransactionsWrapper. # noqa: E501 :type: list[ScheduledTransactionDetail] """ - if scheduled_transactions is None: - raise ValueError("Invalid value for `scheduled_transactions`, must not be `None`") # noqa: E501 + self._scheduled_transactions = scheduled_transactions diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index 6adfcd1..1687d1a 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -88,8 +88,7 @@ def id(self, id): :param id: The id of this SubTransaction. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -111,8 +110,7 @@ def transaction_id(self, transaction_id): :param transaction_id: The transaction_id of this SubTransaction. # noqa: E501 :type: str """ - if transaction_id is None: - raise ValueError("Invalid value for `transaction_id`, must not be `None`") # noqa: E501 + self._transaction_id = transaction_id @@ -136,8 +134,7 @@ def amount(self, amount): :param amount: The amount of this SubTransaction. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + self._amount = amount @@ -159,8 +156,7 @@ def memo(self, memo): :param memo: The memo of this SubTransaction. # noqa: E501 :type: str """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 + self._memo = memo @@ -182,8 +178,7 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this SubTransaction. # noqa: E501 :type: str """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 + self._payee_id = payee_id @@ -205,8 +200,7 @@ def category_id(self, category_id): :param category_id: The category_id of this SubTransaction. # noqa: E501 :type: str """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 + self._category_id = category_id @@ -230,8 +224,7 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this SubTransaction. # noqa: E501 :type: str """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 + self._transfer_account_id = transfer_account_id @@ -255,8 +248,7 @@ def deleted(self, deleted): :param deleted: The deleted of this SubTransaction. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 5633482..9806fbb 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -74,8 +74,7 @@ def account_name(self, account_name): :param account_name: The account_name of this TransactionDetail. # noqa: E501 :type: str """ - if account_name is None: - raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 + self._account_name = account_name @@ -97,8 +96,7 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this TransactionDetail. # noqa: E501 :type: str """ - if payee_name is None: - raise ValueError("Invalid value for `payee_name`, must not be `None`") # noqa: E501 + self._payee_name = payee_name @@ -120,8 +118,7 @@ def category_name(self, category_name): :param category_name: The category_name of this TransactionDetail. # noqa: E501 :type: str """ - if category_name is None: - raise ValueError("Invalid value for `category_name`, must not be `None`") # noqa: E501 + self._category_name = category_name @@ -145,8 +142,7 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this TransactionDetail. # noqa: E501 :type: list[SubTransaction] """ - if subtransactions is None: - raise ValueError("Invalid value for `subtransactions`, must not be `None`") # noqa: E501 + self._subtransactions = subtransactions diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index b7909ec..f29197b 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this TransactionResponse. # noqa: E501 :type: TransactionWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index 72ccb4f..f68db32 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -116,8 +116,7 @@ def id(self, id): :param id: The id of this TransactionSummary. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id @@ -139,8 +138,7 @@ def _date(self, _date): :param _date: The _date of this TransactionSummary. # noqa: E501 :type: date """ - if _date is None: - raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 + self.__date = _date @@ -164,8 +162,7 @@ def amount(self, amount): :param amount: The amount of this TransactionSummary. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + self._amount = amount @@ -187,8 +184,7 @@ def memo(self, memo): :param memo: The memo of this TransactionSummary. # noqa: E501 :type: str """ - if memo is None: - raise ValueError("Invalid value for `memo`, must not be `None`") # noqa: E501 + self._memo = memo @@ -212,8 +208,7 @@ def cleared(self, cleared): :param cleared: The cleared of this TransactionSummary. # noqa: E501 :type: str """ - if cleared is None: - raise ValueError("Invalid value for `cleared`, must not be `None`") # noqa: E501 + allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 if cleared not in allowed_values: raise ValueError( @@ -243,8 +238,7 @@ def approved(self, approved): :param approved: The approved of this TransactionSummary. # noqa: E501 :type: bool """ - if approved is None: - raise ValueError("Invalid value for `approved`, must not be `None`") # noqa: E501 + self._approved = approved @@ -268,8 +262,7 @@ def flag_color(self, flag_color): :param flag_color: The flag_color of this TransactionSummary. # noqa: E501 :type: str """ - if flag_color is None: - raise ValueError("Invalid value for `flag_color`, must not be `None`") # noqa: E501 + allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 if flag_color not in allowed_values: raise ValueError( @@ -297,8 +290,7 @@ def account_id(self, account_id): :param account_id: The account_id of this TransactionSummary. # noqa: E501 :type: str """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 + self._account_id = account_id @@ -320,8 +312,7 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this TransactionSummary. # noqa: E501 :type: str """ - if payee_id is None: - raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 + self._payee_id = payee_id @@ -343,8 +334,7 @@ def category_id(self, category_id): :param category_id: The category_id of this TransactionSummary. # noqa: E501 :type: str """ - if category_id is None: - raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E501 + self._category_id = category_id @@ -368,8 +358,7 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this TransactionSummary. # noqa: E501 :type: str """ - if transfer_account_id is None: - raise ValueError("Invalid value for `transfer_account_id`, must not be `None`") # noqa: E501 + self._transfer_account_id = transfer_account_id @@ -393,8 +382,7 @@ def transfer_transaction_id(self, transfer_transaction_id): :param transfer_transaction_id: The transfer_transaction_id of this TransactionSummary. # noqa: E501 :type: str """ - if transfer_transaction_id is None: - raise ValueError("Invalid value for `transfer_transaction_id`, must not be `None`") # noqa: E501 + self._transfer_transaction_id = transfer_transaction_id @@ -418,8 +406,7 @@ def matched_transaction_id(self, matched_transaction_id): :param matched_transaction_id: The matched_transaction_id of this TransactionSummary. # noqa: E501 :type: str """ - if matched_transaction_id is None: - raise ValueError("Invalid value for `matched_transaction_id`, must not be `None`") # noqa: E501 + self._matched_transaction_id = matched_transaction_id @@ -443,8 +430,7 @@ def import_id(self, import_id): :param import_id: The import_id of this TransactionSummary. # noqa: E501 :type: str """ - if import_id is None: - raise ValueError("Invalid value for `import_id`, must not be `None`") # noqa: E501 + self._import_id = import_id @@ -468,8 +454,7 @@ def deleted(self, deleted): :param deleted: The deleted of this TransactionSummary. # noqa: E501 :type: bool """ - if deleted is None: - raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 + self._deleted = deleted diff --git a/ynab/models/transaction_wrapper.py b/ynab/models/transaction_wrapper.py index f7670f0..a500ed6 100644 --- a/ynab/models/transaction_wrapper.py +++ b/ynab/models/transaction_wrapper.py @@ -61,8 +61,7 @@ def transaction(self, transaction): :param transaction: The transaction of this TransactionWrapper. # noqa: E501 :type: TransactionDetail """ - if transaction is None: - raise ValueError("Invalid value for `transaction`, must not be `None`") # noqa: E501 + self._transaction = transaction diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index 68056de..d3b74be 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this TransactionsResponse. # noqa: E501 :type: TransactionsWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/transactions_wrapper.py b/ynab/models/transactions_wrapper.py index 839936b..1b1f4cd 100644 --- a/ynab/models/transactions_wrapper.py +++ b/ynab/models/transactions_wrapper.py @@ -65,8 +65,7 @@ def transactions(self, transactions): :param transactions: The transactions of this TransactionsWrapper. # noqa: E501 :type: list[TransactionDetail] """ - if transactions is None: - raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + self._transactions = transactions @@ -90,8 +89,7 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this TransactionsWrapper. # noqa: E501 :type: int """ - if server_knowledge is None: - raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + self._server_knowledge = server_knowledge diff --git a/ynab/models/user.py b/ynab/models/user.py index c008432..b2fff09 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -60,8 +60,7 @@ def id(self, id): :param id: The id of this User. # noqa: E501 :type: str """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + self._id = id diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index 12359cd..9d9c31c 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -61,8 +61,7 @@ def data(self, data): :param data: The data of this UserResponse. # noqa: E501 :type: UserWrapper """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + self._data = data diff --git a/ynab/models/user_wrapper.py b/ynab/models/user_wrapper.py index 8f9d41b..ea90298 100644 --- a/ynab/models/user_wrapper.py +++ b/ynab/models/user_wrapper.py @@ -61,8 +61,7 @@ def user(self, user): :param user: The user of this UserWrapper. # noqa: E501 :type: User """ - if user is None: - raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + self._user = user From 96a07c9301c3279c7690adb63d40b9fca097c0d1 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Wed, 29 May 2019 20:05:11 -0700 Subject: [PATCH 05/14] Fixed models to have optional values. --- generate_code.sh | 4 +++- ynab/models/account.py | 11 ----------- ynab/models/account_response.py | 1 - ynab/models/account_wrapper.py | 1 - ynab/models/accounts_response.py | 1 - ynab/models/accounts_wrapper.py | 2 -- ynab/models/budget_detail_response.py | 1 - ynab/models/budget_detail_wrapper.py | 2 -- ynab/models/budget_settings.py | 2 -- ynab/models/budget_settings_response.py | 1 - ynab/models/budget_settings_wrapper.py | 1 - ynab/models/budget_summary.py | 2 -- ynab/models/budget_summary_response.py | 1 - ynab/models/budget_summary_wrapper.py | 1 - ynab/models/bulk_id_wrapper.py | 1 - ynab/models/bulk_ids.py | 2 -- ynab/models/bulk_response.py | 1 - ynab/models/bulk_transactions.py | 1 - ynab/models/categories_response.py | 1 - ynab/models/category.py | 14 -------------- ynab/models/category_group.py | 4 ---- ynab/models/category_group_with_categories.py | 1 - ynab/models/category_groups_wrapper.py | 2 -- ynab/models/category_response.py | 1 - ynab/models/category_wrapper.py | 1 - ynab/models/currency_format.py | 8 -------- ynab/models/date_format.py | 1 - ynab/models/error_detail.py | 3 --- ynab/models/error_response.py | 1 - ynab/models/hybrid_transaction.py | 5 ----- ynab/models/hybrid_transactions_response.py | 1 - ynab/models/hybrid_transactions_wrapper.py | 1 - ynab/models/month_detail.py | 1 - ynab/models/month_detail_response.py | 1 - ynab/models/month_detail_wrapper.py | 1 - ynab/models/month_summaries_response.py | 1 - ynab/models/month_summaries_wrapper.py | 2 -- ynab/models/month_summary.py | 8 -------- ynab/models/payee.py | 4 ---- ynab/models/payee_location.py | 5 ----- ynab/models/payee_location_response.py | 1 - ynab/models/payee_location_wrapper.py | 1 - ynab/models/payee_locations_response.py | 1 - ynab/models/payee_locations_wrapper.py | 1 - ynab/models/payee_response.py | 1 - ynab/models/payee_wrapper.py | 1 - ynab/models/payees_response.py | 1 - ynab/models/payees_wrapper.py | 2 -- ynab/models/save_month_category.py | 1 - ynab/models/save_month_category_wrapper.py | 1 - ynab/models/save_transaction.py | 3 --- ynab/models/save_transaction_wrapper.py | 1 - ynab/models/save_transactions_response.py | 1 - ynab/models/scheduled_sub_transaction.py | 8 -------- ynab/models/scheduled_transaction_detail.py | 4 ---- ynab/models/scheduled_transaction_response.py | 1 - ynab/models/scheduled_transaction_summary.py | 12 ------------ ynab/models/scheduled_transaction_wrapper.py | 1 - ynab/models/scheduled_transactions_response.py | 1 - ynab/models/scheduled_transactions_wrapper.py | 1 - ynab/models/sub_transaction.py | 8 -------- ynab/models/transaction_detail.py | 4 ---- ynab/models/transaction_response.py | 1 - ynab/models/transaction_summary.py | 15 --------------- ynab/models/transaction_wrapper.py | 1 - ynab/models/transactions_response.py | 1 - ynab/models/transactions_wrapper.py | 2 -- ynab/models/user.py | 1 - ynab/models/user_response.py | 1 - ynab/models/user_wrapper.py | 1 - 70 files changed, 3 insertions(+), 179 deletions(-) diff --git a/generate_code.sh b/generate_code.sh index 98db936..7f147fe 100755 --- a/generate_code.sh +++ b/generate_code.sh @@ -15,5 +15,7 @@ git grep -lz test | xargs -0 sed -i '' 's/from api\./from ynab\.api\./g' # Fix the api function call path git grep -lz test | xargs -0 sed -i '' 's/self\.api = api\./self\.api = ynab\.api\./g' +git ls-files -z ynab/models | xargs -0 perl -i -p0e 's/\s+if \w+ is None:\n\s+raise ValueError.*//g' + # Run the tests -nosetests \ No newline at end of file +nosetests diff --git a/ynab/models/account.py b/ynab/models/account.py index 73ea818..60aa644 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -100,7 +100,6 @@ def id(self, id): :param id: The id of this Account. # noqa: E501 :type: str """ - self._id = id @@ -122,7 +121,6 @@ def name(self, name): :param name: The name of this Account. # noqa: E501 :type: str """ - self._name = name @@ -146,7 +144,6 @@ def type(self, type): :param type: The type of this Account. # noqa: E501 :type: str """ - allowed_values = ["checking", "savings", "cash", "creditCard", "lineOfCredit", "otherAsset", "otherLiability", "payPal", "merchantAccount", "investmentAccount", "mortgage"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -176,7 +173,6 @@ def on_budget(self, on_budget): :param on_budget: The on_budget of this Account. # noqa: E501 :type: bool """ - self._on_budget = on_budget @@ -200,7 +196,6 @@ def closed(self, closed): :param closed: The closed of this Account. # noqa: E501 :type: bool """ - self._closed = closed @@ -222,7 +217,6 @@ def note(self, note): :param note: The note of this Account. # noqa: E501 :type: str """ - self._note = note @@ -246,7 +240,6 @@ def balance(self, balance): :param balance: The balance of this Account. # noqa: E501 :type: int """ - self._balance = balance @@ -270,7 +263,6 @@ def cleared_balance(self, cleared_balance): :param cleared_balance: The cleared_balance of this Account. # noqa: E501 :type: int """ - self._cleared_balance = cleared_balance @@ -294,7 +286,6 @@ def uncleared_balance(self, uncleared_balance): :param uncleared_balance: The uncleared_balance of this Account. # noqa: E501 :type: int """ - self._uncleared_balance = uncleared_balance @@ -318,7 +309,6 @@ def transfer_payee_id(self, transfer_payee_id): :param transfer_payee_id: The transfer_payee_id of this Account. # noqa: E501 :type: str """ - self._transfer_payee_id = transfer_payee_id @@ -342,7 +332,6 @@ def deleted(self, deleted): :param deleted: The deleted of this Account. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 8babcf1..6d03c9a 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this AccountResponse. # noqa: E501 :type: AccountWrapper """ - self._data = data diff --git a/ynab/models/account_wrapper.py b/ynab/models/account_wrapper.py index ca71330..11b17f0 100644 --- a/ynab/models/account_wrapper.py +++ b/ynab/models/account_wrapper.py @@ -61,7 +61,6 @@ def account(self, account): :param account: The account of this AccountWrapper. # noqa: E501 :type: Account """ - self._account = account diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index 1153f95..ebd3301 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this AccountsResponse. # noqa: E501 :type: AccountsWrapper """ - self._data = data diff --git a/ynab/models/accounts_wrapper.py b/ynab/models/accounts_wrapper.py index 84a91cb..4ebfbb3 100644 --- a/ynab/models/accounts_wrapper.py +++ b/ynab/models/accounts_wrapper.py @@ -65,7 +65,6 @@ def accounts(self, accounts): :param accounts: The accounts of this AccountsWrapper. # noqa: E501 :type: list[Account] """ - self._accounts = accounts @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this AccountsWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index 6526b18..c1ec05e 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this BudgetDetailResponse. # noqa: E501 :type: BudgetDetailWrapper """ - self._data = data diff --git a/ynab/models/budget_detail_wrapper.py b/ynab/models/budget_detail_wrapper.py index 16ac879..8a1a0bc 100644 --- a/ynab/models/budget_detail_wrapper.py +++ b/ynab/models/budget_detail_wrapper.py @@ -65,7 +65,6 @@ def budget(self, budget): :param budget: The budget of this BudgetDetailWrapper. # noqa: E501 :type: BudgetDetail """ - self._budget = budget @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this BudgetDetailWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py index 1830698..09f48bf 100644 --- a/ynab/models/budget_settings.py +++ b/ynab/models/budget_settings.py @@ -66,7 +66,6 @@ def date_format(self, date_format): :param date_format: The date_format of this BudgetSettings. # noqa: E501 :type: DateFormat """ - self._date_format = date_format @@ -88,7 +87,6 @@ def currency_format(self, currency_format): :param currency_format: The currency_format of this BudgetSettings. # noqa: E501 :type: CurrencyFormat """ - self._currency_format = currency_format diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index 58d75e6..c9cdcb6 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this BudgetSettingsResponse. # noqa: E501 :type: BudgetSettingsWrapper """ - self._data = data diff --git a/ynab/models/budget_settings_wrapper.py b/ynab/models/budget_settings_wrapper.py index ea126d4..8a776dd 100644 --- a/ynab/models/budget_settings_wrapper.py +++ b/ynab/models/budget_settings_wrapper.py @@ -61,7 +61,6 @@ def settings(self, settings): :param settings: The settings of this BudgetSettingsWrapper. # noqa: E501 :type: BudgetSettings """ - self._settings = settings diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index 533578f..9ddf960 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -91,7 +91,6 @@ def id(self, id): :param id: The id of this BudgetSummary. # noqa: E501 :type: str """ - self._id = id @@ -113,7 +112,6 @@ def name(self, name): :param name: The name of this BudgetSummary. # noqa: E501 :type: str """ - self._name = name diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index a735572..a8dfb46 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this BudgetSummaryResponse. # noqa: E501 :type: BudgetSummaryWrapper """ - self._data = data diff --git a/ynab/models/budget_summary_wrapper.py b/ynab/models/budget_summary_wrapper.py index a6fe6c6..eaf1d08 100644 --- a/ynab/models/budget_summary_wrapper.py +++ b/ynab/models/budget_summary_wrapper.py @@ -61,7 +61,6 @@ def budgets(self, budgets): :param budgets: The budgets of this BudgetSummaryWrapper. # noqa: E501 :type: list[BudgetSummary] """ - self._budgets = budgets diff --git a/ynab/models/bulk_id_wrapper.py b/ynab/models/bulk_id_wrapper.py index cd2bf03..bfa43ce 100644 --- a/ynab/models/bulk_id_wrapper.py +++ b/ynab/models/bulk_id_wrapper.py @@ -61,7 +61,6 @@ def bulk(self, bulk): :param bulk: The bulk of this BulkIdWrapper. # noqa: E501 :type: BulkIds """ - self._bulk = bulk diff --git a/ynab/models/bulk_ids.py b/ynab/models/bulk_ids.py index bd60c99..146f2f6 100644 --- a/ynab/models/bulk_ids.py +++ b/ynab/models/bulk_ids.py @@ -66,7 +66,6 @@ def transaction_ids(self, transaction_ids): :param transaction_ids: The transaction_ids of this BulkIds. # noqa: E501 :type: list[str] """ - self._transaction_ids = transaction_ids @@ -90,7 +89,6 @@ def duplicate_import_ids(self, duplicate_import_ids): :param duplicate_import_ids: The duplicate_import_ids of this BulkIds. # noqa: E501 :type: list[str] """ - self._duplicate_import_ids = duplicate_import_ids diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index 2352363..a2c7351 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this BulkResponse. # noqa: E501 :type: BulkIdWrapper """ - self._data = data diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index 9110865..d8c8778 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -61,7 +61,6 @@ def transactions(self, transactions): :param transactions: The transactions of this BulkTransactions. # noqa: E501 :type: list[SaveTransaction] """ - self._transactions = transactions diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 84a952b..4c6be9c 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this CategoriesResponse. # noqa: E501 :type: CategoryGroupsWrapper """ - self._data = data diff --git a/ynab/models/category.py b/ynab/models/category.py index 6bd26a8..bf3b5e6 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -117,7 +117,6 @@ def id(self, id): :param id: The id of this Category. # noqa: E501 :type: str """ - self._id = id @@ -139,7 +138,6 @@ def category_group_id(self, category_group_id): :param category_group_id: The category_group_id of this Category. # noqa: E501 :type: str """ - self._category_group_id = category_group_id @@ -161,7 +159,6 @@ def name(self, name): :param name: The name of this Category. # noqa: E501 :type: str """ - self._name = name @@ -185,7 +182,6 @@ def hidden(self, hidden): :param hidden: The hidden of this Category. # noqa: E501 :type: bool """ - self._hidden = hidden @@ -230,7 +226,6 @@ def note(self, note): :param note: The note of this Category. # noqa: E501 :type: str """ - self._note = note @@ -254,7 +249,6 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this Category. # noqa: E501 :type: int """ - self._budgeted = budgeted @@ -278,7 +272,6 @@ def activity(self, activity): :param activity: The activity of this Category. # noqa: E501 :type: int """ - self._activity = activity @@ -302,7 +295,6 @@ def balance(self, balance): :param balance: The balance of this Category. # noqa: E501 :type: int """ - self._balance = balance @@ -326,7 +318,6 @@ def goal_type(self, goal_type): :param goal_type: The goal_type of this Category. # noqa: E501 :type: str """ - allowed_values = ["TB", "TBD", "MF"] # noqa: E501 if goal_type not in allowed_values: raise ValueError( @@ -356,7 +347,6 @@ def goal_creation_month(self, goal_creation_month): :param goal_creation_month: The goal_creation_month of this Category. # noqa: E501 :type: date """ - self._goal_creation_month = goal_creation_month @@ -380,7 +370,6 @@ def goal_target(self, goal_target): :param goal_target: The goal_target of this Category. # noqa: E501 :type: int """ - self._goal_target = goal_target @@ -404,7 +393,6 @@ def goal_target_month(self, goal_target_month): :param goal_target_month: The goal_target_month of this Category. # noqa: E501 :type: date """ - self._goal_target_month = goal_target_month @@ -428,7 +416,6 @@ def goal_percentage_complete(self, goal_percentage_complete): :param goal_percentage_complete: The goal_percentage_complete of this Category. # noqa: E501 :type: int """ - self._goal_percentage_complete = goal_percentage_complete @@ -452,7 +439,6 @@ def deleted(self, deleted): :param deleted: The deleted of this Category. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index 8db81ba..dfaf35d 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -72,7 +72,6 @@ def id(self, id): :param id: The id of this CategoryGroup. # noqa: E501 :type: str """ - self._id = id @@ -94,7 +93,6 @@ def name(self, name): :param name: The name of this CategoryGroup. # noqa: E501 :type: str """ - self._name = name @@ -118,7 +116,6 @@ def hidden(self, hidden): :param hidden: The hidden of this CategoryGroup. # noqa: E501 :type: bool """ - self._hidden = hidden @@ -142,7 +139,6 @@ def deleted(self, deleted): :param deleted: The deleted of this CategoryGroup. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index ed2345f..9823efa 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -64,7 +64,6 @@ def categories(self, categories): :param categories: The categories of this CategoryGroupWithCategories. # noqa: E501 :type: list[Category] """ - self._categories = categories diff --git a/ynab/models/category_groups_wrapper.py b/ynab/models/category_groups_wrapper.py index 4c26176..a2bf0a4 100644 --- a/ynab/models/category_groups_wrapper.py +++ b/ynab/models/category_groups_wrapper.py @@ -65,7 +65,6 @@ def category_groups(self, category_groups): :param category_groups: The category_groups of this CategoryGroupsWrapper. # noqa: E501 :type: list[CategoryGroupWithCategories] """ - self._category_groups = category_groups @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this CategoryGroupsWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index 1948b6c..e5f68a7 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this CategoryResponse. # noqa: E501 :type: CategoryWrapper """ - self._data = data diff --git a/ynab/models/category_wrapper.py b/ynab/models/category_wrapper.py index ab4b0ac..714339a 100644 --- a/ynab/models/category_wrapper.py +++ b/ynab/models/category_wrapper.py @@ -61,7 +61,6 @@ def category(self, category): :param category: The category of this CategoryWrapper. # noqa: E501 :type: Category """ - self._category = category diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index 6e62a69..08e351d 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -88,7 +88,6 @@ def iso_code(self, iso_code): :param iso_code: The iso_code of this CurrencyFormat. # noqa: E501 :type: str """ - self._iso_code = iso_code @@ -110,7 +109,6 @@ def example_format(self, example_format): :param example_format: The example_format of this CurrencyFormat. # noqa: E501 :type: str """ - self._example_format = example_format @@ -132,7 +130,6 @@ def decimal_digits(self, decimal_digits): :param decimal_digits: The decimal_digits of this CurrencyFormat. # noqa: E501 :type: int """ - self._decimal_digits = decimal_digits @@ -154,7 +151,6 @@ def decimal_separator(self, decimal_separator): :param decimal_separator: The decimal_separator of this CurrencyFormat. # noqa: E501 :type: str """ - self._decimal_separator = decimal_separator @@ -176,7 +172,6 @@ def symbol_first(self, symbol_first): :param symbol_first: The symbol_first of this CurrencyFormat. # noqa: E501 :type: bool """ - self._symbol_first = symbol_first @@ -198,7 +193,6 @@ def group_separator(self, group_separator): :param group_separator: The group_separator of this CurrencyFormat. # noqa: E501 :type: str """ - self._group_separator = group_separator @@ -220,7 +214,6 @@ def currency_symbol(self, currency_symbol): :param currency_symbol: The currency_symbol of this CurrencyFormat. # noqa: E501 :type: str """ - self._currency_symbol = currency_symbol @@ -242,7 +235,6 @@ def display_symbol(self, display_symbol): :param display_symbol: The display_symbol of this CurrencyFormat. # noqa: E501 :type: bool """ - self._display_symbol = display_symbol diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index a30ef03..f5815ad 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -60,7 +60,6 @@ def format(self, format): :param format: The format of this DateFormat. # noqa: E501 :type: str """ - self._format = format diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index 8c05c1e..310215e 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -68,7 +68,6 @@ def id(self, id): :param id: The id of this ErrorDetail. # noqa: E501 :type: str """ - self._id = id @@ -90,7 +89,6 @@ def name(self, name): :param name: The name of this ErrorDetail. # noqa: E501 :type: str """ - self._name = name @@ -112,7 +110,6 @@ def detail(self, detail): :param detail: The detail of this ErrorDetail. # noqa: E501 :type: str """ - self._detail = detail diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index 54a9da7..c2acdc6 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -61,7 +61,6 @@ def error(self, error): :param error: The error of this ErrorResponse. # noqa: E501 :type: ErrorDetail """ - self._error = error diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index cd94acf..465a56a 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -79,7 +79,6 @@ def type(self, type): :param type: The type of this HybridTransaction. # noqa: E501 :type: str """ - allowed_values = ["transaction", "subtransaction"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -109,7 +108,6 @@ def parent_transaction_id(self, parent_transaction_id): :param parent_transaction_id: The parent_transaction_id of this HybridTransaction. # noqa: E501 :type: str """ - self._parent_transaction_id = parent_transaction_id @@ -131,7 +129,6 @@ def account_name(self, account_name): :param account_name: The account_name of this HybridTransaction. # noqa: E501 :type: str """ - self._account_name = account_name @@ -153,7 +150,6 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this HybridTransaction. # noqa: E501 :type: str """ - self._payee_name = payee_name @@ -175,7 +171,6 @@ def category_name(self, category_name): :param category_name: The category_name of this HybridTransaction. # noqa: E501 :type: str """ - self._category_name = category_name diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index 6a570e5..9dd07a1 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this HybridTransactionsResponse. # noqa: E501 :type: HybridTransactionsWrapper """ - self._data = data diff --git a/ynab/models/hybrid_transactions_wrapper.py b/ynab/models/hybrid_transactions_wrapper.py index 2024f3e..ac67a8e 100644 --- a/ynab/models/hybrid_transactions_wrapper.py +++ b/ynab/models/hybrid_transactions_wrapper.py @@ -61,7 +61,6 @@ def transactions(self, transactions): :param transactions: The transactions of this HybridTransactionsWrapper. # noqa: E501 :type: list[HybridTransaction] """ - self._transactions = transactions diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index 2bed276..e81fa7a 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -64,7 +64,6 @@ def categories(self, categories): :param categories: The categories of this MonthDetail. # noqa: E501 :type: list[Category] """ - self._categories = categories diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index b1d36ae..45bccfa 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this MonthDetailResponse. # noqa: E501 :type: MonthDetailWrapper """ - self._data = data diff --git a/ynab/models/month_detail_wrapper.py b/ynab/models/month_detail_wrapper.py index 7810779..18717ac 100644 --- a/ynab/models/month_detail_wrapper.py +++ b/ynab/models/month_detail_wrapper.py @@ -61,7 +61,6 @@ def month(self, month): :param month: The month of this MonthDetailWrapper. # noqa: E501 :type: MonthDetail """ - self._month = month diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index d728e77..71ae3a8 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this MonthSummariesResponse. # noqa: E501 :type: MonthSummariesWrapper """ - self._data = data diff --git a/ynab/models/month_summaries_wrapper.py b/ynab/models/month_summaries_wrapper.py index 102de5b..ba15764 100644 --- a/ynab/models/month_summaries_wrapper.py +++ b/ynab/models/month_summaries_wrapper.py @@ -65,7 +65,6 @@ def months(self, months): :param months: The months of this MonthSummariesWrapper. # noqa: E501 :type: list[MonthSummary] """ - self._months = months @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this MonthSummariesWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 300121c..1e7b5f6 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -88,7 +88,6 @@ def month(self, month): :param month: The month of this MonthSummary. # noqa: E501 :type: date """ - self._month = month @@ -110,7 +109,6 @@ def note(self, note): :param note: The note of this MonthSummary. # noqa: E501 :type: str """ - self._note = note @@ -134,7 +132,6 @@ def income(self, income): :param income: The income of this MonthSummary. # noqa: E501 :type: int """ - self._income = income @@ -158,7 +155,6 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this MonthSummary. # noqa: E501 :type: int """ - self._budgeted = budgeted @@ -182,7 +178,6 @@ def activity(self, activity): :param activity: The activity of this MonthSummary. # noqa: E501 :type: int """ - self._activity = activity @@ -206,7 +201,6 @@ def to_be_budgeted(self, to_be_budgeted): :param to_be_budgeted: The to_be_budgeted of this MonthSummary. # noqa: E501 :type: int """ - self._to_be_budgeted = to_be_budgeted @@ -230,7 +224,6 @@ def age_of_money(self, age_of_money): :param age_of_money: The age_of_money of this MonthSummary. # noqa: E501 :type: int """ - self._age_of_money = age_of_money @@ -254,7 +247,6 @@ def deleted(self, deleted): :param deleted: The deleted of this MonthSummary. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 892e139..80c31c5 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -72,7 +72,6 @@ def id(self, id): :param id: The id of this Payee. # noqa: E501 :type: str """ - self._id = id @@ -94,7 +93,6 @@ def name(self, name): :param name: The name of this Payee. # noqa: E501 :type: str """ - self._name = name @@ -118,7 +116,6 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this Payee. # noqa: E501 :type: str """ - self._transfer_account_id = transfer_account_id @@ -142,7 +139,6 @@ def deleted(self, deleted): :param deleted: The deleted of this Payee. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 268ac67..951e12d 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -76,7 +76,6 @@ def id(self, id): :param id: The id of this PayeeLocation. # noqa: E501 :type: str """ - self._id = id @@ -98,7 +97,6 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this PayeeLocation. # noqa: E501 :type: str """ - self._payee_id = payee_id @@ -120,7 +118,6 @@ def latitude(self, latitude): :param latitude: The latitude of this PayeeLocation. # noqa: E501 :type: str """ - self._latitude = latitude @@ -142,7 +139,6 @@ def longitude(self, longitude): :param longitude: The longitude of this PayeeLocation. # noqa: E501 :type: str """ - self._longitude = longitude @@ -166,7 +162,6 @@ def deleted(self, deleted): :param deleted: The deleted of this PayeeLocation. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 00175cc..35f0a08 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this PayeeLocationResponse. # noqa: E501 :type: PayeeLocationWrapper """ - self._data = data diff --git a/ynab/models/payee_location_wrapper.py b/ynab/models/payee_location_wrapper.py index 51c27d0..3781334 100644 --- a/ynab/models/payee_location_wrapper.py +++ b/ynab/models/payee_location_wrapper.py @@ -61,7 +61,6 @@ def payee_location(self, payee_location): :param payee_location: The payee_location of this PayeeLocationWrapper. # noqa: E501 :type: PayeeLocation """ - self._payee_location = payee_location diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index b12169b..2b61912 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this PayeeLocationsResponse. # noqa: E501 :type: PayeeLocationsWrapper """ - self._data = data diff --git a/ynab/models/payee_locations_wrapper.py b/ynab/models/payee_locations_wrapper.py index 76c0256..c93a6b7 100644 --- a/ynab/models/payee_locations_wrapper.py +++ b/ynab/models/payee_locations_wrapper.py @@ -61,7 +61,6 @@ def payee_locations(self, payee_locations): :param payee_locations: The payee_locations of this PayeeLocationsWrapper. # noqa: E501 :type: list[PayeeLocation] """ - self._payee_locations = payee_locations diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 3b8bfe8..64592e2 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this PayeeResponse. # noqa: E501 :type: PayeeWrapper """ - self._data = data diff --git a/ynab/models/payee_wrapper.py b/ynab/models/payee_wrapper.py index e13542e..a84de0a 100644 --- a/ynab/models/payee_wrapper.py +++ b/ynab/models/payee_wrapper.py @@ -61,7 +61,6 @@ def payee(self, payee): :param payee: The payee of this PayeeWrapper. # noqa: E501 :type: Payee """ - self._payee = payee diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index b95d38e..47b3637 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this PayeesResponse. # noqa: E501 :type: PayeesWrapper """ - self._data = data diff --git a/ynab/models/payees_wrapper.py b/ynab/models/payees_wrapper.py index a032b1f..4caf030 100644 --- a/ynab/models/payees_wrapper.py +++ b/ynab/models/payees_wrapper.py @@ -65,7 +65,6 @@ def payees(self, payees): :param payees: The payees of this PayeesWrapper. # noqa: E501 :type: list[Payee] """ - self._payees = payees @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this PayeesWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py index 4a91aeb..d0d0140 100644 --- a/ynab/models/save_month_category.py +++ b/ynab/models/save_month_category.py @@ -62,7 +62,6 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this SaveMonthCategory. # noqa: E501 :type: int """ - self._budgeted = budgeted diff --git a/ynab/models/save_month_category_wrapper.py b/ynab/models/save_month_category_wrapper.py index 00a587b..9a2a8c3 100644 --- a/ynab/models/save_month_category_wrapper.py +++ b/ynab/models/save_month_category_wrapper.py @@ -61,7 +61,6 @@ def category(self, category): :param category: The category of this SaveMonthCategoryWrapper. # noqa: E501 :type: SaveMonthCategory """ - self._category = category diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index 5fee9c0..8774e19 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -108,7 +108,6 @@ def account_id(self, account_id): :param account_id: The account_id of this SaveTransaction. # noqa: E501 :type: str """ - self._account_id = account_id @@ -130,7 +129,6 @@ def _date(self, _date): :param _date: The _date of this SaveTransaction. # noqa: E501 :type: date """ - self.__date = _date @@ -154,7 +152,6 @@ def amount(self, amount): :param amount: The amount of this SaveTransaction. # noqa: E501 :type: int """ - self._amount = amount diff --git a/ynab/models/save_transaction_wrapper.py b/ynab/models/save_transaction_wrapper.py index dedddbb..78f88c6 100644 --- a/ynab/models/save_transaction_wrapper.py +++ b/ynab/models/save_transaction_wrapper.py @@ -61,7 +61,6 @@ def transaction(self, transaction): :param transaction: The transaction of this SaveTransactionWrapper. # noqa: E501 :type: SaveTransaction """ - self._transaction = transaction diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py index 907fecc..c0f10df 100644 --- a/ynab/models/save_transactions_response.py +++ b/ynab/models/save_transactions_response.py @@ -60,7 +60,6 @@ def data(self, data): :param data: The data of this SaveTransactionsResponse. # noqa: E501 :type: object """ - self._data = data diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index 667c43b..6373371 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -88,7 +88,6 @@ def id(self, id): :param id: The id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._id = id @@ -110,7 +109,6 @@ def scheduled_transaction_id(self, scheduled_transaction_id): :param scheduled_transaction_id: The scheduled_transaction_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._scheduled_transaction_id = scheduled_transaction_id @@ -134,7 +132,6 @@ def amount(self, amount): :param amount: The amount of this ScheduledSubTransaction. # noqa: E501 :type: int """ - self._amount = amount @@ -156,7 +153,6 @@ def memo(self, memo): :param memo: The memo of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._memo = memo @@ -178,7 +174,6 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._payee_id = payee_id @@ -200,7 +195,6 @@ def category_id(self, category_id): :param category_id: The category_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._category_id = category_id @@ -224,7 +218,6 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ - self._transfer_account_id = transfer_account_id @@ -248,7 +241,6 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledSubTransaction. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index dbb4c23..f5412b0 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -74,7 +74,6 @@ def account_name(self, account_name): :param account_name: The account_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - self._account_name = account_name @@ -96,7 +95,6 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - self._payee_name = payee_name @@ -118,7 +116,6 @@ def category_name(self, category_name): :param category_name: The category_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ - self._category_name = category_name @@ -142,7 +139,6 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this ScheduledTransactionDetail. # noqa: E501 :type: list[ScheduledSubTransaction] """ - self._subtransactions = subtransactions diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index c51d260..ff49ce9 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this ScheduledTransactionResponse. # noqa: E501 :type: ScheduledTransactionWrapper """ - self._data = data diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index 401564f..207a9d6 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -104,7 +104,6 @@ def id(self, id): :param id: The id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._id = id @@ -128,7 +127,6 @@ def date_first(self, date_first): :param date_first: The date_first of this ScheduledTransactionSummary. # noqa: E501 :type: date """ - self._date_first = date_first @@ -152,7 +150,6 @@ def date_next(self, date_next): :param date_next: The date_next of this ScheduledTransactionSummary. # noqa: E501 :type: date """ - self._date_next = date_next @@ -174,7 +171,6 @@ def frequency(self, frequency): :param frequency: The frequency of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - allowed_values = ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"] # noqa: E501 if frequency not in allowed_values: raise ValueError( @@ -204,7 +200,6 @@ def amount(self, amount): :param amount: The amount of this ScheduledTransactionSummary. # noqa: E501 :type: int """ - self._amount = amount @@ -226,7 +221,6 @@ def memo(self, memo): :param memo: The memo of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._memo = memo @@ -250,7 +244,6 @@ def flag_color(self, flag_color): :param flag_color: The flag_color of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 if flag_color not in allowed_values: raise ValueError( @@ -278,7 +271,6 @@ def account_id(self, account_id): :param account_id: The account_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._account_id = account_id @@ -300,7 +292,6 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._payee_id = payee_id @@ -322,7 +313,6 @@ def category_id(self, category_id): :param category_id: The category_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._category_id = category_id @@ -346,7 +336,6 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ - self._transfer_account_id = transfer_account_id @@ -370,7 +359,6 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledTransactionSummary. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/scheduled_transaction_wrapper.py b/ynab/models/scheduled_transaction_wrapper.py index 27d9cf7..06b3b26 100644 --- a/ynab/models/scheduled_transaction_wrapper.py +++ b/ynab/models/scheduled_transaction_wrapper.py @@ -61,7 +61,6 @@ def scheduled_transaction(self, scheduled_transaction): :param scheduled_transaction: The scheduled_transaction of this ScheduledTransactionWrapper. # noqa: E501 :type: ScheduledTransactionDetail """ - self._scheduled_transaction = scheduled_transaction diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index b5b0eb4..af537d4 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this ScheduledTransactionsResponse. # noqa: E501 :type: ScheduledTransactionsWrapper """ - self._data = data diff --git a/ynab/models/scheduled_transactions_wrapper.py b/ynab/models/scheduled_transactions_wrapper.py index e39f1ec..5496d89 100644 --- a/ynab/models/scheduled_transactions_wrapper.py +++ b/ynab/models/scheduled_transactions_wrapper.py @@ -61,7 +61,6 @@ def scheduled_transactions(self, scheduled_transactions): :param scheduled_transactions: The scheduled_transactions of this ScheduledTransactionsWrapper. # noqa: E501 :type: list[ScheduledTransactionDetail] """ - self._scheduled_transactions = scheduled_transactions diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index 1687d1a..5ad6210 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -88,7 +88,6 @@ def id(self, id): :param id: The id of this SubTransaction. # noqa: E501 :type: str """ - self._id = id @@ -110,7 +109,6 @@ def transaction_id(self, transaction_id): :param transaction_id: The transaction_id of this SubTransaction. # noqa: E501 :type: str """ - self._transaction_id = transaction_id @@ -134,7 +132,6 @@ def amount(self, amount): :param amount: The amount of this SubTransaction. # noqa: E501 :type: int """ - self._amount = amount @@ -156,7 +153,6 @@ def memo(self, memo): :param memo: The memo of this SubTransaction. # noqa: E501 :type: str """ - self._memo = memo @@ -178,7 +174,6 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this SubTransaction. # noqa: E501 :type: str """ - self._payee_id = payee_id @@ -200,7 +195,6 @@ def category_id(self, category_id): :param category_id: The category_id of this SubTransaction. # noqa: E501 :type: str """ - self._category_id = category_id @@ -224,7 +218,6 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this SubTransaction. # noqa: E501 :type: str """ - self._transfer_account_id = transfer_account_id @@ -248,7 +241,6 @@ def deleted(self, deleted): :param deleted: The deleted of this SubTransaction. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 9806fbb..0aa73e7 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -74,7 +74,6 @@ def account_name(self, account_name): :param account_name: The account_name of this TransactionDetail. # noqa: E501 :type: str """ - self._account_name = account_name @@ -96,7 +95,6 @@ def payee_name(self, payee_name): :param payee_name: The payee_name of this TransactionDetail. # noqa: E501 :type: str """ - self._payee_name = payee_name @@ -118,7 +116,6 @@ def category_name(self, category_name): :param category_name: The category_name of this TransactionDetail. # noqa: E501 :type: str """ - self._category_name = category_name @@ -142,7 +139,6 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this TransactionDetail. # noqa: E501 :type: list[SubTransaction] """ - self._subtransactions = subtransactions diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index f29197b..e621c16 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this TransactionResponse. # noqa: E501 :type: TransactionWrapper """ - self._data = data diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index f68db32..8e8b261 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -116,7 +116,6 @@ def id(self, id): :param id: The id of this TransactionSummary. # noqa: E501 :type: str """ - self._id = id @@ -138,7 +137,6 @@ def _date(self, _date): :param _date: The _date of this TransactionSummary. # noqa: E501 :type: date """ - self.__date = _date @@ -162,7 +160,6 @@ def amount(self, amount): :param amount: The amount of this TransactionSummary. # noqa: E501 :type: int """ - self._amount = amount @@ -184,7 +181,6 @@ def memo(self, memo): :param memo: The memo of this TransactionSummary. # noqa: E501 :type: str """ - self._memo = memo @@ -208,7 +204,6 @@ def cleared(self, cleared): :param cleared: The cleared of this TransactionSummary. # noqa: E501 :type: str """ - allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 if cleared not in allowed_values: raise ValueError( @@ -238,7 +233,6 @@ def approved(self, approved): :param approved: The approved of this TransactionSummary. # noqa: E501 :type: bool """ - self._approved = approved @@ -262,7 +256,6 @@ def flag_color(self, flag_color): :param flag_color: The flag_color of this TransactionSummary. # noqa: E501 :type: str """ - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 if flag_color not in allowed_values: raise ValueError( @@ -290,7 +283,6 @@ def account_id(self, account_id): :param account_id: The account_id of this TransactionSummary. # noqa: E501 :type: str """ - self._account_id = account_id @@ -312,7 +304,6 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this TransactionSummary. # noqa: E501 :type: str """ - self._payee_id = payee_id @@ -334,7 +325,6 @@ def category_id(self, category_id): :param category_id: The category_id of this TransactionSummary. # noqa: E501 :type: str """ - self._category_id = category_id @@ -358,7 +348,6 @@ def transfer_account_id(self, transfer_account_id): :param transfer_account_id: The transfer_account_id of this TransactionSummary. # noqa: E501 :type: str """ - self._transfer_account_id = transfer_account_id @@ -382,7 +371,6 @@ def transfer_transaction_id(self, transfer_transaction_id): :param transfer_transaction_id: The transfer_transaction_id of this TransactionSummary. # noqa: E501 :type: str """ - self._transfer_transaction_id = transfer_transaction_id @@ -406,7 +394,6 @@ def matched_transaction_id(self, matched_transaction_id): :param matched_transaction_id: The matched_transaction_id of this TransactionSummary. # noqa: E501 :type: str """ - self._matched_transaction_id = matched_transaction_id @@ -430,7 +417,6 @@ def import_id(self, import_id): :param import_id: The import_id of this TransactionSummary. # noqa: E501 :type: str """ - self._import_id = import_id @@ -454,7 +440,6 @@ def deleted(self, deleted): :param deleted: The deleted of this TransactionSummary. # noqa: E501 :type: bool """ - self._deleted = deleted diff --git a/ynab/models/transaction_wrapper.py b/ynab/models/transaction_wrapper.py index a500ed6..7b7cf74 100644 --- a/ynab/models/transaction_wrapper.py +++ b/ynab/models/transaction_wrapper.py @@ -61,7 +61,6 @@ def transaction(self, transaction): :param transaction: The transaction of this TransactionWrapper. # noqa: E501 :type: TransactionDetail """ - self._transaction = transaction diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index d3b74be..57e1765 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this TransactionsResponse. # noqa: E501 :type: TransactionsWrapper """ - self._data = data diff --git a/ynab/models/transactions_wrapper.py b/ynab/models/transactions_wrapper.py index 1b1f4cd..e85ce4e 100644 --- a/ynab/models/transactions_wrapper.py +++ b/ynab/models/transactions_wrapper.py @@ -65,7 +65,6 @@ def transactions(self, transactions): :param transactions: The transactions of this TransactionsWrapper. # noqa: E501 :type: list[TransactionDetail] """ - self._transactions = transactions @@ -89,7 +88,6 @@ def server_knowledge(self, server_knowledge): :param server_knowledge: The server_knowledge of this TransactionsWrapper. # noqa: E501 :type: int """ - self._server_knowledge = server_knowledge diff --git a/ynab/models/user.py b/ynab/models/user.py index b2fff09..f65e7c5 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -60,7 +60,6 @@ def id(self, id): :param id: The id of this User. # noqa: E501 :type: str """ - self._id = id diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index 9d9c31c..8262d17 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -61,7 +61,6 @@ def data(self, data): :param data: The data of this UserResponse. # noqa: E501 :type: UserWrapper """ - self._data = data diff --git a/ynab/models/user_wrapper.py b/ynab/models/user_wrapper.py index ea90298..b376d18 100644 --- a/ynab/models/user_wrapper.py +++ b/ynab/models/user_wrapper.py @@ -61,7 +61,6 @@ def user(self, user): :param user: The user of this UserWrapper. # noqa: E501 :type: User """ - self._user = user From 5ae1b7bdc6bcf28d1584b98b1c4652db95322b51 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sat, 1 Jun 2019 13:12:16 -0700 Subject: [PATCH 06/14] Use the local copy of the OpenAPI spec that removes the 'allOf' for transactions. --- docs/TransactionDetail.md | 15 ++ generate_code.sh | 2 +- ynab/models/transaction_detail.py | 414 +++++++++++++++++++++++++++++- 3 files changed, 425 insertions(+), 6 deletions(-) diff --git a/docs/TransactionDetail.md b/docs/TransactionDetail.md index 5580479..fb72a92 100644 --- a/docs/TransactionDetail.md +++ b/docs/TransactionDetail.md @@ -7,6 +7,21 @@ Name | Type | Description | Notes **payee_name** | **str** | | **category_name** | **str** | | **subtransactions** | [**list[SubTransaction]**](SubTransaction.md) | If a split transaction, the subtransactions. | +**id** | **str** | | +**_date** | **date** | | +**amount** | **int** | The transaction amount in milliunits format | +**memo** | **str** | | +**cleared** | **str** | The cleared status of the transaction | +**approved** | **bool** | Whether or not the transaction is approved | +**flag_color** | **str** | The transaction flag | +**account_id** | **str** | | +**payee_id** | **str** | | +**category_id** | **str** | | +**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | +**transfer_transaction_id** | **str** | If a transfer transaction, the id of transaction on the other side of the transfer | +**matched_transaction_id** | **str** | If transaction is matched, the id of the matched transaction | +**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | +**deleted** | **bool** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generate_code.sh b/generate_code.sh index 7f147fe..804268a 100755 --- a/generate_code.sh +++ b/generate_code.sh @@ -4,7 +4,7 @@ rm -rf test/* # Generate the code -swagger-codegen generate -i https://api.youneedabudget.com/papi/spec-v1-swagger.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python +swagger-codegen generate -i spec-v1-swagger.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python # Fix the models module path git grep -lz test | xargs -0 sed -i '' 's/from models\./from ynab\.models\./g' diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 0aa73e7..5b91f5b 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -15,10 +15,9 @@ import six from ynab.models.sub_transaction import SubTransaction # noqa: F401,E501 -from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 -class TransactionDetail(TransactionSummary): +class TransactionDetail(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -34,27 +33,87 @@ class TransactionDetail(TransactionSummary): 'account_name': 'str', 'payee_name': 'str', 'category_name': 'str', - 'subtransactions': 'list[SubTransaction]' + 'subtransactions': 'list[SubTransaction]', + 'id': 'str', + '_date': 'date', + 'amount': 'int', + 'memo': 'str', + 'cleared': 'str', + 'approved': 'bool', + 'flag_color': 'str', + 'account_id': 'str', + 'payee_id': 'str', + 'category_id': 'str', + 'transfer_account_id': 'str', + 'transfer_transaction_id': 'str', + 'matched_transaction_id': 'str', + 'import_id': 'str', + 'deleted': 'bool' } attribute_map = { 'account_name': 'account_name', 'payee_name': 'payee_name', 'category_name': 'category_name', - 'subtransactions': 'subtransactions' + 'subtransactions': 'subtransactions', + 'id': 'id', + '_date': 'date', + 'amount': 'amount', + 'memo': 'memo', + 'cleared': 'cleared', + 'approved': 'approved', + 'flag_color': 'flag_color', + 'account_id': 'account_id', + 'payee_id': 'payee_id', + 'category_id': 'category_id', + 'transfer_account_id': 'transfer_account_id', + 'transfer_transaction_id': 'transfer_transaction_id', + 'matched_transaction_id': 'matched_transaction_id', + 'import_id': 'import_id', + 'deleted': 'deleted' } - def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None, id=None, _date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, transfer_transaction_id=None, matched_transaction_id=None, import_id=None, deleted=None): # noqa: E501 """TransactionDetail - a model defined in Swagger""" # noqa: E501 self._account_name = None self._payee_name = None self._category_name = None self._subtransactions = None + self._id = None + self.__date = None + self._amount = None + self._memo = None + self._cleared = None + self._approved = None + self._flag_color = None + self._account_id = None + self._payee_id = None + self._category_id = None + self._transfer_account_id = None + self._transfer_transaction_id = None + self._matched_transaction_id = None + self._import_id = None + self._deleted = None self.discriminator = None self.account_name = account_name self.payee_name = payee_name self.category_name = category_name self.subtransactions = subtransactions + self.id = id + self._date = _date + self.amount = amount + self.memo = memo + self.cleared = cleared + self.approved = approved + self.flag_color = flag_color + self.account_id = account_id + self.payee_id = payee_id + self.category_id = category_id + self.transfer_account_id = transfer_account_id + self.transfer_transaction_id = transfer_transaction_id + self.matched_transaction_id = matched_transaction_id + self.import_id = import_id + self.deleted = deleted @property def account_name(self): @@ -142,6 +201,351 @@ def subtransactions(self, subtransactions): self._subtransactions = subtransactions + @property + def id(self): + """Gets the id of this TransactionDetail. # noqa: E501 + + + :return: The id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TransactionDetail. + + + :param id: The id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def _date(self): + """Gets the _date of this TransactionDetail. # noqa: E501 + + + :return: The _date of this TransactionDetail. # noqa: E501 + :rtype: date + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this TransactionDetail. + + + :param _date: The _date of this TransactionDetail. # noqa: E501 + :type: date + """ + + self.__date = _date + + @property + def amount(self): + """Gets the amount of this TransactionDetail. # noqa: E501 + + The transaction amount in milliunits format # noqa: E501 + + :return: The amount of this TransactionDetail. # noqa: E501 + :rtype: int + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this TransactionDetail. + + The transaction amount in milliunits format # noqa: E501 + + :param amount: The amount of this TransactionDetail. # noqa: E501 + :type: int + """ + + self._amount = amount + + @property + def memo(self): + """Gets the memo of this TransactionDetail. # noqa: E501 + + + :return: The memo of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this TransactionDetail. + + + :param memo: The memo of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def cleared(self): + """Gets the cleared of this TransactionDetail. # noqa: E501 + + The cleared status of the transaction # noqa: E501 + + :return: The cleared of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._cleared + + @cleared.setter + def cleared(self, cleared): + """Sets the cleared of this TransactionDetail. + + The cleared status of the transaction # noqa: E501 + + :param cleared: The cleared of this TransactionDetail. # noqa: E501 + :type: str + """ + allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 + if cleared not in allowed_values: + raise ValueError( + "Invalid value for `cleared` ({0}), must be one of {1}" # noqa: E501 + .format(cleared, allowed_values) + ) + + self._cleared = cleared + + @property + def approved(self): + """Gets the approved of this TransactionDetail. # noqa: E501 + + Whether or not the transaction is approved # noqa: E501 + + :return: The approved of this TransactionDetail. # noqa: E501 + :rtype: bool + """ + return self._approved + + @approved.setter + def approved(self, approved): + """Sets the approved of this TransactionDetail. + + Whether or not the transaction is approved # noqa: E501 + + :param approved: The approved of this TransactionDetail. # noqa: E501 + :type: bool + """ + + self._approved = approved + + @property + def flag_color(self): + """Gets the flag_color of this TransactionDetail. # noqa: E501 + + The transaction flag # noqa: E501 + + :return: The flag_color of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._flag_color + + @flag_color.setter + def flag_color(self, flag_color): + """Sets the flag_color of this TransactionDetail. + + The transaction flag # noqa: E501 + + :param flag_color: The flag_color of this TransactionDetail. # noqa: E501 + :type: str + """ + allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 + if flag_color not in allowed_values: + raise ValueError( + "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 + .format(flag_color, allowed_values) + ) + + self._flag_color = flag_color + + @property + def account_id(self): + """Gets the account_id of this TransactionDetail. # noqa: E501 + + + :return: The account_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._account_id + + @account_id.setter + def account_id(self, account_id): + """Sets the account_id of this TransactionDetail. + + + :param account_id: The account_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._account_id = account_id + + @property + def payee_id(self): + """Gets the payee_id of this TransactionDetail. # noqa: E501 + + + :return: The payee_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._payee_id + + @payee_id.setter + def payee_id(self, payee_id): + """Sets the payee_id of this TransactionDetail. + + + :param payee_id: The payee_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._payee_id = payee_id + + @property + def category_id(self): + """Gets the category_id of this TransactionDetail. # noqa: E501 + + + :return: The category_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this TransactionDetail. + + + :param category_id: The category_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._category_id = category_id + + @property + def transfer_account_id(self): + """Gets the transfer_account_id of this TransactionDetail. # noqa: E501 + + If a transfer transaction, the account to which it transfers # noqa: E501 + + :return: The transfer_account_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._transfer_account_id + + @transfer_account_id.setter + def transfer_account_id(self, transfer_account_id): + """Sets the transfer_account_id of this TransactionDetail. + + If a transfer transaction, the account to which it transfers # noqa: E501 + + :param transfer_account_id: The transfer_account_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._transfer_account_id = transfer_account_id + + @property + def transfer_transaction_id(self): + """Gets the transfer_transaction_id of this TransactionDetail. # noqa: E501 + + If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 + + :return: The transfer_transaction_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._transfer_transaction_id + + @transfer_transaction_id.setter + def transfer_transaction_id(self, transfer_transaction_id): + """Sets the transfer_transaction_id of this TransactionDetail. + + If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 + + :param transfer_transaction_id: The transfer_transaction_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._transfer_transaction_id = transfer_transaction_id + + @property + def matched_transaction_id(self): + """Gets the matched_transaction_id of this TransactionDetail. # noqa: E501 + + If transaction is matched, the id of the matched transaction # noqa: E501 + + :return: The matched_transaction_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._matched_transaction_id + + @matched_transaction_id.setter + def matched_transaction_id(self, matched_transaction_id): + """Sets the matched_transaction_id of this TransactionDetail. + + If transaction is matched, the id of the matched transaction # noqa: E501 + + :param matched_transaction_id: The matched_transaction_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._matched_transaction_id = matched_transaction_id + + @property + def import_id(self): + """Gets the import_id of this TransactionDetail. # noqa: E501 + + If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 + + :return: The import_id of this TransactionDetail. # noqa: E501 + :rtype: str + """ + return self._import_id + + @import_id.setter + def import_id(self, import_id): + """Sets the import_id of this TransactionDetail. + + If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 + + :param import_id: The import_id of this TransactionDetail. # noqa: E501 + :type: str + """ + + self._import_id = import_id + + @property + def deleted(self): + """Gets the deleted of this TransactionDetail. # noqa: E501 + + Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 + + :return: The deleted of this TransactionDetail. # noqa: E501 + :rtype: bool + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this TransactionDetail. + + Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 + + :param deleted: The deleted of this TransactionDetail. # noqa: E501 + :type: bool + """ + + self._deleted = deleted + def to_dict(self): """Returns the model properties as a dict""" result = {} From 2d497f75d787b389b0985d31ff2d1ef95ea10256 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sat, 1 Jun 2019 13:12:29 -0700 Subject: [PATCH 07/14] Add the local copy of the OpenAPI spec. --- spec-v1-swagger.json | 2924 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2924 insertions(+) create mode 100644 spec-v1-swagger.json diff --git a/spec-v1-swagger.json b/spec-v1-swagger.json new file mode 100644 index 0000000..2fc76ff --- /dev/null +++ b/spec-v1-swagger.json @@ -0,0 +1,2924 @@ +{ + "swagger": "2.0", + "info": { + "description": "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.youneedabudget.com", + "version": "1.0.0", + "title": "YNAB API Endpoints" + }, + "schemes": ["https"], + "host": "api.youneedabudget.com", + "basePath": "/v1", + "tags": [ + { + "name": "User" + }, + { + "name": "Budgets" + }, + { + "name": "Accounts", + "description": "The accounts for a budget" + }, + { + "name": "Categories", + "description": "The categories for a budget" + }, + { + "name": "Payees", + "description": "The payees for a budget" + }, + { + "name": "Payee Locations", + "description": "When you enter a transaction and specify a payee on the YNAB mobile apps, the GPS coordinates for that location are stored, with your permission, so that the next time you are in the same place (like the Grocery store) we can pre-populate nearby payees for you! It’s handy and saves you time. This resource makes these locations available. Locations will not be available for all payees." + }, + { + "name": "Months", + "description": "Each budget contains one or more months, which is where To be Budgeted, Age of Money and category (budgeted / activity / balances) amounts are available." + }, + { + "name": "Transactions", + "description": "The transactions for a budget" + }, + { + "name": "Scheduled Transactions", + "description": "The scheduled transactions for a budget" + } + ], + "security": [ + { + "bearer": [] + } + ], + "paths": { + "/user": { + "get": { + "tags": ["User"], + "summary": "User info", + "description": "Returns authenticated user information", + "operationId": "getUser", + "produces": ["application/json"], + "responses": { + "200": { + "description": "The user info", + "schema": { + "$ref": "#/definitions/UserResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets": { + "get": { + "tags": ["Budgets"], + "summary": "List budgets", + "description": "Returns budgets list with summary information", + "operationId": "getBudgets", + "produces": ["application/json"], + "parameters": [], + "responses": { + "200": { + "description": "The list of budgets", + "schema": { + "$ref": "#/definitions/BudgetSummaryResponse" + } + }, + "404": { + "description": "No budgets were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}": { + "get": { + "tags": ["Budgets"], + "summary": "Single budget", + "description": "Returns a single budget with all related entities. This resource is effectively a full budget export.", + "operationId": "getBudgetById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The requested budget", + "schema": { + "$ref": "#/definitions/BudgetDetailResponse" + } + }, + "404": { + "description": "The specified budget was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/settings": { + "get": { + "tags": ["Budgets"], + "summary": "Budget Settings", + "description": "Returns settings for a budget", + "operationId": "getBudgetSettingsById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested budget settings", + "schema": { + "$ref": "#/definitions/BudgetSettingsResponse" + } + }, + "404": { + "description": "The specified Budget was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/accounts": { + "get": { + "tags": ["Accounts"], + "summary": "Account list", + "description": "Returns all accounts", + "operationId": "getAccounts", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of requested accounts", + "schema": { + "$ref": "#/definitions/AccountsResponse" + } + }, + "404": { + "description": "No nccounts were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/accounts/{account_id}": { + "get": { + "tags": ["Accounts"], + "summary": "Single account", + "description": "Returns a single account", + "operationId": "getAccountById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "account_id", + "in": "path", + "description": "The id of the account", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "The requested account", + "schema": { + "$ref": "#/definitions/AccountResponse" + } + }, + "404": { + "description": "The requested account was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/categories": { + "get": { + "tags": ["Categories"], + "summary": "List categories", + "description": "Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).", + "operationId": "getCategories", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The categories grouped by category group", + "schema": { + "$ref": "#/definitions/CategoriesResponse" + } + }, + "404": { + "description": "No categories were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/categories/{category_id}": { + "get": { + "tags": ["Categories"], + "summary": "Single category", + "description": "Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).", + "operationId": "getCategoryById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "category_id", + "in": "path", + "description": "The id of the category", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested category", + "schema": { + "$ref": "#/definitions/CategoryResponse" + } + }, + "404": { + "description": "The category not was found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/months/{month}/categories/{category_id}": { + "get": { + "tags": ["Categories"], + "summary": "Single category for a specific budget month", + "description": "Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).", + "operationId": "getMonthCategoryById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "month", + "in": "path", + "description": "The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))", + "required": true, + "type": "string", + "format": "date" + }, + { + "name": "category_id", + "in": "path", + "description": "The id of the category", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested month category", + "schema": { + "$ref": "#/definitions/CategoryResponse" + } + }, + "404": { + "description": "The month category was not was found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": ["Categories"], + "summary": "Update a category for a specific month", + "description": "Update a category for a specific month", + "operationId": "updateMonthCategory", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "month", + "in": "path", + "description": "The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))", + "required": true, + "type": "string", + "format": "date" + }, + { + "name": "category_id", + "in": "path", + "description": "The id of the category", + "required": true, + "type": "string" + }, + { + "name": "data", + "in": "body", + "description": "The category to update", + "required": true, + "schema": { + "$ref": "#/definitions/SaveMonthCategoryWrapper" + } + } + ], + "responses": { + "200": { + "description": "The month category was successfully updated", + "schema": { + "$ref": "#/definitions/CategoryResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s)", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payees": { + "get": { + "tags": ["Payees"], + "summary": "List payees", + "description": "Returns all payees", + "operationId": "getPayees", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The requested list of payees", + "schema": { + "$ref": "#/definitions/PayeesResponse" + } + }, + "404": { + "description": "No payees were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payees/{payee_id}": { + "get": { + "tags": ["Payees"], + "summary": "Single payee", + "description": "Returns single payee", + "operationId": "getPayeeById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "payee_id", + "in": "path", + "description": "The id of the payee", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested payee", + "schema": { + "$ref": "#/definitions/PayeeResponse" + } + }, + "404": { + "description": "The payee was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payee_locations": { + "get": { + "tags": ["Payee Locations"], + "summary": "List payee locations", + "description": "Returns all payee locations", + "operationId": "getPayeeLocations", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The list of payee locations", + "schema": { + "$ref": "#/definitions/PayeeLocationsResponse" + } + }, + "404": { + "description": "No payees locations were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payee_locations/{payee_location_id}": { + "get": { + "tags": ["Payee Locations"], + "summary": "Single payee location", + "description": "Returns a single payee location", + "operationId": "getPayeeLocationById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "payee_location_id", + "in": "path", + "description": "id of payee location", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The payee location", + "schema": { + "$ref": "#/definitions/PayeeLocationResponse" + } + }, + "404": { + "description": "The payee location was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payees/{payee_id}/payee_locations": { + "get": { + "tags": ["Payee Locations"], + "summary": "List locations for a payee", + "description": "Returns all payee locations for the specified payee", + "operationId": "getPayeeLocationsByPayee", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "payee_id", + "in": "path", + "description": "id of payee", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The list of requested payee locations", + "schema": { + "$ref": "#/definitions/PayeeLocationsResponse" + } + }, + "404": { + "description": "No payees locations were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/months": { + "get": { + "tags": ["Months"], + "summary": "List budget months", + "description": "Returns all budget months", + "operationId": "getBudgetMonths", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of budget months", + "schema": { + "$ref": "#/definitions/MonthSummariesResponse" + } + }, + "404": { + "description": "No budget months were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/months/{month}": { + "get": { + "tags": ["Months"], + "summary": "Single budget month", + "description": "Returns a single budget month", + "operationId": "getBudgetMonth", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "month", + "in": "path", + "description": "The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))", + "required": true, + "type": "string", + "format": "date" + } + ], + "responses": { + "200": { + "description": "The budget month detail", + "schema": { + "$ref": "#/definitions/MonthDetailResponse" + } + }, + "404": { + "description": "The budget month was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/transactions": { + "get": { + "tags": ["Transactions"], + "summary": "List transactions", + "description": "Returns budget transactions", + "operationId": "getTransactions", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "since_date", + "in": "query", + "description": "If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).", + "required": false, + "type": "string", + "format": "date" + }, + { + "name": "type", + "in": "query", + "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "required": false, + "type": "string", + "enum": ["uncategorized", "unapproved"] + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of requested transactions", + "schema": { + "$ref": "#/definitions/TransactionsResponse" + } + }, + "404": { + "description": "No transactions were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "400": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "post": { + "tags": ["Transactions"], + "summary": "Create a single transaction or multiple transactions", + "description": "Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created.", + "operationId": "createTransaction", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "data", + "in": "body", + "description": "The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects.", + "required": true, + "schema": { + "$ref": "#/definitions/SaveTransactionsWrapper" + } + } + ], + "responses": { + "201": { + "description": "The transaction or transactions were successfully created", + "schema": { + "$ref": "#/definitions/SaveTransactionsResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s).", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "409": { + "description": "A transaction on the same account with the same import_id already exists.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": ["Transactions"], + "summary": "Update multiple transactions", + "description": "Updates multiple transactions, by 'id' or 'import_id'.", + "operationId": "updateTransactions", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "data", + "in": "body", + "description": "The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id.", + "required": true, + "schema": { + "$ref": "#/definitions/SaveTransactionsWrapper" + } + } + ], + "responses": { + "209": { + "description": "The transactions were successfully updated", + "schema": { + "$ref": "#/definitions/SaveTransactionsResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s).", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/transactions/{transaction_id}": { + "get": { + "tags": ["Transactions"], + "summary": "Single transaction", + "description": "Returns a single transaction", + "operationId": "getTransactionById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "transaction_id", + "in": "path", + "description": "The id of the transaction", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested transaction", + "schema": { + "$ref": "#/definitions/TransactionResponse" + } + }, + "404": { + "description": "The transaction was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": ["Transactions"], + "summary": "Updates an existing transaction", + "description": "Updates a transaction", + "operationId": "updateTransaction", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "transaction_id", + "in": "path", + "description": "The id of the transaction", + "required": true, + "type": "string" + }, + { + "name": "data", + "in": "body", + "description": "The transaction to update", + "required": true, + "schema": { + "$ref": "#/definitions/SaveTransactionWrapper" + } + } + ], + "responses": { + "200": { + "description": "The transaction was successfully updated", + "schema": { + "$ref": "#/definitions/TransactionResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s)", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/transactions/bulk": { + "post": { + "tags": ["Deprecated"], + "summary": "Bulk create transactions", + "description": "Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.", + "operationId": "bulkCreateTransactions", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "transactions", + "in": "body", + "description": "The list of transactions to create", + "required": true, + "schema": { + "$ref": "#/definitions/BulkTransactions" + } + } + ], + "responses": { + "201": { + "description": "The bulk request was processed sucessfully", + "schema": { + "$ref": "#/definitions/BulkResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s)", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/accounts/{account_id}/transactions": { + "get": { + "tags": ["Transactions"], + "summary": "List account transactions", + "description": "Returns all transactions for a specified account", + "operationId": "getTransactionsByAccount", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "account_id", + "in": "path", + "description": "The id of the account", + "required": true, + "type": "string" + }, + { + "name": "since_date", + "in": "query", + "description": "If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).", + "required": false, + "type": "string", + "format": "date" + }, + { + "name": "type", + "in": "query", + "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "required": false, + "type": "string", + "enum": ["uncategorized", "unapproved"] + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of requested transactions", + "schema": { + "$ref": "#/definitions/TransactionsResponse" + } + }, + "404": { + "description": "No transactions were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/categories/{category_id}/transactions": { + "get": { + "tags": ["Transactions"], + "summary": "List category transactions", + "description": "Returns all transactions for a specified category", + "operationId": "getTransactionsByCategory", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "category_id", + "in": "path", + "description": "The id of the category", + "required": true, + "type": "string" + }, + { + "name": "since_date", + "in": "query", + "description": "If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).", + "required": false, + "type": "string", + "format": "date" + }, + { + "name": "type", + "in": "query", + "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "required": false, + "type": "string", + "enum": ["uncategorized", "unapproved"] + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of requested transactions", + "schema": { + "$ref": "#/definitions/HybridTransactionsResponse" + } + }, + "404": { + "description": "No transactions were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/payees/{payee_id}/transactions": { + "get": { + "tags": ["Transactions"], + "summary": "List payee transactions", + "description": "Returns all transactions for a specified payee", + "operationId": "getTransactionsByPayee", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "payee_id", + "in": "path", + "description": "The id of the payee", + "required": true, + "type": "string" + }, + { + "name": "since_date", + "in": "query", + "description": "If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).", + "required": false, + "type": "string", + "format": "date" + }, + { + "name": "type", + "in": "query", + "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "required": false, + "type": "string", + "enum": ["uncategorized", "unapproved"] + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "The list of requested transactions", + "schema": { + "$ref": "#/definitions/HybridTransactionsResponse" + } + }, + "404": { + "description": "No transactions were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/scheduled_transactions": { + "get": { + "tags": ["Scheduled Transactions"], + "summary": "List scheduled transactions", + "description": "Returns all scheduled transactions", + "operationId": "getScheduledTransactions", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The list of requested scheduled transactions", + "schema": { + "$ref": "#/definitions/ScheduledTransactionsResponse" + } + }, + "404": { + "description": "No scheduled transactions were found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}": { + "get": { + "tags": ["Scheduled Transactions"], + "summary": "Single scheduled transaction", + "description": "Returns a single scheduled transaction", + "operationId": "getScheduledTransactionById", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "required": true, + "type": "string" + }, + { + "name": "scheduled_transaction_id", + "in": "path", + "description": "The id of the scheduled transaction", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested Scheduled Transaction", + "schema": { + "$ref": "#/definitions/ScheduledTransactionResponse" + } + }, + "404": { + "description": "The scheduled transaction was not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "An error occurred", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "securityDefinitions": { + "bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "definitions": { + "ErrorResponse": { + "type": "object", + "required": ["error"], + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "required": ["id", "name", "detail"], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "detail": { + "type": "string" + } + } + }, + "UserResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/UserWrapper" + } + } + }, + "UserWrapper": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "$ref": "#/definitions/User" + } + } + }, + "User": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + } + }, + "DateFormat": { + "type": "object", + "description": "The date format setting for the budget. In some cases the format will not be available and will be specified as null.", + "required": ["format"], + "properties": { + "format": { + "type": "string" + } + } + }, + "CurrencyFormat": { + "type": "object", + "description": "The currency format setting for the budget. In some cases the format will not be available and will be specified as null.", + "required": [ + "iso_code", + "example_format", + "decimal_digits", + "decimal_separator", + "symbol_first", + "group_separator", + "currency_symbol", + "display_symbol" + ], + "properties": { + "iso_code": { + "type": "string" + }, + "example_format": { + "type": "string" + }, + "decimal_digits": { + "type": "integer", + "format": "int32" + }, + "decimal_separator": { + "type": "string" + }, + "symbol_first": { + "type": "boolean" + }, + "group_separator": { + "type": "string" + }, + "currency_symbol": { + "type": "string" + }, + "display_symbol": { + "type": "boolean" + } + } + }, + "BudgetSummaryResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/BudgetSummaryWrapper" + } + } + }, + "BudgetSummaryWrapper": { + "type": "object", + "required": ["budgets"], + "properties": { + "budgets": { + "type": "array", + "items": { + "$ref": "#/definitions/BudgetSummary" + } + } + } + }, + "BudgetDetailResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/BudgetDetailWrapper" + } + } + }, + "BudgetDetailWrapper": { + "type": "object", + "required": ["budget", "server_knowledge"], + "properties": { + "budget": { + "$ref": "#/definitions/BudgetDetail" + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "BudgetSettingsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/BudgetSettingsWrapper" + } + } + }, + "BudgetSettingsWrapper": { + "type": "object", + "required": ["settings"], + "properties": { + "settings": { + "$ref": "#/definitions/BudgetSettings" + } + } + }, + "BudgetSummary": { + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "last_modified_on": { + "type": "string", + "format": "date-time", + "description": "The last time any changes were made to the budget from either a web or mobile client." + }, + "first_month": { + "type": "string", + "format": "date", + "description": "The earliest budget month." + }, + "last_month": { + "type": "string", + "format": "date", + "description": "The latest budget month." + }, + "date_format": { + "$ref": "#/definitions/DateFormat" + }, + "currency_format": { + "$ref": "#/definitions/CurrencyFormat" + } + } + }, + "BudgetSettings": { + "type": "object", + "required": ["date_format", "currency_format"], + "properties": { + "date_format": { + "$ref": "#/definitions/DateFormat" + }, + "currency_format": { + "$ref": "#/definitions/CurrencyFormat" + } + } + }, + "BudgetDetail": { + "allOf": [ + { + "$ref": "#/definitions/BudgetSummary" + }, + { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Account" + } + }, + "payees": { + "type": "array", + "items": { + "$ref": "#/definitions/Payee" + } + }, + "payee_locations": { + "type": "array", + "items": { + "$ref": "#/definitions/PayeeLocation" + } + }, + "category_groups": { + "type": "array", + "items": { + "$ref": "#/definitions/CategoryGroup" + } + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/definitions/Category" + } + }, + "months": { + "type": "array", + "items": { + "$ref": "#/definitions/MonthDetail" + } + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionSummary" + } + }, + "subtransactions": { + "type": "array", + "items": { + "$ref": "#/definitions/SubTransaction" + } + }, + "scheduled_transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/ScheduledTransactionSummary" + } + }, + "scheduled_subtransactions": { + "type": "array", + "items": { + "$ref": "#/definitions/ScheduledSubTransaction" + } + } + } + } + ] + }, + "AccountsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/AccountsWrapper" + } + } + }, + "AccountsWrapper": { + "type": "object", + "required": ["accounts", "server_knowledge"], + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Account" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "AccountResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/AccountWrapper" + } + } + }, + "AccountWrapper": { + "type": "object", + "required": ["account"], + "properties": { + "account": { + "$ref": "#/definitions/Account" + } + } + }, + "Account": { + "type": "object", + "required": [ + "id", + "name", + "type", + "on_budget", + "closed", + "note", + "balance", + "cleared_balance", + "uncleared_balance", + "transfer_payee_id", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of account. Note: payPal, merchantAccount, investmentAccount, and mortgage types have been deprecated and will be removed in the future.", + "enum": [ + "checking", + "savings", + "cash", + "creditCard", + "lineOfCredit", + "otherAsset", + "otherLiability", + "payPal", + "merchantAccount", + "investmentAccount", + "mortgage" + ] + }, + "on_budget": { + "type": "boolean", + "description": "Whether this account is on budget or not" + }, + "closed": { + "type": "boolean", + "description": "Whether this account is closed or not" + }, + "note": { + "type": "string" + }, + "balance": { + "type": "integer", + "format": "int64", + "description": "The current balance of the account in milliunits format" + }, + "cleared_balance": { + "type": "integer", + "format": "int64", + "description": "The current cleared balance of the account in milliunits format" + }, + "uncleared_balance": { + "type": "integer", + "format": "int64", + "description": "The current uncleared balance of the account in milliunits format" + }, + "transfer_payee_id": { + "type": "string", + "format": "uuid", + "description": + "The payee id which should be used when transferring to this account" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the account has been deleted. Deleted accounts will only be included in delta requests." + } + } + }, + "CategoriesResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/CategoryGroupsWrapper" + } + } + }, + "CategoryGroupsWrapper": { + "type": "object", + "required": ["category_groups", "server_knowledge"], + "properties": { + "category_groups": { + "type": "array", + "items": { + "$ref": "#/definitions/CategoryGroupWithCategories" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "CategoryResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/CategoryWrapper" + } + } + }, + "CategoryWrapper": { + "type": "object", + "required": ["category"], + "properties": { + "category": { + "$ref": "#/definitions/Category" + } + } + }, + "CategoryGroup": { + "type": "object", + "required": ["id", "name", "hidden", "deleted"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "hidden": { + "description": "Whether or not the category group is hidden", + "type": "boolean" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests." + } + } + }, + "CategoryGroupWithCategories": { + "allOf": [ + { + "$ref": "#/definitions/CategoryGroup" + }, + { + "type": "object", + "required": ["categories"], + "properties": { + "categories": { + "type": "array", + "description": "Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).", + "items": { + "$ref": "#/definitions/Category" + } + } + } + } + ] + }, + "Category": { + "type": "object", + "required": [ + "id", + "category_group_id", + "name", + "hidden", + "note", + "budgeted", + "activity", + "balance", + "goal_type", + "goal_creation_month", + "goal_target", + "goal_target_month", + "goal_percentage_complete", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "category_group_id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "hidden": { + "description": "Whether or not the category is hidden", + "type": "boolean" + }, + "original_category_group_id": { + "description": "If category is hidden this is the id of the category group it originally belonged to before it was hidden.", + "type": "string", + "format": "uuid" + }, + "note": { + "type": "string" + }, + "budgeted": { + "type": "integer", + "format": "int64", + "description": "Budgeted amount in milliunits format" + }, + "activity": { + "type": "integer", + "format": "int64", + "description": "Activity amount in milliunits format" + }, + "balance": { + "type": "integer", + "format": "int64", + "description": "Balance in milliunits format" + }, + "goal_type": { + "type": "string", + "enum": ["TB", "TBD", "MF", null], + "description": "The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding)" + }, + "goal_creation_month": { + "type": "string", + "format": "date", + "description": "The month a goal was created" + }, + "goal_target": { + "type": "integer", + "format": "int64", + "description": "The goal target amount in milliunits" + }, + "goal_target_month": { + "type": "string", + "format": "date", + "description": "If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed" + }, + "goal_percentage_complete": { + "type": "integer", + "format": "int32", + "description": "The percentage completion of the goal" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the category has been deleted. Deleted categories will only be included in delta requests." + } + } + }, + "PayeesResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/PayeesWrapper" + } + } + }, + "PayeesWrapper": { + "type": "object", + "required": ["payees", "server_knowledge"], + "properties": { + "payees": { + "type": "array", + "items": { + "$ref": "#/definitions/Payee" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "PayeeResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/PayeeWrapper" + } + } + }, + "PayeeWrapper": { + "type": "object", + "required": ["payee"], + "properties": { + "payee": { + "$ref": "#/definitions/Payee" + } + } + }, + "Payee": { + "type": "object", + "required": ["id", "name", "transfer_account_id", "deleted"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "transfer_account_id": { + "description": "If a transfer payee, the account_id to which this payee transfers to", + "type": "string" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the payee has been deleted. Deleted payees will only be included in delta requests." + } + } + }, + "PayeeLocationsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/PayeeLocationsWrapper" + } + } + }, + "PayeeLocationsWrapper": { + "type": "object", + "required": ["payee_locations"], + "properties": { + "payee_locations": { + "type": "array", + "items": { + "$ref": "#/definitions/PayeeLocation" + } + } + } + }, + "PayeeLocationResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/PayeeLocationWrapper" + } + } + }, + "PayeeLocationWrapper": { + "type": "object", + "required": ["payee_location"], + "properties": { + "payee_location": { + "$ref": "#/definitions/PayeeLocation" + } + } + }, + "PayeeLocation": { + "type": "object", + "required": ["id", "payee_id", "latitude", "longitude", "deleted"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "latitude": { + "type": "string" + }, + "longitude": { + "type": "string" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests." + } + } + }, + "TransactionsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/TransactionsWrapper" + } + } + }, + "TransactionsWrapper": { + "type": "object", + "required": ["transactions", "server_knowledge"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionDetail" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "HybridTransactionsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/HybridTransactionsWrapper" + } + } + }, + "HybridTransactionsWrapper": { + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/HybridTransaction" + } + } + } + }, + "SaveTransactionWrapper": { + "type": "object", + "required": ["transaction"], + "properties": { + "transaction": { + "$ref": "#/definitions/SaveTransaction" + } + } + }, + "SaveTransactionsWrapper": { + "type": "object", + "properties": { + "transaction": { + "$ref": "#/definitions/SaveTransaction" + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/SaveTransaction" + } + } + } + }, + "SaveTransaction": { + "type": "object", + "required": ["account_id", "date", "amount"], + "properties": { + "account_id": { + "type": "string", + "format": "uuid" + }, + "date": { + "type": "string", + "format": "date" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The transaction amount in milliunits format" + }, + "payee_id": { + "type": "string", + "format": "uuid", + "description": "The payee for the transaction" + }, + "payee_name": { + "type": "string", + "maxLength": 50, + "description": "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." + }, + "category_id": { + "type": "string", + "format": "uuid", + "description": "The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed." + }, + "memo": { + "type": "string", + "maxLength": 200 + }, + "cleared": { + "type": "string", + "enum": ["cleared", "uncleared", "reconciled"], + "description": "The cleared status of the transaction" + }, + "approved": { + "type": "boolean", + "description": "Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default." + }, + "flag_color": { + "type": "string", + "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], + "description": "The transaction flag" + }, + "import_id": { + "type": "string", + "maxLength": 36, + "description": "If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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)." + } + } + }, + "SaveTransactionsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "type": "object", + "required": ["transaction_ids"], + "properties": { + "transaction_ids": { + "type": "array", + "description": "The transaction ids that were saved", + "items": { + "type": "string" + } + }, + "transaction": { + "description": "If a single transaction was specified, the transaction that was saved", + "$ref": "#/definitions/TransactionDetail" + }, + "transactions": { + "type": "array", + "description": "If multiple transactions were specified, the transactions that were saved", + "items": { + "$ref": "#/definitions/TransactionDetail" + } + }, + "duplicate_import_ids": { + "type": "array", + "description": "If multiple transactions were specified, a list of import_ids that were not were created because of an existing import_id found on the same account", + "items": { + "type": "string" + } + } + } + } + } + }, + "TransactionResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/TransactionWrapper" + } + } + }, + "TransactionWrapper": { + "type": "object", + "required": ["transaction"], + "properties": { + "transaction": { + "$ref": "#/definitions/TransactionDetail" + } + } + }, + "TransactionSummary": { + "type": "object", + "required": [ + "id", + "date", + "amount", + "memo", + "cleared", + "approved", + "flag_color", + "account_id", + "payee_id", + "category_id", + "transfer_account_id", + "transfer_transaction_id", + "matched_transaction_id", + "import_id", + "deleted" + ], + "properties": { + "id": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The transaction amount in milliunits format" + }, + "memo": { + "type": "string" + }, + "cleared": { + "type": "string", + "enum": ["cleared", "uncleared", "reconciled"], + "description": "The cleared status of the transaction" + }, + "approved": { + "type": "boolean", + "description": "Whether or not the transaction is approved" + }, + "flag_color": { + "type": "string", + "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], + "description": "The transaction flag" + }, + "account_id": { + "type": "string", + "format": "uuid" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "category_id": { + "type": "string", + "format": "uuid" + }, + "transfer_account_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer transaction, the account to which it transfers" + }, + "transfer_transaction_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer transaction, the id of transaction on the other side of the transfer" + }, + "matched_transaction_id": { + "type": "string", + "format": "uuid", + "description": "If transaction is matched, the id of the matched transaction" + }, + "import_id": { + "type": "string", + "description": "If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'." + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests." + } + } + }, + "TransactionDetail": { + "type": "object", + "required": [ + "account_name", + "payee_name", + "category_name", + "subtransactions", + "id", + "date", + "amount", + "memo", + "cleared", + "approved", + "flag_color", + "account_id", + "payee_id", + "category_id", + "transfer_account_id", + "transfer_transaction_id", + "matched_transaction_id", + "import_id", + "deleted" + ], + "properties": { + "account_name": { + "type": "string" + }, + "payee_name": { + "type": "string" + }, + "category_name": { + "type": "string", + "nullable": true + }, + "subtransactions": { + "type": "array", + "description": "If a split transaction, the subtransactions.", + "items": { + "$ref": "#/definitions/SubTransaction" + } + }, + "id": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The transaction amount in milliunits format" + }, + "memo": { + "type": "string" + }, + "cleared": { + "type": "string", + "enum": ["cleared", "uncleared", "reconciled"], + "description": "The cleared status of the transaction" + }, + "approved": { + "type": "boolean", + "description": "Whether or not the transaction is approved" + }, + "flag_color": { + "type": "string", + "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], + "description": "The transaction flag" + }, + "account_id": { + "type": "string", + "format": "uuid" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "category_id": { + "type": "string", + "format": "uuid" + }, + "transfer_account_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer transaction, the account to which it transfers" + }, + "transfer_transaction_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer transaction, the id of transaction on the other side of the transfer" + }, + "matched_transaction_id": { + "type": "string", + "format": "uuid", + "description": "If transaction is matched, the id of the matched transaction" + }, + "import_id": { + "type": "string", + "description": "If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'." + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests." + } + } + }, + "HybridTransaction": { + "allOf": [ + { + "$ref": "#/definitions/TransactionSummary" + }, + { + "type": "object", + "required": [ + "type", + "parent_transaction_id", + "account_name", + "payee_name", + "category_name" + ], + "properties": { + "type": { + "type": "string", + "enum": ["transaction", "subtransaction"], + "description": "Whether the hybrid transaction represents a regular transaction or a subtransaction" + }, + "parent_transaction_id": { + "type": "string", + "description": "For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null." + }, + "account_name": { + "type": "string" + }, + "payee_name": { + "type": "string" + }, + "category_name": { + "type": "string" + } + } + } + ] + }, + "SaveMonthCategoryWrapper": { + "type": "object", + "required": ["category"], + "properties": { + "category": { + "$ref": "#/definitions/SaveMonthCategory" + } + } + }, + "SaveMonthCategory": { + "type": "object", + "required": ["budgeted"], + "properties": { + "budgeted": { + "type": "integer", + "format": "int64", + "description": "Budgeted amount in milliunits format" + } + } + }, + "BulkIdWrapper": { + "type": "object", + "required": ["bulk"], + "properties": { + "bulk": { + "$ref": "#/definitions/BulkIds" + } + } + }, + "BulkIds": { + "type": "object", + "required": ["transaction_ids", "duplicate_import_ids"], + "properties": { + "transaction_ids": { + "type": "array", + "description": "The list of Transaction ids that were created.", + "items": { + "type": "string" + } + }, + "duplicate_import_ids": { + "type": "array", + "description": "If any Transactions were not created because they had an import_id matching a transaction already on the same account, the specified import_id(s) will be included in this list.", + "items": { + "type": "string" + } + } + } + }, + "BulkResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/BulkIdWrapper" + } + } + }, + "BulkTransactions": { + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/SaveTransaction" + } + } + } + }, + "SubTransaction": { + "type": "object", + "required": [ + "id", + "transaction_id", + "amount", + "memo", + "payee_id", + "category_id", + "transfer_account_id", + "deleted" + ], + "properties": { + "id": { + "type": "string" + }, + "transaction_id": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The subtransaction amount in milliunits format" + }, + "memo": { + "type": "string" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "category_id": { + "type": "string", + "format": "uuid" + }, + "transfer_account_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer, the account_id which the subtransaction transfers to" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests." + } + } + }, + "ScheduledTransactionsResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/ScheduledTransactionsWrapper" + } + } + }, + "ScheduledTransactionsWrapper": { + "type": "object", + "required": ["scheduled_transactions"], + "properties": { + "scheduled_transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/ScheduledTransactionDetail" + } + } + } + }, + "ScheduledTransactionResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/ScheduledTransactionWrapper" + } + } + }, + "ScheduledTransactionWrapper": { + "type": "object", + "required": ["scheduled_transaction"], + "properties": { + "scheduled_transaction": { + "$ref": "#/definitions/ScheduledTransactionDetail" + } + } + }, + "ScheduledTransactionSummary": { + "type": "object", + "required": [ + "id", + "date_first", + "date_next", + "frequency", + "amount", + "memo", + "flag_color", + "account_id", + "payee_id", + "category_id", + "transfer_account_id", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "date_first": { + "type": "string", + "format": "date", + "description": "The first date for which the Scheduled Transaction was scheduled." + }, + "date_next": { + "type": "string", + "format": "date", + "description": "The next date for which the Scheduled Transaction is scheduled." + }, + "frequency": { + "type": "string", + "enum": [ + "never", + "daily", + "weekly", + "everyOtherWeek", + "twiceAMonth", + "every4Weeks", + "monthly", + "everyOtherMonth", + "every3Months", + "every4Months", + "twiceAYear", + "yearly", + "everyOtherYear" + ] + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The scheduled transaction amount in milliunits format" + }, + "memo": { + "type": "string" + }, + "flag_color": { + "type": "string", + "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], + "description": "The scheduled transaction flag" + }, + "account_id": { + "type": "string", + "format": "uuid" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "category_id": { + "type": "string", + "format": "uuid" + }, + "transfer_account_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer, the account_id which the scheduled transaction transfers to" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests." + } + } + }, + "ScheduledTransactionDetail": { + "allOf": [ + { + "$ref": "#/definitions/ScheduledTransactionSummary" + }, + { + "type": "object", + "required": [ + "account_name", + "payee_name", + "category_name", + "subtransactions" + ], + "properties": { + "account_name": { + "type": "string" + }, + "payee_name": { + "type": "string" + }, + "category_name": { + "type": "string" + }, + "subtransactions": { + "type": "array", + "description": "If a split scheduled transaction, the subtransactions.", + "items": { + "$ref": "#/definitions/ScheduledSubTransaction" + } + } + } + } + ] + }, + "ScheduledSubTransaction": { + "type": "object", + "required": [ + "id", + "scheduled_transaction_id", + "amount", + "memo", + "payee_id", + "category_id", + "transfer_account_id", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "scheduled_transaction_id": { + "type": "string", + "format": "uuid" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "The scheduled subtransaction amount in milliunits format" + }, + "memo": { + "type": "string" + }, + "payee_id": { + "type": "string", + "format": "uuid" + }, + "category_id": { + "type": "string", + "format": "uuid" + }, + "transfer_account_id": { + "type": "string", + "format": "uuid", + "description": "If a transfer, the account_id which the scheduled subtransaction transfers to" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests." + } + } + }, + "MonthSummariesResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/MonthSummariesWrapper" + } + } + }, + "MonthSummariesWrapper": { + "type": "object", + "required": ["months", "server_knowledge"], + "properties": { + "months": { + "type": "array", + "items": { + "$ref": "#/definitions/MonthSummary" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } + }, + "MonthDetailResponse": { + "type": "object", + "required": ["data"], + "properties": { + "data": { + "$ref": "#/definitions/MonthDetailWrapper" + } + } + }, + "MonthDetailWrapper": { + "type": "object", + "required": ["month"], + "properties": { + "month": { + "$ref": "#/definitions/MonthDetail" + } + } + }, + "MonthSummary": { + "type": "object", + "required": [ + "month", + "note", + "income", + "budgeted", + "activity", + "to_be_budgeted", + "age_of_money", + "deleted" + ], + "properties": { + "month": { + "type": "string", + "format": "date" + }, + "note": { + "type": "string" + }, + "income": { + "type": "integer", + "format": "int64", + "description": "The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month" + }, + "budgeted": { + "type": "integer", + "format": "int64", + "description": "The total amount budgeted in the month" + }, + "activity": { + "type": "integer", + "format": "int64", + "description": "The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted'" + }, + "to_be_budgeted": { + "type": "integer", + "format": "int64", + "description": "The available amount for 'To be Budgeted'" + }, + "age_of_money": { + "type": "integer", + "format": "int32", + "description": "The Age of Money as of the month" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the month has been deleted. Deleted months will only be included in delta requests." + } + } + }, + "MonthDetail": { + "allOf": [ + { + "$ref": "#/definitions/MonthSummary" + }, + { + "type": "object", + "required": ["categories"], + "properties": { + "categories": { + "type": "array", + "description": "The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified.", + "items": { + "$ref": "#/definitions/Category" + } + } + } + } + ] + } + } +} From 49c7064bf895cb319f1f4b6150e6e269fd638c82 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sat, 1 Jun 2019 13:13:56 -0700 Subject: [PATCH 08/14] Rename API spec for clarity. --- generate_code.sh | 2 +- spec-v1-swagger.json => ynab-swagger-api-spec-v1.json | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename spec-v1-swagger.json => ynab-swagger-api-spec-v1.json (100%) diff --git a/generate_code.sh b/generate_code.sh index 804268a..ca8d3d8 100755 --- a/generate_code.sh +++ b/generate_code.sh @@ -4,7 +4,7 @@ rm -rf test/* # Generate the code -swagger-codegen generate -i spec-v1-swagger.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python +swagger-codegen generate -i ynab-swagger-api-spec-v1.json -l python -o . --config swagger-codegen-python-config.json --git-user-id deanmcgregor --git-repo-id ynab-python # Fix the models module path git grep -lz test | xargs -0 sed -i '' 's/from models\./from ynab\.models\./g' diff --git a/spec-v1-swagger.json b/ynab-swagger-api-spec-v1.json similarity index 100% rename from spec-v1-swagger.json rename to ynab-swagger-api-spec-v1.json From 791604b798c2149ed2435c3f5dae3168b49cdc09 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sat, 1 Jun 2019 13:37:41 -0700 Subject: [PATCH 09/14] Manually adjust TransactionDetail flag_color enum because swagger-codegen fails on 'nullable' with Python. --- ynab-swagger-api-spec-v1.json | 3 ++- ynab/models/transaction_detail.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ynab-swagger-api-spec-v1.json b/ynab-swagger-api-spec-v1.json index 2fc76ff..221b9a4 100644 --- a/ynab-swagger-api-spec-v1.json +++ b/ynab-swagger-api-spec-v1.json @@ -2407,7 +2407,8 @@ "flag_color": { "type": "string", "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], - "description": "The transaction flag" + "description": "The transaction flag", + "nullable": true }, "account_id": { "type": "string", diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 5b91f5b..8386796 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -359,7 +359,7 @@ def flag_color(self, flag_color): :param flag_color: The flag_color of this TransactionDetail. # noqa: E501 :type: str """ - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 + allowed_values = ["red", "orange", "yellow", "green", "blue", "purple", None] # noqa: E501 if flag_color not in allowed_values: raise ValueError( "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 From 4bba24bf2e0c135e86852a875517f615ffa2fc86 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 9 Jun 2019 18:25:19 -0700 Subject: [PATCH 10/14] Add PyCharm files. --- .gitignore | 88 +++++++++++++++++++++++++++++++++++++++++++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ .idea/ynab-python.iml | 12 ++++++ 5 files changed, 118 insertions(+) create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/ynab-python.iml diff --git a/.gitignore b/.gitignore index a655050..8ff7fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,91 @@ target/ #Ipython Notebook .ipynb_checkpoints + +# Created by https://www.gitignore.io/api/IntelliJ +# Edit at https://www.gitignore.io/?templates=IntelliJ + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# JetBrains templates +**___jb_tmp___ + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +# End of https://www.gitignore.io/api/IntelliJ +n \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a2e120d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6a67d83 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/ynab-python.iml b/.idea/ynab-python.iml new file mode 100644 index 0000000..6f63a63 --- /dev/null +++ b/.idea/ynab-python.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file From 27fe752ad85bb4efa305f8aab12c082231cb22da Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 12 Jun 2022 16:39:38 -0700 Subject: [PATCH 11/14] Updated Swagger spec to latest. --- ynab-swagger-api-spec-v1.json | 1181 +++++++++++++++++---------------- 1 file changed, 620 insertions(+), 561 deletions(-) diff --git a/ynab-swagger-api-spec-v1.json b/ynab-swagger-api-spec-v1.json index 221b9a4..f5800b5 100644 --- a/ynab-swagger-api-spec-v1.json +++ b/ynab-swagger-api-spec-v1.json @@ -33,7 +33,7 @@ }, { "name": "Months", - "description": "Each budget contains one or more months, which is where To be Budgeted, Age of Money and category (budgeted / activity / balances) amounts are available." + "description": "Each budget contains one or more months, which is where Ready to Assign, Age of Money and category (budgeted / activity / balances) amounts are available." }, { "name": "Transactions", @@ -80,7 +80,15 @@ "description": "Returns budgets list with summary information", "operationId": "getBudgets", "produces": ["application/json"], - "parameters": [], + "parameters": [ + { + "name": "include_accounts", + "in": "query", + "description": "Whether to include the list of budget accounts", + "required": false, + "type": "boolean" + } + ], "responses": { "200": { "description": "The list of budgets", @@ -114,14 +122,14 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -160,7 +168,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" } @@ -198,14 +206,14 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -219,7 +227,7 @@ } }, "404": { - "description": "No nccounts were found", + "description": "No accounts were found", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -231,6 +239,45 @@ } } } + }, + "post": { + "tags": ["Accounts"], + "summary": "Create a new account", + "description": "Creates a new account", + "operationId": "createAccount", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)", + "required": true, + "type": "string" + }, + { + "name": "data", + "in": "body", + "description": "The account to create.", + "required": true, + "schema": { + "$ref": "#/definitions/SaveAccountWrapper" + } + } + ], + "responses": { + "201": { + "description": "The account was successfully created", + "schema": { + "$ref": "#/definitions/AccountResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s).", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } } }, "/budgets/{budget_id}/accounts/{account_id}": { @@ -244,7 +291,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -290,14 +337,14 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -336,7 +383,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -381,7 +428,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -425,14 +472,14 @@ "patch": { "tags": ["Categories"], "summary": "Update a category for a specific month", - "description": "Update a category for a specific month", + "description": "Update a category for a specific month. Only `budgeted` amount can be updated.", "operationId": "updateMonthCategory", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -454,7 +501,7 @@ { "name": "data", "in": "body", - "description": "The category to update", + "description": "The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.", "required": true, "schema": { "$ref": "#/definitions/SaveMonthCategoryWrapper" @@ -465,7 +512,7 @@ "200": { "description": "The month category was successfully updated", "schema": { - "$ref": "#/definitions/CategoryResponse" + "$ref": "#/definitions/SaveCategoryResponse" } }, "400": { @@ -488,14 +535,14 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -527,14 +574,14 @@ "get": { "tags": ["Payees"], "summary": "Single payee", - "description": "Returns single payee", + "description": "Returns a single payee", "operationId": "getPayeeById", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -579,7 +626,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" } @@ -617,7 +664,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -655,14 +702,14 @@ "get": { "tags": ["Payee Locations"], "summary": "List locations for a payee", - "description": "Returns all payee locations for the specified payee", + "description": "Returns all payee locations for a specified payee", "operationId": "getPayeeLocationsByPayee", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -707,14 +754,14 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -753,7 +800,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -799,7 +846,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -814,7 +861,7 @@ { "name": "type", "in": "query", - "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "description": "If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.", "required": false, "type": "string", "enum": ["uncategorized", "unapproved"] @@ -822,7 +869,7 @@ { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -852,21 +899,21 @@ "post": { "tags": ["Transactions"], "summary": "Create a single transaction or multiple transactions", - "description": "Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created.", + "description": "Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.", "operationId": "createTransaction", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "data", "in": "body", - "description": "The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects.", + "description": "The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.", "required": true, "schema": { "$ref": "#/definitions/SaveTransactionsWrapper" @@ -887,7 +934,7 @@ } }, "409": { - "description": "A transaction on the same account with the same import_id already exists.", + "description": "A transaction on the same account with the same `import_id` already exists.", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -897,24 +944,24 @@ "patch": { "tags": ["Transactions"], "summary": "Update multiple transactions", - "description": "Updates multiple transactions, by 'id' or 'import_id'.", + "description": "Updates multiple transactions, by `id` or `import_id`.", "operationId": "updateTransactions", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, { "name": "data", "in": "body", - "description": "The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id.", + "description": "The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup.", "required": true, "schema": { - "$ref": "#/definitions/SaveTransactionsWrapper" + "$ref": "#/definitions/UpdateTransactionsWrapper" } } ], @@ -934,6 +981,44 @@ } } }, + "/budgets/{budget_id}/transactions/import": { + "post": { + "tags": ["Transactions"], + "summary": "Import transactions", + "description": "Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.", + "operationId": "importTransactions", + "produces": ["application/json"], + "parameters": [ + { + "name": "budget_id", + "in": "path", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request was successful but there were no transactions to import", + "schema": { + "$ref": "#/definitions/TransactionsImportResponse" + } + }, + "201": { + "description": "One or more transactions were imported successfully", + "schema": { + "$ref": "#/definitions/TransactionsImportResponse" + } + }, + "400": { + "description": "The request could not be understood due to malformed syntax or validation error(s)", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/budgets/{budget_id}/transactions/{transaction_id}": { "get": { "tags": ["Transactions"], @@ -945,7 +1030,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -981,14 +1066,14 @@ "put": { "tags": ["Transactions"], "summary": "Updates an existing transaction", - "description": "Updates a transaction", + "description": "Updates a single transaction", "operationId": "updateTransaction", "produces": ["application/json"], "parameters": [ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1036,7 +1121,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1052,7 +1137,7 @@ ], "responses": { "201": { - "description": "The bulk request was processed sucessfully", + "description": "The bulk request was processed successfully", "schema": { "$ref": "#/definitions/BulkResponse" } @@ -1077,7 +1162,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1099,7 +1184,7 @@ { "name": "type", "in": "query", - "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "description": "If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.", "required": false, "type": "string", "enum": ["uncategorized", "unapproved"] @@ -1107,7 +1192,7 @@ { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -1146,7 +1231,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1168,7 +1253,7 @@ { "name": "type", "in": "query", - "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "description": "If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.", "required": false, "type": "string", "enum": ["uncategorized", "unapproved"] @@ -1176,7 +1261,7 @@ { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -1215,7 +1300,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1237,7 +1322,7 @@ { "name": "type", "in": "query", - "description": "If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported.", + "description": "If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.", "required": false, "type": "string", "enum": ["uncategorized", "unapproved"] @@ -1245,7 +1330,7 @@ { "name": "last_knowledge_of_server", "in": "query", - "description": "The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included.", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", "required": false, "type": "integer", "format": "int64" @@ -1284,9 +1369,17 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" + }, + { + "name": "last_knowledge_of_server", + "in": "query", + "description": "The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.", + "required": false, + "type": "integer", + "format": "int64" } ], "responses": { @@ -1322,7 +1415,7 @@ { "name": "budget_id", "in": "path", - "description": "The id of the budget (\"last-used\" can also be used to specify the last used budget)", + "description": "The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).", "required": true, "type": "string" }, @@ -1394,16 +1487,13 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/UserWrapper" - } - } - }, - "UserWrapper": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "$ref": "#/definitions/User" + "type": "object", + "required": ["user"], + "properties": { + "user": { + "$ref": "#/definitions/User" + } + } } } }, @@ -1473,63 +1563,23 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/BudgetSummaryWrapper" - } - } - }, - "BudgetSummaryWrapper": { - "type": "object", - "required": ["budgets"], - "properties": { - "budgets": { - "type": "array", - "items": { - "$ref": "#/definitions/BudgetSummary" + "type": "object", + "required": ["budgets"], + "properties": { + "budgets": { + "type": "array", + "items": { + "$ref": "#/definitions/BudgetSummary" + } + }, + "default_budget": { + "$ref": "#/definitions/BudgetSummary", + "description": "The default budget, if the associated application is configured to support specifying it" + } } } } }, - "BudgetDetailResponse": { - "type": "object", - "required": ["data"], - "properties": { - "data": { - "$ref": "#/definitions/BudgetDetailWrapper" - } - } - }, - "BudgetDetailWrapper": { - "type": "object", - "required": ["budget", "server_knowledge"], - "properties": { - "budget": { - "$ref": "#/definitions/BudgetDetail" - }, - "server_knowledge": { - "type": "integer", - "format": "int64", - "description": "The knowledge of the server" - } - } - }, - "BudgetSettingsResponse": { - "type": "object", - "required": ["data"], - "properties": { - "data": { - "$ref": "#/definitions/BudgetSettingsWrapper" - } - } - }, - "BudgetSettingsWrapper": { - "type": "object", - "required": ["settings"], - "properties": { - "settings": { - "$ref": "#/definitions/BudgetSettings" - } - } - }, "BudgetSummary": { "type": "object", "required": ["id", "name"], @@ -1544,35 +1594,50 @@ "last_modified_on": { "type": "string", "format": "date-time", - "description": "The last time any changes were made to the budget from either a web or mobile client." + "description": "The last time any changes were made to the budget from either a web or mobile client" }, "first_month": { "type": "string", "format": "date", - "description": "The earliest budget month." + "description": "The earliest budget month" }, "last_month": { "type": "string", "format": "date", - "description": "The latest budget month." + "description": "The latest budget month" }, "date_format": { "$ref": "#/definitions/DateFormat" }, "currency_format": { "$ref": "#/definitions/CurrencyFormat" + }, + "accounts": { + "type": "array", + "description": "The budget accounts (only included if `include_accounts=true` specified as query parameter)", + "items": { + "$ref": "#/definitions/Account" + } } } }, - "BudgetSettings": { + "BudgetDetailResponse": { "type": "object", - "required": ["date_format", "currency_format"], + "required": ["data"], "properties": { - "date_format": { - "$ref": "#/definitions/DateFormat" - }, - "currency_format": { - "$ref": "#/definitions/CurrencyFormat" + "data": { + "type": "object", + "required": ["budget", "server_knowledge"], + "properties": { + "budget": { + "$ref": "#/definitions/BudgetDetail" + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } } } }, @@ -1648,47 +1713,68 @@ } ] }, - "AccountsResponse": { + "BudgetSettingsResponse": { "type": "object", "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/AccountsWrapper" + "type": "object", + "required": ["settings"], + "properties": { + "settings": { + "$ref": "#/definitions/BudgetSettings" + } + } } } }, - "AccountsWrapper": { + "BudgetSettings": { "type": "object", - "required": ["accounts", "server_knowledge"], + "required": ["date_format", "currency_format"], "properties": { - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/Account" - } + "date_format": { + "$ref": "#/definitions/DateFormat" }, - "server_knowledge": { - "type": "integer", - "format": "int64", - "description": "The knowledge of the server" + "currency_format": { + "$ref": "#/definitions/CurrencyFormat" } } }, - "AccountResponse": { + "AccountsResponse": { "type": "object", "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/AccountWrapper" + "type": "object", + "required": ["accounts", "server_knowledge"], + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Account" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } } } }, - "AccountWrapper": { + "AccountResponse": { "type": "object", - "required": ["account"], + "required": ["data"], "properties": { - "account": { - "$ref": "#/definitions/Account" + "data": { + "type": "object", + "required": ["account"], + "properties": { + "account": { + "$ref": "#/definitions/Account" + } + } } } }, @@ -1700,7 +1786,6 @@ "type", "on_budget", "closed", - "note", "balance", "cleared_balance", "uncleared_balance", @@ -1761,8 +1846,15 @@ "transfer_payee_id": { "type": "string", "format": "uuid", - "description": - "The payee id which should be used when transferring to this account" + "description": "The payee id which should be used when transferring to this account" + }, + "direct_import_linked": { + "type": "boolean", + "description": "Whether or not the account is linked to a financial institution for automatic transaction import." + }, + "direct_import_in_error": { + "type": "boolean", + "description": "If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true." }, "deleted": { "type": "boolean", @@ -1770,68 +1862,70 @@ } } }, - "CategoriesResponse": { + "SaveAccountWrapper": { "type": "object", - "required": ["data"], + "required": ["account"], "properties": { - "data": { - "$ref": "#/definitions/CategoryGroupsWrapper" + "account": { + "$ref": "#/definitions/SaveAccount" } } }, - "CategoryGroupsWrapper": { + "SaveAccount": { "type": "object", - "required": ["category_groups", "server_knowledge"], + "required": ["name", "type", "balance"], "properties": { - "category_groups": { - "type": "array", - "items": { - "$ref": "#/definitions/CategoryGroupWithCategories" - } + "name": { + "type": "string", + "description": "The name of the account" + }, + "type": { + "type": "string", + "enum": ["checking", "savings", "creditCard", "cash", "lineOfCredit", "otherAsset", "otherLiability"], + "description": "The account type" }, - "server_knowledge": { + "balance": { "type": "integer", "format": "int64", - "description": "The knowledge of the server" + "description": "The current balance of the account in milliunits format" } } }, - "CategoryResponse": { + "CategoriesResponse": { "type": "object", "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/CategoryWrapper" - } - } - }, - "CategoryWrapper": { - "type": "object", - "required": ["category"], - "properties": { - "category": { - "$ref": "#/definitions/Category" + "type": "object", + "required": ["category_groups", "server_knowledge"], + "properties": { + "category_groups": { + "type": "array", + "items": { + "$ref": "#/definitions/CategoryGroupWithCategories" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } } } }, - "CategoryGroup": { + "CategoryResponse": { "type": "object", - "required": ["id", "name", "hidden", "deleted"], + "required": ["data"], "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string" - }, - "hidden": { - "description": "Whether or not the category group is hidden", - "type": "boolean" - }, - "deleted": { - "type": "boolean", - "description": "Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests." + "data": { + "type": "object", + "required": ["category"], + "properties": { + "category": { + "$ref": "#/definitions/Category" + } + } } } }, @@ -1855,24 +1949,30 @@ } ] }, - "Category": { + "CategoryGroup": { "type": "object", - "required": [ - "id", - "category_group_id", - "name", - "hidden", - "note", - "budgeted", - "activity", - "balance", - "goal_type", - "goal_creation_month", - "goal_target", - "goal_target_month", - "goal_percentage_complete", - "deleted" - ], + "required": ["id", "name", "hidden", "deleted"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "hidden": { + "description": "Whether or not the category group is hidden", + "type": "boolean" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests." + } + } + }, + "Category": { + "type": "object", + "required": ["id", "category_group_id", "name", "hidden", "budgeted", "activity", "balance", "deleted"], "properties": { "id": { "type": "string", @@ -1914,8 +2014,8 @@ }, "goal_type": { "type": "string", - "enum": ["TB", "TBD", "MF", null], - "description": "The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding)" + "enum": ["TB", "TBD", "MF", "NEED", null], + "description": "The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')" }, "goal_creation_month": { "type": "string", @@ -1930,42 +2030,79 @@ "goal_target_month": { "type": "string", "format": "date", - "description": "If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed" + "description": "The original target month for the goal to be completed. Only some goal types specify this date." }, "goal_percentage_complete": { "type": "integer", "format": "int32", "description": "The percentage completion of the goal" }, + "goal_months_to_budget": { + "type": "integer", + "format": "int32", + "description": "The number of months, including the current month, left in the current goal period." + }, + "goal_under_funded": { + "type": "integer", + "format": "int64", + "description": "The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month." + }, + "goal_overall_funded": { + "type": "integer", + "format": "int64", + "description": "The total amount funded towards the goal within the current goal period." + }, + "goal_overall_left": { + "type": "integer", + "format": "int64", + "description": "The amount of funding still needed to complete the goal within the current goal period." + }, "deleted": { "type": "boolean", "description": "Whether or not the category has been deleted. Deleted categories will only be included in delta requests." } } }, - "PayeesResponse": { + "SaveCategoryResponse": { "type": "object", "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/PayeesWrapper" + "type": "object", + "required": ["category", "server_knowledge"], + "properties": { + "category": { + "$ref": "#/definitions/Category" + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } + } } } }, - "PayeesWrapper": { + "PayeesResponse": { "type": "object", - "required": ["payees", "server_knowledge"], + "required": ["data"], "properties": { - "payees": { - "type": "array", - "items": { - "$ref": "#/definitions/Payee" + "data": { + "type": "object", + "required": ["payees", "server_knowledge"], + "properties": { + "payees": { + "type": "array", + "items": { + "$ref": "#/definitions/Payee" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } } - }, - "server_knowledge": { - "type": "integer", - "format": "int64", - "description": "The knowledge of the server" } } }, @@ -1974,22 +2111,19 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/PayeeWrapper" - } - } - }, - "PayeeWrapper": { - "type": "object", - "required": ["payee"], - "properties": { - "payee": { - "$ref": "#/definitions/Payee" + "type": "object", + "required": ["payee"], + "properties": { + "payee": { + "$ref": "#/definitions/Payee" + } + } } } }, "Payee": { "type": "object", - "required": ["id", "name", "transfer_account_id", "deleted"], + "required": ["id", "name", "deleted"], "properties": { "id": { "type": "string", @@ -1999,7 +2133,7 @@ "type": "string" }, "transfer_account_id": { - "description": "If a transfer payee, the account_id to which this payee transfers to", + "description": "If a transfer payee, the `account_id` to which this payee transfers to", "type": "string" }, "deleted": { @@ -2013,18 +2147,15 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/PayeeLocationsWrapper" - } - } - }, - "PayeeLocationsWrapper": { - "type": "object", - "required": ["payee_locations"], - "properties": { - "payee_locations": { - "type": "array", - "items": { - "$ref": "#/definitions/PayeeLocation" + "type": "object", + "required": ["payee_locations"], + "properties": { + "payee_locations": { + "type": "array", + "items": { + "$ref": "#/definitions/PayeeLocation" + } + } } } } @@ -2034,16 +2165,13 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/PayeeLocationWrapper" - } - } - }, - "PayeeLocationWrapper": { - "type": "object", - "required": ["payee_location"], - "properties": { - "payee_location": { - "$ref": "#/definitions/PayeeLocation" + "type": "object", + "required": ["payee_location"], + "properties": { + "payee_location": { + "$ref": "#/definitions/PayeeLocation" + } + } } } }, @@ -2076,24 +2204,21 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/TransactionsWrapper" - } - } - }, - "TransactionsWrapper": { - "type": "object", - "required": ["transactions", "server_knowledge"], - "properties": { - "transactions": { - "type": "array", - "items": { - "$ref": "#/definitions/TransactionDetail" + "type": "object", + "required": ["transactions", "server_knowledge"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionDetail" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } } - }, - "server_knowledge": { - "type": "integer", - "format": "int64", - "description": "The knowledge of the server" } } }, @@ -2102,18 +2227,15 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/HybridTransactionsWrapper" - } - } - }, - "HybridTransactionsWrapper": { - "type": "object", - "required": ["transactions"], - "properties": { - "transactions": { - "type": "array", - "items": { - "$ref": "#/definitions/HybridTransaction" + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/HybridTransaction" + } + } } } } @@ -2141,6 +2263,34 @@ } } }, + "UpdateTransactionsWrapper": { + "type": "object", + "required": ["transactions"], + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateTransaction" + } + } + } + }, + "UpdateTransaction": { + "allOf": [ + { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string" + } + } + }, + { + "$ref": "#/definitions/SaveTransaction" + } + ] + }, "SaveTransaction": { "type": "object", "required": ["account_id", "date", "amount"], @@ -2151,27 +2301,28 @@ }, "date": { "type": "string", - "format": "date" + "format": "date", + "description": "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." }, "amount": { "type": "integer", "format": "int64", - "description": "The transaction amount in milliunits format" + "description": "The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored." }, "payee_id": { "type": "string", "format": "uuid", - "description": "The payee for the transaction" + "description": "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." }, "payee_name": { "type": "string", "maxLength": 50, - "description": "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." + "description": "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." }, "category_id": { "type": "string", "format": "uuid", - "description": "The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed." + "description": "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." }, "memo": { "type": "string", @@ -2194,7 +2345,44 @@ "import_id": { "type": "string", "maxLength": 36, - "description": "If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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)." + "description": "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.

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.

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)." + }, + "subtransactions": { + "type": "array", + "description": "An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.", + "items": { + "$ref": "#/definitions/SaveSubTransaction" + } + } + } + }, + "SaveSubTransaction": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "type": "integer", + "format": "int64", + "description": "The subtransaction amount in milliunits format." + }, + "payee_id": { + "type": "string", + "format": "uuid", + "description": "The payee for the subtransaction." + }, + "payee_name": { + "type": "string", + "maxLength": 50, + "description": "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 on parent transaction) or (2) a payee with the same name or (3) creation of a new payee." + }, + "category_id": { + "type": "string", + "format": "uuid", + "description": "The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied." + }, + "memo": { + "type": "string", + "maxLength": 200 } } }, @@ -2204,7 +2392,7 @@ "properties": { "data": { "type": "object", - "required": ["transaction_ids"], + "required": ["transaction_ids", "server_knowledge"], "properties": { "transaction_ids": { "type": "array", @@ -2226,10 +2414,15 @@ }, "duplicate_import_ids": { "type": "array", - "description": "If multiple transactions were specified, a list of import_ids that were not were created because of an existing import_id found on the same account", + "description": "If multiple transactions were specified, a list of import_ids that were not created because of an existing `import_id` found on the same account", "items": { "type": "string" } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" } } } @@ -2240,45 +2433,27 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/TransactionWrapper" - } - } - }, - "TransactionWrapper": { - "type": "object", - "required": ["transaction"], - "properties": { - "transaction": { - "$ref": "#/definitions/TransactionDetail" + "type": "object", + "required": ["transaction"], + "properties": { + "transaction": { + "$ref": "#/definitions/TransactionDetail" + } + } } } }, "TransactionSummary": { "type": "object", - "required": [ - "id", - "date", - "amount", - "memo", - "cleared", - "approved", - "flag_color", - "account_id", - "payee_id", - "category_id", - "transfer_account_id", - "transfer_transaction_id", - "matched_transaction_id", - "import_id", - "deleted" - ], + "required": ["id", "date", "amount", "cleared", "approved", "account_id", "deleted"], "properties": { "id": { "type": "string" }, "date": { "type": "string", - "format": "date" + "format": "date", + "description": "The transaction date in ISO format (e.g. 2016-12-01)" }, "amount": { "type": "integer", @@ -2321,12 +2496,10 @@ }, "transfer_transaction_id": { "type": "string", - "format": "uuid", "description": "If a transfer transaction, the id of transaction on the other side of the transfer" }, "matched_transaction_id": { "type": "string", - "format": "uuid", "description": "If transaction is matched, the id of the matched transaction" }, "import_id": { @@ -2340,112 +2513,33 @@ } }, "TransactionDetail": { - "type": "object", - "required": [ - "account_name", - "payee_name", - "category_name", - "subtransactions", - "id", - "date", - "amount", - "memo", - "cleared", - "approved", - "flag_color", - "account_id", - "payee_id", - "category_id", - "transfer_account_id", - "transfer_transaction_id", - "matched_transaction_id", - "import_id", - "deleted" - ], - "properties": { - "account_name": { - "type": "string" - }, - "payee_name": { - "type": "string" - }, - "category_name": { - "type": "string", - "nullable": true + "allOf": [ + { + "$ref": "#/definitions/TransactionSummary" }, - "subtransactions": { - "type": "array", - "description": "If a split transaction, the subtransactions.", - "items": { - "$ref": "#/definitions/SubTransaction" + { + "type": "object", + "required": ["account_name", "subtransactions"], + "properties": { + "account_name": { + "type": "string" + }, + "payee_name": { + "type": "string" + }, + "category_name": { + "type": "string" + }, + "subtransactions": { + "type": "array", + "description": "If a split transaction, the subtransactions.", + "items": { + "$ref": "#/definitions/SubTransaction" + } + } } - }, - "id": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date" - }, - "amount": { - "type": "integer", - "format": "int64", - "description": "The transaction amount in milliunits format" - }, - "memo": { - "type": "string" - }, - "cleared": { - "type": "string", - "enum": ["cleared", "uncleared", "reconciled"], - "description": "The cleared status of the transaction" - }, - "approved": { - "type": "boolean", - "description": "Whether or not the transaction is approved" - }, - "flag_color": { - "type": "string", - "enum": ["red", "orange", "yellow", "green", "blue", "purple", null], - "description": "The transaction flag", - "nullable": true - }, - "account_id": { - "type": "string", - "format": "uuid" - }, - "payee_id": { - "type": "string", - "format": "uuid" - }, - "category_id": { - "type": "string", - "format": "uuid" - }, - "transfer_account_id": { - "type": "string", - "format": "uuid", - "description": "If a transfer transaction, the account to which it transfers" - }, - "transfer_transaction_id": { - "type": "string", - "format": "uuid", - "description": "If a transfer transaction, the id of transaction on the other side of the transfer" - }, - "matched_transaction_id": { - "type": "string", - "format": "uuid", - "description": "If transaction is matched, the id of the matched transaction" - }, - "import_id": { - "type": "string", - "description": "If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'." - }, - "deleted": { - "type": "boolean", - "description": "Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests." } - } + ] }, "HybridTransaction": { "allOf": [ @@ -2454,13 +2548,7 @@ }, { "type": "object", - "required": [ - "type", - "parent_transaction_id", - "account_name", - "payee_name", - "category_name" - ], + "required": ["type", "account_name"], "properties": { "type": { "type": "string", @@ -2469,7 +2557,7 @@ }, "parent_transaction_id": { "type": "string", - "description": "For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null." + "description": "For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null." }, "account_name": { "type": "string" @@ -2504,31 +2592,21 @@ } } }, - "BulkIdWrapper": { + "TransactionsImportResponse": { "type": "object", - "required": ["bulk"], - "properties": { - "bulk": { - "$ref": "#/definitions/BulkIds" - } - } - }, - "BulkIds": { - "type": "object", - "required": ["transaction_ids", "duplicate_import_ids"], + "required": ["data"], "properties": { - "transaction_ids": { - "type": "array", - "description": "The list of Transaction ids that were created.", - "items": { - "type": "string" - } - }, - "duplicate_import_ids": { - "type": "array", - "description": "If any Transactions were not created because they had an import_id matching a transaction already on the same account, the specified import_id(s) will be included in this list.", - "items": { - "type": "string" + "data": { + "type": "object", + "required": ["transaction_ids"], + "properties": { + "transaction_ids": { + "type": "array", + "description": "The list of transaction ids that were imported.", + "items": { + "type": "string" + } + } } } } @@ -2538,7 +2616,30 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/BulkIdWrapper" + "type": "object", + "required": ["bulk"], + "properties": { + "bulk": { + "type": "object", + "required": ["transaction_ids", "duplicate_import_ids"], + "properties": { + "transaction_ids": { + "type": "array", + "description": "The list of Transaction ids that were created.", + "items": { + "type": "string" + } + }, + "duplicate_import_ids": { + "type": "array", + "description": "If any Transactions were not created because they had an `import_id` matching a transaction already on the same account, the specified import_id(s) will be included in this list.", + "items": { + "type": "string" + } + } + } + } + } } } }, @@ -2556,16 +2657,7 @@ }, "SubTransaction": { "type": "object", - "required": [ - "id", - "transaction_id", - "amount", - "memo", - "payee_id", - "category_id", - "transfer_account_id", - "deleted" - ], + "required": ["id", "transaction_id", "amount", "deleted"], "properties": { "id": { "type": "string" @@ -2585,15 +2677,25 @@ "type": "string", "format": "uuid" }, + "payee_name": { + "type": "string" + }, "category_id": { "type": "string", "format": "uuid" }, + "category_name": { + "type": "string" + }, "transfer_account_id": { "type": "string", "format": "uuid", "description": "If a transfer, the account_id which the subtransaction transfers to" }, + "transfer_transaction_id": { + "type": "string", + "description": "If a transfer, the id of transaction on the other side of the transfer" + }, "deleted": { "type": "boolean", "description": "Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests." @@ -2605,18 +2707,20 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/ScheduledTransactionsWrapper" - } - } - }, - "ScheduledTransactionsWrapper": { - "type": "object", - "required": ["scheduled_transactions"], - "properties": { - "scheduled_transactions": { - "type": "array", - "items": { - "$ref": "#/definitions/ScheduledTransactionDetail" + "type": "object", + "required": ["scheduled_transactions", "server_knowledge"], + "properties": { + "scheduled_transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/ScheduledTransactionDetail" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } } } } @@ -2626,35 +2730,19 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/ScheduledTransactionWrapper" - } - } - }, - "ScheduledTransactionWrapper": { - "type": "object", - "required": ["scheduled_transaction"], - "properties": { - "scheduled_transaction": { - "$ref": "#/definitions/ScheduledTransactionDetail" + "type": "object", + "required": ["scheduled_transaction"], + "properties": { + "scheduled_transaction": { + "$ref": "#/definitions/ScheduledTransactionDetail" + } + } } } }, "ScheduledTransactionSummary": { "type": "object", - "required": [ - "id", - "date_first", - "date_next", - "frequency", - "amount", - "memo", - "flag_color", - "account_id", - "payee_id", - "category_id", - "transfer_account_id", - "deleted" - ], + "required": ["id", "date_first", "date_next", "frequency", "amount", "account_id", "deleted"], "properties": { "id": { "type": "string", @@ -2731,12 +2819,7 @@ }, { "type": "object", - "required": [ - "account_name", - "payee_name", - "category_name", - "subtransactions" - ], + "required": ["account_name", "subtransactions"], "properties": { "account_name": { "type": "string" @@ -2760,16 +2843,7 @@ }, "ScheduledSubTransaction": { "type": "object", - "required": [ - "id", - "scheduled_transaction_id", - "amount", - "memo", - "payee_id", - "category_id", - "transfer_account_id", - "deleted" - ], + "required": ["id", "scheduled_transaction_id", "amount", "deleted"], "properties": { "id": { "type": "string", @@ -2811,24 +2885,21 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/MonthSummariesWrapper" - } - } - }, - "MonthSummariesWrapper": { - "type": "object", - "required": ["months", "server_knowledge"], - "properties": { - "months": { - "type": "array", - "items": { - "$ref": "#/definitions/MonthSummary" + "type": "object", + "required": ["months", "server_knowledge"], + "properties": { + "months": { + "type": "array", + "items": { + "$ref": "#/definitions/MonthSummary" + } + }, + "server_knowledge": { + "type": "integer", + "format": "int64", + "description": "The knowledge of the server" + } } - }, - "server_knowledge": { - "type": "integer", - "format": "int64", - "description": "The knowledge of the server" } } }, @@ -2837,31 +2908,19 @@ "required": ["data"], "properties": { "data": { - "$ref": "#/definitions/MonthDetailWrapper" - } - } - }, - "MonthDetailWrapper": { - "type": "object", - "required": ["month"], - "properties": { - "month": { - "$ref": "#/definitions/MonthDetail" + "type": "object", + "required": ["month"], + "properties": { + "month": { + "$ref": "#/definitions/MonthDetail" + } + } } } }, "MonthSummary": { "type": "object", - "required": [ - "month", - "note", - "income", - "budgeted", - "activity", - "to_be_budgeted", - "age_of_money", - "deleted" - ], + "required": ["month", "income", "budgeted", "activity", "to_be_budgeted", "deleted"], "properties": { "month": { "type": "string", @@ -2873,7 +2932,7 @@ "income": { "type": "integer", "format": "int64", - "description": "The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month" + "description": "The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month" }, "budgeted": { "type": "integer", @@ -2883,12 +2942,12 @@ "activity": { "type": "integer", "format": "int64", - "description": "The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted'" + "description": "The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign'" }, "to_be_budgeted": { "type": "integer", "format": "int64", - "description": "The available amount for 'To be Budgeted'" + "description": "The available amount for 'Ready to Assign'" }, "age_of_money": { "type": "integer", From e62fa4a946f9dfe71c2481e70d797b789985db51 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 12 Jun 2022 16:45:56 -0700 Subject: [PATCH 12/14] Update to latest version, test1 --- docs/Account.md | 4 +- docs/AccountResponse.md | 2 +- docs/AccountsApi.md | 69 ++- docs/AccountsResponse.md | 2 +- docs/BudgetDetailResponse.md | 2 +- docs/BudgetSettingsResponse.md | 2 +- docs/BudgetSummary.md | 7 +- docs/BudgetSummaryResponse.md | 2 +- docs/BudgetsApi.md | 22 +- docs/BulkResponse.md | 2 +- docs/CategoriesApi.md | 30 +- docs/CategoriesResponse.md | 2 +- docs/Category.md | 16 +- docs/CategoryResponse.md | 2 +- docs/DeprecatedApi.md | 4 +- docs/HybridTransaction.md | 6 +- docs/HybridTransactionsResponse.md | 2 +- docs/MonthDetailResponse.md | 2 +- docs/MonthSummariesResponse.md | 2 +- docs/MonthSummary.md | 10 +- docs/MonthsApi.md | 12 +- docs/Payee.md | 2 +- docs/PayeeLocationResponse.md | 2 +- docs/PayeeLocationsApi.md | 14 +- docs/PayeeLocationsResponse.md | 2 +- docs/PayeeResponse.md | 2 +- docs/PayeesApi.md | 14 +- docs/PayeesResponse.md | 2 +- docs/SaveAccount.md | 11 + docs/SaveAccountWrapper.md | 9 + docs/SaveCategoryResponse.md | 9 + docs/SaveSubTransaction.md | 13 + docs/SaveTransaction.md | 13 +- docs/ScheduledSubTransaction.md | 8 +- docs/ScheduledTransactionDetail.md | 4 +- docs/ScheduledTransactionResponse.md | 2 +- docs/ScheduledTransactionSummary.md | 10 +- docs/ScheduledTransactionsApi.md | 14 +- docs/ScheduledTransactionsResponse.md | 2 +- docs/SubTransaction.md | 11 +- docs/TransactionDetail.md | 19 +- docs/TransactionResponse.md | 2 +- docs/TransactionSummary.md | 18 +- docs/TransactionsApi.md | 133 ++++-- docs/TransactionsImportResponse.md | 9 + docs/TransactionsResponse.md | 2 +- docs/UpdateTransaction.md | 20 + docs/UpdateTransactionsWrapper.md | 9 + docs/UserResponse.md | 2 +- test/test_accounts_api.py | 7 + test/test_budget_settings_wrapper.py | 39 -- test/test_budget_summary_wrapper.py | 39 -- test/test_bulk_id_wrapper.py | 39 -- test/test_bulk_ids.py | 39 -- test/test_category_groups_wrapper.py | 39 -- test/test_category_wrapper.py | 39 -- test/test_hybrid_transactions_wrapper.py | 39 -- test/test_month_summaries_wrapper.py | 39 -- test/test_payee_location_wrapper.py | 39 -- test/test_payee_locations_wrapper.py | 39 -- test/test_payees_wrapper.py | 39 -- ...t_user_wrapper.py => test_save_account.py} | 12 +- ...rapper.py => test_save_account_wrapper.py} | 12 +- ...pper.py => test_save_category_response.py} | 12 +- ...rapper.py => test_save_sub_transaction.py} | 12 +- test/test_scheduled_transaction_wrapper.py | 39 -- test/test_scheduled_transactions_wrapper.py | 39 -- test/test_transactions_api.py | 7 + ...y => test_transactions_import_response.py} | 12 +- test/test_transactions_wrapper.py | 39 -- ..._wrapper.py => test_update_transaction.py} | 12 +- ...py => test_update_transactions_wrapper.py} | 12 +- ynab/models/__init__.py | 28 +- ynab/models/account.py | 61 ++- ynab/models/account_response.py | 7 +- ynab/models/accounts_response.py | 7 +- ynab/models/budget_detail_response.py | 7 +- ynab/models/budget_settings_response.py | 7 +- ynab/models/budget_summary.py | 47 +- ynab/models/budget_summary_response.py | 7 +- ynab/models/bulk_response.py | 7 +- ynab/models/categories_response.py | 7 +- ynab/models/category.py | 142 +++++- ynab/models/category_response.py | 7 +- ynab/models/hybrid_transaction.py | 13 +- ynab/models/hybrid_transactions_response.py | 7 +- ynab/models/month_detail_response.py | 7 +- ynab/models/month_summaries_response.py | 7 +- ynab/models/month_summary.py | 18 +- ynab/models/payee.py | 7 +- ynab/models/payee_location_response.py | 7 +- ynab/models/payee_locations_response.py | 7 +- ynab/models/payee_response.py | 7 +- ynab/models/payees_response.py | 7 +- ynab/models/save_account.py | 178 +++++++ ynab/models/save_account_wrapper.py | 113 +++++ ynab/models/save_category_response.py | 112 +++++ ynab/models/save_sub_transaction.py | 224 +++++++++ ynab/models/save_transaction.py | 57 ++- ynab/models/scheduled_sub_transaction.py | 12 +- ynab/models/scheduled_transaction_detail.py | 6 +- ynab/models/scheduled_transaction_response.py | 7 +- ynab/models/scheduled_transaction_summary.py | 15 +- .../models/scheduled_transactions_response.py | 7 +- ynab/models/sub_transaction.py | 94 +++- ynab/models/transaction_detail.py | 420 +---------------- ynab/models/transaction_response.py | 7 +- ynab/models/transaction_summary.py | 26 +- ynab/models/transactions_import_response.py | 112 +++++ ynab/models/transactions_response.py | 7 +- ynab/models/update_transaction.py | 434 ++++++++++++++++++ ynab/models/update_transactions_wrapper.py | 113 +++++ ynab/models/user_response.py | 7 +- 113 files changed, 2217 insertions(+), 1359 deletions(-) create mode 100644 docs/SaveAccount.md create mode 100644 docs/SaveAccountWrapper.md create mode 100644 docs/SaveCategoryResponse.md create mode 100644 docs/SaveSubTransaction.md create mode 100644 docs/TransactionsImportResponse.md create mode 100644 docs/UpdateTransaction.md create mode 100644 docs/UpdateTransactionsWrapper.md delete mode 100644 test/test_budget_settings_wrapper.py delete mode 100644 test/test_budget_summary_wrapper.py delete mode 100644 test/test_bulk_id_wrapper.py delete mode 100644 test/test_bulk_ids.py delete mode 100644 test/test_category_groups_wrapper.py delete mode 100644 test/test_category_wrapper.py delete mode 100644 test/test_hybrid_transactions_wrapper.py delete mode 100644 test/test_month_summaries_wrapper.py delete mode 100644 test/test_payee_location_wrapper.py delete mode 100644 test/test_payee_locations_wrapper.py delete mode 100644 test/test_payees_wrapper.py rename test/{test_user_wrapper.py => test_save_account.py} (74%) rename test/{test_month_detail_wrapper.py => test_save_account_wrapper.py} (71%) rename test/{test_budget_detail_wrapper.py => test_save_category_response.py} (69%) rename test/{test_payee_wrapper.py => test_save_sub_transaction.py} (70%) delete mode 100644 test/test_scheduled_transaction_wrapper.py delete mode 100644 test/test_scheduled_transactions_wrapper.py rename test/{test_accounts_wrapper.py => test_transactions_import_response.py} (66%) delete mode 100644 test/test_transactions_wrapper.py rename test/{test_account_wrapper.py => test_update_transaction.py} (70%) rename test/{test_transaction_wrapper.py => test_update_transactions_wrapper.py} (72%) create mode 100644 ynab/models/save_account.py create mode 100644 ynab/models/save_account_wrapper.py create mode 100644 ynab/models/save_category_response.py create mode 100644 ynab/models/save_sub_transaction.py create mode 100644 ynab/models/transactions_import_response.py create mode 100644 ynab/models/update_transaction.py create mode 100644 ynab/models/update_transactions_wrapper.py diff --git a/docs/Account.md b/docs/Account.md index c2900bd..baacf40 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -8,11 +8,13 @@ Name | Type | Description | Notes **type** | **str** | The type of account. Note: payPal, merchantAccount, investmentAccount, and mortgage types have been deprecated and will be removed in the future. | **on_budget** | **bool** | Whether this account is on budget or not | **closed** | **bool** | Whether this account is closed or not | -**note** | **str** | | +**note** | **str** | | [optional] **balance** | **int** | The current balance of the account in milliunits format | **cleared_balance** | **int** | The current cleared balance of the account in milliunits format | **uncleared_balance** | **int** | The current uncleared balance of the account in milliunits format | **transfer_payee_id** | **str** | The payee id which should be used when transferring to this account | +**direct_import_linked** | **bool** | Whether or not the account is linked to a financial institution for automatic transaction import. | [optional] +**direct_import_in_error** | **bool** | If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true. | [optional] **deleted** | **bool** | Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountResponse.md b/docs/AccountResponse.md index c80c863..43d9555 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**AccountWrapper**](AccountWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountsApi.md b/docs/AccountsApi.md index 41d2fb3..8afd4d4 100644 --- a/docs/AccountsApi.md +++ b/docs/AccountsApi.md @@ -4,9 +4,66 @@ All URIs are relative to *https://api.youneedabudget.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_account**](AccountsApi.md#create_account) | **POST** /budgets/{budget_id}/accounts | Create a new account [**get_account_by_id**](AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account [**get_accounts**](AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list +# **create_account** +> AccountResponse create_account(body, budget_id) + +Create a new account + +Creates a new account + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) +body = ynab.SaveAccountWrapper() # SaveAccountWrapper | The account to create. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) + +try: + # Create a new account + api_response = api_instance.create_account(body, budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountsApi->create_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SaveAccountWrapper**](SaveAccountWrapper.md)| The account to create. | + **budget_id** | **str**| The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) | + +### Return type + +[**AccountResponse**](AccountResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_account_by_id** > AccountResponse get_account_by_id(budget_id, account_id) @@ -30,7 +87,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # str | The id of the account try: @@ -45,7 +102,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **account_id** | [**str**](.md)| The id of the account | ### Return type @@ -86,8 +143,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # Account list @@ -101,8 +158,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type diff --git a/docs/AccountsResponse.md b/docs/AccountsResponse.md index ebbc2f8..cdc7a50 100644 --- a/docs/AccountsResponse.md +++ b/docs/AccountsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**AccountsWrapper**](AccountsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetDetailResponse.md b/docs/BudgetDetailResponse.md index 9b08942..04162dc 100644 --- a/docs/BudgetDetailResponse.md +++ b/docs/BudgetDetailResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**BudgetDetailWrapper**](BudgetDetailWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetSettingsResponse.md b/docs/BudgetSettingsResponse.md index 15f5800..b07691e 100644 --- a/docs/BudgetSettingsResponse.md +++ b/docs/BudgetSettingsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**BudgetSettingsWrapper**](BudgetSettingsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetSummary.md b/docs/BudgetSummary.md index a69a6b1..a15cbdd 100644 --- a/docs/BudgetSummary.md +++ b/docs/BudgetSummary.md @@ -5,11 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **name** | **str** | | -**last_modified_on** | **datetime** | The last time any changes were made to the budget from either a web or mobile client. | [optional] -**first_month** | **date** | The earliest budget month. | [optional] -**last_month** | **date** | The latest budget month. | [optional] +**last_modified_on** | **datetime** | The last time any changes were made to the budget from either a web or mobile client | [optional] +**first_month** | **date** | The earliest budget month | [optional] +**last_month** | **date** | The latest budget month | [optional] **date_format** | [**DateFormat**](DateFormat.md) | | [optional] **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] +**accounts** | [**list[Account]**](Account.md) | The budget accounts (only included if `include_accounts=true` specified as query parameter) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetSummaryResponse.md b/docs/BudgetSummaryResponse.md index 50f633e..cf979ca 100644 --- a/docs/BudgetSummaryResponse.md +++ b/docs/BudgetSummaryResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**BudgetSummaryWrapper**](BudgetSummaryWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetsApi.md b/docs/BudgetsApi.md index 5dab434..8197133 100644 --- a/docs/BudgetsApi.md +++ b/docs/BudgetsApi.md @@ -31,8 +31,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.BudgetsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # Single budget @@ -46,8 +46,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -87,7 +87,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.BudgetsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). try: # Budget Settings @@ -101,7 +101,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | ### Return type @@ -119,7 +119,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_budgets** -> BudgetSummaryResponse get_budgets() +> BudgetSummaryResponse get_budgets(include_accounts=include_accounts) List budgets @@ -141,17 +141,21 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.BudgetsApi(ynab.ApiClient(configuration)) +include_accounts = true # bool | Whether to include the list of budget accounts (optional) try: # List budgets - api_response = api_instance.get_budgets() + api_response = api_instance.get_budgets(include_accounts=include_accounts) pprint(api_response) except ApiException as e: print("Exception when calling BudgetsApi->get_budgets: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include_accounts** | **bool**| Whether to include the list of budget accounts | [optional] ### Return type diff --git a/docs/BulkResponse.md b/docs/BulkResponse.md index 1af81aa..a0ed87f 100644 --- a/docs/BulkResponse.md +++ b/docs/BulkResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**BulkIdWrapper**](BulkIdWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CategoriesApi.md b/docs/CategoriesApi.md index c67792b..2a7f367 100644 --- a/docs/CategoriesApi.md +++ b/docs/CategoriesApi.md @@ -32,8 +32,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List categories @@ -47,8 +47,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -88,7 +88,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). category_id = 'category_id_example' # str | The id of the category try: @@ -103,7 +103,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **category_id** | **str**| The id of the category | ### Return type @@ -144,7 +144,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) category_id = 'category_id_example' # str | The id of the category @@ -160,7 +160,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | **category_id** | **str**| The id of the category | @@ -180,11 +180,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_month_category** -> CategoryResponse update_month_category(body, budget_id, month, category_id) +> SaveCategoryResponse update_month_category(body, budget_id, month, category_id) Update a category for a specific month -Update a category for a specific month +Update a category for a specific month. Only `budgeted` amount can be updated. ### Example ```python @@ -202,8 +202,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.CategoriesApi(ynab.ApiClient(configuration)) -body = ynab.SaveMonthCategoryWrapper() # SaveMonthCategoryWrapper | The category to update -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +body = ynab.SaveMonthCategoryWrapper() # SaveMonthCategoryWrapper | The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) category_id = 'category_id_example' # str | The id of the category @@ -219,14 +219,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SaveMonthCategoryWrapper**](SaveMonthCategoryWrapper.md)| The category to update | - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **body** | [**SaveMonthCategoryWrapper**](SaveMonthCategoryWrapper.md)| The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | **category_id** | **str**| The id of the category | ### Return type -[**CategoryResponse**](CategoryResponse.md) +[**SaveCategoryResponse**](SaveCategoryResponse.md) ### Authorization diff --git a/docs/CategoriesResponse.md b/docs/CategoriesResponse.md index 1c5d65b..e8e6fcf 100644 --- a/docs/CategoriesResponse.md +++ b/docs/CategoriesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**CategoryGroupsWrapper**](CategoryGroupsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Category.md b/docs/Category.md index b14ef01..1648b51 100644 --- a/docs/Category.md +++ b/docs/Category.md @@ -8,15 +8,19 @@ Name | Type | Description | Notes **name** | **str** | | **hidden** | **bool** | Whether or not the category is hidden | **original_category_group_id** | **str** | If category is hidden this is the id of the category group it originally belonged to before it was hidden. | [optional] -**note** | **str** | | +**note** | **str** | | [optional] **budgeted** | **int** | Budgeted amount in milliunits format | **activity** | **int** | Activity amount in milliunits format | **balance** | **int** | Balance in milliunits format | -**goal_type** | **str** | The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) | -**goal_creation_month** | **date** | The month a goal was created | -**goal_target** | **int** | The goal target amount in milliunits | -**goal_target_month** | **date** | If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed | -**goal_percentage_complete** | **int** | The percentage completion of the goal | +**goal_type** | **str** | The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending') | [optional] +**goal_creation_month** | **date** | The month a goal was created | [optional] +**goal_target** | **int** | The goal target amount in milliunits | [optional] +**goal_target_month** | **date** | The original target month for the goal to be completed. Only some goal types specify this date. | [optional] +**goal_percentage_complete** | **int** | The percentage completion of the goal | [optional] +**goal_months_to_budget** | **int** | The number of months, including the current month, left in the current goal period. | [optional] +**goal_under_funded** | **int** | The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month. | [optional] +**goal_overall_funded** | **int** | The total amount funded towards the goal within the current goal period. | [optional] +**goal_overall_left** | **int** | The amount of funding still needed to complete the goal within the current goal period. | [optional] **deleted** | **bool** | Whether or not the category has been deleted. Deleted categories will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CategoryResponse.md b/docs/CategoryResponse.md index 8a60d37..aafecf1 100644 --- a/docs/CategoryResponse.md +++ b/docs/CategoryResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**CategoryWrapper**](CategoryWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeprecatedApi.md b/docs/DeprecatedApi.md index 06709e5..131a532 100644 --- a/docs/DeprecatedApi.md +++ b/docs/DeprecatedApi.md @@ -30,7 +30,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.DeprecatedApi(ynab.ApiClient(configuration)) body = ynab.BulkTransactions() # BulkTransactions | The list of transactions to create -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). try: # Bulk create transactions @@ -45,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BulkTransactions**](BulkTransactions.md)| The list of transactions to create | - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | ### Return type diff --git a/docs/HybridTransaction.md b/docs/HybridTransaction.md index 5fdfd0e..2246ce9 100644 --- a/docs/HybridTransaction.md +++ b/docs/HybridTransaction.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | Whether the hybrid transaction represents a regular transaction or a subtransaction | -**parent_transaction_id** | **str** | For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null. | +**parent_transaction_id** | **str** | For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null. | [optional] **account_name** | **str** | | -**payee_name** | **str** | | -**category_name** | **str** | | +**payee_name** | **str** | | [optional] +**category_name** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/HybridTransactionsResponse.md b/docs/HybridTransactionsResponse.md index 130c7b3..5aba5bd 100644 --- a/docs/HybridTransactionsResponse.md +++ b/docs/HybridTransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**HybridTransactionsWrapper**](HybridTransactionsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthDetailResponse.md b/docs/MonthDetailResponse.md index 5a4d693..041a8e6 100644 --- a/docs/MonthDetailResponse.md +++ b/docs/MonthDetailResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**MonthDetailWrapper**](MonthDetailWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthSummariesResponse.md b/docs/MonthSummariesResponse.md index 58b69d7..8810b7c 100644 --- a/docs/MonthSummariesResponse.md +++ b/docs/MonthSummariesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**MonthSummariesWrapper**](MonthSummariesWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthSummary.md b/docs/MonthSummary.md index b617df6..d54bf76 100644 --- a/docs/MonthSummary.md +++ b/docs/MonthSummary.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **month** | **date** | | -**note** | **str** | | -**income** | **int** | The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month | +**note** | **str** | | [optional] +**income** | **int** | The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month | **budgeted** | **int** | The total amount budgeted in the month | -**activity** | **int** | The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' | -**to_be_budgeted** | **int** | The available amount for 'To be Budgeted' | -**age_of_money** | **int** | The Age of Money as of the month | +**activity** | **int** | The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign' | +**to_be_budgeted** | **int** | The available amount for 'Ready to Assign' | +**age_of_money** | **int** | The Age of Money as of the month | [optional] **deleted** | **bool** | Whether or not the month has been deleted. Deleted months will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthsApi.md b/docs/MonthsApi.md index 71e0c1c..2ded3ab 100644 --- a/docs/MonthsApi.md +++ b/docs/MonthsApi.md @@ -30,7 +30,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.MonthsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). month = '2013-10-20' # date | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) try: @@ -45,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **month** | **date**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | ### Return type @@ -86,8 +86,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.MonthsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List budget months @@ -101,8 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type diff --git a/docs/Payee.md b/docs/Payee.md index 4d39a46..8104c25 100644 --- a/docs/Payee.md +++ b/docs/Payee.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **name** | **str** | | -**transfer_account_id** | **str** | If a transfer payee, the account_id to which this payee transfers to | +**transfer_account_id** | **str** | If a transfer payee, the `account_id` to which this payee transfers to | [optional] **deleted** | **bool** | Whether or not the payee has been deleted. Deleted payees will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeLocationResponse.md b/docs/PayeeLocationResponse.md index 5f699c9..b0c55ad 100644 --- a/docs/PayeeLocationResponse.md +++ b/docs/PayeeLocationResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**PayeeLocationWrapper**](PayeeLocationWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeLocationsApi.md b/docs/PayeeLocationsApi.md index 7a6b881..528ba1f 100644 --- a/docs/PayeeLocationsApi.md +++ b/docs/PayeeLocationsApi.md @@ -31,7 +31,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). payee_location_id = 'payee_location_id_example' # str | id of payee location try: @@ -46,7 +46,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **payee_location_id** | **str**| id of payee location | ### Return type @@ -87,7 +87,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). try: # List payee locations @@ -101,7 +101,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | ### Return type @@ -123,7 +123,7 @@ Name | Type | Description | Notes List locations for a payee -Returns all payee locations for the specified payee +Returns all payee locations for a specified payee ### Example ```python @@ -141,7 +141,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeeLocationsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). payee_id = 'payee_id_example' # str | id of payee try: @@ -156,7 +156,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **payee_id** | **str**| id of payee | ### Return type diff --git a/docs/PayeeLocationsResponse.md b/docs/PayeeLocationsResponse.md index a092d6f..2504a57 100644 --- a/docs/PayeeLocationsResponse.md +++ b/docs/PayeeLocationsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**PayeeLocationsWrapper**](PayeeLocationsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeResponse.md b/docs/PayeeResponse.md index 9ce693f..e57cc40 100644 --- a/docs/PayeeResponse.md +++ b/docs/PayeeResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**PayeeWrapper**](PayeeWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeesApi.md b/docs/PayeesApi.md index d2d2dde..afd3a64 100644 --- a/docs/PayeesApi.md +++ b/docs/PayeesApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description Single payee -Returns single payee +Returns a single payee ### Example ```python @@ -30,7 +30,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). payee_id = 'payee_id_example' # str | The id of the payee try: @@ -45,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **payee_id** | **str**| The id of the payee | ### Return type @@ -86,8 +86,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.PayeesApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List payees @@ -101,8 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type diff --git a/docs/PayeesResponse.md b/docs/PayeesResponse.md index e21afc5..3fdc6c3 100644 --- a/docs/PayeesResponse.md +++ b/docs/PayeesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**PayeesWrapper**](PayeesWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SaveAccount.md b/docs/SaveAccount.md new file mode 100644 index 0000000..d8302f0 --- /dev/null +++ b/docs/SaveAccount.md @@ -0,0 +1,11 @@ +# SaveAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the account | +**type** | **str** | The account type | +**balance** | **int** | The current balance of the account in milliunits format | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveAccountWrapper.md b/docs/SaveAccountWrapper.md new file mode 100644 index 0000000..009bd9e --- /dev/null +++ b/docs/SaveAccountWrapper.md @@ -0,0 +1,9 @@ +# SaveAccountWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account** | [**SaveAccount**](SaveAccount.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveCategoryResponse.md b/docs/SaveCategoryResponse.md new file mode 100644 index 0000000..37d597d --- /dev/null +++ b/docs/SaveCategoryResponse.md @@ -0,0 +1,9 @@ +# SaveCategoryResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveSubTransaction.md b/docs/SaveSubTransaction.md new file mode 100644 index 0000000..59a766a --- /dev/null +++ b/docs/SaveSubTransaction.md @@ -0,0 +1,13 @@ +# SaveSubTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | The subtransaction amount in milliunits format. | +**payee_id** | **str** | The payee for the subtransaction. | [optional] +**payee_name** | **str** | 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 on parent transaction) or (2) a payee with the same name or (3) creation of a new payee. | [optional] +**category_id** | **str** | The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] +**memo** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveTransaction.md b/docs/SaveTransaction.md index 1a51eaa..176df8a 100644 --- a/docs/SaveTransaction.md +++ b/docs/SaveTransaction.md @@ -4,16 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | | -**_date** | **date** | | -**amount** | **int** | The transaction amount in milliunits format | -**payee_id** | **str** | The payee for the transaction | [optional] -**payee_name** | **str** | 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] -**category_id** | **str** | The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. | [optional] +**_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. | +**amount** | **int** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | +**payee_id** | **str** | 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] +**payee_name** | **str** | 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] +**category_id** | **str** | 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] **memo** | **str** | | [optional] **cleared** | **str** | The cleared status of the transaction | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] **flag_color** | **str** | The transaction flag | [optional] -**import_id** | **str** | If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.<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] +**import_id** | **str** | 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] +**subtransactions** | [**list[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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledSubTransaction.md b/docs/ScheduledSubTransaction.md index 002cd26..63a9565 100644 --- a/docs/ScheduledSubTransaction.md +++ b/docs/ScheduledSubTransaction.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes **id** | **str** | | **scheduled_transaction_id** | **str** | | **amount** | **int** | The scheduled subtransaction amount in milliunits format | -**memo** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled subtransaction transfers to | +**memo** | **str** | | [optional] +**payee_id** | **str** | | [optional] +**category_id** | **str** | | [optional] +**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled subtransaction transfers to | [optional] **deleted** | **bool** | Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionDetail.md b/docs/ScheduledTransactionDetail.md index 7e359da..451e634 100644 --- a/docs/ScheduledTransactionDetail.md +++ b/docs/ScheduledTransactionDetail.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_name** | **str** | | -**payee_name** | **str** | | -**category_name** | **str** | | +**payee_name** | **str** | | [optional] +**category_name** | **str** | | [optional] **subtransactions** | [**list[ScheduledSubTransaction]**](ScheduledSubTransaction.md) | If a split scheduled transaction, the subtransactions. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionResponse.md b/docs/ScheduledTransactionResponse.md index 439f799..84cc32b 100644 --- a/docs/ScheduledTransactionResponse.md +++ b/docs/ScheduledTransactionResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**ScheduledTransactionWrapper**](ScheduledTransactionWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionSummary.md b/docs/ScheduledTransactionSummary.md index 5082496..900535b 100644 --- a/docs/ScheduledTransactionSummary.md +++ b/docs/ScheduledTransactionSummary.md @@ -8,12 +8,12 @@ Name | Type | Description | Notes **date_next** | **date** | The next date for which the Scheduled Transaction is scheduled. | **frequency** | **str** | | **amount** | **int** | The scheduled transaction amount in milliunits format | -**memo** | **str** | | -**flag_color** | **str** | The scheduled transaction flag | +**memo** | **str** | | [optional] +**flag_color** | **str** | The scheduled transaction flag | [optional] **account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled transaction transfers to | +**payee_id** | **str** | | [optional] +**category_id** | **str** | | [optional] +**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled transaction transfers to | [optional] **deleted** | **bool** | Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionsApi.md b/docs/ScheduledTransactionsApi.md index a6194be..c63b637 100644 --- a/docs/ScheduledTransactionsApi.md +++ b/docs/ScheduledTransactionsApi.md @@ -30,7 +30,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The id of the scheduled transaction try: @@ -45,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **scheduled_transaction_id** | **str**| The id of the scheduled transaction | ### Return type @@ -64,7 +64,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_scheduled_transactions** -> ScheduledTransactionsResponse get_scheduled_transactions(budget_id) +> ScheduledTransactionsResponse get_scheduled_transactions(budget_id, last_knowledge_of_server=last_knowledge_of_server) List scheduled transactions @@ -86,11 +86,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List scheduled transactions - api_response = api_instance.get_scheduled_transactions(budget_id) + api_response = api_instance.get_scheduled_transactions(budget_id, last_knowledge_of_server=last_knowledge_of_server) pprint(api_response) except ApiException as e: print("Exception when calling ScheduledTransactionsApi->get_scheduled_transactions: %s\n" % e) @@ -100,7 +101,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type diff --git a/docs/ScheduledTransactionsResponse.md b/docs/ScheduledTransactionsResponse.md index 7f79679..ecad1c8 100644 --- a/docs/ScheduledTransactionsResponse.md +++ b/docs/ScheduledTransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**ScheduledTransactionsWrapper**](ScheduledTransactionsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SubTransaction.md b/docs/SubTransaction.md index cdc8593..9633ea3 100644 --- a/docs/SubTransaction.md +++ b/docs/SubTransaction.md @@ -6,10 +6,13 @@ Name | Type | Description | Notes **id** | **str** | | **transaction_id** | **str** | | **amount** | **int** | The subtransaction amount in milliunits format | -**memo** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer, the account_id which the subtransaction transfers to | +**memo** | **str** | | [optional] +**payee_id** | **str** | | [optional] +**payee_name** | **str** | | [optional] +**category_id** | **str** | | [optional] +**category_name** | **str** | | [optional] +**transfer_account_id** | **str** | If a transfer, the account_id which the subtransaction transfers to | [optional] +**transfer_transaction_id** | **str** | If a transfer, the id of transaction on the other side of the transfer | [optional] **deleted** | **bool** | Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionDetail.md b/docs/TransactionDetail.md index fb72a92..4855989 100644 --- a/docs/TransactionDetail.md +++ b/docs/TransactionDetail.md @@ -4,24 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_name** | **str** | | -**payee_name** | **str** | | -**category_name** | **str** | | +**payee_name** | **str** | | [optional] +**category_name** | **str** | | [optional] **subtransactions** | [**list[SubTransaction]**](SubTransaction.md) | If a split transaction, the subtransactions. | -**id** | **str** | | -**_date** | **date** | | -**amount** | **int** | The transaction amount in milliunits format | -**memo** | **str** | | -**cleared** | **str** | The cleared status of the transaction | -**approved** | **bool** | Whether or not the transaction is approved | -**flag_color** | **str** | The transaction flag | -**account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | -**transfer_transaction_id** | **str** | If a transfer transaction, the id of transaction on the other side of the transfer | -**matched_transaction_id** | **str** | If transaction is matched, the id of the matched transaction | -**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | -**deleted** | **bool** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionResponse.md b/docs/TransactionResponse.md index 3b750a7..33848c9 100644 --- a/docs/TransactionResponse.md +++ b/docs/TransactionResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**TransactionWrapper**](TransactionWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionSummary.md b/docs/TransactionSummary.md index 33e7595..1368b6f 100644 --- a/docs/TransactionSummary.md +++ b/docs/TransactionSummary.md @@ -4,19 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**_date** | **date** | | +**_date** | **date** | The transaction date in ISO format (e.g. 2016-12-01) | **amount** | **int** | The transaction amount in milliunits format | -**memo** | **str** | | +**memo** | **str** | | [optional] **cleared** | **str** | The cleared status of the transaction | **approved** | **bool** | Whether or not the transaction is approved | -**flag_color** | **str** | The transaction flag | +**flag_color** | **str** | The transaction flag | [optional] **account_id** | **str** | | -**payee_id** | **str** | | -**category_id** | **str** | | -**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | -**transfer_transaction_id** | **str** | If a transfer transaction, the id of transaction on the other side of the transfer | -**matched_transaction_id** | **str** | If transaction is matched, the id of the matched transaction | -**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | +**payee_id** | **str** | | [optional] +**category_id** | **str** | | [optional] +**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | [optional] +**transfer_transaction_id** | **str** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] +**matched_transaction_id** | **str** | If transaction is matched, the id of the matched transaction | [optional] +**import_id** | **str** | If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | [optional] **deleted** | **bool** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionsApi.md b/docs/TransactionsApi.md index fe161b4..ae0996e 100644 --- a/docs/TransactionsApi.md +++ b/docs/TransactionsApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions +[**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /budgets/{budget_id}/transactions/import | Import transactions [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions @@ -18,7 +19,7 @@ Method | HTTP request | Description Create a single transaction or multiple transactions -Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. +Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint. ### Example ```python @@ -36,8 +37,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -body = ynab.SaveTransactionsWrapper() # SaveTransactionsWrapper | The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +body = ynab.SaveTransactionsWrapper() # SaveTransactionsWrapper | The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects. +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). try: # Create a single transaction or multiple transactions @@ -51,8 +52,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SaveTransactionsWrapper**](SaveTransactionsWrapper.md)| The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. | - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **body** | [**SaveTransactionsWrapper**](SaveTransactionsWrapper.md)| The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects. | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | ### Return type @@ -92,7 +93,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). transaction_id = 'transaction_id_example' # str | The id of the transaction try: @@ -107,7 +108,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **transaction_id** | **str**| The id of the transaction | ### Return type @@ -148,10 +149,10 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) -type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List transactions @@ -165,10 +166,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] - **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -208,11 +209,11 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). account_id = 'account_id_example' # str | The id of the account since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) -type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List account transactions @@ -226,11 +227,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **account_id** | **str**| The id of the account | **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] - **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -270,11 +271,11 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). category_id = 'category_id_example' # str | The id of the category since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) -type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List category transactions @@ -288,11 +289,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **category_id** | **str**| The id of the category | **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] - **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -332,11 +333,11 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). payee_id = 'payee_id_example' # str | The id of the payee since_date = '2013-10-20' # date | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). (optional) -type = 'type_example' # str | If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. (optional) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +type = 'type_example' # str | If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. (optional) +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # List payee transactions @@ -350,11 +351,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **payee_id** | **str**| The id of the payee | **since_date** | **date**| If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] - **type** | **str**| If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. | [optional] - **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. | [optional] + **type** | **str**| If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. | [optional] + **last_knowledge_of_server** | **int**| The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] ### Return type @@ -371,12 +372,66 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **import_transactions** +> TransactionsImportResponse import_transactions(budget_id) + +Import transactions + +Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported. + +### Example +```python +from __future__ import print_function +import time +import ynab +from ynab.rest import ApiException +from pprint import pprint + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). + +try: + # Import transactions + api_response = api_instance.import_transactions(budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling TransactionsApi->import_transactions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | + +### Return type + +[**TransactionsImportResponse**](TransactionsImportResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **update_transaction** > TransactionResponse update_transaction(body, budget_id, transaction_id) Updates an existing transaction -Updates a transaction +Updates a single transaction ### Example ```python @@ -395,7 +450,7 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) body = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The transaction to update -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). transaction_id = 'transaction_id_example' # str | The id of the transaction try: @@ -411,7 +466,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**SaveTransactionWrapper**](SaveTransactionWrapper.md)| The transaction to update | - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | **transaction_id** | **str**| The id of the transaction | ### Return type @@ -434,7 +489,7 @@ Name | Type | Description | Notes Update multiple transactions -Updates multiple transactions, by 'id' or 'import_id'. +Updates multiple transactions, by `id` or `import_id`. ### Example ```python @@ -452,8 +507,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration)) -body = ynab.SaveTransactionsWrapper() # SaveTransactionsWrapper | The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +body = ynab.UpdateTransactionsWrapper() # UpdateTransactionsWrapper | The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup. +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). try: # Update multiple transactions @@ -467,8 +522,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SaveTransactionsWrapper**](SaveTransactionsWrapper.md)| The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. | - **budget_id** | **str**| The id of the budget (\"last-used\" can also be used to specify the last used budget) | + **body** | [**UpdateTransactionsWrapper**](UpdateTransactionsWrapper.md)| The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup. | + **budget_id** | **str**| The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). | ### Return type diff --git a/docs/TransactionsImportResponse.md b/docs/TransactionsImportResponse.md new file mode 100644 index 0000000..6d19707 --- /dev/null +++ b/docs/TransactionsImportResponse.md @@ -0,0 +1,9 @@ +# TransactionsImportResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TransactionsResponse.md b/docs/TransactionsResponse.md index 620297f..112ac75 100644 --- a/docs/TransactionsResponse.md +++ b/docs/TransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**TransactionsWrapper**](TransactionsWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateTransaction.md b/docs/UpdateTransaction.md new file mode 100644 index 0000000..b698f46 --- /dev/null +++ b/docs/UpdateTransaction.md @@ -0,0 +1,20 @@ +# UpdateTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | | +**_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. | +**amount** | **int** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | +**payee_id** | **str** | 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] +**payee_name** | **str** | 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] +**category_id** | **str** | 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] +**memo** | **str** | | [optional] +**cleared** | **str** | The cleared status of the transaction | [optional] +**approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] +**flag_color** | **str** | The transaction flag | [optional] +**import_id** | **str** | 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] +**subtransactions** | [**list[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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UpdateTransactionsWrapper.md b/docs/UpdateTransactionsWrapper.md new file mode 100644 index 0000000..85fe705 --- /dev/null +++ b/docs/UpdateTransactionsWrapper.md @@ -0,0 +1,9 @@ +# UpdateTransactionsWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactions** | [**list[UpdateTransaction]**](UpdateTransaction.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UserResponse.md b/docs/UserResponse.md index 2fdac58..d74196e 100644 --- a/docs/UserResponse.md +++ b/docs/UserResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**UserWrapper**](UserWrapper.md) | | +**data** | **object** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/test/test_accounts_api.py b/test/test_accounts_api.py index 86dd7c7..354acfd 100644 --- a/test/test_accounts_api.py +++ b/test/test_accounts_api.py @@ -28,6 +28,13 @@ def setUp(self): def tearDown(self): pass + def test_create_account(self): + """Test case for create_account + + Create a new account # noqa: E501 + """ + pass + def test_get_account_by_id(self): """Test case for get_account_by_id diff --git a/test/test_budget_settings_wrapper.py b/test/test_budget_settings_wrapper.py deleted file mode 100644 index 1f511a1..0000000 --- a/test/test_budget_settings_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestBudgetSettingsWrapper(unittest.TestCase): - """BudgetSettingsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBudgetSettingsWrapper(self): - """Test BudgetSettingsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.budget_settings_wrapper.BudgetSettingsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_budget_summary_wrapper.py b/test/test_budget_summary_wrapper.py deleted file mode 100644 index c0c7eeb..0000000 --- a/test/test_budget_summary_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestBudgetSummaryWrapper(unittest.TestCase): - """BudgetSummaryWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBudgetSummaryWrapper(self): - """Test BudgetSummaryWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.budget_summary_wrapper.BudgetSummaryWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bulk_id_wrapper.py b/test/test_bulk_id_wrapper.py deleted file mode 100644 index e3b6ba8..0000000 --- a/test/test_bulk_id_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.bulk_id_wrapper import BulkIdWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestBulkIdWrapper(unittest.TestCase): - """BulkIdWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBulkIdWrapper(self): - """Test BulkIdWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.bulk_id_wrapper.BulkIdWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bulk_ids.py b/test/test_bulk_ids.py deleted file mode 100644 index bd5ecd0..0000000 --- a/test/test_bulk_ids.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.bulk_ids import BulkIds # noqa: E501 -from ynab.rest import ApiException - - -class TestBulkIds(unittest.TestCase): - """BulkIds unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBulkIds(self): - """Test BulkIds""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.bulk_ids.BulkIds() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_category_groups_wrapper.py b/test/test_category_groups_wrapper.py deleted file mode 100644 index ff4f523..0000000 --- a/test/test_category_groups_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.category_groups_wrapper import CategoryGroupsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestCategoryGroupsWrapper(unittest.TestCase): - """CategoryGroupsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategoryGroupsWrapper(self): - """Test CategoryGroupsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.category_groups_wrapper.CategoryGroupsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_category_wrapper.py b/test/test_category_wrapper.py deleted file mode 100644 index 18eda49..0000000 --- a/test/test_category_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.category_wrapper import CategoryWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestCategoryWrapper(unittest.TestCase): - """CategoryWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategoryWrapper(self): - """Test CategoryWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.category_wrapper.CategoryWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_hybrid_transactions_wrapper.py b/test/test_hybrid_transactions_wrapper.py deleted file mode 100644 index 0336a37..0000000 --- a/test/test_hybrid_transactions_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestHybridTransactionsWrapper(unittest.TestCase): - """HybridTransactionsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHybridTransactionsWrapper(self): - """Test HybridTransactionsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.hybrid_transactions_wrapper.HybridTransactionsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_month_summaries_wrapper.py b/test/test_month_summaries_wrapper.py deleted file mode 100644 index 8f4db0f..0000000 --- a/test/test_month_summaries_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.month_summaries_wrapper import MonthSummariesWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestMonthSummariesWrapper(unittest.TestCase): - """MonthSummariesWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMonthSummariesWrapper(self): - """Test MonthSummariesWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.month_summaries_wrapper.MonthSummariesWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_payee_location_wrapper.py b/test/test_payee_location_wrapper.py deleted file mode 100644 index 31a7302..0000000 --- a/test/test_payee_location_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.payee_location_wrapper import PayeeLocationWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestPayeeLocationWrapper(unittest.TestCase): - """PayeeLocationWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPayeeLocationWrapper(self): - """Test PayeeLocationWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.payee_location_wrapper.PayeeLocationWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_payee_locations_wrapper.py b/test/test_payee_locations_wrapper.py deleted file mode 100644 index d6cff0e..0000000 --- a/test/test_payee_locations_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.payee_locations_wrapper import PayeeLocationsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestPayeeLocationsWrapper(unittest.TestCase): - """PayeeLocationsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPayeeLocationsWrapper(self): - """Test PayeeLocationsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.payee_locations_wrapper.PayeeLocationsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_payees_wrapper.py b/test/test_payees_wrapper.py deleted file mode 100644 index fd54e5d..0000000 --- a/test/test_payees_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.payees_wrapper import PayeesWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestPayeesWrapper(unittest.TestCase): - """PayeesWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPayeesWrapper(self): - """Test PayeesWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.payees_wrapper.PayeesWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_wrapper.py b/test/test_save_account.py similarity index 74% rename from test/test_user_wrapper.py rename to test/test_save_account.py index 0da7618..741a67e 100644 --- a/test/test_user_wrapper.py +++ b/test/test_save_account.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.user_wrapper import UserWrapper # noqa: E501 +from models.save_account import SaveAccount # noqa: E501 from ynab.rest import ApiException -class TestUserWrapper(unittest.TestCase): - """UserWrapper unit test stubs""" +class TestSaveAccount(unittest.TestCase): + """SaveAccount unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testUserWrapper(self): - """Test UserWrapper""" + def testSaveAccount(self): + """Test SaveAccount""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.user_wrapper.UserWrapper() # noqa: E501 + # model = ynab.models.save_account.SaveAccount() # noqa: E501 pass diff --git a/test/test_month_detail_wrapper.py b/test/test_save_account_wrapper.py similarity index 71% rename from test/test_month_detail_wrapper.py rename to test/test_save_account_wrapper.py index 072ee06..65a42de 100644 --- a/test/test_month_detail_wrapper.py +++ b/test/test_save_account_wrapper.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.month_detail_wrapper import MonthDetailWrapper # noqa: E501 +from models.save_account_wrapper import SaveAccountWrapper # noqa: E501 from ynab.rest import ApiException -class TestMonthDetailWrapper(unittest.TestCase): - """MonthDetailWrapper unit test stubs""" +class TestSaveAccountWrapper(unittest.TestCase): + """SaveAccountWrapper unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testMonthDetailWrapper(self): - """Test MonthDetailWrapper""" + def testSaveAccountWrapper(self): + """Test SaveAccountWrapper""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.month_detail_wrapper.MonthDetailWrapper() # noqa: E501 + # model = ynab.models.save_account_wrapper.SaveAccountWrapper() # noqa: E501 pass diff --git a/test/test_budget_detail_wrapper.py b/test/test_save_category_response.py similarity index 69% rename from test/test_budget_detail_wrapper.py rename to test/test_save_category_response.py index eb212fd..7c8619b 100644 --- a/test/test_budget_detail_wrapper.py +++ b/test/test_save_category_response.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.budget_detail_wrapper import BudgetDetailWrapper # noqa: E501 +from models.save_category_response import SaveCategoryResponse # noqa: E501 from ynab.rest import ApiException -class TestBudgetDetailWrapper(unittest.TestCase): - """BudgetDetailWrapper unit test stubs""" +class TestSaveCategoryResponse(unittest.TestCase): + """SaveCategoryResponse unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testBudgetDetailWrapper(self): - """Test BudgetDetailWrapper""" + def testSaveCategoryResponse(self): + """Test SaveCategoryResponse""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.budget_detail_wrapper.BudgetDetailWrapper() # noqa: E501 + # model = ynab.models.save_category_response.SaveCategoryResponse() # noqa: E501 pass diff --git a/test/test_payee_wrapper.py b/test/test_save_sub_transaction.py similarity index 70% rename from test/test_payee_wrapper.py rename to test/test_save_sub_transaction.py index 05da610..8737218 100644 --- a/test/test_payee_wrapper.py +++ b/test/test_save_sub_transaction.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.payee_wrapper import PayeeWrapper # noqa: E501 +from models.save_sub_transaction import SaveSubTransaction # noqa: E501 from ynab.rest import ApiException -class TestPayeeWrapper(unittest.TestCase): - """PayeeWrapper unit test stubs""" +class TestSaveSubTransaction(unittest.TestCase): + """SaveSubTransaction unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testPayeeWrapper(self): - """Test PayeeWrapper""" + def testSaveSubTransaction(self): + """Test SaveSubTransaction""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.payee_wrapper.PayeeWrapper() # noqa: E501 + # model = ynab.models.save_sub_transaction.SaveSubTransaction() # noqa: E501 pass diff --git a/test/test_scheduled_transaction_wrapper.py b/test/test_scheduled_transaction_wrapper.py deleted file mode 100644 index 63ab589..0000000 --- a/test/test_scheduled_transaction_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestScheduledTransactionWrapper(unittest.TestCase): - """ScheduledTransactionWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScheduledTransactionWrapper(self): - """Test ScheduledTransactionWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.scheduled_transaction_wrapper.ScheduledTransactionWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_scheduled_transactions_wrapper.py b/test/test_scheduled_transactions_wrapper.py deleted file mode 100644 index 843076c..0000000 --- a/test/test_scheduled_transactions_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestScheduledTransactionsWrapper(unittest.TestCase): - """ScheduledTransactionsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScheduledTransactionsWrapper(self): - """Test ScheduledTransactionsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.scheduled_transactions_wrapper.ScheduledTransactionsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transactions_api.py b/test/test_transactions_api.py index 3c201a7..7e32280 100644 --- a/test/test_transactions_api.py +++ b/test/test_transactions_api.py @@ -70,6 +70,13 @@ def test_get_transactions_by_payee(self): """ pass + def test_import_transactions(self): + """Test case for import_transactions + + Import transactions # noqa: E501 + """ + pass + def test_update_transaction(self): """Test case for update_transaction diff --git a/test/test_accounts_wrapper.py b/test/test_transactions_import_response.py similarity index 66% rename from test/test_accounts_wrapper.py rename to test/test_transactions_import_response.py index f69ab68..efe6252 100644 --- a/test/test_accounts_wrapper.py +++ b/test/test_transactions_import_response.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.accounts_wrapper import AccountsWrapper # noqa: E501 +from models.transactions_import_response import TransactionsImportResponse # noqa: E501 from ynab.rest import ApiException -class TestAccountsWrapper(unittest.TestCase): - """AccountsWrapper unit test stubs""" +class TestTransactionsImportResponse(unittest.TestCase): + """TransactionsImportResponse unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testAccountsWrapper(self): - """Test AccountsWrapper""" + def testTransactionsImportResponse(self): + """Test TransactionsImportResponse""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.accounts_wrapper.AccountsWrapper() # noqa: E501 + # model = ynab.models.transactions_import_response.TransactionsImportResponse() # noqa: E501 pass diff --git a/test/test_transactions_wrapper.py b/test/test_transactions_wrapper.py deleted file mode 100644 index 180b7a6..0000000 --- a/test/test_transactions_wrapper.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - YNAB API Endpoints - - 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.youneedabudget.com # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import ynab -from ynab.models.transactions_wrapper import TransactionsWrapper # noqa: E501 -from ynab.rest import ApiException - - -class TestTransactionsWrapper(unittest.TestCase): - """TransactionsWrapper unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTransactionsWrapper(self): - """Test TransactionsWrapper""" - # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.transactions_wrapper.TransactionsWrapper() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_wrapper.py b/test/test_update_transaction.py similarity index 70% rename from test/test_account_wrapper.py rename to test/test_update_transaction.py index f1e73fa..87823ba 100644 --- a/test/test_account_wrapper.py +++ b/test/test_update_transaction.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.account_wrapper import AccountWrapper # noqa: E501 +from models.update_transaction import UpdateTransaction # noqa: E501 from ynab.rest import ApiException -class TestAccountWrapper(unittest.TestCase): - """AccountWrapper unit test stubs""" +class TestUpdateTransaction(unittest.TestCase): + """UpdateTransaction unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testAccountWrapper(self): - """Test AccountWrapper""" + def testUpdateTransaction(self): + """Test UpdateTransaction""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.account_wrapper.AccountWrapper() # noqa: E501 + # model = ynab.models.update_transaction.UpdateTransaction() # noqa: E501 pass diff --git a/test/test_transaction_wrapper.py b/test/test_update_transactions_wrapper.py similarity index 72% rename from test/test_transaction_wrapper.py rename to test/test_update_transactions_wrapper.py index 279e3a1..c92e2e9 100644 --- a/test/test_transaction_wrapper.py +++ b/test/test_update_transactions_wrapper.py @@ -15,12 +15,12 @@ import unittest import ynab -from ynab.models.transaction_wrapper import TransactionWrapper # noqa: E501 +from models.update_transactions_wrapper import UpdateTransactionsWrapper # noqa: E501 from ynab.rest import ApiException -class TestTransactionWrapper(unittest.TestCase): - """TransactionWrapper unit test stubs""" +class TestUpdateTransactionsWrapper(unittest.TestCase): + """UpdateTransactionsWrapper unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testTransactionWrapper(self): - """Test TransactionWrapper""" + def testUpdateTransactionsWrapper(self): + """Test UpdateTransactionsWrapper""" # FIXME: construct object with mandatory attributes with example values - # model = ynab.models.transaction_wrapper.TransactionWrapper() # noqa: E501 + # model = ynab.models.update_transactions_wrapper.UpdateTransactionsWrapper() # noqa: E501 pass diff --git a/ynab/models/__init__.py b/ynab/models/__init__.py index dac19b8..a3527c5 100644 --- a/ynab/models/__init__.py +++ b/ynab/models/__init__.py @@ -16,54 +16,42 @@ # import models into model package from ynab.models.account import Account from ynab.models.account_response import AccountResponse -from ynab.models.account_wrapper import AccountWrapper from ynab.models.accounts_response import AccountsResponse -from ynab.models.accounts_wrapper import AccountsWrapper from ynab.models.budget_detail import BudgetDetail from ynab.models.budget_detail_response import BudgetDetailResponse -from ynab.models.budget_detail_wrapper import BudgetDetailWrapper from ynab.models.budget_settings import BudgetSettings from ynab.models.budget_settings_response import BudgetSettingsResponse -from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper from ynab.models.budget_summary import BudgetSummary from ynab.models.budget_summary_response import BudgetSummaryResponse -from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper -from ynab.models.bulk_id_wrapper import BulkIdWrapper -from ynab.models.bulk_ids import BulkIds from ynab.models.bulk_response import BulkResponse from ynab.models.bulk_transactions import BulkTransactions from ynab.models.categories_response import CategoriesResponse from ynab.models.category import Category from ynab.models.category_group import CategoryGroup from ynab.models.category_group_with_categories import CategoryGroupWithCategories -from ynab.models.category_groups_wrapper import CategoryGroupsWrapper from ynab.models.category_response import CategoryResponse -from ynab.models.category_wrapper import CategoryWrapper from ynab.models.currency_format import CurrencyFormat from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse from ynab.models.hybrid_transaction import HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse -from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper from ynab.models.month_detail import MonthDetail from ynab.models.month_detail_response import MonthDetailResponse -from ynab.models.month_detail_wrapper import MonthDetailWrapper from ynab.models.month_summaries_response import MonthSummariesResponse -from ynab.models.month_summaries_wrapper import MonthSummariesWrapper from ynab.models.month_summary import MonthSummary from ynab.models.payee import Payee from ynab.models.payee_location import PayeeLocation from ynab.models.payee_location_response import PayeeLocationResponse -from ynab.models.payee_location_wrapper import PayeeLocationWrapper from ynab.models.payee_locations_response import PayeeLocationsResponse -from ynab.models.payee_locations_wrapper import PayeeLocationsWrapper from ynab.models.payee_response import PayeeResponse -from ynab.models.payee_wrapper import PayeeWrapper from ynab.models.payees_response import PayeesResponse -from ynab.models.payees_wrapper import PayeesWrapper +from ynab.models.save_account import SaveAccount +from ynab.models.save_account_wrapper import SaveAccountWrapper +from ynab.models.save_category_response import SaveCategoryResponse from ynab.models.save_month_category import SaveMonthCategory from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper +from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.save_transaction import SaveTransaction from ynab.models.save_transaction_wrapper import SaveTransactionWrapper from ynab.models.save_transactions_response import SaveTransactionsResponse @@ -72,16 +60,14 @@ from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail from ynab.models.scheduled_transaction_response import ScheduledTransactionResponse from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary -from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper from ynab.models.scheduled_transactions_response import ScheduledTransactionsResponse -from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper from ynab.models.sub_transaction import SubTransaction from ynab.models.transaction_detail import TransactionDetail from ynab.models.transaction_response import TransactionResponse from ynab.models.transaction_summary import TransactionSummary -from ynab.models.transaction_wrapper import TransactionWrapper +from ynab.models.transactions_import_response import TransactionsImportResponse from ynab.models.transactions_response import TransactionsResponse -from ynab.models.transactions_wrapper import TransactionsWrapper +from ynab.models.update_transaction import UpdateTransaction +from ynab.models.update_transactions_wrapper import UpdateTransactionsWrapper from ynab.models.user import User from ynab.models.user_response import UserResponse -from ynab.models.user_wrapper import UserWrapper diff --git a/ynab/models/account.py b/ynab/models/account.py index 60aa644..b539401 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -39,6 +39,8 @@ class Account(object): 'cleared_balance': 'int', 'uncleared_balance': 'int', 'transfer_payee_id': 'str', + 'direct_import_linked': 'bool', + 'direct_import_in_error': 'bool', 'deleted': 'bool' } @@ -53,10 +55,12 @@ class Account(object): 'cleared_balance': 'cleared_balance', 'uncleared_balance': 'uncleared_balance', 'transfer_payee_id': 'transfer_payee_id', + 'direct_import_linked': 'direct_import_linked', + 'direct_import_in_error': 'direct_import_in_error', 'deleted': 'deleted' } - def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, note=None, balance=None, cleared_balance=None, uncleared_balance=None, transfer_payee_id=None, deleted=None): # noqa: E501 + def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, note=None, balance=None, cleared_balance=None, uncleared_balance=None, transfer_payee_id=None, direct_import_linked=None, direct_import_in_error=None, deleted=None): # noqa: E501 """Account - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -68,6 +72,8 @@ def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, n self._cleared_balance = None self._uncleared_balance = None self._transfer_payee_id = None + self._direct_import_linked = None + self._direct_import_in_error = None self._deleted = None self.discriminator = None self.id = id @@ -75,11 +81,16 @@ def __init__(self, id=None, name=None, type=None, on_budget=None, closed=None, n self.type = type self.on_budget = on_budget self.closed = closed - self.note = note + if note is not None: + self.note = note self.balance = balance self.cleared_balance = cleared_balance self.uncleared_balance = uncleared_balance self.transfer_payee_id = transfer_payee_id + if direct_import_linked is not None: + self.direct_import_linked = direct_import_linked + if direct_import_in_error is not None: + self.direct_import_in_error = direct_import_in_error self.deleted = deleted @property @@ -312,6 +323,52 @@ def transfer_payee_id(self, transfer_payee_id): self._transfer_payee_id = transfer_payee_id + @property + def direct_import_linked(self): + """Gets the direct_import_linked of this Account. # noqa: E501 + + Whether or not the account is linked to a financial institution for automatic transaction import. # noqa: E501 + + :return: The direct_import_linked of this Account. # noqa: E501 + :rtype: bool + """ + return self._direct_import_linked + + @direct_import_linked.setter + def direct_import_linked(self, direct_import_linked): + """Sets the direct_import_linked of this Account. + + Whether or not the account is linked to a financial institution for automatic transaction import. # noqa: E501 + + :param direct_import_linked: The direct_import_linked of this Account. # noqa: E501 + :type: bool + """ + + self._direct_import_linked = direct_import_linked + + @property + def direct_import_in_error(self): + """Gets the direct_import_in_error of this Account. # noqa: E501 + + If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true. # noqa: E501 + + :return: The direct_import_in_error of this Account. # noqa: E501 + :rtype: bool + """ + return self._direct_import_in_error + + @direct_import_in_error.setter + def direct_import_in_error(self, direct_import_in_error): + """Sets the direct_import_in_error of this Account. + + If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true. # noqa: E501 + + :param direct_import_in_error: The direct_import_in_error of this Account. # noqa: E501 + :type: bool + """ + + self._direct_import_in_error = direct_import_in_error + @property def deleted(self): """Gets the deleted of this Account. # noqa: E501 diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 6d03c9a..88484c2 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.account_wrapper import AccountWrapper # noqa: F401,E501 class AccountResponse(object): @@ -30,7 +29,7 @@ class AccountResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'AccountWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this AccountResponse. # noqa: E501 - :rtype: AccountWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this AccountResponse. # noqa: E501 - :type: AccountWrapper + :type: object """ self._data = data diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index ebd3301..23d2e3b 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.accounts_wrapper import AccountsWrapper # noqa: F401,E501 class AccountsResponse(object): @@ -30,7 +29,7 @@ class AccountsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'AccountsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this AccountsResponse. # noqa: E501 - :rtype: AccountsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this AccountsResponse. # noqa: E501 - :type: AccountsWrapper + :type: object """ self._data = data diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index c1ec05e..9d95ab6 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.budget_detail_wrapper import BudgetDetailWrapper # noqa: F401,E501 class BudgetDetailResponse(object): @@ -30,7 +29,7 @@ class BudgetDetailResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'BudgetDetailWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this BudgetDetailResponse. # noqa: E501 - :rtype: BudgetDetailWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this BudgetDetailResponse. # noqa: E501 - :type: BudgetDetailWrapper + :type: object """ self._data = data diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index c9cdcb6..60d7aa1 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper # noqa: F401,E501 class BudgetSettingsResponse(object): @@ -30,7 +29,7 @@ class BudgetSettingsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'BudgetSettingsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this BudgetSettingsResponse. # noqa: E501 - :rtype: BudgetSettingsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this BudgetSettingsResponse. # noqa: E501 - :type: BudgetSettingsWrapper + :type: object """ self._data = data diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index 9ddf960..d79a2b0 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -14,6 +14,7 @@ import re # noqa: F401 import six +from ynab.models.account import Account # noqa: F401,E501 from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 from ynab.models.date_format import DateFormat # noqa: F401,E501 @@ -37,7 +38,8 @@ class BudgetSummary(object): 'first_month': 'date', 'last_month': 'date', 'date_format': 'DateFormat', - 'currency_format': 'CurrencyFormat' + 'currency_format': 'CurrencyFormat', + 'accounts': 'list[Account]' } attribute_map = { @@ -47,10 +49,11 @@ class BudgetSummary(object): 'first_month': 'first_month', 'last_month': 'last_month', 'date_format': 'date_format', - 'currency_format': 'currency_format' + 'currency_format': 'currency_format', + 'accounts': 'accounts' } - def __init__(self, id=None, name=None, last_modified_on=None, first_month=None, last_month=None, date_format=None, currency_format=None): # noqa: E501 + def __init__(self, id=None, name=None, last_modified_on=None, first_month=None, last_month=None, date_format=None, currency_format=None, accounts=None): # noqa: E501 """BudgetSummary - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -59,6 +62,7 @@ def __init__(self, id=None, name=None, last_modified_on=None, first_month=None, self._last_month = None self._date_format = None self._currency_format = None + self._accounts = None self.discriminator = None self.id = id self.name = name @@ -72,6 +76,8 @@ def __init__(self, id=None, name=None, last_modified_on=None, first_month=None, self.date_format = date_format if currency_format is not None: self.currency_format = currency_format + if accounts is not None: + self.accounts = accounts @property def id(self): @@ -119,7 +125,7 @@ def name(self, name): def last_modified_on(self): """Gets the last_modified_on of this BudgetSummary. # noqa: E501 - The last time any changes were made to the budget from either a web or mobile client. # noqa: E501 + The last time any changes were made to the budget from either a web or mobile client # noqa: E501 :return: The last_modified_on of this BudgetSummary. # noqa: E501 :rtype: datetime @@ -130,7 +136,7 @@ def last_modified_on(self): def last_modified_on(self, last_modified_on): """Sets the last_modified_on of this BudgetSummary. - The last time any changes were made to the budget from either a web or mobile client. # noqa: E501 + The last time any changes were made to the budget from either a web or mobile client # noqa: E501 :param last_modified_on: The last_modified_on of this BudgetSummary. # noqa: E501 :type: datetime @@ -142,7 +148,7 @@ def last_modified_on(self, last_modified_on): def first_month(self): """Gets the first_month of this BudgetSummary. # noqa: E501 - The earliest budget month. # noqa: E501 + The earliest budget month # noqa: E501 :return: The first_month of this BudgetSummary. # noqa: E501 :rtype: date @@ -153,7 +159,7 @@ def first_month(self): def first_month(self, first_month): """Sets the first_month of this BudgetSummary. - The earliest budget month. # noqa: E501 + The earliest budget month # noqa: E501 :param first_month: The first_month of this BudgetSummary. # noqa: E501 :type: date @@ -165,7 +171,7 @@ def first_month(self, first_month): def last_month(self): """Gets the last_month of this BudgetSummary. # noqa: E501 - The latest budget month. # noqa: E501 + The latest budget month # noqa: E501 :return: The last_month of this BudgetSummary. # noqa: E501 :rtype: date @@ -176,7 +182,7 @@ def last_month(self): def last_month(self, last_month): """Sets the last_month of this BudgetSummary. - The latest budget month. # noqa: E501 + The latest budget month # noqa: E501 :param last_month: The last_month of this BudgetSummary. # noqa: E501 :type: date @@ -226,6 +232,29 @@ def currency_format(self, currency_format): self._currency_format = currency_format + @property + def accounts(self): + """Gets the accounts of this BudgetSummary. # noqa: E501 + + The budget accounts (only included if `include_accounts=true` specified as query parameter) # noqa: E501 + + :return: The accounts of this BudgetSummary. # noqa: E501 + :rtype: list[Account] + """ + return self._accounts + + @accounts.setter + def accounts(self, accounts): + """Sets the accounts of this BudgetSummary. + + The budget accounts (only included if `include_accounts=true` specified as query parameter) # noqa: E501 + + :param accounts: The accounts of this BudgetSummary. # noqa: E501 + :type: list[Account] + """ + + self._accounts = accounts + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index a8dfb46..d56bcac 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper # noqa: F401,E501 class BudgetSummaryResponse(object): @@ -30,7 +29,7 @@ class BudgetSummaryResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'BudgetSummaryWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this BudgetSummaryResponse. # noqa: E501 - :rtype: BudgetSummaryWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this BudgetSummaryResponse. # noqa: E501 - :type: BudgetSummaryWrapper + :type: object """ self._data = data diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index a2c7351..66626f4 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.bulk_id_wrapper import BulkIdWrapper # noqa: F401,E501 class BulkResponse(object): @@ -30,7 +29,7 @@ class BulkResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'BulkIdWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this BulkResponse. # noqa: E501 - :rtype: BulkIdWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this BulkResponse. # noqa: E501 - :type: BulkIdWrapper + :type: object """ self._data = data diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 4c6be9c..024276c 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.category_groups_wrapper import CategoryGroupsWrapper # noqa: F401,E501 class CategoriesResponse(object): @@ -30,7 +29,7 @@ class CategoriesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'CategoryGroupsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this CategoriesResponse. # noqa: E501 - :rtype: CategoryGroupsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this CategoriesResponse. # noqa: E501 - :type: CategoryGroupsWrapper + :type: object """ self._data = data diff --git a/ynab/models/category.py b/ynab/models/category.py index bf3b5e6..5797cec 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -43,6 +43,10 @@ class Category(object): 'goal_target': 'int', 'goal_target_month': 'date', 'goal_percentage_complete': 'int', + 'goal_months_to_budget': 'int', + 'goal_under_funded': 'int', + 'goal_overall_funded': 'int', + 'goal_overall_left': 'int', 'deleted': 'bool' } @@ -61,10 +65,14 @@ class Category(object): 'goal_target': 'goal_target', 'goal_target_month': 'goal_target_month', 'goal_percentage_complete': 'goal_percentage_complete', + 'goal_months_to_budget': 'goal_months_to_budget', + 'goal_under_funded': 'goal_under_funded', + 'goal_overall_funded': 'goal_overall_funded', + 'goal_overall_left': 'goal_overall_left', 'deleted': 'deleted' } - def __init__(self, id=None, category_group_id=None, name=None, hidden=None, original_category_group_id=None, note=None, budgeted=None, activity=None, balance=None, goal_type=None, goal_creation_month=None, goal_target=None, goal_target_month=None, goal_percentage_complete=None, deleted=None): # noqa: E501 + def __init__(self, id=None, category_group_id=None, name=None, hidden=None, original_category_group_id=None, note=None, budgeted=None, activity=None, balance=None, goal_type=None, goal_creation_month=None, goal_target=None, goal_target_month=None, goal_percentage_complete=None, goal_months_to_budget=None, goal_under_funded=None, goal_overall_funded=None, goal_overall_left=None, deleted=None): # noqa: E501 """Category - a model defined in Swagger""" # noqa: E501 self._id = None self._category_group_id = None @@ -80,6 +88,10 @@ def __init__(self, id=None, category_group_id=None, name=None, hidden=None, orig self._goal_target = None self._goal_target_month = None self._goal_percentage_complete = None + self._goal_months_to_budget = None + self._goal_under_funded = None + self._goal_overall_funded = None + self._goal_overall_left = None self._deleted = None self.discriminator = None self.id = id @@ -88,15 +100,29 @@ def __init__(self, id=None, category_group_id=None, name=None, hidden=None, orig self.hidden = hidden if original_category_group_id is not None: self.original_category_group_id = original_category_group_id - self.note = note + if note is not None: + self.note = note self.budgeted = budgeted self.activity = activity self.balance = balance - self.goal_type = goal_type - self.goal_creation_month = goal_creation_month - self.goal_target = goal_target - self.goal_target_month = goal_target_month - self.goal_percentage_complete = goal_percentage_complete + if goal_type is not None: + self.goal_type = goal_type + if goal_creation_month is not None: + self.goal_creation_month = goal_creation_month + if goal_target is not None: + self.goal_target = goal_target + if goal_target_month is not None: + self.goal_target_month = goal_target_month + if goal_percentage_complete is not None: + self.goal_percentage_complete = goal_percentage_complete + if goal_months_to_budget is not None: + self.goal_months_to_budget = goal_months_to_budget + if goal_under_funded is not None: + self.goal_under_funded = goal_under_funded + if goal_overall_funded is not None: + self.goal_overall_funded = goal_overall_funded + if goal_overall_left is not None: + self.goal_overall_left = goal_overall_left self.deleted = deleted @property @@ -302,7 +328,7 @@ def balance(self, balance): def goal_type(self): """Gets the goal_type of this Category. # noqa: E501 - The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) # noqa: E501 + The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending') # noqa: E501 :return: The goal_type of this Category. # noqa: E501 :rtype: str @@ -313,12 +339,12 @@ def goal_type(self): def goal_type(self, goal_type): """Sets the goal_type of this Category. - The type of goal, if the cagegory has a goal (TB=Target Category Balance, TBD=Target Category Balance by Date, MF=Monthly Funding) # noqa: E501 + The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending') # noqa: E501 :param goal_type: The goal_type of this Category. # noqa: E501 :type: str """ - allowed_values = ["TB", "TBD", "MF"] # noqa: E501 + allowed_values = ["TB", "TBD", "MF", "NEED"] # noqa: E501 if goal_type not in allowed_values: raise ValueError( "Invalid value for `goal_type` ({0}), must be one of {1}" # noqa: E501 @@ -377,7 +403,7 @@ def goal_target(self, goal_target): def goal_target_month(self): """Gets the goal_target_month of this Category. # noqa: E501 - If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed # noqa: E501 + The original target month for the goal to be completed. Only some goal types specify this date. # noqa: E501 :return: The goal_target_month of this Category. # noqa: E501 :rtype: date @@ -388,7 +414,7 @@ def goal_target_month(self): def goal_target_month(self, goal_target_month): """Sets the goal_target_month of this Category. - If the goal type is 'TBD' (Target Category Balance by Date), this is the target month for the goal to be completed # noqa: E501 + The original target month for the goal to be completed. Only some goal types specify this date. # noqa: E501 :param goal_target_month: The goal_target_month of this Category. # noqa: E501 :type: date @@ -419,6 +445,98 @@ def goal_percentage_complete(self, goal_percentage_complete): self._goal_percentage_complete = goal_percentage_complete + @property + def goal_months_to_budget(self): + """Gets the goal_months_to_budget of this Category. # noqa: E501 + + The number of months, including the current month, left in the current goal period. # noqa: E501 + + :return: The goal_months_to_budget of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_months_to_budget + + @goal_months_to_budget.setter + def goal_months_to_budget(self, goal_months_to_budget): + """Sets the goal_months_to_budget of this Category. + + The number of months, including the current month, left in the current goal period. # noqa: E501 + + :param goal_months_to_budget: The goal_months_to_budget of this Category. # noqa: E501 + :type: int + """ + + self._goal_months_to_budget = goal_months_to_budget + + @property + def goal_under_funded(self): + """Gets the goal_under_funded of this Category. # noqa: E501 + + The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month. # noqa: E501 + + :return: The goal_under_funded of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_under_funded + + @goal_under_funded.setter + def goal_under_funded(self, goal_under_funded): + """Sets the goal_under_funded of this Category. + + The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month. # noqa: E501 + + :param goal_under_funded: The goal_under_funded of this Category. # noqa: E501 + :type: int + """ + + self._goal_under_funded = goal_under_funded + + @property + def goal_overall_funded(self): + """Gets the goal_overall_funded of this Category. # noqa: E501 + + The total amount funded towards the goal within the current goal period. # noqa: E501 + + :return: The goal_overall_funded of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_overall_funded + + @goal_overall_funded.setter + def goal_overall_funded(self, goal_overall_funded): + """Sets the goal_overall_funded of this Category. + + The total amount funded towards the goal within the current goal period. # noqa: E501 + + :param goal_overall_funded: The goal_overall_funded of this Category. # noqa: E501 + :type: int + """ + + self._goal_overall_funded = goal_overall_funded + + @property + def goal_overall_left(self): + """Gets the goal_overall_left of this Category. # noqa: E501 + + The amount of funding still needed to complete the goal within the current goal period. # noqa: E501 + + :return: The goal_overall_left of this Category. # noqa: E501 + :rtype: int + """ + return self._goal_overall_left + + @goal_overall_left.setter + def goal_overall_left(self, goal_overall_left): + """Sets the goal_overall_left of this Category. + + The amount of funding still needed to complete the goal within the current goal period. # noqa: E501 + + :param goal_overall_left: The goal_overall_left of this Category. # noqa: E501 + :type: int + """ + + self._goal_overall_left = goal_overall_left + @property def deleted(self): """Gets the deleted of this Category. # noqa: E501 diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index e5f68a7..97f31c7 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.category_wrapper import CategoryWrapper # noqa: F401,E501 class CategoryResponse(object): @@ -30,7 +29,7 @@ class CategoryResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'CategoryWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this CategoryResponse. # noqa: E501 - :rtype: CategoryWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this CategoryResponse. # noqa: E501 - :type: CategoryWrapper + :type: object """ self._data = data diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index 465a56a..8ae8c43 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -54,10 +54,13 @@ def __init__(self, type=None, parent_transaction_id=None, account_name=None, pay self._category_name = None self.discriminator = None self.type = type - self.parent_transaction_id = parent_transaction_id + if parent_transaction_id is not None: + self.parent_transaction_id = parent_transaction_id self.account_name = account_name - self.payee_name = payee_name - self.category_name = category_name + if payee_name is not None: + self.payee_name = payee_name + if category_name is not None: + self.category_name = category_name @property def type(self): @@ -92,7 +95,7 @@ def type(self, type): def parent_transaction_id(self): """Gets the parent_transaction_id of this HybridTransaction. # noqa: E501 - For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null. # noqa: E501 + For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null. # noqa: E501 :return: The parent_transaction_id of this HybridTransaction. # noqa: E501 :rtype: str @@ -103,7 +106,7 @@ def parent_transaction_id(self): def parent_transaction_id(self, parent_transaction_id): """Sets the parent_transaction_id of this HybridTransaction. - For subtransaction types, this is the id of the pararent transaction. For transaction types, this id will be always be null. # noqa: E501 + For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null. # noqa: E501 :param parent_transaction_id: The parent_transaction_id of this HybridTransaction. # noqa: E501 :type: str diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index 9dd07a1..32d77de 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper # noqa: F401,E501 class HybridTransactionsResponse(object): @@ -30,7 +29,7 @@ class HybridTransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'HybridTransactionsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this HybridTransactionsResponse. # noqa: E501 - :rtype: HybridTransactionsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this HybridTransactionsResponse. # noqa: E501 - :type: HybridTransactionsWrapper + :type: object """ self._data = data diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index 45bccfa..c3f00eb 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.month_detail_wrapper import MonthDetailWrapper # noqa: F401,E501 class MonthDetailResponse(object): @@ -30,7 +29,7 @@ class MonthDetailResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'MonthDetailWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this MonthDetailResponse. # noqa: E501 - :rtype: MonthDetailWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this MonthDetailResponse. # noqa: E501 - :type: MonthDetailWrapper + :type: object """ self._data = data diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index 71ae3a8..c4ada58 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.month_summaries_wrapper import MonthSummariesWrapper # noqa: F401,E501 class MonthSummariesResponse(object): @@ -30,7 +29,7 @@ class MonthSummariesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'MonthSummariesWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this MonthSummariesResponse. # noqa: E501 - :rtype: MonthSummariesWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this MonthSummariesResponse. # noqa: E501 - :type: MonthSummariesWrapper + :type: object """ self._data = data diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 1e7b5f6..3742c3b 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -62,12 +62,14 @@ def __init__(self, month=None, note=None, income=None, budgeted=None, activity=N self._deleted = None self.discriminator = None self.month = month - self.note = note + if note is not None: + self.note = note self.income = income self.budgeted = budgeted self.activity = activity self.to_be_budgeted = to_be_budgeted - self.age_of_money = age_of_money + if age_of_money is not None: + self.age_of_money = age_of_money self.deleted = deleted @property @@ -116,7 +118,7 @@ def note(self, note): def income(self): """Gets the income of this MonthSummary. # noqa: E501 - The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month # noqa: E501 + The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month # noqa: E501 :return: The income of this MonthSummary. # noqa: E501 :rtype: int @@ -127,7 +129,7 @@ def income(self): def income(self, income): """Sets the income of this MonthSummary. - The total amount in transactions categorized to 'Inflow: To be Budgeted' in the month # noqa: E501 + The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month # noqa: E501 :param income: The income of this MonthSummary. # noqa: E501 :type: int @@ -162,7 +164,7 @@ def budgeted(self, budgeted): def activity(self): """Gets the activity of this MonthSummary. # noqa: E501 - The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' # noqa: E501 + The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign' # noqa: E501 :return: The activity of this MonthSummary. # noqa: E501 :rtype: int @@ -173,7 +175,7 @@ def activity(self): def activity(self, activity): """Sets the activity of this MonthSummary. - The total amount in transactions in the month, excluding those categorized to 'Inflow: To be Budgeted' # noqa: E501 + The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign' # noqa: E501 :param activity: The activity of this MonthSummary. # noqa: E501 :type: int @@ -185,7 +187,7 @@ def activity(self, activity): def to_be_budgeted(self): """Gets the to_be_budgeted of this MonthSummary. # noqa: E501 - The available amount for 'To be Budgeted' # noqa: E501 + The available amount for 'Ready to Assign' # noqa: E501 :return: The to_be_budgeted of this MonthSummary. # noqa: E501 :rtype: int @@ -196,7 +198,7 @@ def to_be_budgeted(self): def to_be_budgeted(self, to_be_budgeted): """Sets the to_be_budgeted of this MonthSummary. - The available amount for 'To be Budgeted' # noqa: E501 + The available amount for 'Ready to Assign' # noqa: E501 :param to_be_budgeted: The to_be_budgeted of this MonthSummary. # noqa: E501 :type: int diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 80c31c5..eacae52 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -51,7 +51,8 @@ def __init__(self, id=None, name=None, transfer_account_id=None, deleted=None): self.discriminator = None self.id = id self.name = name - self.transfer_account_id = transfer_account_id + if transfer_account_id is not None: + self.transfer_account_id = transfer_account_id self.deleted = deleted @property @@ -100,7 +101,7 @@ def name(self, name): def transfer_account_id(self): """Gets the transfer_account_id of this Payee. # noqa: E501 - If a transfer payee, the account_id to which this payee transfers to # noqa: E501 + If a transfer payee, the `account_id` to which this payee transfers to # noqa: E501 :return: The transfer_account_id of this Payee. # noqa: E501 :rtype: str @@ -111,7 +112,7 @@ def transfer_account_id(self): def transfer_account_id(self, transfer_account_id): """Sets the transfer_account_id of this Payee. - If a transfer payee, the account_id to which this payee transfers to # noqa: E501 + If a transfer payee, the `account_id` to which this payee transfers to # noqa: E501 :param transfer_account_id: The transfer_account_id of this Payee. # noqa: E501 :type: str diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 35f0a08..0f2fea7 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.payee_location_wrapper import PayeeLocationWrapper # noqa: F401,E501 class PayeeLocationResponse(object): @@ -30,7 +29,7 @@ class PayeeLocationResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'PayeeLocationWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this PayeeLocationResponse. # noqa: E501 - :rtype: PayeeLocationWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this PayeeLocationResponse. # noqa: E501 - :type: PayeeLocationWrapper + :type: object """ self._data = data diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index 2b61912..b79312a 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.payee_locations_wrapper import PayeeLocationsWrapper # noqa: F401,E501 class PayeeLocationsResponse(object): @@ -30,7 +29,7 @@ class PayeeLocationsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'PayeeLocationsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this PayeeLocationsResponse. # noqa: E501 - :rtype: PayeeLocationsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this PayeeLocationsResponse. # noqa: E501 - :type: PayeeLocationsWrapper + :type: object """ self._data = data diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 64592e2..74926a2 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.payee_wrapper import PayeeWrapper # noqa: F401,E501 class PayeeResponse(object): @@ -30,7 +29,7 @@ class PayeeResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'PayeeWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this PayeeResponse. # noqa: E501 - :rtype: PayeeWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this PayeeResponse. # noqa: E501 - :type: PayeeWrapper + :type: object """ self._data = data diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index 47b3637..cd49cbe 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.payees_wrapper import PayeesWrapper # noqa: F401,E501 class PayeesResponse(object): @@ -30,7 +29,7 @@ class PayeesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'PayeesWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this PayeesResponse. # noqa: E501 - :rtype: PayeesWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this PayeesResponse. # noqa: E501 - :type: PayeesWrapper + :type: object """ self._data = data diff --git a/ynab/models/save_account.py b/ynab/models/save_account.py new file mode 100644 index 0000000..0d03f83 --- /dev/null +++ b/ynab/models/save_account.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SaveAccount(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'type': 'str', + 'balance': 'int' + } + + attribute_map = { + 'name': 'name', + 'type': 'type', + 'balance': 'balance' + } + + def __init__(self, name=None, type=None, balance=None): # noqa: E501 + """SaveAccount - a model defined in Swagger""" # noqa: E501 + self._name = None + self._type = None + self._balance = None + self.discriminator = None + self.name = name + self.type = type + self.balance = balance + + @property + def name(self): + """Gets the name of this SaveAccount. # noqa: E501 + + The name of the account # noqa: E501 + + :return: The name of this SaveAccount. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SaveAccount. + + The name of the account # noqa: E501 + + :param name: The name of this SaveAccount. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def type(self): + """Gets the type of this SaveAccount. # noqa: E501 + + The account type # noqa: E501 + + :return: The type of this SaveAccount. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SaveAccount. + + The account type # noqa: E501 + + :param type: The type of this SaveAccount. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["checking", "savings", "creditCard", "cash", "lineOfCredit", "otherAsset", "otherLiability"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def balance(self): + """Gets the balance of this SaveAccount. # noqa: E501 + + The current balance of the account in milliunits format # noqa: E501 + + :return: The balance of this SaveAccount. # noqa: E501 + :rtype: int + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this SaveAccount. + + The current balance of the account in milliunits format # noqa: E501 + + :param balance: The balance of this SaveAccount. # noqa: E501 + :type: int + """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + + self._balance = balance + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveAccount, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveAccount): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_account_wrapper.py b/ynab/models/save_account_wrapper.py new file mode 100644 index 0000000..d303cee --- /dev/null +++ b/ynab/models/save_account_wrapper.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.save_account import SaveAccount # noqa: F401,E501 + + +class SaveAccountWrapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'account': 'SaveAccount' + } + + attribute_map = { + 'account': 'account' + } + + def __init__(self, account=None): # noqa: E501 + """SaveAccountWrapper - a model defined in Swagger""" # noqa: E501 + self._account = None + self.discriminator = None + self.account = account + + @property + def account(self): + """Gets the account of this SaveAccountWrapper. # noqa: E501 + + + :return: The account of this SaveAccountWrapper. # noqa: E501 + :rtype: SaveAccount + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this SaveAccountWrapper. + + + :param account: The account of this SaveAccountWrapper. # noqa: E501 + :type: SaveAccount + """ + if account is None: + raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 + + self._account = account + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveAccountWrapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveAccountWrapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_category_response.py b/ynab/models/save_category_response.py new file mode 100644 index 0000000..e8ebf29 --- /dev/null +++ b/ynab/models/save_category_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SaveCategoryResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'object' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """SaveCategoryResponse - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + self.data = data + + @property + def data(self): + """Gets the data of this SaveCategoryResponse. # noqa: E501 + + + :return: The data of this SaveCategoryResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SaveCategoryResponse. + + + :param data: The data of this SaveCategoryResponse. # noqa: E501 + :type: object + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveCategoryResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveCategoryResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_sub_transaction.py b/ynab/models/save_sub_transaction.py new file mode 100644 index 0000000..83a5ddd --- /dev/null +++ b/ynab/models/save_sub_transaction.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SaveSubTransaction(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'amount': 'int', + 'payee_id': 'str', + 'payee_name': 'str', + 'category_id': 'str', + 'memo': 'str' + } + + attribute_map = { + 'amount': 'amount', + 'payee_id': 'payee_id', + 'payee_name': 'payee_name', + 'category_id': 'category_id', + 'memo': 'memo' + } + + def __init__(self, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None): # noqa: E501 + """SaveSubTransaction - a model defined in Swagger""" # noqa: E501 + self._amount = None + self._payee_id = None + self._payee_name = None + self._category_id = None + self._memo = None + self.discriminator = None + self.amount = amount + if payee_id is not None: + self.payee_id = payee_id + if payee_name is not None: + self.payee_name = payee_name + if category_id is not None: + self.category_id = category_id + if memo is not None: + self.memo = memo + + @property + def amount(self): + """Gets the amount of this SaveSubTransaction. # noqa: E501 + + The subtransaction amount in milliunits format. # noqa: E501 + + :return: The amount of this SaveSubTransaction. # noqa: E501 + :rtype: int + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SaveSubTransaction. + + The subtransaction amount in milliunits format. # noqa: E501 + + :param amount: The amount of this SaveSubTransaction. # noqa: E501 + :type: int + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def payee_id(self): + """Gets the payee_id of this SaveSubTransaction. # noqa: E501 + + The payee for the subtransaction. # noqa: E501 + + :return: The payee_id of this SaveSubTransaction. # noqa: E501 + :rtype: str + """ + return self._payee_id + + @payee_id.setter + def payee_id(self, payee_id): + """Sets the payee_id of this SaveSubTransaction. + + The payee for the subtransaction. # noqa: E501 + + :param payee_id: The payee_id of this SaveSubTransaction. # noqa: E501 + :type: str + """ + + self._payee_id = payee_id + + @property + def payee_name(self): + """Gets the payee_name of this SaveSubTransaction. # noqa: E501 + + 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 on parent transaction) or (2) a payee with the same name or (3) creation of a new payee. # noqa: E501 + + :return: The payee_name of this SaveSubTransaction. # noqa: E501 + :rtype: str + """ + return self._payee_name + + @payee_name.setter + def payee_name(self, payee_name): + """Sets the payee_name of this SaveSubTransaction. + + 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 on parent transaction) or (2) a payee with the same name or (3) creation of a new payee. # noqa: E501 + + :param payee_name: The payee_name of this SaveSubTransaction. # noqa: E501 + :type: str + """ + + self._payee_name = payee_name + + @property + def category_id(self): + """Gets the category_id of this SaveSubTransaction. # noqa: E501 + + The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied. # noqa: E501 + + :return: The category_id of this SaveSubTransaction. # noqa: E501 + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this SaveSubTransaction. + + The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied. # noqa: E501 + + :param category_id: The category_id of this SaveSubTransaction. # noqa: E501 + :type: str + """ + + self._category_id = category_id + + @property + def memo(self): + """Gets the memo of this SaveSubTransaction. # noqa: E501 + + + :return: The memo of this SaveSubTransaction. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this SaveSubTransaction. + + + :param memo: The memo of this SaveSubTransaction. # noqa: E501 + :type: str + """ + + self._memo = memo + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveSubTransaction, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveSubTransaction): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index 8774e19..09cc661 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -14,6 +14,7 @@ import re # noqa: F401 import six +from ynab.models.save_sub_transaction import SaveSubTransaction # noqa: F401,E501 class SaveTransaction(object): @@ -39,7 +40,8 @@ class SaveTransaction(object): 'cleared': 'str', 'approved': 'bool', 'flag_color': 'str', - 'import_id': 'str' + 'import_id': 'str', + 'subtransactions': 'list[SaveSubTransaction]' } attribute_map = { @@ -53,10 +55,11 @@ class SaveTransaction(object): 'cleared': 'cleared', 'approved': 'approved', 'flag_color': 'flag_color', - 'import_id': 'import_id' + 'import_id': 'import_id', + 'subtransactions': 'subtransactions' } - def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None, cleared=None, approved=None, flag_color=None, import_id=None): # noqa: E501 + def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None, cleared=None, approved=None, flag_color=None, import_id=None, subtransactions=None): # noqa: E501 """SaveTransaction - a model defined in Swagger""" # noqa: E501 self._account_id = None self.__date = None @@ -69,6 +72,7 @@ def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, paye self._approved = None self._flag_color = None self._import_id = None + self._subtransactions = None self.discriminator = None self.account_id = account_id self._date = _date @@ -89,6 +93,8 @@ def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, paye self.flag_color = flag_color if import_id is not None: self.import_id = import_id + if subtransactions is not None: + self.subtransactions = subtransactions @property def account_id(self): @@ -115,6 +121,7 @@ def account_id(self, account_id): def _date(self): """Gets the _date of this SaveTransaction. # noqa: E501 + 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. # noqa: E501 :return: The _date of this SaveTransaction. # noqa: E501 :rtype: date @@ -125,6 +132,7 @@ def _date(self): def _date(self, _date): """Sets the _date of this SaveTransaction. + 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. # noqa: E501 :param _date: The _date of this SaveTransaction. # noqa: E501 :type: date @@ -136,7 +144,7 @@ def _date(self, _date): def amount(self): """Gets the amount of this SaveTransaction. # noqa: E501 - The transaction amount in milliunits format # noqa: E501 + The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. # noqa: E501 :return: The amount of this SaveTransaction. # noqa: E501 :rtype: int @@ -147,7 +155,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SaveTransaction. - The transaction amount in milliunits format # noqa: E501 + The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. # noqa: E501 :param amount: The amount of this SaveTransaction. # noqa: E501 :type: int @@ -159,7 +167,7 @@ def amount(self, amount): def payee_id(self): """Gets the payee_id of this SaveTransaction. # noqa: E501 - The payee for the transaction # noqa: E501 + 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. # noqa: E501 :return: The payee_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -170,7 +178,7 @@ def payee_id(self): def payee_id(self, payee_id): """Sets the payee_id of this SaveTransaction. - The payee for the transaction # noqa: E501 + 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. # noqa: E501 :param payee_id: The payee_id of this SaveTransaction. # noqa: E501 :type: str @@ -182,7 +190,7 @@ def payee_id(self, payee_id): def payee_name(self): """Gets the payee_name of this SaveTransaction. # noqa: E501 - 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. # noqa: E501 + 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. # noqa: E501 :return: The payee_name of this SaveTransaction. # noqa: E501 :rtype: str @@ -193,7 +201,7 @@ def payee_name(self): def payee_name(self, payee_name): """Sets the payee_name of this SaveTransaction. - 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. # noqa: E501 + 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. # noqa: E501 :param payee_name: The payee_name of this SaveTransaction. # noqa: E501 :type: str @@ -205,7 +213,7 @@ def payee_name(self, payee_name): def category_id(self): """Gets the category_id of this SaveTransaction. # noqa: E501 - The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. # noqa: E501 + 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. # noqa: E501 :return: The category_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -216,7 +224,7 @@ def category_id(self): def category_id(self, category_id): """Sets the category_id of this SaveTransaction. - The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed. # noqa: E501 + 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. # noqa: E501 :param category_id: The category_id of this SaveTransaction. # noqa: E501 :type: str @@ -330,7 +338,7 @@ def flag_color(self, flag_color): def import_id(self): """Gets the import_id of this SaveTransaction. # noqa: E501 - If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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). # noqa: E501 + 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.

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.

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). # noqa: E501 :return: The import_id of this SaveTransaction. # noqa: E501 :rtype: str @@ -341,7 +349,7 @@ def import_id(self): def import_id(self, import_id): """Sets the import_id of this SaveTransaction. - If specified, the new transaction will be assigned this import_id and considered \"imported\". *At the time of import* we will attempt to match \"imported\" transactions with non-imported (i.e. \"user-entered\") transactions.

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.

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). # noqa: E501 + 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.

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.

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). # noqa: E501 :param import_id: The import_id of this SaveTransaction. # noqa: E501 :type: str @@ -349,6 +357,29 @@ def import_id(self, import_id): self._import_id = import_id + @property + def subtransactions(self): + """Gets the subtransactions of this SaveTransaction. # noqa: E501 + + An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. # noqa: E501 + + :return: The subtransactions of this SaveTransaction. # noqa: E501 + :rtype: list[SaveSubTransaction] + """ + return self._subtransactions + + @subtransactions.setter + def subtransactions(self, subtransactions): + """Sets the subtransactions of this SaveTransaction. + + An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. # noqa: E501 + + :param subtransactions: The subtransactions of this SaveTransaction. # noqa: E501 + :type: list[SaveSubTransaction] + """ + + self._subtransactions = subtransactions + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index 6373371..d532466 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -64,10 +64,14 @@ def __init__(self, id=None, scheduled_transaction_id=None, amount=None, memo=Non self.id = id self.scheduled_transaction_id = scheduled_transaction_id self.amount = amount - self.memo = memo - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id + if memo is not None: + self.memo = memo + if payee_id is not None: + self.payee_id = payee_id + if category_id is not None: + self.category_id = category_id + if transfer_account_id is not None: + self.transfer_account_id = transfer_account_id self.deleted = deleted @property diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index f5412b0..a77ca33 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -52,8 +52,10 @@ def __init__(self, account_name=None, payee_name=None, category_name=None, subtr self._subtransactions = None self.discriminator = None self.account_name = account_name - self.payee_name = payee_name - self.category_name = category_name + if payee_name is not None: + self.payee_name = payee_name + if category_name is not None: + self.category_name = category_name self.subtransactions = subtransactions @property diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index ff49ce9..8995979 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper # noqa: F401,E501 class ScheduledTransactionResponse(object): @@ -30,7 +29,7 @@ class ScheduledTransactionResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'ScheduledTransactionWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this ScheduledTransactionResponse. # noqa: E501 - :rtype: ScheduledTransactionWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionResponse. # noqa: E501 - :type: ScheduledTransactionWrapper + :type: object """ self._data = data diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index 207a9d6..af235f3 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -78,12 +78,17 @@ def __init__(self, id=None, date_first=None, date_next=None, frequency=None, amo self.date_next = date_next self.frequency = frequency self.amount = amount - self.memo = memo - self.flag_color = flag_color + if memo is not None: + self.memo = memo + if flag_color is not None: + self.flag_color = flag_color self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id + if payee_id is not None: + self.payee_id = payee_id + if category_id is not None: + self.category_id = category_id + if transfer_account_id is not None: + self.transfer_account_id = transfer_account_id self.deleted = deleted @property diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index af537d4..8c3f182 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper # noqa: F401,E501 class ScheduledTransactionsResponse(object): @@ -30,7 +29,7 @@ class ScheduledTransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'ScheduledTransactionsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this ScheduledTransactionsResponse. # noqa: E501 - :rtype: ScheduledTransactionsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionsResponse. # noqa: E501 - :type: ScheduledTransactionsWrapper + :type: object """ self._data = data diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index 5ad6210..b8c9e48 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -34,8 +34,11 @@ class SubTransaction(object): 'amount': 'int', 'memo': 'str', 'payee_id': 'str', + 'payee_name': 'str', 'category_id': 'str', + 'category_name': 'str', 'transfer_account_id': 'str', + 'transfer_transaction_id': 'str', 'deleted': 'bool' } @@ -45,29 +48,45 @@ class SubTransaction(object): 'amount': 'amount', 'memo': 'memo', 'payee_id': 'payee_id', + 'payee_name': 'payee_name', 'category_id': 'category_id', + 'category_name': 'category_name', 'transfer_account_id': 'transfer_account_id', + 'transfer_transaction_id': 'transfer_transaction_id', 'deleted': 'deleted' } - def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_id=None, category_id=None, transfer_account_id=None, deleted=None): # noqa: E501 + def __init__(self, id=None, transaction_id=None, amount=None, memo=None, payee_id=None, payee_name=None, category_id=None, category_name=None, transfer_account_id=None, transfer_transaction_id=None, deleted=None): # noqa: E501 """SubTransaction - a model defined in Swagger""" # noqa: E501 self._id = None self._transaction_id = None self._amount = None self._memo = None self._payee_id = None + self._payee_name = None self._category_id = None + self._category_name = None self._transfer_account_id = None + self._transfer_transaction_id = None self._deleted = None self.discriminator = None self.id = id self.transaction_id = transaction_id self.amount = amount - self.memo = memo - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id + if memo is not None: + self.memo = memo + if payee_id is not None: + self.payee_id = payee_id + if payee_name is not None: + self.payee_name = payee_name + if category_id is not None: + self.category_id = category_id + if category_name is not None: + self.category_name = category_name + if transfer_account_id is not None: + self.transfer_account_id = transfer_account_id + if transfer_transaction_id is not None: + self.transfer_transaction_id = transfer_transaction_id self.deleted = deleted @property @@ -177,6 +196,27 @@ def payee_id(self, payee_id): self._payee_id = payee_id + @property + def payee_name(self): + """Gets the payee_name of this SubTransaction. # noqa: E501 + + + :return: The payee_name of this SubTransaction. # noqa: E501 + :rtype: str + """ + return self._payee_name + + @payee_name.setter + def payee_name(self, payee_name): + """Sets the payee_name of this SubTransaction. + + + :param payee_name: The payee_name of this SubTransaction. # noqa: E501 + :type: str + """ + + self._payee_name = payee_name + @property def category_id(self): """Gets the category_id of this SubTransaction. # noqa: E501 @@ -198,6 +238,27 @@ def category_id(self, category_id): self._category_id = category_id + @property + def category_name(self): + """Gets the category_name of this SubTransaction. # noqa: E501 + + + :return: The category_name of this SubTransaction. # noqa: E501 + :rtype: str + """ + return self._category_name + + @category_name.setter + def category_name(self, category_name): + """Sets the category_name of this SubTransaction. + + + :param category_name: The category_name of this SubTransaction. # noqa: E501 + :type: str + """ + + self._category_name = category_name + @property def transfer_account_id(self): """Gets the transfer_account_id of this SubTransaction. # noqa: E501 @@ -221,6 +282,29 @@ def transfer_account_id(self, transfer_account_id): self._transfer_account_id = transfer_account_id + @property + def transfer_transaction_id(self): + """Gets the transfer_transaction_id of this SubTransaction. # noqa: E501 + + If a transfer, the id of transaction on the other side of the transfer # noqa: E501 + + :return: The transfer_transaction_id of this SubTransaction. # noqa: E501 + :rtype: str + """ + return self._transfer_transaction_id + + @transfer_transaction_id.setter + def transfer_transaction_id(self, transfer_transaction_id): + """Sets the transfer_transaction_id of this SubTransaction. + + If a transfer, the id of transaction on the other side of the transfer # noqa: E501 + + :param transfer_transaction_id: The transfer_transaction_id of this SubTransaction. # noqa: E501 + :type: str + """ + + self._transfer_transaction_id = transfer_transaction_id + @property def deleted(self): """Gets the deleted of this SubTransaction. # noqa: E501 diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 8386796..6ac1a17 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -15,9 +15,10 @@ import six from ynab.models.sub_transaction import SubTransaction # noqa: F401,E501 +from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 -class TransactionDetail(object): +class TransactionDetail(TransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -33,87 +34,29 @@ class TransactionDetail(object): 'account_name': 'str', 'payee_name': 'str', 'category_name': 'str', - 'subtransactions': 'list[SubTransaction]', - 'id': 'str', - '_date': 'date', - 'amount': 'int', - 'memo': 'str', - 'cleared': 'str', - 'approved': 'bool', - 'flag_color': 'str', - 'account_id': 'str', - 'payee_id': 'str', - 'category_id': 'str', - 'transfer_account_id': 'str', - 'transfer_transaction_id': 'str', - 'matched_transaction_id': 'str', - 'import_id': 'str', - 'deleted': 'bool' + 'subtransactions': 'list[SubTransaction]' } attribute_map = { 'account_name': 'account_name', 'payee_name': 'payee_name', 'category_name': 'category_name', - 'subtransactions': 'subtransactions', - 'id': 'id', - '_date': 'date', - 'amount': 'amount', - 'memo': 'memo', - 'cleared': 'cleared', - 'approved': 'approved', - 'flag_color': 'flag_color', - 'account_id': 'account_id', - 'payee_id': 'payee_id', - 'category_id': 'category_id', - 'transfer_account_id': 'transfer_account_id', - 'transfer_transaction_id': 'transfer_transaction_id', - 'matched_transaction_id': 'matched_transaction_id', - 'import_id': 'import_id', - 'deleted': 'deleted' + 'subtransactions': 'subtransactions' } - def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None, id=None, _date=None, amount=None, memo=None, cleared=None, approved=None, flag_color=None, account_id=None, payee_id=None, category_id=None, transfer_account_id=None, transfer_transaction_id=None, matched_transaction_id=None, import_id=None, deleted=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 """TransactionDetail - a model defined in Swagger""" # noqa: E501 self._account_name = None self._payee_name = None self._category_name = None self._subtransactions = None - self._id = None - self.__date = None - self._amount = None - self._memo = None - self._cleared = None - self._approved = None - self._flag_color = None - self._account_id = None - self._payee_id = None - self._category_id = None - self._transfer_account_id = None - self._transfer_transaction_id = None - self._matched_transaction_id = None - self._import_id = None - self._deleted = None self.discriminator = None self.account_name = account_name - self.payee_name = payee_name - self.category_name = category_name + if payee_name is not None: + self.payee_name = payee_name + if category_name is not None: + self.category_name = category_name self.subtransactions = subtransactions - self.id = id - self._date = _date - self.amount = amount - self.memo = memo - self.cleared = cleared - self.approved = approved - self.flag_color = flag_color - self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id - self.transfer_transaction_id = transfer_transaction_id - self.matched_transaction_id = matched_transaction_id - self.import_id = import_id - self.deleted = deleted @property def account_name(self): @@ -201,351 +144,6 @@ def subtransactions(self, subtransactions): self._subtransactions = subtransactions - @property - def id(self): - """Gets the id of this TransactionDetail. # noqa: E501 - - - :return: The id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this TransactionDetail. - - - :param id: The id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def _date(self): - """Gets the _date of this TransactionDetail. # noqa: E501 - - - :return: The _date of this TransactionDetail. # noqa: E501 - :rtype: date - """ - return self.__date - - @_date.setter - def _date(self, _date): - """Sets the _date of this TransactionDetail. - - - :param _date: The _date of this TransactionDetail. # noqa: E501 - :type: date - """ - - self.__date = _date - - @property - def amount(self): - """Gets the amount of this TransactionDetail. # noqa: E501 - - The transaction amount in milliunits format # noqa: E501 - - :return: The amount of this TransactionDetail. # noqa: E501 - :rtype: int - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this TransactionDetail. - - The transaction amount in milliunits format # noqa: E501 - - :param amount: The amount of this TransactionDetail. # noqa: E501 - :type: int - """ - - self._amount = amount - - @property - def memo(self): - """Gets the memo of this TransactionDetail. # noqa: E501 - - - :return: The memo of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._memo - - @memo.setter - def memo(self, memo): - """Sets the memo of this TransactionDetail. - - - :param memo: The memo of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._memo = memo - - @property - def cleared(self): - """Gets the cleared of this TransactionDetail. # noqa: E501 - - The cleared status of the transaction # noqa: E501 - - :return: The cleared of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._cleared - - @cleared.setter - def cleared(self, cleared): - """Sets the cleared of this TransactionDetail. - - The cleared status of the transaction # noqa: E501 - - :param cleared: The cleared of this TransactionDetail. # noqa: E501 - :type: str - """ - allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 - if cleared not in allowed_values: - raise ValueError( - "Invalid value for `cleared` ({0}), must be one of {1}" # noqa: E501 - .format(cleared, allowed_values) - ) - - self._cleared = cleared - - @property - def approved(self): - """Gets the approved of this TransactionDetail. # noqa: E501 - - Whether or not the transaction is approved # noqa: E501 - - :return: The approved of this TransactionDetail. # noqa: E501 - :rtype: bool - """ - return self._approved - - @approved.setter - def approved(self, approved): - """Sets the approved of this TransactionDetail. - - Whether or not the transaction is approved # noqa: E501 - - :param approved: The approved of this TransactionDetail. # noqa: E501 - :type: bool - """ - - self._approved = approved - - @property - def flag_color(self): - """Gets the flag_color of this TransactionDetail. # noqa: E501 - - The transaction flag # noqa: E501 - - :return: The flag_color of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._flag_color - - @flag_color.setter - def flag_color(self, flag_color): - """Sets the flag_color of this TransactionDetail. - - The transaction flag # noqa: E501 - - :param flag_color: The flag_color of this TransactionDetail. # noqa: E501 - :type: str - """ - allowed_values = ["red", "orange", "yellow", "green", "blue", "purple", None] # noqa: E501 - if flag_color not in allowed_values: - raise ValueError( - "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 - .format(flag_color, allowed_values) - ) - - self._flag_color = flag_color - - @property - def account_id(self): - """Gets the account_id of this TransactionDetail. # noqa: E501 - - - :return: The account_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._account_id - - @account_id.setter - def account_id(self, account_id): - """Sets the account_id of this TransactionDetail. - - - :param account_id: The account_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._account_id = account_id - - @property - def payee_id(self): - """Gets the payee_id of this TransactionDetail. # noqa: E501 - - - :return: The payee_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._payee_id - - @payee_id.setter - def payee_id(self, payee_id): - """Sets the payee_id of this TransactionDetail. - - - :param payee_id: The payee_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._payee_id = payee_id - - @property - def category_id(self): - """Gets the category_id of this TransactionDetail. # noqa: E501 - - - :return: The category_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._category_id - - @category_id.setter - def category_id(self, category_id): - """Sets the category_id of this TransactionDetail. - - - :param category_id: The category_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._category_id = category_id - - @property - def transfer_account_id(self): - """Gets the transfer_account_id of this TransactionDetail. # noqa: E501 - - If a transfer transaction, the account to which it transfers # noqa: E501 - - :return: The transfer_account_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._transfer_account_id - - @transfer_account_id.setter - def transfer_account_id(self, transfer_account_id): - """Sets the transfer_account_id of this TransactionDetail. - - If a transfer transaction, the account to which it transfers # noqa: E501 - - :param transfer_account_id: The transfer_account_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._transfer_account_id = transfer_account_id - - @property - def transfer_transaction_id(self): - """Gets the transfer_transaction_id of this TransactionDetail. # noqa: E501 - - If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 - - :return: The transfer_transaction_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._transfer_transaction_id - - @transfer_transaction_id.setter - def transfer_transaction_id(self, transfer_transaction_id): - """Sets the transfer_transaction_id of this TransactionDetail. - - If a transfer transaction, the id of transaction on the other side of the transfer # noqa: E501 - - :param transfer_transaction_id: The transfer_transaction_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._transfer_transaction_id = transfer_transaction_id - - @property - def matched_transaction_id(self): - """Gets the matched_transaction_id of this TransactionDetail. # noqa: E501 - - If transaction is matched, the id of the matched transaction # noqa: E501 - - :return: The matched_transaction_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._matched_transaction_id - - @matched_transaction_id.setter - def matched_transaction_id(self, matched_transaction_id): - """Sets the matched_transaction_id of this TransactionDetail. - - If transaction is matched, the id of the matched transaction # noqa: E501 - - :param matched_transaction_id: The matched_transaction_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._matched_transaction_id = matched_transaction_id - - @property - def import_id(self): - """Gets the import_id of this TransactionDetail. # noqa: E501 - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :return: The import_id of this TransactionDetail. # noqa: E501 - :rtype: str - """ - return self._import_id - - @import_id.setter - def import_id(self, import_id): - """Sets the import_id of this TransactionDetail. - - If the Transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. # noqa: E501 - - :param import_id: The import_id of this TransactionDetail. # noqa: E501 - :type: str - """ - - self._import_id = import_id - - @property - def deleted(self): - """Gets the deleted of this TransactionDetail. # noqa: E501 - - Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 - - :return: The deleted of this TransactionDetail. # noqa: E501 - :rtype: bool - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this TransactionDetail. - - Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. # noqa: E501 - - :param deleted: The deleted of this TransactionDetail. # noqa: E501 - :type: bool - """ - - self._deleted = deleted - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index e621c16..cb60044 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.transaction_wrapper import TransactionWrapper # noqa: F401,E501 class TransactionResponse(object): @@ -30,7 +29,7 @@ class TransactionResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'TransactionWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this TransactionResponse. # noqa: E501 - :rtype: TransactionWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this TransactionResponse. # noqa: E501 - :type: TransactionWrapper + :type: object """ self._data = data diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index 8e8b261..162ee21 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -85,17 +85,25 @@ def __init__(self, id=None, _date=None, amount=None, memo=None, cleared=None, ap self.id = id self._date = _date self.amount = amount - self.memo = memo + if memo is not None: + self.memo = memo self.cleared = cleared self.approved = approved - self.flag_color = flag_color + if flag_color is not None: + self.flag_color = flag_color self.account_id = account_id - self.payee_id = payee_id - self.category_id = category_id - self.transfer_account_id = transfer_account_id - self.transfer_transaction_id = transfer_transaction_id - self.matched_transaction_id = matched_transaction_id - self.import_id = import_id + if payee_id is not None: + self.payee_id = payee_id + if category_id is not None: + self.category_id = category_id + if transfer_account_id is not None: + self.transfer_account_id = transfer_account_id + if transfer_transaction_id is not None: + self.transfer_transaction_id = transfer_transaction_id + if matched_transaction_id is not None: + self.matched_transaction_id = matched_transaction_id + if import_id is not None: + self.import_id = import_id self.deleted = deleted @property @@ -123,6 +131,7 @@ def id(self, id): def _date(self): """Gets the _date of this TransactionSummary. # noqa: E501 + The transaction date in ISO format (e.g. 2016-12-01) # noqa: E501 :return: The _date of this TransactionSummary. # noqa: E501 :rtype: date @@ -133,6 +142,7 @@ def _date(self): def _date(self, _date): """Sets the _date of this TransactionSummary. + The transaction date in ISO format (e.g. 2016-12-01) # noqa: E501 :param _date: The _date of this TransactionSummary. # noqa: E501 :type: date diff --git a/ynab/models/transactions_import_response.py b/ynab/models/transactions_import_response.py new file mode 100644 index 0000000..af7120a --- /dev/null +++ b/ynab/models/transactions_import_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class TransactionsImportResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'object' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """TransactionsImportResponse - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + self.data = data + + @property + def data(self): + """Gets the data of this TransactionsImportResponse. # noqa: E501 + + + :return: The data of this TransactionsImportResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TransactionsImportResponse. + + + :param data: The data of this TransactionsImportResponse. # noqa: E501 + :type: object + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TransactionsImportResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionsImportResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index 57e1765..f827597 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.transactions_wrapper import TransactionsWrapper # noqa: F401,E501 class TransactionsResponse(object): @@ -30,7 +29,7 @@ class TransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'TransactionsWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this TransactionsResponse. # noqa: E501 - :rtype: TransactionsWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this TransactionsResponse. # noqa: E501 - :type: TransactionsWrapper + :type: object """ self._data = data diff --git a/ynab/models/update_transaction.py b/ynab/models/update_transaction.py new file mode 100644 index 0000000..255765f --- /dev/null +++ b/ynab/models/update_transaction.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.save_sub_transaction import SaveSubTransaction # noqa: F401,E501 +from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 + + +class UpdateTransaction(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'account_id': 'str', + '_date': 'date', + 'amount': 'int', + 'payee_id': 'str', + 'payee_name': 'str', + 'category_id': 'str', + 'memo': 'str', + 'cleared': 'str', + 'approved': 'bool', + 'flag_color': 'str', + 'import_id': 'str', + 'subtransactions': 'list[SaveSubTransaction]' + } + + attribute_map = { + 'account_id': 'account_id', + '_date': 'date', + 'amount': 'amount', + 'payee_id': 'payee_id', + 'payee_name': 'payee_name', + 'category_id': 'category_id', + 'memo': 'memo', + 'cleared': 'cleared', + 'approved': 'approved', + 'flag_color': 'flag_color', + 'import_id': 'import_id', + 'subtransactions': 'subtransactions' + } + + def __init__(self, account_id=None, _date=None, amount=None, payee_id=None, payee_name=None, category_id=None, memo=None, cleared=None, approved=None, flag_color=None, import_id=None, subtransactions=None): # noqa: E501 + """UpdateTransaction - a model defined in Swagger""" # noqa: E501 + self._account_id = None + self.__date = None + self._amount = None + self._payee_id = None + self._payee_name = None + self._category_id = None + self._memo = None + self._cleared = None + self._approved = None + self._flag_color = None + self._import_id = None + self._subtransactions = None + self.discriminator = None + self.account_id = account_id + self._date = _date + self.amount = amount + if payee_id is not None: + self.payee_id = payee_id + if payee_name is not None: + self.payee_name = payee_name + if category_id is not None: + self.category_id = category_id + if memo is not None: + self.memo = memo + if cleared is not None: + self.cleared = cleared + if approved is not None: + self.approved = approved + if flag_color is not None: + self.flag_color = flag_color + if import_id is not None: + self.import_id = import_id + if subtransactions is not None: + self.subtransactions = subtransactions + + @property + def account_id(self): + """Gets the account_id of this UpdateTransaction. # noqa: E501 + + + :return: The account_id of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._account_id + + @account_id.setter + def account_id(self, account_id): + """Sets the account_id of this UpdateTransaction. + + + :param account_id: The account_id of this UpdateTransaction. # noqa: E501 + :type: str + """ + if account_id is None: + raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 + + self._account_id = account_id + + @property + def _date(self): + """Gets the _date of this UpdateTransaction. # noqa: E501 + + 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. # noqa: E501 + + :return: The _date of this UpdateTransaction. # noqa: E501 + :rtype: date + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this UpdateTransaction. + + 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. # noqa: E501 + + :param _date: The _date of this UpdateTransaction. # noqa: E501 + :type: date + """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 + + self.__date = _date + + @property + def amount(self): + """Gets the amount of this UpdateTransaction. # noqa: E501 + + The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. # noqa: E501 + + :return: The amount of this UpdateTransaction. # noqa: E501 + :rtype: int + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UpdateTransaction. + + The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. # noqa: E501 + + :param amount: The amount of this UpdateTransaction. # noqa: E501 + :type: int + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def payee_id(self): + """Gets the payee_id of this UpdateTransaction. # noqa: E501 + + 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. # noqa: E501 + + :return: The payee_id of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._payee_id + + @payee_id.setter + def payee_id(self, payee_id): + """Sets the payee_id of this UpdateTransaction. + + 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. # noqa: E501 + + :param payee_id: The payee_id of this UpdateTransaction. # noqa: E501 + :type: str + """ + + self._payee_id = payee_id + + @property + def payee_name(self): + """Gets the payee_name of this UpdateTransaction. # noqa: E501 + + 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. # noqa: E501 + + :return: The payee_name of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._payee_name + + @payee_name.setter + def payee_name(self, payee_name): + """Sets the payee_name of this UpdateTransaction. + + 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. # noqa: E501 + + :param payee_name: The payee_name of this UpdateTransaction. # noqa: E501 + :type: str + """ + + self._payee_name = payee_name + + @property + def category_id(self): + """Gets the category_id of this UpdateTransaction. # noqa: E501 + + 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. # noqa: E501 + + :return: The category_id of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this UpdateTransaction. + + 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. # noqa: E501 + + :param category_id: The category_id of this UpdateTransaction. # noqa: E501 + :type: str + """ + + self._category_id = category_id + + @property + def memo(self): + """Gets the memo of this UpdateTransaction. # noqa: E501 + + + :return: The memo of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this UpdateTransaction. + + + :param memo: The memo of this UpdateTransaction. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def cleared(self): + """Gets the cleared of this UpdateTransaction. # noqa: E501 + + The cleared status of the transaction # noqa: E501 + + :return: The cleared of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._cleared + + @cleared.setter + def cleared(self, cleared): + """Sets the cleared of this UpdateTransaction. + + The cleared status of the transaction # noqa: E501 + + :param cleared: The cleared of this UpdateTransaction. # noqa: E501 + :type: str + """ + allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 + if cleared not in allowed_values: + raise ValueError( + "Invalid value for `cleared` ({0}), must be one of {1}" # noqa: E501 + .format(cleared, allowed_values) + ) + + self._cleared = cleared + + @property + def approved(self): + """Gets the approved of this UpdateTransaction. # noqa: E501 + + Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. # noqa: E501 + + :return: The approved of this UpdateTransaction. # noqa: E501 + :rtype: bool + """ + return self._approved + + @approved.setter + def approved(self, approved): + """Sets the approved of this UpdateTransaction. + + Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. # noqa: E501 + + :param approved: The approved of this UpdateTransaction. # noqa: E501 + :type: bool + """ + + self._approved = approved + + @property + def flag_color(self): + """Gets the flag_color of this UpdateTransaction. # noqa: E501 + + The transaction flag # noqa: E501 + + :return: The flag_color of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._flag_color + + @flag_color.setter + def flag_color(self, flag_color): + """Sets the flag_color of this UpdateTransaction. + + The transaction flag # noqa: E501 + + :param flag_color: The flag_color of this UpdateTransaction. # noqa: E501 + :type: str + """ + allowed_values = ["red", "orange", "yellow", "green", "blue", "purple"] # noqa: E501 + if flag_color not in allowed_values: + raise ValueError( + "Invalid value for `flag_color` ({0}), must be one of {1}" # noqa: E501 + .format(flag_color, allowed_values) + ) + + self._flag_color = flag_color + + @property + def import_id(self): + """Gets the import_id of this UpdateTransaction. # noqa: E501 + + 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.

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.

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). # noqa: E501 + + :return: The import_id of this UpdateTransaction. # noqa: E501 + :rtype: str + """ + return self._import_id + + @import_id.setter + def import_id(self, import_id): + """Sets the import_id of this UpdateTransaction. + + 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.

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.

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). # noqa: E501 + + :param import_id: The import_id of this UpdateTransaction. # noqa: E501 + :type: str + """ + + self._import_id = import_id + + @property + def subtransactions(self): + """Gets the subtransactions of this UpdateTransaction. # noqa: E501 + + An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. # noqa: E501 + + :return: The subtransactions of this UpdateTransaction. # noqa: E501 + :rtype: list[SaveSubTransaction] + """ + return self._subtransactions + + @subtransactions.setter + def subtransactions(self, subtransactions): + """Sets the subtransactions of this UpdateTransaction. + + An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. # noqa: E501 + + :param subtransactions: The subtransactions of this UpdateTransaction. # noqa: E501 + :type: list[SaveSubTransaction] + """ + + self._subtransactions = subtransactions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdateTransaction, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateTransaction): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/update_transactions_wrapper.py b/ynab/models/update_transactions_wrapper.py new file mode 100644 index 0000000..2780546 --- /dev/null +++ b/ynab/models/update_transactions_wrapper.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from ynab.models.update_transaction import UpdateTransaction # noqa: F401,E501 + + +class UpdateTransactionsWrapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transactions': 'list[UpdateTransaction]' + } + + attribute_map = { + 'transactions': 'transactions' + } + + def __init__(self, transactions=None): # noqa: E501 + """UpdateTransactionsWrapper - a model defined in Swagger""" # noqa: E501 + self._transactions = None + self.discriminator = None + self.transactions = transactions + + @property + def transactions(self): + """Gets the transactions of this UpdateTransactionsWrapper. # noqa: E501 + + + :return: The transactions of this UpdateTransactionsWrapper. # noqa: E501 + :rtype: list[UpdateTransaction] + """ + return self._transactions + + @transactions.setter + def transactions(self, transactions): + """Sets the transactions of this UpdateTransactionsWrapper. + + + :param transactions: The transactions of this UpdateTransactionsWrapper. # noqa: E501 + :type: list[UpdateTransaction] + """ + if transactions is None: + raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + + self._transactions = transactions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdateTransactionsWrapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateTransactionsWrapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index 8262d17..307b2c2 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -14,7 +14,6 @@ import re # noqa: F401 import six -from ynab.models.user_wrapper import UserWrapper # noqa: F401,E501 class UserResponse(object): @@ -30,7 +29,7 @@ class UserResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'UserWrapper' + 'data': 'object' } attribute_map = { @@ -49,7 +48,7 @@ def data(self): :return: The data of this UserResponse. # noqa: E501 - :rtype: UserWrapper + :rtype: object """ return self._data @@ -59,7 +58,7 @@ def data(self, data): :param data: The data of this UserResponse. # noqa: E501 - :type: UserWrapper + :type: object """ self._data = data From 71257a32a73f80df2bff15de494213438beabe2d Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 12 Jun 2022 17:04:06 -0700 Subject: [PATCH 13/14] Updated swagger-codegen to fix generation issues. --- .swagger-codegen/VERSION | 2 +- .travis.yml | 1 - README.md | 78 ++++-- docs/AccountResponse.md | 2 +- docs/AccountResponseData.md | 9 + docs/AccountsResponse.md | 2 +- docs/AccountsResponseData.md | 10 + docs/BudgetDetailResponse.md | 2 +- docs/BudgetDetailResponseData.md | 10 + docs/BudgetSettingsResponse.md | 2 +- docs/BudgetSettingsResponseData.md | 9 + docs/BudgetSummaryResponse.md | 2 +- docs/BudgetSummaryResponseData.md | 10 + docs/BulkResponse.md | 2 +- docs/BulkResponseData.md | 9 + docs/BulkResponseDataBulk.md | 10 + docs/CategoriesResponse.md | 2 +- docs/CategoriesResponseData.md | 10 + docs/CategoryResponse.md | 2 +- docs/CategoryResponseData.md | 9 + docs/HybridTransactionsResponse.md | 2 +- docs/HybridTransactionsResponseData.md | 9 + docs/MonthDetailResponse.md | 2 +- docs/MonthDetailResponseData.md | 9 + docs/MonthSummariesResponse.md | 2 +- docs/MonthSummariesResponseData.md | 10 + docs/PayeeLocationResponse.md | 2 +- docs/PayeeLocationResponseData.md | 9 + docs/PayeeLocationsResponse.md | 2 +- docs/PayeeLocationsResponseData.md | 9 + docs/PayeeResponse.md | 2 +- docs/PayeeResponseData.md | 9 + docs/PayeesResponse.md | 2 +- docs/PayeesResponseData.md | 10 + docs/SaveCategoryResponse.md | 2 +- docs/SaveCategoryResponseData.md | 10 + docs/SaveTransactionsResponse.md | 2 +- docs/SaveTransactionsResponseData.md | 13 + docs/ScheduledTransactionResponse.md | 2 +- docs/ScheduledTransactionResponseData.md | 9 + docs/ScheduledTransactionsResponse.md | 2 +- docs/ScheduledTransactionsResponseData.md | 10 + docs/TransactionResponse.md | 2 +- docs/TransactionResponseData.md | 9 + docs/TransactionsImportResponse.md | 2 +- docs/TransactionsImportResponseData.md | 9 + docs/TransactionsResponse.md | 2 +- docs/TransactionsResponseData.md | 10 + docs/UserResponse.md | 2 +- docs/UserResponseData.md | 9 + test/test_account_response_data.py | 39 +++ test/test_accounts_api.py | 2 +- test/test_accounts_response_data.py | 39 +++ test/test_budget_detail_response_data.py | 39 +++ test/test_budget_settings_response_data.py | 39 +++ test/test_budget_summary_response_data.py | 39 +++ test/test_budgets_api.py | 2 +- test/test_bulk_response_data.py | 39 +++ test/test_bulk_response_data_bulk.py | 39 +++ test/test_categories_api.py | 2 +- test/test_categories_response_data.py | 39 +++ test/test_category_response_data.py | 39 +++ test/test_deprecated_api.py | 2 +- .../test_hybrid_transactions_response_data.py | 39 +++ test/test_month_detail_response_data.py | 39 +++ test/test_month_summaries_response_data.py | 39 +++ test/test_months_api.py | 2 +- test/test_payee_location_response_data.py | 39 +++ test/test_payee_locations_api.py | 2 +- test/test_payee_locations_response_data.py | 39 +++ test/test_payee_response_data.py | 39 +++ test/test_payees_api.py | 2 +- test/test_payees_response_data.py | 39 +++ test/test_save_account.py | 2 +- test/test_save_account_wrapper.py | 2 +- test/test_save_category_response.py | 2 +- test/test_save_category_response_data.py | 39 +++ test/test_save_sub_transaction.py | 2 +- test/test_save_transactions_response_data.py | 39 +++ ...est_scheduled_transaction_response_data.py | 39 +++ test/test_scheduled_transactions_api.py | 2 +- ...st_scheduled_transactions_response_data.py | 39 +++ test/test_transaction_response_data.py | 39 +++ test/test_transactions_api.py | 2 +- test/test_transactions_import_response.py | 2 +- .../test_transactions_import_response_data.py | 39 +++ test/test_transactions_response_data.py | 39 +++ test/test_update_transaction.py | 2 +- test/test_update_transactions_wrapper.py | 2 +- test/test_user_api.py | 2 +- test/test_user_response_data.py | 39 +++ tox.ini | 2 +- ynab/__init__.py | 52 ++-- ynab/api/accounts_api.py | 119 +++++++++- ynab/api/budgets_api.py | 18 +- ynab/api/categories_api.py | 34 +-- ynab/api/deprecated_api.py | 4 +- ynab/api/months_api.py | 12 +- ynab/api/payee_locations_api.py | 16 +- ynab/api/payees_api.py | 16 +- ynab/api/scheduled_transactions_api.py | 14 +- ynab/api/transactions_api.py | 179 ++++++++++---- ynab/api_client.py | 12 +- ynab/configuration.py | 17 +- ynab/models/__init__.py | 24 ++ ynab/models/account.py | 1 - ynab/models/account_response.py | 7 +- ynab/models/account_response_data.py | 111 +++++++++ ynab/models/accounts_response.py | 7 +- ynab/models/accounts_response_data.py | 140 +++++++++++ ynab/models/budget_detail.py | 20 +- ynab/models/budget_detail_response.py | 7 +- ynab/models/budget_detail_response_data.py | 140 +++++++++++ ynab/models/budget_settings.py | 3 - ynab/models/budget_settings_response.py | 7 +- ynab/models/budget_settings_response_data.py | 111 +++++++++ ynab/models/budget_summary.py | 4 - ynab/models/budget_summary_response.py | 7 +- ynab/models/budget_summary_response_data.py | 137 +++++++++++ ynab/models/bulk_response.py | 7 +- ynab/models/bulk_response_data.py | 111 +++++++++ ynab/models/bulk_response_data_bulk.py | 142 +++++++++++ ynab/models/bulk_transactions.py | 2 - ynab/models/categories_response.py | 7 +- ynab/models/categories_response_data.py | 140 +++++++++++ ynab/models/category.py | 1 - ynab/models/category_group.py | 1 - ynab/models/category_group_with_categories.py | 9 +- ynab/models/category_response.py | 7 +- ynab/models/category_response_data.py | 111 +++++++++ ynab/models/currency_format.py | 1 - ynab/models/date_format.py | 1 - ynab/models/error_detail.py | 1 - ynab/models/error_response.py | 2 - ynab/models/hybrid_transaction.py | 8 +- ynab/models/hybrid_transactions_response.py | 7 +- .../hybrid_transactions_response_data.py | 111 +++++++++ ynab/models/month_detail.py | 9 +- ynab/models/month_detail_response.py | 7 +- ynab/models/month_detail_response_data.py | 111 +++++++++ ynab/models/month_summaries_response.py | 7 +- ynab/models/month_summaries_response_data.py | 140 +++++++++++ ynab/models/month_summary.py | 1 - ynab/models/payee.py | 1 - ynab/models/payee_location.py | 1 - ynab/models/payee_location_response.py | 7 +- ynab/models/payee_location_response_data.py | 111 +++++++++ ynab/models/payee_locations_response.py | 7 +- ynab/models/payee_locations_response_data.py | 111 +++++++++ ynab/models/payee_response.py | 7 +- ynab/models/payee_response_data.py | 111 +++++++++ ynab/models/payees_response.py | 7 +- ynab/models/payees_response_data.py | 140 +++++++++++ ynab/models/save_account.py | 7 - ynab/models/save_account_wrapper.py | 4 - ynab/models/save_category_response.py | 9 +- ynab/models/save_category_response_data.py | 140 +++++++++++ ynab/models/save_month_category.py | 1 - ynab/models/save_month_category_wrapper.py | 2 - ynab/models/save_sub_transaction.py | 3 - ynab/models/save_transaction.py | 2 - ynab/models/save_transaction_wrapper.py | 2 - ynab/models/save_transactions_response.py | 7 +- .../models/save_transactions_response_data.py | 224 ++++++++++++++++++ ynab/models/save_transactions_wrapper.py | 2 - ynab/models/scheduled_sub_transaction.py | 1 - ynab/models/scheduled_transaction_detail.py | 9 +- ynab/models/scheduled_transaction_response.py | 7 +- .../scheduled_transaction_response_data.py | 111 +++++++++ ynab/models/scheduled_transaction_summary.py | 1 - .../models/scheduled_transactions_response.py | 7 +- .../scheduled_transactions_response_data.py | 140 +++++++++++ ynab/models/sub_transaction.py | 1 - ynab/models/transaction_detail.py | 9 +- ynab/models/transaction_response.py | 7 +- ynab/models/transaction_response_data.py | 111 +++++++++ ynab/models/transaction_summary.py | 1 - ynab/models/transactions_import_response.py | 9 +- .../transactions_import_response_data.py | 113 +++++++++ ynab/models/transactions_response.py | 7 +- ynab/models/transactions_response_data.py | 140 +++++++++++ ynab/models/update_transaction.py | 9 - ynab/models/update_transactions_wrapper.py | 4 - ynab/models/user.py | 1 - ynab/models/user_response.py | 7 +- ynab/models/user_response_data.py | 111 +++++++++ ynab/rest.py | 7 +- 187 files changed, 4822 insertions(+), 389 deletions(-) create mode 100644 docs/AccountResponseData.md create mode 100644 docs/AccountsResponseData.md create mode 100644 docs/BudgetDetailResponseData.md create mode 100644 docs/BudgetSettingsResponseData.md create mode 100644 docs/BudgetSummaryResponseData.md create mode 100644 docs/BulkResponseData.md create mode 100644 docs/BulkResponseDataBulk.md create mode 100644 docs/CategoriesResponseData.md create mode 100644 docs/CategoryResponseData.md create mode 100644 docs/HybridTransactionsResponseData.md create mode 100644 docs/MonthDetailResponseData.md create mode 100644 docs/MonthSummariesResponseData.md create mode 100644 docs/PayeeLocationResponseData.md create mode 100644 docs/PayeeLocationsResponseData.md create mode 100644 docs/PayeeResponseData.md create mode 100644 docs/PayeesResponseData.md create mode 100644 docs/SaveCategoryResponseData.md create mode 100644 docs/SaveTransactionsResponseData.md create mode 100644 docs/ScheduledTransactionResponseData.md create mode 100644 docs/ScheduledTransactionsResponseData.md create mode 100644 docs/TransactionResponseData.md create mode 100644 docs/TransactionsImportResponseData.md create mode 100644 docs/TransactionsResponseData.md create mode 100644 docs/UserResponseData.md create mode 100644 test/test_account_response_data.py create mode 100644 test/test_accounts_response_data.py create mode 100644 test/test_budget_detail_response_data.py create mode 100644 test/test_budget_settings_response_data.py create mode 100644 test/test_budget_summary_response_data.py create mode 100644 test/test_bulk_response_data.py create mode 100644 test/test_bulk_response_data_bulk.py create mode 100644 test/test_categories_response_data.py create mode 100644 test/test_category_response_data.py create mode 100644 test/test_hybrid_transactions_response_data.py create mode 100644 test/test_month_detail_response_data.py create mode 100644 test/test_month_summaries_response_data.py create mode 100644 test/test_payee_location_response_data.py create mode 100644 test/test_payee_locations_response_data.py create mode 100644 test/test_payee_response_data.py create mode 100644 test/test_payees_response_data.py create mode 100644 test/test_save_category_response_data.py create mode 100644 test/test_save_transactions_response_data.py create mode 100644 test/test_scheduled_transaction_response_data.py create mode 100644 test/test_scheduled_transactions_response_data.py create mode 100644 test/test_transaction_response_data.py create mode 100644 test/test_transactions_import_response_data.py create mode 100644 test/test_transactions_response_data.py create mode 100644 test/test_user_response_data.py create mode 100644 ynab/models/account_response_data.py create mode 100644 ynab/models/accounts_response_data.py create mode 100644 ynab/models/budget_detail_response_data.py create mode 100644 ynab/models/budget_settings_response_data.py create mode 100644 ynab/models/budget_summary_response_data.py create mode 100644 ynab/models/bulk_response_data.py create mode 100644 ynab/models/bulk_response_data_bulk.py create mode 100644 ynab/models/categories_response_data.py create mode 100644 ynab/models/category_response_data.py create mode 100644 ynab/models/hybrid_transactions_response_data.py create mode 100644 ynab/models/month_detail_response_data.py create mode 100644 ynab/models/month_summaries_response_data.py create mode 100644 ynab/models/payee_location_response_data.py create mode 100644 ynab/models/payee_locations_response_data.py create mode 100644 ynab/models/payee_response_data.py create mode 100644 ynab/models/payees_response_data.py create mode 100644 ynab/models/save_category_response_data.py create mode 100644 ynab/models/save_transactions_response_data.py create mode 100644 ynab/models/scheduled_transaction_response_data.py create mode 100644 ynab/models/scheduled_transactions_response_data.py create mode 100644 ynab/models/transaction_response_data.py create mode 100644 ynab/models/transactions_import_response_data.py create mode 100644 ynab/models/transactions_response_data.py create mode 100644 ynab/models/user_response_data.py diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index e46454b..10bbf27 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.8 \ No newline at end of file +3.0.34 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 86211e2..dd6c445 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/README.md b/README.md index df0477d..7f1a332 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,25 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) +body = ynab.SaveAccountWrapper() # SaveAccountWrapper | The account to create. +budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) + +try: + # Create a new account + api_response = api_instance.create_account(body, budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountsApi->create_account: %s\n" % e) + +# Configure API key authorization: bearer +configuration = ynab.Configuration() +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # str | The id of the account try: @@ -77,8 +95,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = ynab.AccountsApi(ynab.ApiClient(configuration)) -budget_id = 'budget_id_example' # str | The id of the budget (\"last-used\" can also be used to specify the last used budget) -last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional) +budget_id = 'budget_id_example' # str | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). +last_knowledge_of_server = 789 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: # Account list @@ -94,6 +112,7 @@ All URIs are relative to *https://api.youneedabudget.com/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AccountsApi* | [**create_account**](docs/AccountsApi.md#create_account) | **POST** /budgets/{budget_id}/accounts | Create a new account *AccountsApi* | [**get_account_by_id**](docs/AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account *AccountsApi* | [**get_accounts**](docs/AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list *BudgetsApi* | [**get_budget_by_id**](docs/BudgetsApi.md#get_budget_by_id) | **GET** /budgets/{budget_id} | Single budget @@ -119,6 +138,7 @@ Class | Method | HTTP request | Description *TransactionsApi* | [**get_transactions_by_account**](docs/TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions *TransactionsApi* | [**get_transactions_by_category**](docs/TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions *TransactionsApi* | [**get_transactions_by_payee**](docs/TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions +*TransactionsApi* | [**import_transactions**](docs/TransactionsApi.md#import_transactions) | **POST** /budgets/{budget_id}/transactions/import | Import transactions *TransactionsApi* | [**update_transaction**](docs/TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction *TransactionsApi* | [**update_transactions**](docs/TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions *UserApi* | [**get_user**](docs/UserApi.md#get_user) | **GET** /user | User info @@ -127,75 +147,85 @@ Class | Method | HTTP request | Description - [Account](docs/Account.md) - [AccountResponse](docs/AccountResponse.md) - - [AccountWrapper](docs/AccountWrapper.md) + - [AccountResponseData](docs/AccountResponseData.md) - [AccountsResponse](docs/AccountsResponse.md) - - [AccountsWrapper](docs/AccountsWrapper.md) + - [AccountsResponseData](docs/AccountsResponseData.md) - [BudgetDetail](docs/BudgetDetail.md) - [BudgetDetailResponse](docs/BudgetDetailResponse.md) - - [BudgetDetailWrapper](docs/BudgetDetailWrapper.md) + - [BudgetDetailResponseData](docs/BudgetDetailResponseData.md) - [BudgetSettings](docs/BudgetSettings.md) - [BudgetSettingsResponse](docs/BudgetSettingsResponse.md) - - [BudgetSettingsWrapper](docs/BudgetSettingsWrapper.md) + - [BudgetSettingsResponseData](docs/BudgetSettingsResponseData.md) - [BudgetSummary](docs/BudgetSummary.md) - [BudgetSummaryResponse](docs/BudgetSummaryResponse.md) - - [BudgetSummaryWrapper](docs/BudgetSummaryWrapper.md) - - [BulkIdWrapper](docs/BulkIdWrapper.md) - - [BulkIds](docs/BulkIds.md) + - [BudgetSummaryResponseData](docs/BudgetSummaryResponseData.md) - [BulkResponse](docs/BulkResponse.md) + - [BulkResponseData](docs/BulkResponseData.md) + - [BulkResponseDataBulk](docs/BulkResponseDataBulk.md) - [BulkTransactions](docs/BulkTransactions.md) - [CategoriesResponse](docs/CategoriesResponse.md) + - [CategoriesResponseData](docs/CategoriesResponseData.md) - [Category](docs/Category.md) - [CategoryGroup](docs/CategoryGroup.md) - [CategoryGroupWithCategories](docs/CategoryGroupWithCategories.md) - - [CategoryGroupsWrapper](docs/CategoryGroupsWrapper.md) - [CategoryResponse](docs/CategoryResponse.md) - - [CategoryWrapper](docs/CategoryWrapper.md) + - [CategoryResponseData](docs/CategoryResponseData.md) - [CurrencyFormat](docs/CurrencyFormat.md) - [DateFormat](docs/DateFormat.md) - [ErrorDetail](docs/ErrorDetail.md) - [ErrorResponse](docs/ErrorResponse.md) - [HybridTransaction](docs/HybridTransaction.md) - [HybridTransactionsResponse](docs/HybridTransactionsResponse.md) - - [HybridTransactionsWrapper](docs/HybridTransactionsWrapper.md) + - [HybridTransactionsResponseData](docs/HybridTransactionsResponseData.md) - [MonthDetail](docs/MonthDetail.md) - [MonthDetailResponse](docs/MonthDetailResponse.md) - - [MonthDetailWrapper](docs/MonthDetailWrapper.md) + - [MonthDetailResponseData](docs/MonthDetailResponseData.md) - [MonthSummariesResponse](docs/MonthSummariesResponse.md) - - [MonthSummariesWrapper](docs/MonthSummariesWrapper.md) + - [MonthSummariesResponseData](docs/MonthSummariesResponseData.md) - [MonthSummary](docs/MonthSummary.md) - [Payee](docs/Payee.md) - [PayeeLocation](docs/PayeeLocation.md) - [PayeeLocationResponse](docs/PayeeLocationResponse.md) - - [PayeeLocationWrapper](docs/PayeeLocationWrapper.md) + - [PayeeLocationResponseData](docs/PayeeLocationResponseData.md) - [PayeeLocationsResponse](docs/PayeeLocationsResponse.md) - - [PayeeLocationsWrapper](docs/PayeeLocationsWrapper.md) + - [PayeeLocationsResponseData](docs/PayeeLocationsResponseData.md) - [PayeeResponse](docs/PayeeResponse.md) - - [PayeeWrapper](docs/PayeeWrapper.md) + - [PayeeResponseData](docs/PayeeResponseData.md) - [PayeesResponse](docs/PayeesResponse.md) - - [PayeesWrapper](docs/PayeesWrapper.md) + - [PayeesResponseData](docs/PayeesResponseData.md) + - [SaveAccount](docs/SaveAccount.md) + - [SaveAccountWrapper](docs/SaveAccountWrapper.md) + - [SaveCategoryResponse](docs/SaveCategoryResponse.md) + - [SaveCategoryResponseData](docs/SaveCategoryResponseData.md) - [SaveMonthCategory](docs/SaveMonthCategory.md) - [SaveMonthCategoryWrapper](docs/SaveMonthCategoryWrapper.md) + - [SaveSubTransaction](docs/SaveSubTransaction.md) - [SaveTransaction](docs/SaveTransaction.md) - [SaveTransactionWrapper](docs/SaveTransactionWrapper.md) - [SaveTransactionsResponse](docs/SaveTransactionsResponse.md) + - [SaveTransactionsResponseData](docs/SaveTransactionsResponseData.md) - [SaveTransactionsWrapper](docs/SaveTransactionsWrapper.md) - [ScheduledSubTransaction](docs/ScheduledSubTransaction.md) - [ScheduledTransactionDetail](docs/ScheduledTransactionDetail.md) - [ScheduledTransactionResponse](docs/ScheduledTransactionResponse.md) + - [ScheduledTransactionResponseData](docs/ScheduledTransactionResponseData.md) - [ScheduledTransactionSummary](docs/ScheduledTransactionSummary.md) - - [ScheduledTransactionWrapper](docs/ScheduledTransactionWrapper.md) - [ScheduledTransactionsResponse](docs/ScheduledTransactionsResponse.md) - - [ScheduledTransactionsWrapper](docs/ScheduledTransactionsWrapper.md) + - [ScheduledTransactionsResponseData](docs/ScheduledTransactionsResponseData.md) - [SubTransaction](docs/SubTransaction.md) - [TransactionDetail](docs/TransactionDetail.md) - [TransactionResponse](docs/TransactionResponse.md) + - [TransactionResponseData](docs/TransactionResponseData.md) - [TransactionSummary](docs/TransactionSummary.md) - - [TransactionWrapper](docs/TransactionWrapper.md) + - [TransactionsImportResponse](docs/TransactionsImportResponse.md) + - [TransactionsImportResponseData](docs/TransactionsImportResponseData.md) - [TransactionsResponse](docs/TransactionsResponse.md) - - [TransactionsWrapper](docs/TransactionsWrapper.md) + - [TransactionsResponseData](docs/TransactionsResponseData.md) + - [UpdateTransaction](docs/UpdateTransaction.md) + - [UpdateTransactionsWrapper](docs/UpdateTransactionsWrapper.md) - [User](docs/User.md) - [UserResponse](docs/UserResponse.md) - - [UserWrapper](docs/UserWrapper.md) + - [UserResponseData](docs/UserResponseData.md) ## Documentation For Authorization diff --git a/docs/AccountResponse.md b/docs/AccountResponse.md index 43d9555..20cb464 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**AccountResponseData**](AccountResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountResponseData.md b/docs/AccountResponseData.md new file mode 100644 index 0000000..a7095fa --- /dev/null +++ b/docs/AccountResponseData.md @@ -0,0 +1,9 @@ +# AccountResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account** | [**Account**](Account.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AccountsResponse.md b/docs/AccountsResponse.md index cdc7a50..2d39380 100644 --- a/docs/AccountsResponse.md +++ b/docs/AccountsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**AccountsResponseData**](AccountsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountsResponseData.md b/docs/AccountsResponseData.md new file mode 100644 index 0000000..391591e --- /dev/null +++ b/docs/AccountsResponseData.md @@ -0,0 +1,10 @@ +# AccountsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**list[Account]**](Account.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BudgetDetailResponse.md b/docs/BudgetDetailResponse.md index 04162dc..867a268 100644 --- a/docs/BudgetDetailResponse.md +++ b/docs/BudgetDetailResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**BudgetDetailResponseData**](BudgetDetailResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetDetailResponseData.md b/docs/BudgetDetailResponseData.md new file mode 100644 index 0000000..d3be256 --- /dev/null +++ b/docs/BudgetDetailResponseData.md @@ -0,0 +1,10 @@ +# BudgetDetailResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budget** | [**BudgetDetail**](BudgetDetail.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BudgetSettingsResponse.md b/docs/BudgetSettingsResponse.md index b07691e..1b3f5c5 100644 --- a/docs/BudgetSettingsResponse.md +++ b/docs/BudgetSettingsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**BudgetSettingsResponseData**](BudgetSettingsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetSettingsResponseData.md b/docs/BudgetSettingsResponseData.md new file mode 100644 index 0000000..9c4d46f --- /dev/null +++ b/docs/BudgetSettingsResponseData.md @@ -0,0 +1,9 @@ +# BudgetSettingsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**BudgetSettings**](BudgetSettings.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BudgetSummaryResponse.md b/docs/BudgetSummaryResponse.md index cf979ca..f8eb36f 100644 --- a/docs/BudgetSummaryResponse.md +++ b/docs/BudgetSummaryResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**BudgetSummaryResponseData**](BudgetSummaryResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BudgetSummaryResponseData.md b/docs/BudgetSummaryResponseData.md new file mode 100644 index 0000000..c16a708 --- /dev/null +++ b/docs/BudgetSummaryResponseData.md @@ -0,0 +1,10 @@ +# BudgetSummaryResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budgets** | [**list[BudgetSummary]**](BudgetSummary.md) | | +**default_budget** | [**BudgetSummary**](BudgetSummary.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BulkResponse.md b/docs/BulkResponse.md index a0ed87f..a59c134 100644 --- a/docs/BulkResponse.md +++ b/docs/BulkResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**BulkResponseData**](BulkResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BulkResponseData.md b/docs/BulkResponseData.md new file mode 100644 index 0000000..171c89e --- /dev/null +++ b/docs/BulkResponseData.md @@ -0,0 +1,9 @@ +# BulkResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bulk** | [**BulkResponseDataBulk**](BulkResponseDataBulk.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BulkResponseDataBulk.md b/docs/BulkResponseDataBulk.md new file mode 100644 index 0000000..95d521a --- /dev/null +++ b/docs/BulkResponseDataBulk.md @@ -0,0 +1,10 @@ +# BulkResponseDataBulk + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_ids** | **list[str]** | The list of Transaction ids that were created. | +**duplicate_import_ids** | **list[str]** | If any Transactions were not created because they had an `import_id` matching a transaction already on the same account, the specified import_id(s) will be included in this list. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CategoriesResponse.md b/docs/CategoriesResponse.md index e8e6fcf..e885513 100644 --- a/docs/CategoriesResponse.md +++ b/docs/CategoriesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**CategoriesResponseData**](CategoriesResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CategoriesResponseData.md b/docs/CategoriesResponseData.md new file mode 100644 index 0000000..0e2b851 --- /dev/null +++ b/docs/CategoriesResponseData.md @@ -0,0 +1,10 @@ +# CategoriesResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_groups** | [**list[CategoryGroupWithCategories]**](CategoryGroupWithCategories.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CategoryResponse.md b/docs/CategoryResponse.md index aafecf1..cd5d65e 100644 --- a/docs/CategoryResponse.md +++ b/docs/CategoryResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**CategoryResponseData**](CategoryResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CategoryResponseData.md b/docs/CategoryResponseData.md new file mode 100644 index 0000000..c835283 --- /dev/null +++ b/docs/CategoryResponseData.md @@ -0,0 +1,9 @@ +# CategoryResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**Category**](Category.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/HybridTransactionsResponse.md b/docs/HybridTransactionsResponse.md index 5aba5bd..bf0e4ae 100644 --- a/docs/HybridTransactionsResponse.md +++ b/docs/HybridTransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**HybridTransactionsResponseData**](HybridTransactionsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/HybridTransactionsResponseData.md b/docs/HybridTransactionsResponseData.md new file mode 100644 index 0000000..7f0b715 --- /dev/null +++ b/docs/HybridTransactionsResponseData.md @@ -0,0 +1,9 @@ +# HybridTransactionsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactions** | [**list[HybridTransaction]**](HybridTransaction.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MonthDetailResponse.md b/docs/MonthDetailResponse.md index 041a8e6..d89c070 100644 --- a/docs/MonthDetailResponse.md +++ b/docs/MonthDetailResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**MonthDetailResponseData**](MonthDetailResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthDetailResponseData.md b/docs/MonthDetailResponseData.md new file mode 100644 index 0000000..c40cbbc --- /dev/null +++ b/docs/MonthDetailResponseData.md @@ -0,0 +1,9 @@ +# MonthDetailResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**month** | [**MonthDetail**](MonthDetail.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MonthSummariesResponse.md b/docs/MonthSummariesResponse.md index 8810b7c..1a5c91b 100644 --- a/docs/MonthSummariesResponse.md +++ b/docs/MonthSummariesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**MonthSummariesResponseData**](MonthSummariesResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MonthSummariesResponseData.md b/docs/MonthSummariesResponseData.md new file mode 100644 index 0000000..4b30b73 --- /dev/null +++ b/docs/MonthSummariesResponseData.md @@ -0,0 +1,10 @@ +# MonthSummariesResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**months** | [**list[MonthSummary]**](MonthSummary.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/PayeeLocationResponse.md b/docs/PayeeLocationResponse.md index b0c55ad..95a1423 100644 --- a/docs/PayeeLocationResponse.md +++ b/docs/PayeeLocationResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**PayeeLocationResponseData**](PayeeLocationResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeLocationResponseData.md b/docs/PayeeLocationResponseData.md new file mode 100644 index 0000000..40db184 --- /dev/null +++ b/docs/PayeeLocationResponseData.md @@ -0,0 +1,9 @@ +# PayeeLocationResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payee_location** | [**PayeeLocation**](PayeeLocation.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/PayeeLocationsResponse.md b/docs/PayeeLocationsResponse.md index 2504a57..c0ac6d6 100644 --- a/docs/PayeeLocationsResponse.md +++ b/docs/PayeeLocationsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**PayeeLocationsResponseData**](PayeeLocationsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeLocationsResponseData.md b/docs/PayeeLocationsResponseData.md new file mode 100644 index 0000000..6778668 --- /dev/null +++ b/docs/PayeeLocationsResponseData.md @@ -0,0 +1,9 @@ +# PayeeLocationsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payee_locations** | [**list[PayeeLocation]**](PayeeLocation.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/PayeeResponse.md b/docs/PayeeResponse.md index e57cc40..d0ec7f4 100644 --- a/docs/PayeeResponse.md +++ b/docs/PayeeResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**PayeeResponseData**](PayeeResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeeResponseData.md b/docs/PayeeResponseData.md new file mode 100644 index 0000000..588c000 --- /dev/null +++ b/docs/PayeeResponseData.md @@ -0,0 +1,9 @@ +# PayeeResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payee** | [**Payee**](Payee.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/PayeesResponse.md b/docs/PayeesResponse.md index 3fdc6c3..fb95607 100644 --- a/docs/PayeesResponse.md +++ b/docs/PayeesResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**PayeesResponseData**](PayeesResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PayeesResponseData.md b/docs/PayeesResponseData.md new file mode 100644 index 0000000..a1c6eee --- /dev/null +++ b/docs/PayeesResponseData.md @@ -0,0 +1,10 @@ +# PayeesResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payees** | [**list[Payee]**](Payee.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveCategoryResponse.md b/docs/SaveCategoryResponse.md index 37d597d..010b2ed 100644 --- a/docs/SaveCategoryResponse.md +++ b/docs/SaveCategoryResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**SaveCategoryResponseData**](SaveCategoryResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SaveCategoryResponseData.md b/docs/SaveCategoryResponseData.md new file mode 100644 index 0000000..bf38d21 --- /dev/null +++ b/docs/SaveCategoryResponseData.md @@ -0,0 +1,10 @@ +# SaveCategoryResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**Category**](Category.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SaveTransactionsResponse.md b/docs/SaveTransactionsResponse.md index bdb7fa7..20f6673 100644 --- a/docs/SaveTransactionsResponse.md +++ b/docs/SaveTransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**SaveTransactionsResponseData**](SaveTransactionsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SaveTransactionsResponseData.md b/docs/SaveTransactionsResponseData.md new file mode 100644 index 0000000..f1e40e4 --- /dev/null +++ b/docs/SaveTransactionsResponseData.md @@ -0,0 +1,13 @@ +# SaveTransactionsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_ids** | **list[str]** | The transaction ids that were saved | +**transaction** | [**TransactionDetail**](TransactionDetail.md) | | [optional] +**transactions** | [**list[TransactionDetail]**](TransactionDetail.md) | If multiple transactions were specified, the transactions that were saved | [optional] +**duplicate_import_ids** | **list[str]** | If multiple transactions were specified, a list of import_ids that were not created because of an existing `import_id` found on the same account | [optional] +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ScheduledTransactionResponse.md b/docs/ScheduledTransactionResponse.md index 84cc32b..a141cd1 100644 --- a/docs/ScheduledTransactionResponse.md +++ b/docs/ScheduledTransactionResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**ScheduledTransactionResponseData**](ScheduledTransactionResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionResponseData.md b/docs/ScheduledTransactionResponseData.md new file mode 100644 index 0000000..199fb4f --- /dev/null +++ b/docs/ScheduledTransactionResponseData.md @@ -0,0 +1,9 @@ +# ScheduledTransactionResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scheduled_transaction** | [**ScheduledTransactionDetail**](ScheduledTransactionDetail.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ScheduledTransactionsResponse.md b/docs/ScheduledTransactionsResponse.md index ecad1c8..984e134 100644 --- a/docs/ScheduledTransactionsResponse.md +++ b/docs/ScheduledTransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**ScheduledTransactionsResponseData**](ScheduledTransactionsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ScheduledTransactionsResponseData.md b/docs/ScheduledTransactionsResponseData.md new file mode 100644 index 0000000..af9b0f6 --- /dev/null +++ b/docs/ScheduledTransactionsResponseData.md @@ -0,0 +1,10 @@ +# ScheduledTransactionsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scheduled_transactions** | [**list[ScheduledTransactionDetail]**](ScheduledTransactionDetail.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TransactionResponse.md b/docs/TransactionResponse.md index 33848c9..f8d49d2 100644 --- a/docs/TransactionResponse.md +++ b/docs/TransactionResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**TransactionResponseData**](TransactionResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionResponseData.md b/docs/TransactionResponseData.md new file mode 100644 index 0000000..c6ef646 --- /dev/null +++ b/docs/TransactionResponseData.md @@ -0,0 +1,9 @@ +# TransactionResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction** | [**TransactionDetail**](TransactionDetail.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TransactionsImportResponse.md b/docs/TransactionsImportResponse.md index 6d19707..55aa195 100644 --- a/docs/TransactionsImportResponse.md +++ b/docs/TransactionsImportResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**TransactionsImportResponseData**](TransactionsImportResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionsImportResponseData.md b/docs/TransactionsImportResponseData.md new file mode 100644 index 0000000..8b0f5d4 --- /dev/null +++ b/docs/TransactionsImportResponseData.md @@ -0,0 +1,9 @@ +# TransactionsImportResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_ids** | **list[str]** | The list of transaction ids that were imported. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TransactionsResponse.md b/docs/TransactionsResponse.md index 112ac75..3c237f8 100644 --- a/docs/TransactionsResponse.md +++ b/docs/TransactionsResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**TransactionsResponseData**](TransactionsResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransactionsResponseData.md b/docs/TransactionsResponseData.md new file mode 100644 index 0000000..3c75f96 --- /dev/null +++ b/docs/TransactionsResponseData.md @@ -0,0 +1,10 @@ +# TransactionsResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactions** | [**list[TransactionDetail]**](TransactionDetail.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UserResponse.md b/docs/UserResponse.md index d74196e..30daaed 100644 --- a/docs/UserResponse.md +++ b/docs/UserResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object** | | +**data** | [**UserResponseData**](UserResponseData.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserResponseData.md b/docs/UserResponseData.md new file mode 100644 index 0000000..76418b1 --- /dev/null +++ b/docs/UserResponseData.md @@ -0,0 +1,9 @@ +# UserResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**User**](User.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/test/test_account_response_data.py b/test/test_account_response_data.py new file mode 100644 index 0000000..bfa98aa --- /dev/null +++ b/test/test_account_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.account_response_data import AccountResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestAccountResponseData(unittest.TestCase): + """AccountResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAccountResponseData(self): + """Test AccountResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.account_response_data.AccountResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_accounts_api.py b/test/test_accounts_api.py index 354acfd..1755797 100644 --- a/test/test_accounts_api.py +++ b/test/test_accounts_api.py @@ -23,7 +23,7 @@ class TestAccountsApi(unittest.TestCase): """AccountsApi unit test stubs""" def setUp(self): - self.api = ynab.api.accounts_api.AccountsApi() # noqa: E501 + self.api = AccountsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_accounts_response_data.py b/test/test_accounts_response_data.py new file mode 100644 index 0000000..d5d741e --- /dev/null +++ b/test/test_accounts_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.accounts_response_data import AccountsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestAccountsResponseData(unittest.TestCase): + """AccountsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAccountsResponseData(self): + """Test AccountsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.accounts_response_data.AccountsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_detail_response_data.py b/test/test_budget_detail_response_data.py new file mode 100644 index 0000000..6407ede --- /dev/null +++ b/test/test_budget_detail_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_detail_response_data import BudgetDetailResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetDetailResponseData(unittest.TestCase): + """BudgetDetailResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetDetailResponseData(self): + """Test BudgetDetailResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_detail_response_data.BudgetDetailResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_settings_response_data.py b/test/test_budget_settings_response_data.py new file mode 100644 index 0000000..a613c3d --- /dev/null +++ b/test/test_budget_settings_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_settings_response_data import BudgetSettingsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetSettingsResponseData(unittest.TestCase): + """BudgetSettingsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetSettingsResponseData(self): + """Test BudgetSettingsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_settings_response_data.BudgetSettingsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_summary_response_data.py b/test/test_budget_summary_response_data.py new file mode 100644 index 0000000..0050622 --- /dev/null +++ b/test/test_budget_summary_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.budget_summary_response_data import BudgetSummaryResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestBudgetSummaryResponseData(unittest.TestCase): + """BudgetSummaryResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBudgetSummaryResponseData(self): + """Test BudgetSummaryResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.budget_summary_response_data.BudgetSummaryResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budgets_api.py b/test/test_budgets_api.py index a606b67..b103f67 100644 --- a/test/test_budgets_api.py +++ b/test/test_budgets_api.py @@ -23,7 +23,7 @@ class TestBudgetsApi(unittest.TestCase): """BudgetsApi unit test stubs""" def setUp(self): - self.api = ynab.api.budgets_api.BudgetsApi() # noqa: E501 + self.api = BudgetsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_bulk_response_data.py b/test/test_bulk_response_data.py new file mode 100644 index 0000000..ff5a68f --- /dev/null +++ b/test/test_bulk_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.bulk_response_data import BulkResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestBulkResponseData(unittest.TestCase): + """BulkResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBulkResponseData(self): + """Test BulkResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.bulk_response_data.BulkResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bulk_response_data_bulk.py b/test/test_bulk_response_data_bulk.py new file mode 100644 index 0000000..4e4209b --- /dev/null +++ b/test/test_bulk_response_data_bulk.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.bulk_response_data_bulk import BulkResponseDataBulk # noqa: E501 +from ynab.rest import ApiException + + +class TestBulkResponseDataBulk(unittest.TestCase): + """BulkResponseDataBulk unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBulkResponseDataBulk(self): + """Test BulkResponseDataBulk""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.bulk_response_data_bulk.BulkResponseDataBulk() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_categories_api.py b/test/test_categories_api.py index fd36bdc..a69e072 100644 --- a/test/test_categories_api.py +++ b/test/test_categories_api.py @@ -23,7 +23,7 @@ class TestCategoriesApi(unittest.TestCase): """CategoriesApi unit test stubs""" def setUp(self): - self.api = ynab.api.categories_api.CategoriesApi() # noqa: E501 + self.api = CategoriesApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_categories_response_data.py b/test/test_categories_response_data.py new file mode 100644 index 0000000..3051ec0 --- /dev/null +++ b/test/test_categories_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.categories_response_data import CategoriesResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestCategoriesResponseData(unittest.TestCase): + """CategoriesResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategoriesResponseData(self): + """Test CategoriesResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.categories_response_data.CategoriesResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_category_response_data.py b/test/test_category_response_data.py new file mode 100644 index 0000000..b0ae586 --- /dev/null +++ b/test/test_category_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.category_response_data import CategoryResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestCategoryResponseData(unittest.TestCase): + """CategoryResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategoryResponseData(self): + """Test CategoryResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.category_response_data.CategoryResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_deprecated_api.py b/test/test_deprecated_api.py index c31748d..5273637 100644 --- a/test/test_deprecated_api.py +++ b/test/test_deprecated_api.py @@ -23,7 +23,7 @@ class TestDeprecatedApi(unittest.TestCase): """DeprecatedApi unit test stubs""" def setUp(self): - self.api = ynab.api.deprecated_api.DeprecatedApi() # noqa: E501 + self.api = DeprecatedApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_hybrid_transactions_response_data.py b/test/test_hybrid_transactions_response_data.py new file mode 100644 index 0000000..f39f308 --- /dev/null +++ b/test/test_hybrid_transactions_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.hybrid_transactions_response_data import HybridTransactionsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestHybridTransactionsResponseData(unittest.TestCase): + """HybridTransactionsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHybridTransactionsResponseData(self): + """Test HybridTransactionsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.hybrid_transactions_response_data.HybridTransactionsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_month_detail_response_data.py b/test/test_month_detail_response_data.py new file mode 100644 index 0000000..f611af4 --- /dev/null +++ b/test/test_month_detail_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.month_detail_response_data import MonthDetailResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestMonthDetailResponseData(unittest.TestCase): + """MonthDetailResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMonthDetailResponseData(self): + """Test MonthDetailResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.month_detail_response_data.MonthDetailResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_month_summaries_response_data.py b/test/test_month_summaries_response_data.py new file mode 100644 index 0000000..8546031 --- /dev/null +++ b/test/test_month_summaries_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.month_summaries_response_data import MonthSummariesResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestMonthSummariesResponseData(unittest.TestCase): + """MonthSummariesResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMonthSummariesResponseData(self): + """Test MonthSummariesResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.month_summaries_response_data.MonthSummariesResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_months_api.py b/test/test_months_api.py index 85a5e82..e307e40 100644 --- a/test/test_months_api.py +++ b/test/test_months_api.py @@ -23,7 +23,7 @@ class TestMonthsApi(unittest.TestCase): """MonthsApi unit test stubs""" def setUp(self): - self.api = ynab.api.months_api.MonthsApi() # noqa: E501 + self.api = MonthsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payee_location_response_data.py b/test/test_payee_location_response_data.py new file mode 100644 index 0000000..e067881 --- /dev/null +++ b/test/test_payee_location_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.payee_location_response_data import PayeeLocationResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestPayeeLocationResponseData(unittest.TestCase): + """PayeeLocationResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayeeLocationResponseData(self): + """Test PayeeLocationResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.payee_location_response_data.PayeeLocationResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payee_locations_api.py b/test/test_payee_locations_api.py index aa2b3b9..d3c0698 100644 --- a/test/test_payee_locations_api.py +++ b/test/test_payee_locations_api.py @@ -23,7 +23,7 @@ class TestPayeeLocationsApi(unittest.TestCase): """PayeeLocationsApi unit test stubs""" def setUp(self): - self.api = ynab.api.payee_locations_api.PayeeLocationsApi() # noqa: E501 + self.api = PayeeLocationsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payee_locations_response_data.py b/test/test_payee_locations_response_data.py new file mode 100644 index 0000000..9bb3e9f --- /dev/null +++ b/test/test_payee_locations_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.payee_locations_response_data import PayeeLocationsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestPayeeLocationsResponseData(unittest.TestCase): + """PayeeLocationsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayeeLocationsResponseData(self): + """Test PayeeLocationsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.payee_locations_response_data.PayeeLocationsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payee_response_data.py b/test/test_payee_response_data.py new file mode 100644 index 0000000..bd2ee09 --- /dev/null +++ b/test/test_payee_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.payee_response_data import PayeeResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestPayeeResponseData(unittest.TestCase): + """PayeeResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayeeResponseData(self): + """Test PayeeResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.payee_response_data.PayeeResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payees_api.py b/test/test_payees_api.py index 422296f..34a65c1 100644 --- a/test/test_payees_api.py +++ b/test/test_payees_api.py @@ -23,7 +23,7 @@ class TestPayeesApi(unittest.TestCase): """PayeesApi unit test stubs""" def setUp(self): - self.api = ynab.api.payees_api.PayeesApi() # noqa: E501 + self.api = PayeesApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_payees_response_data.py b/test/test_payees_response_data.py new file mode 100644 index 0000000..831d94f --- /dev/null +++ b/test/test_payees_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.payees_response_data import PayeesResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestPayeesResponseData(unittest.TestCase): + """PayeesResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayeesResponseData(self): + """Test PayeesResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.payees_response_data.PayeesResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_account.py b/test/test_save_account.py index 741a67e..90c098c 100644 --- a/test/test_save_account.py +++ b/test/test_save_account.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.save_account import SaveAccount # noqa: E501 +from ynab.models.save_account import SaveAccount # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_save_account_wrapper.py b/test/test_save_account_wrapper.py index 65a42de..b36e661 100644 --- a/test/test_save_account_wrapper.py +++ b/test/test_save_account_wrapper.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.save_account_wrapper import SaveAccountWrapper # noqa: E501 +from ynab.models.save_account_wrapper import SaveAccountWrapper # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_save_category_response.py b/test/test_save_category_response.py index 7c8619b..0fdfc9c 100644 --- a/test/test_save_category_response.py +++ b/test/test_save_category_response.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.save_category_response import SaveCategoryResponse # noqa: E501 +from ynab.models.save_category_response import SaveCategoryResponse # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_save_category_response_data.py b/test/test_save_category_response_data.py new file mode 100644 index 0000000..4c08879 --- /dev/null +++ b/test/test_save_category_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_category_response_data import SaveCategoryResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveCategoryResponseData(unittest.TestCase): + """SaveCategoryResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveCategoryResponseData(self): + """Test SaveCategoryResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_category_response_data.SaveCategoryResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_sub_transaction.py b/test/test_save_sub_transaction.py index 8737218..d817721 100644 --- a/test/test_save_sub_transaction.py +++ b/test/test_save_sub_transaction.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.save_sub_transaction import SaveSubTransaction # noqa: E501 +from ynab.models.save_sub_transaction import SaveSubTransaction # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_save_transactions_response_data.py b/test/test_save_transactions_response_data.py new file mode 100644 index 0000000..4a6e882 --- /dev/null +++ b/test/test_save_transactions_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.save_transactions_response_data import SaveTransactionsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestSaveTransactionsResponseData(unittest.TestCase): + """SaveTransactionsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSaveTransactionsResponseData(self): + """Test SaveTransactionsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.save_transactions_response_data.SaveTransactionsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_scheduled_transaction_response_data.py b/test/test_scheduled_transaction_response_data.py new file mode 100644 index 0000000..df0b887 --- /dev/null +++ b/test/test_scheduled_transaction_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.scheduled_transaction_response_data import ScheduledTransactionResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestScheduledTransactionResponseData(unittest.TestCase): + """ScheduledTransactionResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testScheduledTransactionResponseData(self): + """Test ScheduledTransactionResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.scheduled_transaction_response_data.ScheduledTransactionResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_scheduled_transactions_api.py b/test/test_scheduled_transactions_api.py index 808f8a5..5056e30 100644 --- a/test/test_scheduled_transactions_api.py +++ b/test/test_scheduled_transactions_api.py @@ -23,7 +23,7 @@ class TestScheduledTransactionsApi(unittest.TestCase): """ScheduledTransactionsApi unit test stubs""" def setUp(self): - self.api = ynab.api.scheduled_transactions_api.ScheduledTransactionsApi() # noqa: E501 + self.api = ScheduledTransactionsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_scheduled_transactions_response_data.py b/test/test_scheduled_transactions_response_data.py new file mode 100644 index 0000000..8b2ea54 --- /dev/null +++ b/test/test_scheduled_transactions_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.scheduled_transactions_response_data import ScheduledTransactionsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestScheduledTransactionsResponseData(unittest.TestCase): + """ScheduledTransactionsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testScheduledTransactionsResponseData(self): + """Test ScheduledTransactionsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.scheduled_transactions_response_data.ScheduledTransactionsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_response_data.py b/test/test_transaction_response_data.py new file mode 100644 index 0000000..bcd7534 --- /dev/null +++ b/test/test_transaction_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.transaction_response_data import TransactionResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestTransactionResponseData(unittest.TestCase): + """TransactionResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionResponseData(self): + """Test TransactionResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.transaction_response_data.TransactionResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transactions_api.py b/test/test_transactions_api.py index 7e32280..16915df 100644 --- a/test/test_transactions_api.py +++ b/test/test_transactions_api.py @@ -23,7 +23,7 @@ class TestTransactionsApi(unittest.TestCase): """TransactionsApi unit test stubs""" def setUp(self): - self.api = ynab.api.transactions_api.TransactionsApi() # noqa: E501 + self.api = TransactionsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_transactions_import_response.py b/test/test_transactions_import_response.py index efe6252..75ecda6 100644 --- a/test/test_transactions_import_response.py +++ b/test/test_transactions_import_response.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.transactions_import_response import TransactionsImportResponse # noqa: E501 +from ynab.models.transactions_import_response import TransactionsImportResponse # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_transactions_import_response_data.py b/test/test_transactions_import_response_data.py new file mode 100644 index 0000000..4211d02 --- /dev/null +++ b/test/test_transactions_import_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.transactions_import_response_data import TransactionsImportResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestTransactionsImportResponseData(unittest.TestCase): + """TransactionsImportResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionsImportResponseData(self): + """Test TransactionsImportResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.transactions_import_response_data.TransactionsImportResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transactions_response_data.py b/test/test_transactions_response_data.py new file mode 100644 index 0000000..1f5f668 --- /dev/null +++ b/test/test_transactions_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.transactions_response_data import TransactionsResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestTransactionsResponseData(unittest.TestCase): + """TransactionsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionsResponseData(self): + """Test TransactionsResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.transactions_response_data.TransactionsResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_transaction.py b/test/test_update_transaction.py index 87823ba..f2e3336 100644 --- a/test/test_update_transaction.py +++ b/test/test_update_transaction.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.update_transaction import UpdateTransaction # noqa: E501 +from ynab.models.update_transaction import UpdateTransaction # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_update_transactions_wrapper.py b/test/test_update_transactions_wrapper.py index c92e2e9..5bcf704 100644 --- a/test/test_update_transactions_wrapper.py +++ b/test/test_update_transactions_wrapper.py @@ -15,7 +15,7 @@ import unittest import ynab -from models.update_transactions_wrapper import UpdateTransactionsWrapper # noqa: E501 +from ynab.models.update_transactions_wrapper import UpdateTransactionsWrapper # noqa: E501 from ynab.rest import ApiException diff --git a/test/test_user_api.py b/test/test_user_api.py index d9f0718..e5cc7af 100644 --- a/test/test_user_api.py +++ b/test/test_user_api.py @@ -23,7 +23,7 @@ class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" def setUp(self): - self.api = ynab.api.user_api.UserApi() # noqa: E501 + self.api = UserApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_user_response_data.py b/test/test_user_response_data.py new file mode 100644 index 0000000..f27d347 --- /dev/null +++ b/test/test_user_response_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import ynab +from ynab.models.user_response_data import UserResponseData # noqa: E501 +from ynab.rest import ApiException + + +class TestUserResponseData(unittest.TestCase): + """UserResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUserResponseData(self): + """Test UserResponseData""" + # FIXME: construct object with mandatory attributes with example values + # model = ynab.models.user_response_data.UserResponseData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tox.ini b/tox.ini index 3d0be61..a310bec 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/ynab/__init__.py b/ynab/__init__.py index 08ea5ee..06a8a8d 100644 --- a/ynab/__init__.py +++ b/ynab/__init__.py @@ -31,72 +31,82 @@ # import models into sdk package from ynab.models.account import Account from ynab.models.account_response import AccountResponse -from ynab.models.account_wrapper import AccountWrapper +from ynab.models.account_response_data import AccountResponseData from ynab.models.accounts_response import AccountsResponse -from ynab.models.accounts_wrapper import AccountsWrapper +from ynab.models.accounts_response_data import AccountsResponseData from ynab.models.budget_detail import BudgetDetail from ynab.models.budget_detail_response import BudgetDetailResponse -from ynab.models.budget_detail_wrapper import BudgetDetailWrapper +from ynab.models.budget_detail_response_data import BudgetDetailResponseData from ynab.models.budget_settings import BudgetSettings from ynab.models.budget_settings_response import BudgetSettingsResponse -from ynab.models.budget_settings_wrapper import BudgetSettingsWrapper +from ynab.models.budget_settings_response_data import BudgetSettingsResponseData from ynab.models.budget_summary import BudgetSummary from ynab.models.budget_summary_response import BudgetSummaryResponse -from ynab.models.budget_summary_wrapper import BudgetSummaryWrapper -from ynab.models.bulk_id_wrapper import BulkIdWrapper -from ynab.models.bulk_ids import BulkIds +from ynab.models.budget_summary_response_data import BudgetSummaryResponseData from ynab.models.bulk_response import BulkResponse +from ynab.models.bulk_response_data import BulkResponseData +from ynab.models.bulk_response_data_bulk import BulkResponseDataBulk from ynab.models.bulk_transactions import BulkTransactions from ynab.models.categories_response import CategoriesResponse +from ynab.models.categories_response_data import CategoriesResponseData from ynab.models.category import Category from ynab.models.category_group import CategoryGroup from ynab.models.category_group_with_categories import CategoryGroupWithCategories -from ynab.models.category_groups_wrapper import CategoryGroupsWrapper from ynab.models.category_response import CategoryResponse -from ynab.models.category_wrapper import CategoryWrapper +from ynab.models.category_response_data import CategoryResponseData from ynab.models.currency_format import CurrencyFormat from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse from ynab.models.hybrid_transaction import HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse -from ynab.models.hybrid_transactions_wrapper import HybridTransactionsWrapper +from ynab.models.hybrid_transactions_response_data import HybridTransactionsResponseData from ynab.models.month_detail import MonthDetail from ynab.models.month_detail_response import MonthDetailResponse -from ynab.models.month_detail_wrapper import MonthDetailWrapper +from ynab.models.month_detail_response_data import MonthDetailResponseData from ynab.models.month_summaries_response import MonthSummariesResponse -from ynab.models.month_summaries_wrapper import MonthSummariesWrapper +from ynab.models.month_summaries_response_data import MonthSummariesResponseData from ynab.models.month_summary import MonthSummary from ynab.models.payee import Payee from ynab.models.payee_location import PayeeLocation from ynab.models.payee_location_response import PayeeLocationResponse -from ynab.models.payee_location_wrapper import PayeeLocationWrapper +from ynab.models.payee_location_response_data import PayeeLocationResponseData from ynab.models.payee_locations_response import PayeeLocationsResponse -from ynab.models.payee_locations_wrapper import PayeeLocationsWrapper +from ynab.models.payee_locations_response_data import PayeeLocationsResponseData from ynab.models.payee_response import PayeeResponse -from ynab.models.payee_wrapper import PayeeWrapper +from ynab.models.payee_response_data import PayeeResponseData from ynab.models.payees_response import PayeesResponse -from ynab.models.payees_wrapper import PayeesWrapper +from ynab.models.payees_response_data import PayeesResponseData +from ynab.models.save_account import SaveAccount +from ynab.models.save_account_wrapper import SaveAccountWrapper +from ynab.models.save_category_response import SaveCategoryResponse +from ynab.models.save_category_response_data import SaveCategoryResponseData from ynab.models.save_month_category import SaveMonthCategory from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper +from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.save_transaction import SaveTransaction from ynab.models.save_transaction_wrapper import SaveTransactionWrapper from ynab.models.save_transactions_response import SaveTransactionsResponse +from ynab.models.save_transactions_response_data import SaveTransactionsResponseData from ynab.models.save_transactions_wrapper import SaveTransactionsWrapper from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail from ynab.models.scheduled_transaction_response import ScheduledTransactionResponse +from ynab.models.scheduled_transaction_response_data import ScheduledTransactionResponseData from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary -from ynab.models.scheduled_transaction_wrapper import ScheduledTransactionWrapper from ynab.models.scheduled_transactions_response import ScheduledTransactionsResponse -from ynab.models.scheduled_transactions_wrapper import ScheduledTransactionsWrapper +from ynab.models.scheduled_transactions_response_data import ScheduledTransactionsResponseData from ynab.models.sub_transaction import SubTransaction from ynab.models.transaction_detail import TransactionDetail from ynab.models.transaction_response import TransactionResponse +from ynab.models.transaction_response_data import TransactionResponseData from ynab.models.transaction_summary import TransactionSummary -from ynab.models.transaction_wrapper import TransactionWrapper +from ynab.models.transactions_import_response import TransactionsImportResponse +from ynab.models.transactions_import_response_data import TransactionsImportResponseData from ynab.models.transactions_response import TransactionsResponse -from ynab.models.transactions_wrapper import TransactionsWrapper +from ynab.models.transactions_response_data import TransactionsResponseData +from ynab.models.update_transaction import UpdateTransaction +from ynab.models.update_transactions_wrapper import UpdateTransactionsWrapper from ynab.models.user import User from ynab.models.user_response import UserResponse -from ynab.models.user_wrapper import UserWrapper +from ynab.models.user_response_data import UserResponseData diff --git a/ynab/api/accounts_api.py b/ynab/api/accounts_api.py index 1bd689f..e9429e2 100644 --- a/ynab/api/accounts_api.py +++ b/ynab/api/accounts_api.py @@ -32,6 +32,113 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def create_account(self, body, budget_id, **kwargs): # noqa: E501 + """Create a new account # noqa: E501 + + Creates a new account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_account(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveAccountWrapper body: The account to create. (required) + :param str budget_id: The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) (required) + :return: AccountResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_account_with_http_info(body, budget_id, **kwargs) # noqa: E501 + else: + (data) = self.create_account_with_http_info(body, budget_id, **kwargs) # noqa: E501 + return data + + def create_account_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 + """Create a new account # noqa: E501 + + Creates a new account # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_account_with_http_info(body, budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SaveAccountWrapper body: The account to create. (required) + :param str budget_id: The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) (required) + :return: AccountResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_account" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_account`") # noqa: E501 + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `create_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/accounts', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AccountResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def get_account_by_id(self, budget_id, account_id, **kwargs): # noqa: E501 """Single account # noqa: E501 @@ -42,7 +149,7 @@ def get_account_by_id(self, budget_id, account_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str account_id: The id of the account (required) :return: AccountResponse If the method is called asynchronously, @@ -65,7 +172,7 @@ def get_account_by_id_with_http_info(self, budget_id, account_id, **kwargs): # >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str account_id: The id of the account (required) :return: AccountResponse If the method is called asynchronously, @@ -145,8 +252,8 @@ def get_accounts(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: AccountsResponse If the method is called asynchronously, returns the request thread. @@ -168,8 +275,8 @@ def get_accounts_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: AccountsResponse If the method is called asynchronously, returns the request thread. diff --git a/ynab/api/budgets_api.py b/ynab/api/budgets_api.py index 2b4ed77..aa1b7a6 100644 --- a/ynab/api/budgets_api.py +++ b/ynab/api/budgets_api.py @@ -42,8 +42,8 @@ def get_budget_by_id(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: BudgetDetailResponse If the method is called asynchronously, returns the request thread. @@ -65,8 +65,8 @@ def get_budget_by_id_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: BudgetDetailResponse If the method is called asynchronously, returns the request thread. @@ -141,7 +141,7 @@ def get_budget_settings_by_id(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: BudgetSettingsResponse If the method is called asynchronously, returns the request thread. @@ -163,7 +163,7 @@ def get_budget_settings_by_id_with_http_info(self, budget_id, **kwargs): # noqa >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: BudgetSettingsResponse If the method is called asynchronously, returns the request thread. @@ -236,6 +236,7 @@ def get_budgets(self, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool + :param bool include_accounts: Whether to include the list of budget accounts :return: BudgetSummaryResponse If the method is called asynchronously, returns the request thread. @@ -257,12 +258,13 @@ def get_budgets_with_http_info(self, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool + :param bool include_accounts: Whether to include the list of budget accounts :return: BudgetSummaryResponse If the method is called asynchronously, returns the request thread. """ - all_params = [] # noqa: E501 + all_params = ['include_accounts'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -283,6 +285,8 @@ def get_budgets_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] + if 'include_accounts' in params: + query_params.append(('include_accounts', params['include_accounts'])) # noqa: E501 header_params = {} diff --git a/ynab/api/categories_api.py b/ynab/api/categories_api.py index 5ebf9b8..5686c14 100644 --- a/ynab/api/categories_api.py +++ b/ynab/api/categories_api.py @@ -42,8 +42,8 @@ def get_categories(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: CategoriesResponse If the method is called asynchronously, returns the request thread. @@ -65,8 +65,8 @@ def get_categories_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: CategoriesResponse If the method is called asynchronously, returns the request thread. @@ -141,7 +141,7 @@ def get_category_by_id(self, budget_id, category_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str category_id: The id of the category (required) :return: CategoryResponse If the method is called asynchronously, @@ -164,7 +164,7 @@ def get_category_by_id_with_http_info(self, budget_id, category_id, **kwargs): >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str category_id: The id of the category (required) :return: CategoryResponse If the method is called asynchronously, @@ -244,7 +244,7 @@ def get_month_category_by_id(self, budget_id, month, category_id, **kwargs): # >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :param str category_id: The id of the category (required) :return: CategoryResponse @@ -268,7 +268,7 @@ def get_month_category_by_id_with_http_info(self, budget_id, month, category_id, >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :param str category_id: The id of the category (required) :return: CategoryResponse @@ -348,18 +348,18 @@ def get_month_category_by_id_with_http_info(self, budget_id, month, category_id, def update_month_category(self, body, budget_id, month, category_id, **kwargs): # noqa: E501 """Update a category for a specific month # noqa: E501 - Update a category for a specific month # noqa: E501 + Update a category for a specific month. Only `budgeted` amount can be updated. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_month_category(body, budget_id, month, category_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveMonthCategoryWrapper body: The category to update (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param SaveMonthCategoryWrapper body: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :param str category_id: The id of the category (required) - :return: CategoryResponse + :return: SaveCategoryResponse If the method is called asynchronously, returns the request thread. """ @@ -373,18 +373,18 @@ def update_month_category(self, body, budget_id, month, category_id, **kwargs): def update_month_category_with_http_info(self, body, budget_id, month, category_id, **kwargs): # noqa: E501 """Update a category for a specific month # noqa: E501 - Update a category for a specific month # noqa: E501 + Update a category for a specific month. Only `budgeted` amount can be updated. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_month_category_with_http_info(body, budget_id, month, category_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveMonthCategoryWrapper body: The category to update (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param SaveMonthCategoryWrapper body: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :param str category_id: The id of the category (required) - :return: CategoryResponse + :return: SaveCategoryResponse If the method is called asynchronously, returns the request thread. """ @@ -460,7 +460,7 @@ def update_month_category_with_http_info(self, body, budget_id, month, category_ body=body_params, post_params=form_params, files=local_var_files, - response_type='CategoryResponse', # noqa: E501 + response_type='SaveCategoryResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/ynab/api/deprecated_api.py b/ynab/api/deprecated_api.py index 28a5b98..3af1fd1 100644 --- a/ynab/api/deprecated_api.py +++ b/ynab/api/deprecated_api.py @@ -43,7 +43,7 @@ def bulk_create_transactions(self, body, budget_id, **kwargs): # noqa: E501 :param async_req bool :param BulkTransactions body: The list of transactions to create (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: BulkResponse If the method is called asynchronously, returns the request thread. @@ -66,7 +66,7 @@ def bulk_create_transactions_with_http_info(self, body, budget_id, **kwargs): # :param async_req bool :param BulkTransactions body: The list of transactions to create (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: BulkResponse If the method is called asynchronously, returns the request thread. diff --git a/ynab/api/months_api.py b/ynab/api/months_api.py index 24e19f9..1141026 100644 --- a/ynab/api/months_api.py +++ b/ynab/api/months_api.py @@ -42,7 +42,7 @@ def get_budget_month(self, budget_id, month, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :return: MonthDetailResponse If the method is called asynchronously, @@ -65,7 +65,7 @@ def get_budget_month_with_http_info(self, budget_id, month, **kwargs): # noqa: >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :return: MonthDetailResponse If the method is called asynchronously, @@ -145,8 +145,8 @@ def get_budget_months(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: MonthSummariesResponse If the method is called asynchronously, returns the request thread. @@ -168,8 +168,8 @@ def get_budget_months_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: MonthSummariesResponse If the method is called asynchronously, returns the request thread. diff --git a/ynab/api/payee_locations_api.py b/ynab/api/payee_locations_api.py index 7afb4f7..41ad861 100644 --- a/ynab/api/payee_locations_api.py +++ b/ynab/api/payee_locations_api.py @@ -42,7 +42,7 @@ def get_payee_location_by_id(self, budget_id, payee_location_id, **kwargs): # n >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_location_id: id of payee location (required) :return: PayeeLocationResponse If the method is called asynchronously, @@ -65,7 +65,7 @@ def get_payee_location_by_id_with_http_info(self, budget_id, payee_location_id, >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_location_id: id of payee location (required) :return: PayeeLocationResponse If the method is called asynchronously, @@ -145,7 +145,7 @@ def get_payee_locations(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: PayeeLocationsResponse If the method is called asynchronously, returns the request thread. @@ -167,7 +167,7 @@ def get_payee_locations_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: PayeeLocationsResponse If the method is called asynchronously, returns the request thread. @@ -233,14 +233,14 @@ def get_payee_locations_with_http_info(self, budget_id, **kwargs): # noqa: E501 def get_payee_locations_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E501 """List locations for a payee # noqa: E501 - Returns all payee locations for the specified payee # noqa: E501 + Returns all payee locations for a specified payee # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_payee_locations_by_payee(budget_id, payee_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: id of payee (required) :return: PayeeLocationsResponse If the method is called asynchronously, @@ -256,14 +256,14 @@ def get_payee_locations_by_payee(self, budget_id, payee_id, **kwargs): # noqa: def get_payee_locations_by_payee_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 """List locations for a payee # noqa: E501 - Returns all payee locations for the specified payee # noqa: E501 + Returns all payee locations for a specified payee # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_payee_locations_by_payee_with_http_info(budget_id, payee_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: id of payee (required) :return: PayeeLocationsResponse If the method is called asynchronously, diff --git a/ynab/api/payees_api.py b/ynab/api/payees_api.py index 06124f5..ca0800c 100644 --- a/ynab/api/payees_api.py +++ b/ynab/api/payees_api.py @@ -35,14 +35,14 @@ def __init__(self, api_client=None): def get_payee_by_id(self, budget_id, payee_id, **kwargs): # noqa: E501 """Single payee # noqa: E501 - Returns single payee # noqa: E501 + Returns a single payee # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_payee_by_id(budget_id, payee_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: The id of the payee (required) :return: PayeeResponse If the method is called asynchronously, @@ -58,14 +58,14 @@ def get_payee_by_id(self, budget_id, payee_id, **kwargs): # noqa: E501 def get_payee_by_id_with_http_info(self, budget_id, payee_id, **kwargs): # noqa: E501 """Single payee # noqa: E501 - Returns single payee # noqa: E501 + Returns a single payee # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_payee_by_id_with_http_info(budget_id, payee_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: The id of the payee (required) :return: PayeeResponse If the method is called asynchronously, @@ -145,8 +145,8 @@ def get_payees(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: PayeesResponse If the method is called asynchronously, returns the request thread. @@ -168,8 +168,8 @@ def get_payees_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: PayeesResponse If the method is called asynchronously, returns the request thread. diff --git a/ynab/api/scheduled_transactions_api.py b/ynab/api/scheduled_transactions_api.py index 1f1cf64..52d9d2c 100644 --- a/ynab/api/scheduled_transactions_api.py +++ b/ynab/api/scheduled_transactions_api.py @@ -42,7 +42,7 @@ def get_scheduled_transaction_by_id(self, budget_id, scheduled_transaction_id, * >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str scheduled_transaction_id: The id of the scheduled transaction (required) :return: ScheduledTransactionResponse If the method is called asynchronously, @@ -65,7 +65,7 @@ def get_scheduled_transaction_by_id_with_http_info(self, budget_id, scheduled_tr >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str scheduled_transaction_id: The id of the scheduled transaction (required) :return: ScheduledTransactionResponse If the method is called asynchronously, @@ -145,7 +145,8 @@ def get_scheduled_transactions(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: ScheduledTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -167,13 +168,14 @@ def get_scheduled_transactions_with_http_info(self, budget_id, **kwargs): # noq >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: ScheduledTransactionsResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['budget_id'] # noqa: E501 + all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -200,6 +202,8 @@ def get_scheduled_transactions_with_http_info(self, budget_id, **kwargs): # noq path_params['budget_id'] = params['budget_id'] # noqa: E501 query_params = [] + if 'last_knowledge_of_server' in params: + query_params.append(('last_knowledge_of_server', params['last_knowledge_of_server'])) # noqa: E501 header_params = {} diff --git a/ynab/api/transactions_api.py b/ynab/api/transactions_api.py index abcb62c..1e01ceb 100644 --- a/ynab/api/transactions_api.py +++ b/ynab/api/transactions_api.py @@ -35,15 +35,15 @@ def __init__(self, api_client=None): def create_transaction(self, body, budget_id, **kwargs): # noqa: E501 """Create a single transaction or multiple transactions # noqa: E501 - Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. # noqa: E501 + Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_transaction(body, budget_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: SaveTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -58,15 +58,15 @@ def create_transaction(self, body, budget_id, **kwargs): # noqa: E501 def create_transaction_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 """Create a single transaction or multiple transactions # noqa: E501 - Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. # noqa: E501 + Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_transaction_with_http_info(body, budget_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the 'transaction' object and to create multiple transactions you can specify an array of 'transactions'. It is expected that you will only provide a value for one of these objects. (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param SaveTransactionsWrapper body: The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: SaveTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -149,7 +149,7 @@ def get_transaction_by_id(self, budget_id, transaction_id, **kwargs): # noqa: E >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str transaction_id: The id of the transaction (required) :return: TransactionResponse If the method is called asynchronously, @@ -172,7 +172,7 @@ def get_transaction_by_id_with_http_info(self, budget_id, transaction_id, **kwar >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str transaction_id: The id of the transaction (required) :return: TransactionResponse If the method is called asynchronously, @@ -252,10 +252,10 @@ def get_transactions(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: TransactionsResponse If the method is called asynchronously, returns the request thread. @@ -277,10 +277,10 @@ def get_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: TransactionsResponse If the method is called asynchronously, returns the request thread. @@ -359,11 +359,11 @@ def get_transactions_by_account(self, budget_id, account_id, **kwargs): # noqa: >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str account_id: The id of the account (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: TransactionsResponse If the method is called asynchronously, returns the request thread. @@ -385,11 +385,11 @@ def get_transactions_by_account_with_http_info(self, budget_id, account_id, **kw >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str account_id: The id of the account (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: TransactionsResponse If the method is called asynchronously, returns the request thread. @@ -474,11 +474,11 @@ def get_transactions_by_category(self, budget_id, category_id, **kwargs): # noq >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str category_id: The id of the category (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: HybridTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -500,11 +500,11 @@ def get_transactions_by_category_with_http_info(self, budget_id, category_id, ** >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str category_id: The id of the category (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: HybridTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -589,11 +589,11 @@ def get_transactions_by_payee(self, budget_id, payee_id, **kwargs): # noqa: E50 >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: The id of the payee (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: HybridTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -615,11 +615,11 @@ def get_transactions_by_payee_with_http_info(self, budget_id, payee_id, **kwargs >>> result = thread.get() :param async_req bool - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str payee_id: The id of the payee (required) :param date since_date: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). - :param str type: If specified, only transactions of the specified type will be included. 'uncategorized' and 'unapproved' are currently supported. - :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. + :param str type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. + :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :return: HybridTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -694,10 +694,105 @@ def get_transactions_by_payee_with_http_info(self, budget_id, payee_id, **kwargs _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def import_transactions(self, budget_id, **kwargs): # noqa: E501 + """Import transactions # noqa: E501 + + Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_transactions(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :return: TransactionsImportResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + else: + (data) = self.import_transactions_with_http_info(budget_id, **kwargs) # noqa: E501 + return data + + def import_transactions_with_http_info(self, budget_id, **kwargs): # noqa: E501 + """Import transactions # noqa: E501 + + Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_transactions_with_http_info(budget_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) + :return: TransactionsImportResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['budget_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method import_transactions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'budget_id' is set + if ('budget_id' not in params or + params['budget_id'] is None): + raise ValueError("Missing the required parameter `budget_id` when calling `import_transactions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'budget_id' in params: + path_params['budget_id'] = params['budget_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearer'] # noqa: E501 + + return self.api_client.call_api( + '/budgets/{budget_id}/transactions/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionsImportResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def update_transaction(self, body, budget_id, transaction_id, **kwargs): # noqa: E501 """Updates an existing transaction # noqa: E501 - Updates a transaction # noqa: E501 + Updates a single transaction # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_transaction(body, budget_id, transaction_id, async_req=True) @@ -705,7 +800,7 @@ def update_transaction(self, body, budget_id, transaction_id, **kwargs): # noqa :param async_req bool :param SaveTransactionWrapper body: The transaction to update (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str transaction_id: The id of the transaction (required) :return: TransactionResponse If the method is called asynchronously, @@ -721,7 +816,7 @@ def update_transaction(self, body, budget_id, transaction_id, **kwargs): # noqa def update_transaction_with_http_info(self, body, budget_id, transaction_id, **kwargs): # noqa: E501 """Updates an existing transaction # noqa: E501 - Updates a transaction # noqa: E501 + Updates a single transaction # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_transaction_with_http_info(body, budget_id, transaction_id, async_req=True) @@ -729,7 +824,7 @@ def update_transaction_with_http_info(self, body, budget_id, transaction_id, **k :param async_req bool :param SaveTransactionWrapper body: The transaction to update (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :param str transaction_id: The id of the transaction (required) :return: TransactionResponse If the method is called asynchronously, @@ -812,15 +907,15 @@ def update_transaction_with_http_info(self, body, budget_id, transaction_id, **k def update_transactions(self, body, budget_id, **kwargs): # noqa: E501 """Update multiple transactions # noqa: E501 - Updates multiple transactions, by 'id' or 'import_id'. # noqa: E501 + Updates multiple transactions, by `id` or `import_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_transactions(body, budget_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveTransactionsWrapper body: The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param UpdateTransactionsWrapper body: The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: SaveTransactionsResponse If the method is called asynchronously, returns the request thread. @@ -835,15 +930,15 @@ def update_transactions(self, body, budget_id, **kwargs): # noqa: E501 def update_transactions_with_http_info(self, body, budget_id, **kwargs): # noqa: E501 """Update multiple transactions # noqa: E501 - Updates multiple transactions, by 'id' or 'import_id'. # noqa: E501 + Updates multiple transactions, by `id` or `import_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_transactions_with_http_info(body, budget_id, async_req=True) >>> result = thread.get() :param async_req bool - :param SaveTransactionsWrapper body: The transactions to update. Optionally, transaction 'id' value(s) can be specified as null and an 'import_id' value can be provided which will allow transaction(s) to updated by their import_id. (required) - :param str budget_id: The id of the budget (\"last-used\" can also be used to specify the last used budget) (required) + :param UpdateTransactionsWrapper body: The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup. (required) + :param str budget_id: The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget). (required) :return: SaveTransactionsResponse If the method is called asynchronously, returns the request thread. diff --git a/ynab/api_client.py b/ynab/api_client.py index 2e2ce0e..5a2a52b 100644 --- a/ynab/api_client.py +++ b/ynab/api_client.py @@ -523,10 +523,14 @@ def __deserialize_file(self, response): filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) return path def __deserialize_primitive(self, data, klass): diff --git a/ynab/configuration.py b/ynab/configuration.py index c6e575c..066a5b3 100644 --- a/ynab/configuration.py +++ b/ynab/configuration.py @@ -55,6 +55,8 @@ def __init__(self): self.api_key = {} # dict to store API prefix (e.g. Bearer) self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None # Username for HTTP basic authentication self.username = "" # Password for HTTP basic authentication @@ -201,11 +203,16 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/ynab/models/__init__.py b/ynab/models/__init__.py index a3527c5..d71ac86 100644 --- a/ynab/models/__init__.py +++ b/ynab/models/__init__.py @@ -16,58 +16,82 @@ # import models into model package from ynab.models.account import Account from ynab.models.account_response import AccountResponse +from ynab.models.account_response_data import AccountResponseData from ynab.models.accounts_response import AccountsResponse +from ynab.models.accounts_response_data import AccountsResponseData from ynab.models.budget_detail import BudgetDetail from ynab.models.budget_detail_response import BudgetDetailResponse +from ynab.models.budget_detail_response_data import BudgetDetailResponseData from ynab.models.budget_settings import BudgetSettings from ynab.models.budget_settings_response import BudgetSettingsResponse +from ynab.models.budget_settings_response_data import BudgetSettingsResponseData from ynab.models.budget_summary import BudgetSummary from ynab.models.budget_summary_response import BudgetSummaryResponse +from ynab.models.budget_summary_response_data import BudgetSummaryResponseData from ynab.models.bulk_response import BulkResponse +from ynab.models.bulk_response_data import BulkResponseData +from ynab.models.bulk_response_data_bulk import BulkResponseDataBulk from ynab.models.bulk_transactions import BulkTransactions from ynab.models.categories_response import CategoriesResponse +from ynab.models.categories_response_data import CategoriesResponseData from ynab.models.category import Category from ynab.models.category_group import CategoryGroup from ynab.models.category_group_with_categories import CategoryGroupWithCategories from ynab.models.category_response import CategoryResponse +from ynab.models.category_response_data import CategoryResponseData from ynab.models.currency_format import CurrencyFormat from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse from ynab.models.hybrid_transaction import HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse +from ynab.models.hybrid_transactions_response_data import HybridTransactionsResponseData from ynab.models.month_detail import MonthDetail from ynab.models.month_detail_response import MonthDetailResponse +from ynab.models.month_detail_response_data import MonthDetailResponseData from ynab.models.month_summaries_response import MonthSummariesResponse +from ynab.models.month_summaries_response_data import MonthSummariesResponseData from ynab.models.month_summary import MonthSummary from ynab.models.payee import Payee from ynab.models.payee_location import PayeeLocation from ynab.models.payee_location_response import PayeeLocationResponse +from ynab.models.payee_location_response_data import PayeeLocationResponseData from ynab.models.payee_locations_response import PayeeLocationsResponse +from ynab.models.payee_locations_response_data import PayeeLocationsResponseData from ynab.models.payee_response import PayeeResponse +from ynab.models.payee_response_data import PayeeResponseData from ynab.models.payees_response import PayeesResponse +from ynab.models.payees_response_data import PayeesResponseData from ynab.models.save_account import SaveAccount from ynab.models.save_account_wrapper import SaveAccountWrapper from ynab.models.save_category_response import SaveCategoryResponse +from ynab.models.save_category_response_data import SaveCategoryResponseData from ynab.models.save_month_category import SaveMonthCategory from ynab.models.save_month_category_wrapper import SaveMonthCategoryWrapper from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.save_transaction import SaveTransaction from ynab.models.save_transaction_wrapper import SaveTransactionWrapper from ynab.models.save_transactions_response import SaveTransactionsResponse +from ynab.models.save_transactions_response_data import SaveTransactionsResponseData from ynab.models.save_transactions_wrapper import SaveTransactionsWrapper from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction from ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail from ynab.models.scheduled_transaction_response import ScheduledTransactionResponse +from ynab.models.scheduled_transaction_response_data import ScheduledTransactionResponseData from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary from ynab.models.scheduled_transactions_response import ScheduledTransactionsResponse +from ynab.models.scheduled_transactions_response_data import ScheduledTransactionsResponseData from ynab.models.sub_transaction import SubTransaction from ynab.models.transaction_detail import TransactionDetail from ynab.models.transaction_response import TransactionResponse +from ynab.models.transaction_response_data import TransactionResponseData from ynab.models.transaction_summary import TransactionSummary from ynab.models.transactions_import_response import TransactionsImportResponse +from ynab.models.transactions_import_response_data import TransactionsImportResponseData from ynab.models.transactions_response import TransactionsResponse +from ynab.models.transactions_response_data import TransactionsResponseData from ynab.models.update_transaction import UpdateTransaction from ynab.models.update_transactions_wrapper import UpdateTransactionsWrapper from ynab.models.user import User from ynab.models.user_response import UserResponse +from ynab.models.user_response_data import UserResponseData diff --git a/ynab/models/account.py b/ynab/models/account.py index b539401..d242226 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -15,7 +15,6 @@ import six - class Account(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 88484c2..db60cf8 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -15,7 +15,6 @@ import six - class AccountResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class AccountResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'AccountResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this AccountResponse. # noqa: E501 - :rtype: object + :rtype: AccountResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this AccountResponse. # noqa: E501 - :type: object + :type: AccountResponseData """ self._data = data diff --git a/ynab/models/account_response_data.py b/ynab/models/account_response_data.py new file mode 100644 index 0000000..788d0ba --- /dev/null +++ b/ynab/models/account_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AccountResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'account': 'Account' + } + + attribute_map = { + 'account': 'account' + } + + def __init__(self, account=None): # noqa: E501 + """AccountResponseData - a model defined in Swagger""" # noqa: E501 + self._account = None + self.discriminator = None + self.account = account + + @property + def account(self): + """Gets the account of this AccountResponseData. # noqa: E501 + + + :return: The account of this AccountResponseData. # noqa: E501 + :rtype: Account + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this AccountResponseData. + + + :param account: The account of this AccountResponseData. # noqa: E501 + :type: Account + """ + if account is None: + raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 + + self._account = account + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AccountResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index 23d2e3b..8244844 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -15,7 +15,6 @@ import six - class AccountsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class AccountsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'AccountsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this AccountsResponse. # noqa: E501 - :rtype: object + :rtype: AccountsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this AccountsResponse. # noqa: E501 - :type: object + :type: AccountsResponseData """ self._data = data diff --git a/ynab/models/accounts_response_data.py b/ynab/models/accounts_response_data.py new file mode 100644 index 0000000..aa2919a --- /dev/null +++ b/ynab/models/accounts_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AccountsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'accounts': 'list[Account]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'accounts': 'accounts', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, accounts=None, server_knowledge=None): # noqa: E501 + """AccountsResponseData - a model defined in Swagger""" # noqa: E501 + self._accounts = None + self._server_knowledge = None + self.discriminator = None + self.accounts = accounts + self.server_knowledge = server_knowledge + + @property + def accounts(self): + """Gets the accounts of this AccountsResponseData. # noqa: E501 + + + :return: The accounts of this AccountsResponseData. # noqa: E501 + :rtype: list[Account] + """ + return self._accounts + + @accounts.setter + def accounts(self, accounts): + """Sets the accounts of this AccountsResponseData. + + + :param accounts: The accounts of this AccountsResponseData. # noqa: E501 + :type: list[Account] + """ + if accounts is None: + raise ValueError("Invalid value for `accounts`, must not be `None`") # noqa: E501 + + self._accounts = accounts + + @property + def server_knowledge(self): + """Gets the server_knowledge of this AccountsResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this AccountsResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this AccountsResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this AccountsResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AccountsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/budget_detail.py b/ynab/models/budget_detail.py index 0615d24..976d133 100644 --- a/ynab/models/budget_detail.py +++ b/ynab/models/budget_detail.py @@ -14,20 +14,7 @@ import re # noqa: F401 import six -from ynab.models.account import Account # noqa: F401,E501 from ynab.models.budget_summary import BudgetSummary # noqa: F401,E501 -from ynab.models.category import Category # noqa: F401,E501 -from ynab.models.category_group import CategoryGroup # noqa: F401,E501 -from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 -from ynab.models.date_format import DateFormat # noqa: F401,E501 -from ynab.models.month_detail import MonthDetail # noqa: F401,E501 -from ynab.models.payee import Payee # noqa: F401,E501 -from ynab.models.payee_location import PayeeLocation # noqa: F401,E501 -from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction # noqa: F401,E501 -from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary # noqa: F401,E501 -from ynab.models.sub_transaction import SubTransaction # noqa: F401,E501 -from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 - class BudgetDetail(BudgetSummary): """NOTE: This class is auto generated by the swagger code generator program. @@ -53,6 +40,8 @@ class BudgetDetail(BudgetSummary): 'scheduled_transactions': 'list[ScheduledTransactionSummary]', 'scheduled_subtransactions': 'list[ScheduledSubTransaction]' } + if hasattr(BudgetSummary, "swagger_types"): + swagger_types.update(BudgetSummary.swagger_types) attribute_map = { 'accounts': 'accounts', @@ -66,8 +55,10 @@ class BudgetDetail(BudgetSummary): 'scheduled_transactions': 'scheduled_transactions', 'scheduled_subtransactions': 'scheduled_subtransactions' } + if hasattr(BudgetSummary, "attribute_map"): + attribute_map.update(BudgetSummary.attribute_map) - def __init__(self, accounts=None, payees=None, payee_locations=None, category_groups=None, categories=None, months=None, transactions=None, subtransactions=None, scheduled_transactions=None, scheduled_subtransactions=None): # noqa: E501 + def __init__(self, accounts=None, payees=None, payee_locations=None, category_groups=None, categories=None, months=None, transactions=None, subtransactions=None, scheduled_transactions=None, scheduled_subtransactions=None, *args, **kwargs): # noqa: E501 """BudgetDetail - a model defined in Swagger""" # noqa: E501 self._accounts = None self._payees = None @@ -100,6 +91,7 @@ def __init__(self, accounts=None, payees=None, payee_locations=None, category_gr self.scheduled_transactions = scheduled_transactions if scheduled_subtransactions is not None: self.scheduled_subtransactions = scheduled_subtransactions + BudgetSummary.__init__(self, *args, **kwargs) @property def accounts(self): diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index 9d95ab6..2795558 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -15,7 +15,6 @@ import six - class BudgetDetailResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class BudgetDetailResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'BudgetDetailResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this BudgetDetailResponse. # noqa: E501 - :rtype: object + :rtype: BudgetDetailResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this BudgetDetailResponse. # noqa: E501 - :type: object + :type: BudgetDetailResponseData """ self._data = data diff --git a/ynab/models/budget_detail_response_data.py b/ynab/models/budget_detail_response_data.py new file mode 100644 index 0000000..e5b347d --- /dev/null +++ b/ynab/models/budget_detail_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BudgetDetailResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'budget': 'BudgetDetail', + 'server_knowledge': 'int' + } + + attribute_map = { + 'budget': 'budget', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, budget=None, server_knowledge=None): # noqa: E501 + """BudgetDetailResponseData - a model defined in Swagger""" # noqa: E501 + self._budget = None + self._server_knowledge = None + self.discriminator = None + self.budget = budget + self.server_knowledge = server_knowledge + + @property + def budget(self): + """Gets the budget of this BudgetDetailResponseData. # noqa: E501 + + + :return: The budget of this BudgetDetailResponseData. # noqa: E501 + :rtype: BudgetDetail + """ + return self._budget + + @budget.setter + def budget(self, budget): + """Sets the budget of this BudgetDetailResponseData. + + + :param budget: The budget of this BudgetDetailResponseData. # noqa: E501 + :type: BudgetDetail + """ + if budget is None: + raise ValueError("Invalid value for `budget`, must not be `None`") # noqa: E501 + + self._budget = budget + + @property + def server_knowledge(self): + """Gets the server_knowledge of this BudgetDetailResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this BudgetDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this BudgetDetailResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this BudgetDetailResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetDetailResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetDetailResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py index 09f48bf..329a0f2 100644 --- a/ynab/models/budget_settings.py +++ b/ynab/models/budget_settings.py @@ -14,9 +14,6 @@ import re # noqa: F401 import six -from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 -from ynab.models.date_format import DateFormat # noqa: F401,E501 - class BudgetSettings(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index 60d7aa1..1204143 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -15,7 +15,6 @@ import six - class BudgetSettingsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class BudgetSettingsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'BudgetSettingsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this BudgetSettingsResponse. # noqa: E501 - :rtype: object + :rtype: BudgetSettingsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this BudgetSettingsResponse. # noqa: E501 - :type: object + :type: BudgetSettingsResponseData """ self._data = data diff --git a/ynab/models/budget_settings_response_data.py b/ynab/models/budget_settings_response_data.py new file mode 100644 index 0000000..ae8808a --- /dev/null +++ b/ynab/models/budget_settings_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BudgetSettingsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'settings': 'BudgetSettings' + } + + attribute_map = { + 'settings': 'settings' + } + + def __init__(self, settings=None): # noqa: E501 + """BudgetSettingsResponseData - a model defined in Swagger""" # noqa: E501 + self._settings = None + self.discriminator = None + self.settings = settings + + @property + def settings(self): + """Gets the settings of this BudgetSettingsResponseData. # noqa: E501 + + + :return: The settings of this BudgetSettingsResponseData. # noqa: E501 + :rtype: BudgetSettings + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this BudgetSettingsResponseData. + + + :param settings: The settings of this BudgetSettingsResponseData. # noqa: E501 + :type: BudgetSettings + """ + if settings is None: + raise ValueError("Invalid value for `settings`, must not be `None`") # noqa: E501 + + self._settings = settings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetSettingsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetSettingsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index d79a2b0..f522b78 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -14,10 +14,6 @@ import re # noqa: F401 import six -from ynab.models.account import Account # noqa: F401,E501 -from ynab.models.currency_format import CurrencyFormat # noqa: F401,E501 -from ynab.models.date_format import DateFormat # noqa: F401,E501 - class BudgetSummary(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index d56bcac..7b4d520 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -15,7 +15,6 @@ import six - class BudgetSummaryResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class BudgetSummaryResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'BudgetSummaryResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this BudgetSummaryResponse. # noqa: E501 - :rtype: object + :rtype: BudgetSummaryResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this BudgetSummaryResponse. # noqa: E501 - :type: object + :type: BudgetSummaryResponseData """ self._data = data diff --git a/ynab/models/budget_summary_response_data.py b/ynab/models/budget_summary_response_data.py new file mode 100644 index 0000000..b4c5fa9 --- /dev/null +++ b/ynab/models/budget_summary_response_data.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BudgetSummaryResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'budgets': 'list[BudgetSummary]', + 'default_budget': 'BudgetSummary' + } + + attribute_map = { + 'budgets': 'budgets', + 'default_budget': 'default_budget' + } + + def __init__(self, budgets=None, default_budget=None): # noqa: E501 + """BudgetSummaryResponseData - a model defined in Swagger""" # noqa: E501 + self._budgets = None + self._default_budget = None + self.discriminator = None + self.budgets = budgets + if default_budget is not None: + self.default_budget = default_budget + + @property + def budgets(self): + """Gets the budgets of this BudgetSummaryResponseData. # noqa: E501 + + + :return: The budgets of this BudgetSummaryResponseData. # noqa: E501 + :rtype: list[BudgetSummary] + """ + return self._budgets + + @budgets.setter + def budgets(self, budgets): + """Sets the budgets of this BudgetSummaryResponseData. + + + :param budgets: The budgets of this BudgetSummaryResponseData. # noqa: E501 + :type: list[BudgetSummary] + """ + if budgets is None: + raise ValueError("Invalid value for `budgets`, must not be `None`") # noqa: E501 + + self._budgets = budgets + + @property + def default_budget(self): + """Gets the default_budget of this BudgetSummaryResponseData. # noqa: E501 + + + :return: The default_budget of this BudgetSummaryResponseData. # noqa: E501 + :rtype: BudgetSummary + """ + return self._default_budget + + @default_budget.setter + def default_budget(self, default_budget): + """Sets the default_budget of this BudgetSummaryResponseData. + + + :param default_budget: The default_budget of this BudgetSummaryResponseData. # noqa: E501 + :type: BudgetSummary + """ + + self._default_budget = default_budget + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BudgetSummaryResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BudgetSummaryResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index 66626f4..7b14b83 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -15,7 +15,6 @@ import six - class BulkResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class BulkResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'BulkResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this BulkResponse. # noqa: E501 - :rtype: object + :rtype: BulkResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this BulkResponse. # noqa: E501 - :type: object + :type: BulkResponseData """ self._data = data diff --git a/ynab/models/bulk_response_data.py b/ynab/models/bulk_response_data.py new file mode 100644 index 0000000..d266252 --- /dev/null +++ b/ynab/models/bulk_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BulkResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bulk': 'BulkResponseDataBulk' + } + + attribute_map = { + 'bulk': 'bulk' + } + + def __init__(self, bulk=None): # noqa: E501 + """BulkResponseData - a model defined in Swagger""" # noqa: E501 + self._bulk = None + self.discriminator = None + self.bulk = bulk + + @property + def bulk(self): + """Gets the bulk of this BulkResponseData. # noqa: E501 + + + :return: The bulk of this BulkResponseData. # noqa: E501 + :rtype: BulkResponseDataBulk + """ + return self._bulk + + @bulk.setter + def bulk(self, bulk): + """Sets the bulk of this BulkResponseData. + + + :param bulk: The bulk of this BulkResponseData. # noqa: E501 + :type: BulkResponseDataBulk + """ + if bulk is None: + raise ValueError("Invalid value for `bulk`, must not be `None`") # noqa: E501 + + self._bulk = bulk + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BulkResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BulkResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/bulk_response_data_bulk.py b/ynab/models/bulk_response_data_bulk.py new file mode 100644 index 0000000..6fee2e9 --- /dev/null +++ b/ynab/models/bulk_response_data_bulk.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BulkResponseDataBulk(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transaction_ids': 'list[str]', + 'duplicate_import_ids': 'list[str]' + } + + attribute_map = { + 'transaction_ids': 'transaction_ids', + 'duplicate_import_ids': 'duplicate_import_ids' + } + + def __init__(self, transaction_ids=None, duplicate_import_ids=None): # noqa: E501 + """BulkResponseDataBulk - a model defined in Swagger""" # noqa: E501 + self._transaction_ids = None + self._duplicate_import_ids = None + self.discriminator = None + self.transaction_ids = transaction_ids + self.duplicate_import_ids = duplicate_import_ids + + @property + def transaction_ids(self): + """Gets the transaction_ids of this BulkResponseDataBulk. # noqa: E501 + + The list of Transaction ids that were created. # noqa: E501 + + :return: The transaction_ids of this BulkResponseDataBulk. # noqa: E501 + :rtype: list[str] + """ + return self._transaction_ids + + @transaction_ids.setter + def transaction_ids(self, transaction_ids): + """Sets the transaction_ids of this BulkResponseDataBulk. + + The list of Transaction ids that were created. # noqa: E501 + + :param transaction_ids: The transaction_ids of this BulkResponseDataBulk. # noqa: E501 + :type: list[str] + """ + if transaction_ids is None: + raise ValueError("Invalid value for `transaction_ids`, must not be `None`") # noqa: E501 + + self._transaction_ids = transaction_ids + + @property + def duplicate_import_ids(self): + """Gets the duplicate_import_ids of this BulkResponseDataBulk. # noqa: E501 + + If any Transactions were not created because they had an `import_id` matching a transaction already on the same account, the specified import_id(s) will be included in this list. # noqa: E501 + + :return: The duplicate_import_ids of this BulkResponseDataBulk. # noqa: E501 + :rtype: list[str] + """ + return self._duplicate_import_ids + + @duplicate_import_ids.setter + def duplicate_import_ids(self, duplicate_import_ids): + """Sets the duplicate_import_ids of this BulkResponseDataBulk. + + If any Transactions were not created because they had an `import_id` matching a transaction already on the same account, the specified import_id(s) will be included in this list. # noqa: E501 + + :param duplicate_import_ids: The duplicate_import_ids of this BulkResponseDataBulk. # noqa: E501 + :type: list[str] + """ + if duplicate_import_ids is None: + raise ValueError("Invalid value for `duplicate_import_ids`, must not be `None`") # noqa: E501 + + self._duplicate_import_ids = duplicate_import_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BulkResponseDataBulk, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BulkResponseDataBulk): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index d8c8778..1b9f8bc 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 - class BulkTransactions(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 024276c..5bb0e9a 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -15,7 +15,6 @@ import six - class CategoriesResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class CategoriesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'CategoriesResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this CategoriesResponse. # noqa: E501 - :rtype: object + :rtype: CategoriesResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this CategoriesResponse. # noqa: E501 - :type: object + :type: CategoriesResponseData """ self._data = data diff --git a/ynab/models/categories_response_data.py b/ynab/models/categories_response_data.py new file mode 100644 index 0000000..515a06e --- /dev/null +++ b/ynab/models/categories_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoriesResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category_groups': 'list[CategoryGroupWithCategories]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'category_groups': 'category_groups', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, category_groups=None, server_knowledge=None): # noqa: E501 + """CategoriesResponseData - a model defined in Swagger""" # noqa: E501 + self._category_groups = None + self._server_knowledge = None + self.discriminator = None + self.category_groups = category_groups + self.server_knowledge = server_knowledge + + @property + def category_groups(self): + """Gets the category_groups of this CategoriesResponseData. # noqa: E501 + + + :return: The category_groups of this CategoriesResponseData. # noqa: E501 + :rtype: list[CategoryGroupWithCategories] + """ + return self._category_groups + + @category_groups.setter + def category_groups(self, category_groups): + """Sets the category_groups of this CategoriesResponseData. + + + :param category_groups: The category_groups of this CategoriesResponseData. # noqa: E501 + :type: list[CategoryGroupWithCategories] + """ + if category_groups is None: + raise ValueError("Invalid value for `category_groups`, must not be `None`") # noqa: E501 + + self._category_groups = category_groups + + @property + def server_knowledge(self): + """Gets the server_knowledge of this CategoriesResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this CategoriesResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this CategoriesResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this CategoriesResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CategoriesResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CategoriesResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/category.py b/ynab/models/category.py index 5797cec..2f58847 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -15,7 +15,6 @@ import six - class Category(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index dfaf35d..87b3de6 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -15,7 +15,6 @@ import six - class CategoryGroup(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index 9823efa..1fee8be 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -14,10 +14,8 @@ import re # noqa: F401 import six -from ynab.models.category import Category # noqa: F401,E501 from ynab.models.category_group import CategoryGroup # noqa: F401,E501 - class CategoryGroupWithCategories(CategoryGroup): """NOTE: This class is auto generated by the swagger code generator program. @@ -33,16 +31,21 @@ class CategoryGroupWithCategories(CategoryGroup): swagger_types = { 'categories': 'list[Category]' } + if hasattr(CategoryGroup, "swagger_types"): + swagger_types.update(CategoryGroup.swagger_types) attribute_map = { 'categories': 'categories' } + if hasattr(CategoryGroup, "attribute_map"): + attribute_map.update(CategoryGroup.attribute_map) - def __init__(self, categories=None): # noqa: E501 + def __init__(self, categories=None, *args, **kwargs): # noqa: E501 """CategoryGroupWithCategories - a model defined in Swagger""" # noqa: E501 self._categories = None self.discriminator = None self.categories = categories + CategoryGroup.__init__(self, *args, **kwargs) @property def categories(self): diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index 97f31c7..e34f480 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -15,7 +15,6 @@ import six - class CategoryResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class CategoryResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'CategoryResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this CategoryResponse. # noqa: E501 - :rtype: object + :rtype: CategoryResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this CategoryResponse. # noqa: E501 - :type: object + :type: CategoryResponseData """ self._data = data diff --git a/ynab/models/category_response_data.py b/ynab/models/category_response_data.py new file mode 100644 index 0000000..31bf669 --- /dev/null +++ b/ynab/models/category_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoryResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'Category' + } + + attribute_map = { + 'category': 'category' + } + + def __init__(self, category=None): # noqa: E501 + """CategoryResponseData - a model defined in Swagger""" # noqa: E501 + self._category = None + self.discriminator = None + self.category = category + + @property + def category(self): + """Gets the category of this CategoryResponseData. # noqa: E501 + + + :return: The category of this CategoryResponseData. # noqa: E501 + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this CategoryResponseData. + + + :param category: The category of this CategoryResponseData. # noqa: E501 + :type: Category + """ + if category is None: + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + + self._category = category + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CategoryResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CategoryResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index 08e351d..3f8fe20 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -15,7 +15,6 @@ import six - class CurrencyFormat(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index f5815ad..c84beb9 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -15,7 +15,6 @@ import six - class DateFormat(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index 310215e..21e7b86 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -15,7 +15,6 @@ import six - class ErrorDetail(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index c2acdc6..9267cf8 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.error_detail import ErrorDetail # noqa: F401,E501 - class ErrorResponse(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index 8ae8c43..2157239 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -16,7 +16,6 @@ import six from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 - class HybridTransaction(TransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,6 +35,8 @@ class HybridTransaction(TransactionSummary): 'payee_name': 'str', 'category_name': 'str' } + if hasattr(TransactionSummary, "swagger_types"): + swagger_types.update(TransactionSummary.swagger_types) attribute_map = { 'type': 'type', @@ -44,8 +45,10 @@ class HybridTransaction(TransactionSummary): 'payee_name': 'payee_name', 'category_name': 'category_name' } + if hasattr(TransactionSummary, "attribute_map"): + attribute_map.update(TransactionSummary.attribute_map) - def __init__(self, type=None, parent_transaction_id=None, account_name=None, payee_name=None, category_name=None): # noqa: E501 + def __init__(self, type=None, parent_transaction_id=None, account_name=None, payee_name=None, category_name=None, *args, **kwargs): # noqa: E501 """HybridTransaction - a model defined in Swagger""" # noqa: E501 self._type = None self._parent_transaction_id = None @@ -61,6 +64,7 @@ def __init__(self, type=None, parent_transaction_id=None, account_name=None, pay self.payee_name = payee_name if category_name is not None: self.category_name = category_name + TransactionSummary.__init__(self, *args, **kwargs) @property def type(self): diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index 32d77de..da324fd 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -15,7 +15,6 @@ import six - class HybridTransactionsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class HybridTransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'HybridTransactionsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this HybridTransactionsResponse. # noqa: E501 - :rtype: object + :rtype: HybridTransactionsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this HybridTransactionsResponse. # noqa: E501 - :type: object + :type: HybridTransactionsResponseData """ self._data = data diff --git a/ynab/models/hybrid_transactions_response_data.py b/ynab/models/hybrid_transactions_response_data.py new file mode 100644 index 0000000..8154231 --- /dev/null +++ b/ynab/models/hybrid_transactions_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class HybridTransactionsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transactions': 'list[HybridTransaction]' + } + + attribute_map = { + 'transactions': 'transactions' + } + + def __init__(self, transactions=None): # noqa: E501 + """HybridTransactionsResponseData - a model defined in Swagger""" # noqa: E501 + self._transactions = None + self.discriminator = None + self.transactions = transactions + + @property + def transactions(self): + """Gets the transactions of this HybridTransactionsResponseData. # noqa: E501 + + + :return: The transactions of this HybridTransactionsResponseData. # noqa: E501 + :rtype: list[HybridTransaction] + """ + return self._transactions + + @transactions.setter + def transactions(self, transactions): + """Sets the transactions of this HybridTransactionsResponseData. + + + :param transactions: The transactions of this HybridTransactionsResponseData. # noqa: E501 + :type: list[HybridTransaction] + """ + if transactions is None: + raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + + self._transactions = transactions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(HybridTransactionsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HybridTransactionsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index e81fa7a..9a8fc16 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -14,10 +14,8 @@ import re # noqa: F401 import six -from ynab.models.category import Category # noqa: F401,E501 from ynab.models.month_summary import MonthSummary # noqa: F401,E501 - class MonthDetail(MonthSummary): """NOTE: This class is auto generated by the swagger code generator program. @@ -33,16 +31,21 @@ class MonthDetail(MonthSummary): swagger_types = { 'categories': 'list[Category]' } + if hasattr(MonthSummary, "swagger_types"): + swagger_types.update(MonthSummary.swagger_types) attribute_map = { 'categories': 'categories' } + if hasattr(MonthSummary, "attribute_map"): + attribute_map.update(MonthSummary.attribute_map) - def __init__(self, categories=None): # noqa: E501 + def __init__(self, categories=None, *args, **kwargs): # noqa: E501 """MonthDetail - a model defined in Swagger""" # noqa: E501 self._categories = None self.discriminator = None self.categories = categories + MonthSummary.__init__(self, *args, **kwargs) @property def categories(self): diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index c3f00eb..2db35fc 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -15,7 +15,6 @@ import six - class MonthDetailResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class MonthDetailResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'MonthDetailResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this MonthDetailResponse. # noqa: E501 - :rtype: object + :rtype: MonthDetailResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this MonthDetailResponse. # noqa: E501 - :type: object + :type: MonthDetailResponseData """ self._data = data diff --git a/ynab/models/month_detail_response_data.py b/ynab/models/month_detail_response_data.py new file mode 100644 index 0000000..1175ba5 --- /dev/null +++ b/ynab/models/month_detail_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MonthDetailResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'month': 'MonthDetail' + } + + attribute_map = { + 'month': 'month' + } + + def __init__(self, month=None): # noqa: E501 + """MonthDetailResponseData - a model defined in Swagger""" # noqa: E501 + self._month = None + self.discriminator = None + self.month = month + + @property + def month(self): + """Gets the month of this MonthDetailResponseData. # noqa: E501 + + + :return: The month of this MonthDetailResponseData. # noqa: E501 + :rtype: MonthDetail + """ + return self._month + + @month.setter + def month(self, month): + """Sets the month of this MonthDetailResponseData. + + + :param month: The month of this MonthDetailResponseData. # noqa: E501 + :type: MonthDetail + """ + if month is None: + raise ValueError("Invalid value for `month`, must not be `None`") # noqa: E501 + + self._month = month + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonthDetailResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonthDetailResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index c4ada58..89d6559 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -15,7 +15,6 @@ import six - class MonthSummariesResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class MonthSummariesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'MonthSummariesResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this MonthSummariesResponse. # noqa: E501 - :rtype: object + :rtype: MonthSummariesResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this MonthSummariesResponse. # noqa: E501 - :type: object + :type: MonthSummariesResponseData """ self._data = data diff --git a/ynab/models/month_summaries_response_data.py b/ynab/models/month_summaries_response_data.py new file mode 100644 index 0000000..29776e6 --- /dev/null +++ b/ynab/models/month_summaries_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MonthSummariesResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'months': 'list[MonthSummary]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'months': 'months', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, months=None, server_knowledge=None): # noqa: E501 + """MonthSummariesResponseData - a model defined in Swagger""" # noqa: E501 + self._months = None + self._server_knowledge = None + self.discriminator = None + self.months = months + self.server_knowledge = server_knowledge + + @property + def months(self): + """Gets the months of this MonthSummariesResponseData. # noqa: E501 + + + :return: The months of this MonthSummariesResponseData. # noqa: E501 + :rtype: list[MonthSummary] + """ + return self._months + + @months.setter + def months(self, months): + """Sets the months of this MonthSummariesResponseData. + + + :param months: The months of this MonthSummariesResponseData. # noqa: E501 + :type: list[MonthSummary] + """ + if months is None: + raise ValueError("Invalid value for `months`, must not be `None`") # noqa: E501 + + self._months = months + + @property + def server_knowledge(self): + """Gets the server_knowledge of this MonthSummariesResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this MonthSummariesResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this MonthSummariesResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this MonthSummariesResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonthSummariesResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonthSummariesResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 3742c3b..a8bbffc 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -15,7 +15,6 @@ import six - class MonthSummary(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/payee.py b/ynab/models/payee.py index eacae52..65ebd5e 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -15,7 +15,6 @@ import six - class Payee(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 951e12d..25e8fd1 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -15,7 +15,6 @@ import six - class PayeeLocation(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 0f2fea7..1c026b2 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -15,7 +15,6 @@ import six - class PayeeLocationResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class PayeeLocationResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'PayeeLocationResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this PayeeLocationResponse. # noqa: E501 - :rtype: object + :rtype: PayeeLocationResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this PayeeLocationResponse. # noqa: E501 - :type: object + :type: PayeeLocationResponseData """ self._data = data diff --git a/ynab/models/payee_location_response_data.py b/ynab/models/payee_location_response_data.py new file mode 100644 index 0000000..0f333af --- /dev/null +++ b/ynab/models/payee_location_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayeeLocationResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'payee_location': 'PayeeLocation' + } + + attribute_map = { + 'payee_location': 'payee_location' + } + + def __init__(self, payee_location=None): # noqa: E501 + """PayeeLocationResponseData - a model defined in Swagger""" # noqa: E501 + self._payee_location = None + self.discriminator = None + self.payee_location = payee_location + + @property + def payee_location(self): + """Gets the payee_location of this PayeeLocationResponseData. # noqa: E501 + + + :return: The payee_location of this PayeeLocationResponseData. # noqa: E501 + :rtype: PayeeLocation + """ + return self._payee_location + + @payee_location.setter + def payee_location(self, payee_location): + """Sets the payee_location of this PayeeLocationResponseData. + + + :param payee_location: The payee_location of this PayeeLocationResponseData. # noqa: E501 + :type: PayeeLocation + """ + if payee_location is None: + raise ValueError("Invalid value for `payee_location`, must not be `None`") # noqa: E501 + + self._payee_location = payee_location + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayeeLocationResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayeeLocationResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index b79312a..8deeb51 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -15,7 +15,6 @@ import six - class PayeeLocationsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class PayeeLocationsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'PayeeLocationsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this PayeeLocationsResponse. # noqa: E501 - :rtype: object + :rtype: PayeeLocationsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this PayeeLocationsResponse. # noqa: E501 - :type: object + :type: PayeeLocationsResponseData """ self._data = data diff --git a/ynab/models/payee_locations_response_data.py b/ynab/models/payee_locations_response_data.py new file mode 100644 index 0000000..01cb17d --- /dev/null +++ b/ynab/models/payee_locations_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayeeLocationsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'payee_locations': 'list[PayeeLocation]' + } + + attribute_map = { + 'payee_locations': 'payee_locations' + } + + def __init__(self, payee_locations=None): # noqa: E501 + """PayeeLocationsResponseData - a model defined in Swagger""" # noqa: E501 + self._payee_locations = None + self.discriminator = None + self.payee_locations = payee_locations + + @property + def payee_locations(self): + """Gets the payee_locations of this PayeeLocationsResponseData. # noqa: E501 + + + :return: The payee_locations of this PayeeLocationsResponseData. # noqa: E501 + :rtype: list[PayeeLocation] + """ + return self._payee_locations + + @payee_locations.setter + def payee_locations(self, payee_locations): + """Sets the payee_locations of this PayeeLocationsResponseData. + + + :param payee_locations: The payee_locations of this PayeeLocationsResponseData. # noqa: E501 + :type: list[PayeeLocation] + """ + if payee_locations is None: + raise ValueError("Invalid value for `payee_locations`, must not be `None`") # noqa: E501 + + self._payee_locations = payee_locations + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayeeLocationsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayeeLocationsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 74926a2..c120d7d 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -15,7 +15,6 @@ import six - class PayeeResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class PayeeResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'PayeeResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this PayeeResponse. # noqa: E501 - :rtype: object + :rtype: PayeeResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this PayeeResponse. # noqa: E501 - :type: object + :type: PayeeResponseData """ self._data = data diff --git a/ynab/models/payee_response_data.py b/ynab/models/payee_response_data.py new file mode 100644 index 0000000..ee89b97 --- /dev/null +++ b/ynab/models/payee_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayeeResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'payee': 'Payee' + } + + attribute_map = { + 'payee': 'payee' + } + + def __init__(self, payee=None): # noqa: E501 + """PayeeResponseData - a model defined in Swagger""" # noqa: E501 + self._payee = None + self.discriminator = None + self.payee = payee + + @property + def payee(self): + """Gets the payee of this PayeeResponseData. # noqa: E501 + + + :return: The payee of this PayeeResponseData. # noqa: E501 + :rtype: Payee + """ + return self._payee + + @payee.setter + def payee(self, payee): + """Sets the payee of this PayeeResponseData. + + + :param payee: The payee of this PayeeResponseData. # noqa: E501 + :type: Payee + """ + if payee is None: + raise ValueError("Invalid value for `payee`, must not be `None`") # noqa: E501 + + self._payee = payee + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayeeResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayeeResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index cd49cbe..1f1c10a 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -15,7 +15,6 @@ import six - class PayeesResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class PayeesResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'PayeesResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this PayeesResponse. # noqa: E501 - :rtype: object + :rtype: PayeesResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this PayeesResponse. # noqa: E501 - :type: object + :type: PayeesResponseData """ self._data = data diff --git a/ynab/models/payees_response_data.py b/ynab/models/payees_response_data.py new file mode 100644 index 0000000..058f5f2 --- /dev/null +++ b/ynab/models/payees_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayeesResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'payees': 'list[Payee]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'payees': 'payees', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, payees=None, server_knowledge=None): # noqa: E501 + """PayeesResponseData - a model defined in Swagger""" # noqa: E501 + self._payees = None + self._server_knowledge = None + self.discriminator = None + self.payees = payees + self.server_knowledge = server_knowledge + + @property + def payees(self): + """Gets the payees of this PayeesResponseData. # noqa: E501 + + + :return: The payees of this PayeesResponseData. # noqa: E501 + :rtype: list[Payee] + """ + return self._payees + + @payees.setter + def payees(self, payees): + """Sets the payees of this PayeesResponseData. + + + :param payees: The payees of this PayeesResponseData. # noqa: E501 + :type: list[Payee] + """ + if payees is None: + raise ValueError("Invalid value for `payees`, must not be `None`") # noqa: E501 + + self._payees = payees + + @property + def server_knowledge(self): + """Gets the server_knowledge of this PayeesResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this PayeesResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this PayeesResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this PayeesResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayeesResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayeesResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_account.py b/ynab/models/save_account.py index 0d03f83..1f9c72a 100644 --- a/ynab/models/save_account.py +++ b/ynab/models/save_account.py @@ -15,7 +15,6 @@ import six - class SaveAccount(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -70,8 +69,6 @@ def name(self, name): :param name: The name of this SaveAccount. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -95,8 +92,6 @@ def type(self, type): :param type: The type of this SaveAccount. # noqa: E501 :type: str """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 allowed_values = ["checking", "savings", "creditCard", "cash", "lineOfCredit", "otherAsset", "otherLiability"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -126,8 +121,6 @@ def balance(self, balance): :param balance: The balance of this SaveAccount. # noqa: E501 :type: int """ - if balance is None: - raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 self._balance = balance diff --git a/ynab/models/save_account_wrapper.py b/ynab/models/save_account_wrapper.py index d303cee..3b4dd1d 100644 --- a/ynab/models/save_account_wrapper.py +++ b/ynab/models/save_account_wrapper.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_account import SaveAccount # noqa: F401,E501 - class SaveAccountWrapper(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -61,8 +59,6 @@ def account(self, account): :param account: The account of this SaveAccountWrapper. # noqa: E501 :type: SaveAccount """ - if account is None: - raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 self._account = account diff --git a/ynab/models/save_category_response.py b/ynab/models/save_category_response.py index e8ebf29..cfa1b29 100644 --- a/ynab/models/save_category_response.py +++ b/ynab/models/save_category_response.py @@ -15,7 +15,6 @@ import six - class SaveCategoryResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class SaveCategoryResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'SaveCategoryResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this SaveCategoryResponse. # noqa: E501 - :rtype: object + :rtype: SaveCategoryResponseData """ return self._data @@ -58,10 +57,8 @@ def data(self, data): :param data: The data of this SaveCategoryResponse. # noqa: E501 - :type: object + :type: SaveCategoryResponseData """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/save_category_response_data.py b/ynab/models/save_category_response_data.py new file mode 100644 index 0000000..86317cf --- /dev/null +++ b/ynab/models/save_category_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SaveCategoryResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'Category', + 'server_knowledge': 'int' + } + + attribute_map = { + 'category': 'category', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, category=None, server_knowledge=None): # noqa: E501 + """SaveCategoryResponseData - a model defined in Swagger""" # noqa: E501 + self._category = None + self._server_knowledge = None + self.discriminator = None + self.category = category + self.server_knowledge = server_knowledge + + @property + def category(self): + """Gets the category of this SaveCategoryResponseData. # noqa: E501 + + + :return: The category of this SaveCategoryResponseData. # noqa: E501 + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this SaveCategoryResponseData. + + + :param category: The category of this SaveCategoryResponseData. # noqa: E501 + :type: Category + """ + if category is None: + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + + self._category = category + + @property + def server_knowledge(self): + """Gets the server_knowledge of this SaveCategoryResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this SaveCategoryResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this SaveCategoryResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this SaveCategoryResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveCategoryResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveCategoryResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py index d0d0140..0697461 100644 --- a/ynab/models/save_month_category.py +++ b/ynab/models/save_month_category.py @@ -15,7 +15,6 @@ import six - class SaveMonthCategory(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/save_month_category_wrapper.py b/ynab/models/save_month_category_wrapper.py index 9a2a8c3..b3ed64a 100644 --- a/ynab/models/save_month_category_wrapper.py +++ b/ynab/models/save_month_category_wrapper.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_month_category import SaveMonthCategory # noqa: F401,E501 - class SaveMonthCategoryWrapper(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/save_sub_transaction.py b/ynab/models/save_sub_transaction.py index 83a5ddd..39911e5 100644 --- a/ynab/models/save_sub_transaction.py +++ b/ynab/models/save_sub_transaction.py @@ -15,7 +15,6 @@ import six - class SaveSubTransaction(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -82,8 +81,6 @@ def amount(self, amount): :param amount: The amount of this SaveSubTransaction. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index 09cc661..8df25fb 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_sub_transaction import SaveSubTransaction # noqa: F401,E501 - class SaveTransaction(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/save_transaction_wrapper.py b/ynab/models/save_transaction_wrapper.py index 78f88c6..26000ef 100644 --- a/ynab/models/save_transaction_wrapper.py +++ b/ynab/models/save_transaction_wrapper.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 - class SaveTransactionWrapper(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py index c0f10df..7386438 100644 --- a/ynab/models/save_transactions_response.py +++ b/ynab/models/save_transactions_response.py @@ -15,7 +15,6 @@ import six - class SaveTransactionsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class SaveTransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'SaveTransactionsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this SaveTransactionsResponse. # noqa: E501 - :rtype: object + :rtype: SaveTransactionsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this SaveTransactionsResponse. # noqa: E501 - :type: object + :type: SaveTransactionsResponseData """ self._data = data diff --git a/ynab/models/save_transactions_response_data.py b/ynab/models/save_transactions_response_data.py new file mode 100644 index 0000000..89c1b51 --- /dev/null +++ b/ynab/models/save_transactions_response_data.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SaveTransactionsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transaction_ids': 'list[str]', + 'transaction': 'TransactionDetail', + 'transactions': 'list[TransactionDetail]', + 'duplicate_import_ids': 'list[str]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'transaction_ids': 'transaction_ids', + 'transaction': 'transaction', + 'transactions': 'transactions', + 'duplicate_import_ids': 'duplicate_import_ids', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, transaction_ids=None, transaction=None, transactions=None, duplicate_import_ids=None, server_knowledge=None): # noqa: E501 + """SaveTransactionsResponseData - a model defined in Swagger""" # noqa: E501 + self._transaction_ids = None + self._transaction = None + self._transactions = None + self._duplicate_import_ids = None + self._server_knowledge = None + self.discriminator = None + self.transaction_ids = transaction_ids + if transaction is not None: + self.transaction = transaction + if transactions is not None: + self.transactions = transactions + if duplicate_import_ids is not None: + self.duplicate_import_ids = duplicate_import_ids + self.server_knowledge = server_knowledge + + @property + def transaction_ids(self): + """Gets the transaction_ids of this SaveTransactionsResponseData. # noqa: E501 + + The transaction ids that were saved # noqa: E501 + + :return: The transaction_ids of this SaveTransactionsResponseData. # noqa: E501 + :rtype: list[str] + """ + return self._transaction_ids + + @transaction_ids.setter + def transaction_ids(self, transaction_ids): + """Sets the transaction_ids of this SaveTransactionsResponseData. + + The transaction ids that were saved # noqa: E501 + + :param transaction_ids: The transaction_ids of this SaveTransactionsResponseData. # noqa: E501 + :type: list[str] + """ + if transaction_ids is None: + raise ValueError("Invalid value for `transaction_ids`, must not be `None`") # noqa: E501 + + self._transaction_ids = transaction_ids + + @property + def transaction(self): + """Gets the transaction of this SaveTransactionsResponseData. # noqa: E501 + + + :return: The transaction of this SaveTransactionsResponseData. # noqa: E501 + :rtype: TransactionDetail + """ + return self._transaction + + @transaction.setter + def transaction(self, transaction): + """Sets the transaction of this SaveTransactionsResponseData. + + + :param transaction: The transaction of this SaveTransactionsResponseData. # noqa: E501 + :type: TransactionDetail + """ + + self._transaction = transaction + + @property + def transactions(self): + """Gets the transactions of this SaveTransactionsResponseData. # noqa: E501 + + If multiple transactions were specified, the transactions that were saved # noqa: E501 + + :return: The transactions of this SaveTransactionsResponseData. # noqa: E501 + :rtype: list[TransactionDetail] + """ + return self._transactions + + @transactions.setter + def transactions(self, transactions): + """Sets the transactions of this SaveTransactionsResponseData. + + If multiple transactions were specified, the transactions that were saved # noqa: E501 + + :param transactions: The transactions of this SaveTransactionsResponseData. # noqa: E501 + :type: list[TransactionDetail] + """ + + self._transactions = transactions + + @property + def duplicate_import_ids(self): + """Gets the duplicate_import_ids of this SaveTransactionsResponseData. # noqa: E501 + + If multiple transactions were specified, a list of import_ids that were not created because of an existing `import_id` found on the same account # noqa: E501 + + :return: The duplicate_import_ids of this SaveTransactionsResponseData. # noqa: E501 + :rtype: list[str] + """ + return self._duplicate_import_ids + + @duplicate_import_ids.setter + def duplicate_import_ids(self, duplicate_import_ids): + """Sets the duplicate_import_ids of this SaveTransactionsResponseData. + + If multiple transactions were specified, a list of import_ids that were not created because of an existing `import_id` found on the same account # noqa: E501 + + :param duplicate_import_ids: The duplicate_import_ids of this SaveTransactionsResponseData. # noqa: E501 + :type: list[str] + """ + + self._duplicate_import_ids = duplicate_import_ids + + @property + def server_knowledge(self): + """Gets the server_knowledge of this SaveTransactionsResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this SaveTransactionsResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this SaveTransactionsResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this SaveTransactionsResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SaveTransactionsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SaveTransactionsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/save_transactions_wrapper.py b/ynab/models/save_transactions_wrapper.py index 636dfd9..854820f 100644 --- a/ynab/models/save_transactions_wrapper.py +++ b/ynab/models/save_transactions_wrapper.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 - class SaveTransactionsWrapper(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index d532466..6b616b3 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -15,7 +15,6 @@ import six - class ScheduledSubTransaction(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index a77ca33..df18741 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -14,10 +14,8 @@ import re # noqa: F401 import six -from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction # noqa: F401,E501 from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary # noqa: F401,E501 - class ScheduledTransactionDetail(ScheduledTransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,6 +34,8 @@ class ScheduledTransactionDetail(ScheduledTransactionSummary): 'category_name': 'str', 'subtransactions': 'list[ScheduledSubTransaction]' } + if hasattr(ScheduledTransactionSummary, "swagger_types"): + swagger_types.update(ScheduledTransactionSummary.swagger_types) attribute_map = { 'account_name': 'account_name', @@ -43,8 +43,10 @@ class ScheduledTransactionDetail(ScheduledTransactionSummary): 'category_name': 'category_name', 'subtransactions': 'subtransactions' } + if hasattr(ScheduledTransactionSummary, "attribute_map"): + attribute_map.update(ScheduledTransactionSummary.attribute_map) - def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None, *args, **kwargs): # noqa: E501 """ScheduledTransactionDetail - a model defined in Swagger""" # noqa: E501 self._account_name = None self._payee_name = None @@ -57,6 +59,7 @@ def __init__(self, account_name=None, payee_name=None, category_name=None, subtr if category_name is not None: self.category_name = category_name self.subtransactions = subtransactions + ScheduledTransactionSummary.__init__(self, *args, **kwargs) @property def account_name(self): diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index 8995979..1d1fe6b 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -15,7 +15,6 @@ import six - class ScheduledTransactionResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class ScheduledTransactionResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'ScheduledTransactionResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this ScheduledTransactionResponse. # noqa: E501 - :rtype: object + :rtype: ScheduledTransactionResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionResponse. # noqa: E501 - :type: object + :type: ScheduledTransactionResponseData """ self._data = data diff --git a/ynab/models/scheduled_transaction_response_data.py b/ynab/models/scheduled_transaction_response_data.py new file mode 100644 index 0000000..aa17f89 --- /dev/null +++ b/ynab/models/scheduled_transaction_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ScheduledTransactionResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'scheduled_transaction': 'ScheduledTransactionDetail' + } + + attribute_map = { + 'scheduled_transaction': 'scheduled_transaction' + } + + def __init__(self, scheduled_transaction=None): # noqa: E501 + """ScheduledTransactionResponseData - a model defined in Swagger""" # noqa: E501 + self._scheduled_transaction = None + self.discriminator = None + self.scheduled_transaction = scheduled_transaction + + @property + def scheduled_transaction(self): + """Gets the scheduled_transaction of this ScheduledTransactionResponseData. # noqa: E501 + + + :return: The scheduled_transaction of this ScheduledTransactionResponseData. # noqa: E501 + :rtype: ScheduledTransactionDetail + """ + return self._scheduled_transaction + + @scheduled_transaction.setter + def scheduled_transaction(self, scheduled_transaction): + """Sets the scheduled_transaction of this ScheduledTransactionResponseData. + + + :param scheduled_transaction: The scheduled_transaction of this ScheduledTransactionResponseData. # noqa: E501 + :type: ScheduledTransactionDetail + """ + if scheduled_transaction is None: + raise ValueError("Invalid value for `scheduled_transaction`, must not be `None`") # noqa: E501 + + self._scheduled_transaction = scheduled_transaction + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ScheduledTransactionResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScheduledTransactionResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index af235f3..ae582af 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -15,7 +15,6 @@ import six - class ScheduledTransactionSummary(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index 8c3f182..2f76851 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -15,7 +15,6 @@ import six - class ScheduledTransactionsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class ScheduledTransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'ScheduledTransactionsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this ScheduledTransactionsResponse. # noqa: E501 - :rtype: object + :rtype: ScheduledTransactionsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this ScheduledTransactionsResponse. # noqa: E501 - :type: object + :type: ScheduledTransactionsResponseData """ self._data = data diff --git a/ynab/models/scheduled_transactions_response_data.py b/ynab/models/scheduled_transactions_response_data.py new file mode 100644 index 0000000..ac8e08f --- /dev/null +++ b/ynab/models/scheduled_transactions_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ScheduledTransactionsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'scheduled_transactions': 'list[ScheduledTransactionDetail]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'scheduled_transactions': 'scheduled_transactions', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, scheduled_transactions=None, server_knowledge=None): # noqa: E501 + """ScheduledTransactionsResponseData - a model defined in Swagger""" # noqa: E501 + self._scheduled_transactions = None + self._server_knowledge = None + self.discriminator = None + self.scheduled_transactions = scheduled_transactions + self.server_knowledge = server_knowledge + + @property + def scheduled_transactions(self): + """Gets the scheduled_transactions of this ScheduledTransactionsResponseData. # noqa: E501 + + + :return: The scheduled_transactions of this ScheduledTransactionsResponseData. # noqa: E501 + :rtype: list[ScheduledTransactionDetail] + """ + return self._scheduled_transactions + + @scheduled_transactions.setter + def scheduled_transactions(self, scheduled_transactions): + """Sets the scheduled_transactions of this ScheduledTransactionsResponseData. + + + :param scheduled_transactions: The scheduled_transactions of this ScheduledTransactionsResponseData. # noqa: E501 + :type: list[ScheduledTransactionDetail] + """ + if scheduled_transactions is None: + raise ValueError("Invalid value for `scheduled_transactions`, must not be `None`") # noqa: E501 + + self._scheduled_transactions = scheduled_transactions + + @property + def server_knowledge(self): + """Gets the server_knowledge of this ScheduledTransactionsResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this ScheduledTransactionsResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this ScheduledTransactionsResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this ScheduledTransactionsResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ScheduledTransactionsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScheduledTransactionsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index b8c9e48..fc4201a 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -15,7 +15,6 @@ import six - class SubTransaction(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index 6ac1a17..c6b3da6 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -14,10 +14,8 @@ import re # noqa: F401 import six -from ynab.models.sub_transaction import SubTransaction # noqa: F401,E501 from ynab.models.transaction_summary import TransactionSummary # noqa: F401,E501 - class TransactionDetail(TransactionSummary): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,6 +34,8 @@ class TransactionDetail(TransactionSummary): 'category_name': 'str', 'subtransactions': 'list[SubTransaction]' } + if hasattr(TransactionSummary, "swagger_types"): + swagger_types.update(TransactionSummary.swagger_types) attribute_map = { 'account_name': 'account_name', @@ -43,8 +43,10 @@ class TransactionDetail(TransactionSummary): 'category_name': 'category_name', 'subtransactions': 'subtransactions' } + if hasattr(TransactionSummary, "attribute_map"): + attribute_map.update(TransactionSummary.attribute_map) - def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None): # noqa: E501 + def __init__(self, account_name=None, payee_name=None, category_name=None, subtransactions=None, *args, **kwargs): # noqa: E501 """TransactionDetail - a model defined in Swagger""" # noqa: E501 self._account_name = None self._payee_name = None @@ -57,6 +59,7 @@ def __init__(self, account_name=None, payee_name=None, category_name=None, subtr if category_name is not None: self.category_name = category_name self.subtransactions = subtransactions + TransactionSummary.__init__(self, *args, **kwargs) @property def account_name(self): diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index cb60044..f7ad93e 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -15,7 +15,6 @@ import six - class TransactionResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class TransactionResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'TransactionResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this TransactionResponse. # noqa: E501 - :rtype: object + :rtype: TransactionResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this TransactionResponse. # noqa: E501 - :type: object + :type: TransactionResponseData """ self._data = data diff --git a/ynab/models/transaction_response_data.py b/ynab/models/transaction_response_data.py new file mode 100644 index 0000000..48ff338 --- /dev/null +++ b/ynab/models/transaction_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TransactionResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transaction': 'TransactionDetail' + } + + attribute_map = { + 'transaction': 'transaction' + } + + def __init__(self, transaction=None): # noqa: E501 + """TransactionResponseData - a model defined in Swagger""" # noqa: E501 + self._transaction = None + self.discriminator = None + self.transaction = transaction + + @property + def transaction(self): + """Gets the transaction of this TransactionResponseData. # noqa: E501 + + + :return: The transaction of this TransactionResponseData. # noqa: E501 + :rtype: TransactionDetail + """ + return self._transaction + + @transaction.setter + def transaction(self, transaction): + """Sets the transaction of this TransactionResponseData. + + + :param transaction: The transaction of this TransactionResponseData. # noqa: E501 + :type: TransactionDetail + """ + if transaction is None: + raise ValueError("Invalid value for `transaction`, must not be `None`") # noqa: E501 + + self._transaction = transaction + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TransactionResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index 162ee21..a5e9090 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -15,7 +15,6 @@ import six - class TransactionSummary(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/transactions_import_response.py b/ynab/models/transactions_import_response.py index af7120a..c9e43ff 100644 --- a/ynab/models/transactions_import_response.py +++ b/ynab/models/transactions_import_response.py @@ -15,7 +15,6 @@ import six - class TransactionsImportResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class TransactionsImportResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'TransactionsImportResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this TransactionsImportResponse. # noqa: E501 - :rtype: object + :rtype: TransactionsImportResponseData """ return self._data @@ -58,10 +57,8 @@ def data(self, data): :param data: The data of this TransactionsImportResponse. # noqa: E501 - :type: object + :type: TransactionsImportResponseData """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/transactions_import_response_data.py b/ynab/models/transactions_import_response_data.py new file mode 100644 index 0000000..d5cb0fd --- /dev/null +++ b/ynab/models/transactions_import_response_data.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TransactionsImportResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transaction_ids': 'list[str]' + } + + attribute_map = { + 'transaction_ids': 'transaction_ids' + } + + def __init__(self, transaction_ids=None): # noqa: E501 + """TransactionsImportResponseData - a model defined in Swagger""" # noqa: E501 + self._transaction_ids = None + self.discriminator = None + self.transaction_ids = transaction_ids + + @property + def transaction_ids(self): + """Gets the transaction_ids of this TransactionsImportResponseData. # noqa: E501 + + The list of transaction ids that were imported. # noqa: E501 + + :return: The transaction_ids of this TransactionsImportResponseData. # noqa: E501 + :rtype: list[str] + """ + return self._transaction_ids + + @transaction_ids.setter + def transaction_ids(self, transaction_ids): + """Sets the transaction_ids of this TransactionsImportResponseData. + + The list of transaction ids that were imported. # noqa: E501 + + :param transaction_ids: The transaction_ids of this TransactionsImportResponseData. # noqa: E501 + :type: list[str] + """ + if transaction_ids is None: + raise ValueError("Invalid value for `transaction_ids`, must not be `None`") # noqa: E501 + + self._transaction_ids = transaction_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TransactionsImportResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionsImportResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index f827597..e172f25 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -15,7 +15,6 @@ import six - class TransactionsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class TransactionsResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'TransactionsResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this TransactionsResponse. # noqa: E501 - :rtype: object + :rtype: TransactionsResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this TransactionsResponse. # noqa: E501 - :type: object + :type: TransactionsResponseData """ self._data = data diff --git a/ynab/models/transactions_response_data.py b/ynab/models/transactions_response_data.py new file mode 100644 index 0000000..4c71bec --- /dev/null +++ b/ynab/models/transactions_response_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TransactionsResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'transactions': 'list[TransactionDetail]', + 'server_knowledge': 'int' + } + + attribute_map = { + 'transactions': 'transactions', + 'server_knowledge': 'server_knowledge' + } + + def __init__(self, transactions=None, server_knowledge=None): # noqa: E501 + """TransactionsResponseData - a model defined in Swagger""" # noqa: E501 + self._transactions = None + self._server_knowledge = None + self.discriminator = None + self.transactions = transactions + self.server_knowledge = server_knowledge + + @property + def transactions(self): + """Gets the transactions of this TransactionsResponseData. # noqa: E501 + + + :return: The transactions of this TransactionsResponseData. # noqa: E501 + :rtype: list[TransactionDetail] + """ + return self._transactions + + @transactions.setter + def transactions(self, transactions): + """Sets the transactions of this TransactionsResponseData. + + + :param transactions: The transactions of this TransactionsResponseData. # noqa: E501 + :type: list[TransactionDetail] + """ + if transactions is None: + raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 + + self._transactions = transactions + + @property + def server_knowledge(self): + """Gets the server_knowledge of this TransactionsResponseData. # noqa: E501 + + The knowledge of the server # noqa: E501 + + :return: The server_knowledge of this TransactionsResponseData. # noqa: E501 + :rtype: int + """ + return self._server_knowledge + + @server_knowledge.setter + def server_knowledge(self, server_knowledge): + """Sets the server_knowledge of this TransactionsResponseData. + + The knowledge of the server # noqa: E501 + + :param server_knowledge: The server_knowledge of this TransactionsResponseData. # noqa: E501 + :type: int + """ + if server_knowledge is None: + raise ValueError("Invalid value for `server_knowledge`, must not be `None`") # noqa: E501 + + self._server_knowledge = server_knowledge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TransactionsResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionsResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/models/update_transaction.py b/ynab/models/update_transaction.py index 255765f..eb5a778 100644 --- a/ynab/models/update_transaction.py +++ b/ynab/models/update_transaction.py @@ -14,9 +14,6 @@ import re # noqa: F401 import six -from ynab.models.save_sub_transaction import SaveSubTransaction # noqa: F401,E501 -from ynab.models.save_transaction import SaveTransaction # noqa: F401,E501 - class UpdateTransaction(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -115,8 +112,6 @@ def account_id(self, account_id): :param account_id: The account_id of this UpdateTransaction. # noqa: E501 :type: str """ - if account_id is None: - raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 self._account_id = account_id @@ -140,8 +135,6 @@ def _date(self, _date): :param _date: The _date of this UpdateTransaction. # noqa: E501 :type: date """ - if _date is None: - raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 self.__date = _date @@ -165,8 +158,6 @@ def amount(self, amount): :param amount: The amount of this UpdateTransaction. # noqa: E501 :type: int """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount diff --git a/ynab/models/update_transactions_wrapper.py b/ynab/models/update_transactions_wrapper.py index 2780546..78ec5cb 100644 --- a/ynab/models/update_transactions_wrapper.py +++ b/ynab/models/update_transactions_wrapper.py @@ -14,8 +14,6 @@ import re # noqa: F401 import six -from ynab.models.update_transaction import UpdateTransaction # noqa: F401,E501 - class UpdateTransactionsWrapper(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -61,8 +59,6 @@ def transactions(self, transactions): :param transactions: The transactions of this UpdateTransactionsWrapper. # noqa: E501 :type: list[UpdateTransaction] """ - if transactions is None: - raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 self._transactions = transactions diff --git a/ynab/models/user.py b/ynab/models/user.py index f65e7c5..2d09058 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -15,7 +15,6 @@ import six - class User(object): """NOTE: This class is auto generated by the swagger code generator program. diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index 307b2c2..dd80b50 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -15,7 +15,6 @@ import six - class UserResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +28,7 @@ class UserResponse(object): and the value is json key in definition. """ swagger_types = { - 'data': 'object' + 'data': 'UserResponseData' } attribute_map = { @@ -48,7 +47,7 @@ def data(self): :return: The data of this UserResponse. # noqa: E501 - :rtype: object + :rtype: UserResponseData """ return self._data @@ -58,7 +57,7 @@ def data(self, data): :param data: The data of this UserResponse. # noqa: E501 - :type: object + :type: UserResponseData """ self._data = data diff --git a/ynab/models/user_response_data.py b/ynab/models/user_response_data.py new file mode 100644 index 0000000..55fc2d3 --- /dev/null +++ b/ynab/models/user_response_data.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + YNAB API Endpoints + + 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.youneedabudget.com # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UserResponseData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'User' + } + + attribute_map = { + 'user': 'user' + } + + def __init__(self, user=None): # noqa: E501 + """UserResponseData - a model defined in Swagger""" # noqa: E501 + self._user = None + self.discriminator = None + self.user = user + + @property + def user(self): + """Gets the user of this UserResponseData. # noqa: E501 + + + :return: The user of this UserResponseData. # noqa: E501 + :rtype: User + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this UserResponseData. + + + :param user: The user of this UserResponseData. # noqa: E501 + :type: User + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserResponseData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserResponseData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/ynab/rest.py b/ynab/rest.py index 702bdc2..afbda6f 100644 --- a/ynab/rest.py +++ b/ynab/rest.py @@ -155,7 +155,7 @@ def request(self, method, url, query_params=None, headers=None, if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None + request_body = '{}' if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( @@ -215,11 +215,6 @@ def request(self, method, url, query_params=None, headers=None, if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) From 55ae5244a83836cc763da60da73c986b101d4f27 Mon Sep 17 00:00:00 2001 From: Andrew Burks Date: Sun, 12 Jun 2022 17:08:13 -0700 Subject: [PATCH 14/14] Require certain fields. --- generate_code.sh | 2 +- ynab/models/account.py | 20 +++++++++++++++++++ ynab/models/account_response.py | 2 ++ ynab/models/accounts_response.py | 2 ++ ynab/models/budget_detail_response.py | 2 ++ ynab/models/budget_settings.py | 4 ++++ ynab/models/budget_settings_response.py | 2 ++ ynab/models/budget_summary.py | 4 ++++ ynab/models/budget_summary_response.py | 2 ++ ynab/models/bulk_response.py | 2 ++ ynab/models/bulk_transactions.py | 2 ++ ynab/models/categories_response.py | 2 ++ ynab/models/category.py | 16 +++++++++++++++ ynab/models/category_group.py | 8 ++++++++ ynab/models/category_group_with_categories.py | 2 ++ ynab/models/category_response.py | 2 ++ ynab/models/currency_format.py | 16 +++++++++++++++ ynab/models/date_format.py | 2 ++ ynab/models/error_detail.py | 6 ++++++ ynab/models/error_response.py | 2 ++ ynab/models/hybrid_transaction.py | 4 ++++ ynab/models/hybrid_transactions_response.py | 2 ++ ynab/models/month_detail.py | 2 ++ ynab/models/month_detail_response.py | 2 ++ ynab/models/month_summaries_response.py | 2 ++ ynab/models/month_summary.py | 12 +++++++++++ ynab/models/payee.py | 6 ++++++ ynab/models/payee_location.py | 10 ++++++++++ ynab/models/payee_location_response.py | 2 ++ ynab/models/payee_locations_response.py | 2 ++ ynab/models/payee_response.py | 2 ++ ynab/models/payees_response.py | 2 ++ ynab/models/save_account.py | 6 ++++++ ynab/models/save_account_wrapper.py | 2 ++ ynab/models/save_category_response.py | 2 ++ ynab/models/save_month_category.py | 2 ++ ynab/models/save_month_category_wrapper.py | 2 ++ ynab/models/save_sub_transaction.py | 2 ++ ynab/models/save_transaction.py | 6 ++++++ ynab/models/save_transaction_wrapper.py | 2 ++ ynab/models/save_transactions_response.py | 2 ++ ynab/models/scheduled_sub_transaction.py | 8 ++++++++ ynab/models/scheduled_transaction_detail.py | 4 ++++ ynab/models/scheduled_transaction_response.py | 2 ++ ynab/models/scheduled_transaction_summary.py | 14 +++++++++++++ .../models/scheduled_transactions_response.py | 2 ++ ynab/models/sub_transaction.py | 8 ++++++++ ynab/models/transaction_detail.py | 4 ++++ ynab/models/transaction_response.py | 2 ++ ynab/models/transaction_summary.py | 14 +++++++++++++ ynab/models/transactions_import_response.py | 2 ++ ynab/models/transactions_response.py | 2 ++ ynab/models/update_transaction.py | 6 ++++++ ynab/models/update_transactions_wrapper.py | 2 ++ ynab/models/user.py | 2 ++ ynab/models/user_response.py | 2 ++ 56 files changed, 247 insertions(+), 1 deletion(-) diff --git a/generate_code.sh b/generate_code.sh index ca8d3d8..1baca76 100755 --- a/generate_code.sh +++ b/generate_code.sh @@ -15,7 +15,7 @@ git grep -lz test | xargs -0 sed -i '' 's/from api\./from ynab\.api\./g' # Fix the api function call path git grep -lz test | xargs -0 sed -i '' 's/self\.api = api\./self\.api = ynab\.api\./g' -git ls-files -z ynab/models | xargs -0 perl -i -p0e 's/\s+if \w+ is None:\n\s+raise ValueError.*//g' +# git ls-files -z ynab/models | xargs -0 perl -i -p0e 's/\s+if \w+ is None:\n\s+raise ValueError.*//g' # Run the tests nosetests diff --git a/ynab/models/account.py b/ynab/models/account.py index d242226..aea4176 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -110,6 +110,8 @@ def id(self, id): :param id: The id of this Account. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -131,6 +133,8 @@ def name(self, name): :param name: The name of this Account. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -154,6 +158,8 @@ def type(self, type): :param type: The type of this Account. # noqa: E501 :type: str """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 allowed_values = ["checking", "savings", "cash", "creditCard", "lineOfCredit", "otherAsset", "otherLiability", "payPal", "merchantAccount", "investmentAccount", "mortgage"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -183,6 +189,8 @@ def on_budget(self, on_budget): :param on_budget: The on_budget of this Account. # noqa: E501 :type: bool """ + if on_budget is None: + raise ValueError("Invalid value for `on_budget`, must not be `None`") # noqa: E501 self._on_budget = on_budget @@ -206,6 +214,8 @@ def closed(self, closed): :param closed: The closed of this Account. # noqa: E501 :type: bool """ + if closed is None: + raise ValueError("Invalid value for `closed`, must not be `None`") # noqa: E501 self._closed = closed @@ -250,6 +260,8 @@ def balance(self, balance): :param balance: The balance of this Account. # noqa: E501 :type: int """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 self._balance = balance @@ -273,6 +285,8 @@ def cleared_balance(self, cleared_balance): :param cleared_balance: The cleared_balance of this Account. # noqa: E501 :type: int """ + if cleared_balance is None: + raise ValueError("Invalid value for `cleared_balance`, must not be `None`") # noqa: E501 self._cleared_balance = cleared_balance @@ -296,6 +310,8 @@ def uncleared_balance(self, uncleared_balance): :param uncleared_balance: The uncleared_balance of this Account. # noqa: E501 :type: int """ + if uncleared_balance is None: + raise ValueError("Invalid value for `uncleared_balance`, must not be `None`") # noqa: E501 self._uncleared_balance = uncleared_balance @@ -319,6 +335,8 @@ def transfer_payee_id(self, transfer_payee_id): :param transfer_payee_id: The transfer_payee_id of this Account. # noqa: E501 :type: str """ + if transfer_payee_id is None: + raise ValueError("Invalid value for `transfer_payee_id`, must not be `None`") # noqa: E501 self._transfer_payee_id = transfer_payee_id @@ -388,6 +406,8 @@ def deleted(self, deleted): :param deleted: The deleted of this Account. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index db60cf8..5160123 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this AccountResponse. # noqa: E501 :type: AccountResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index 8244844..acc1480 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this AccountsResponse. # noqa: E501 :type: AccountsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index 2795558..143c48b 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this BudgetDetailResponse. # noqa: E501 :type: BudgetDetailResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py index 329a0f2..9bfda4c 100644 --- a/ynab/models/budget_settings.py +++ b/ynab/models/budget_settings.py @@ -63,6 +63,8 @@ def date_format(self, date_format): :param date_format: The date_format of this BudgetSettings. # noqa: E501 :type: DateFormat """ + if date_format is None: + raise ValueError("Invalid value for `date_format`, must not be `None`") # noqa: E501 self._date_format = date_format @@ -84,6 +86,8 @@ def currency_format(self, currency_format): :param currency_format: The currency_format of this BudgetSettings. # noqa: E501 :type: CurrencyFormat """ + if currency_format is None: + raise ValueError("Invalid value for `currency_format`, must not be `None`") # noqa: E501 self._currency_format = currency_format diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index 1204143..e0df20e 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this BudgetSettingsResponse. # noqa: E501 :type: BudgetSettingsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index f522b78..bd3bd9e 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -93,6 +93,8 @@ def id(self, id): :param id: The id of this BudgetSummary. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -114,6 +116,8 @@ def name(self, name): :param name: The name of this BudgetSummary. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index 7b4d520..ead233a 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this BudgetSummaryResponse. # noqa: E501 :type: BudgetSummaryResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index 7b14b83..bf6ae1e 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this BulkResponse. # noqa: E501 :type: BulkResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index 1b9f8bc..19f023c 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -59,6 +59,8 @@ def transactions(self, transactions): :param transactions: The transactions of this BulkTransactions. # noqa: E501 :type: list[SaveTransaction] """ + if transactions is None: + raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 self._transactions = transactions diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 5bb0e9a..0f68361 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this CategoriesResponse. # noqa: E501 :type: CategoriesResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/category.py b/ynab/models/category.py index 2f58847..6821ece 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -142,6 +142,8 @@ def id(self, id): :param id: The id of this Category. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -163,6 +165,8 @@ def category_group_id(self, category_group_id): :param category_group_id: The category_group_id of this Category. # noqa: E501 :type: str """ + if category_group_id is None: + raise ValueError("Invalid value for `category_group_id`, must not be `None`") # noqa: E501 self._category_group_id = category_group_id @@ -184,6 +188,8 @@ def name(self, name): :param name: The name of this Category. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -207,6 +213,8 @@ def hidden(self, hidden): :param hidden: The hidden of this Category. # noqa: E501 :type: bool """ + if hidden is None: + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 self._hidden = hidden @@ -274,6 +282,8 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this Category. # noqa: E501 :type: int """ + if budgeted is None: + raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 self._budgeted = budgeted @@ -297,6 +307,8 @@ def activity(self, activity): :param activity: The activity of this Category. # noqa: E501 :type: int """ + if activity is None: + raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 self._activity = activity @@ -320,6 +332,8 @@ def balance(self, balance): :param balance: The balance of this Category. # noqa: E501 :type: int """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 self._balance = balance @@ -556,6 +570,8 @@ def deleted(self, deleted): :param deleted: The deleted of this Category. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index 87b3de6..7c805a4 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -71,6 +71,8 @@ def id(self, id): :param id: The id of this CategoryGroup. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -92,6 +94,8 @@ def name(self, name): :param name: The name of this CategoryGroup. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -115,6 +119,8 @@ def hidden(self, hidden): :param hidden: The hidden of this CategoryGroup. # noqa: E501 :type: bool """ + if hidden is None: + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 self._hidden = hidden @@ -138,6 +144,8 @@ def deleted(self, deleted): :param deleted: The deleted of this CategoryGroup. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index 1fee8be..2987f7f 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -67,6 +67,8 @@ def categories(self, categories): :param categories: The categories of this CategoryGroupWithCategories. # noqa: E501 :type: list[Category] """ + if categories is None: + raise ValueError("Invalid value for `categories`, must not be `None`") # noqa: E501 self._categories = categories diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index e34f480..f133d21 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this CategoryResponse. # noqa: E501 :type: CategoryResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index 3f8fe20..6cd9a99 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -87,6 +87,8 @@ def iso_code(self, iso_code): :param iso_code: The iso_code of this CurrencyFormat. # noqa: E501 :type: str """ + if iso_code is None: + raise ValueError("Invalid value for `iso_code`, must not be `None`") # noqa: E501 self._iso_code = iso_code @@ -108,6 +110,8 @@ def example_format(self, example_format): :param example_format: The example_format of this CurrencyFormat. # noqa: E501 :type: str """ + if example_format is None: + raise ValueError("Invalid value for `example_format`, must not be `None`") # noqa: E501 self._example_format = example_format @@ -129,6 +133,8 @@ def decimal_digits(self, decimal_digits): :param decimal_digits: The decimal_digits of this CurrencyFormat. # noqa: E501 :type: int """ + if decimal_digits is None: + raise ValueError("Invalid value for `decimal_digits`, must not be `None`") # noqa: E501 self._decimal_digits = decimal_digits @@ -150,6 +156,8 @@ def decimal_separator(self, decimal_separator): :param decimal_separator: The decimal_separator of this CurrencyFormat. # noqa: E501 :type: str """ + if decimal_separator is None: + raise ValueError("Invalid value for `decimal_separator`, must not be `None`") # noqa: E501 self._decimal_separator = decimal_separator @@ -171,6 +179,8 @@ def symbol_first(self, symbol_first): :param symbol_first: The symbol_first of this CurrencyFormat. # noqa: E501 :type: bool """ + if symbol_first is None: + raise ValueError("Invalid value for `symbol_first`, must not be `None`") # noqa: E501 self._symbol_first = symbol_first @@ -192,6 +202,8 @@ def group_separator(self, group_separator): :param group_separator: The group_separator of this CurrencyFormat. # noqa: E501 :type: str """ + if group_separator is None: + raise ValueError("Invalid value for `group_separator`, must not be `None`") # noqa: E501 self._group_separator = group_separator @@ -213,6 +225,8 @@ def currency_symbol(self, currency_symbol): :param currency_symbol: The currency_symbol of this CurrencyFormat. # noqa: E501 :type: str """ + if currency_symbol is None: + raise ValueError("Invalid value for `currency_symbol`, must not be `None`") # noqa: E501 self._currency_symbol = currency_symbol @@ -234,6 +248,8 @@ def display_symbol(self, display_symbol): :param display_symbol: The display_symbol of this CurrencyFormat. # noqa: E501 :type: bool """ + if display_symbol is None: + raise ValueError("Invalid value for `display_symbol`, must not be `None`") # noqa: E501 self._display_symbol = display_symbol diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index c84beb9..f9f80a8 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -59,6 +59,8 @@ def format(self, format): :param format: The format of this DateFormat. # noqa: E501 :type: str """ + if format is None: + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 self._format = format diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index 21e7b86..d520dd3 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -67,6 +67,8 @@ def id(self, id): :param id: The id of this ErrorDetail. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -88,6 +90,8 @@ def name(self, name): :param name: The name of this ErrorDetail. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -109,6 +113,8 @@ def detail(self, detail): :param detail: The detail of this ErrorDetail. # noqa: E501 :type: str """ + if detail is None: + raise ValueError("Invalid value for `detail`, must not be `None`") # noqa: E501 self._detail = detail diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index 9267cf8..a5e2910 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -59,6 +59,8 @@ def error(self, error): :param error: The error of this ErrorResponse. # noqa: E501 :type: ErrorDetail """ + if error is None: + raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 self._error = error diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index 2157239..f321e2e 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -86,6 +86,8 @@ def type(self, type): :param type: The type of this HybridTransaction. # noqa: E501 :type: str """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 allowed_values = ["transaction", "subtransaction"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -136,6 +138,8 @@ def account_name(self, account_name): :param account_name: The account_name of this HybridTransaction. # noqa: E501 :type: str """ + if account_name is None: + raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 self._account_name = account_name diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index da324fd..9bf79b7 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this HybridTransactionsResponse. # noqa: E501 :type: HybridTransactionsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index 9a8fc16..ddad427 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -67,6 +67,8 @@ def categories(self, categories): :param categories: The categories of this MonthDetail. # noqa: E501 :type: list[Category] """ + if categories is None: + raise ValueError("Invalid value for `categories`, must not be `None`") # noqa: E501 self._categories = categories diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index 2db35fc..a8723db 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this MonthDetailResponse. # noqa: E501 :type: MonthDetailResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index 89d6559..d1bdc42 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this MonthSummariesResponse. # noqa: E501 :type: MonthSummariesResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index a8bbffc..86eaf31 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -89,6 +89,8 @@ def month(self, month): :param month: The month of this MonthSummary. # noqa: E501 :type: date """ + if month is None: + raise ValueError("Invalid value for `month`, must not be `None`") # noqa: E501 self._month = month @@ -133,6 +135,8 @@ def income(self, income): :param income: The income of this MonthSummary. # noqa: E501 :type: int """ + if income is None: + raise ValueError("Invalid value for `income`, must not be `None`") # noqa: E501 self._income = income @@ -156,6 +160,8 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this MonthSummary. # noqa: E501 :type: int """ + if budgeted is None: + raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 self._budgeted = budgeted @@ -179,6 +185,8 @@ def activity(self, activity): :param activity: The activity of this MonthSummary. # noqa: E501 :type: int """ + if activity is None: + raise ValueError("Invalid value for `activity`, must not be `None`") # noqa: E501 self._activity = activity @@ -202,6 +210,8 @@ def to_be_budgeted(self, to_be_budgeted): :param to_be_budgeted: The to_be_budgeted of this MonthSummary. # noqa: E501 :type: int """ + if to_be_budgeted is None: + raise ValueError("Invalid value for `to_be_budgeted`, must not be `None`") # noqa: E501 self._to_be_budgeted = to_be_budgeted @@ -248,6 +258,8 @@ def deleted(self, deleted): :param deleted: The deleted of this MonthSummary. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 65ebd5e..8455581 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -72,6 +72,8 @@ def id(self, id): :param id: The id of this Payee. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -93,6 +95,8 @@ def name(self, name): :param name: The name of this Payee. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -139,6 +143,8 @@ def deleted(self, deleted): :param deleted: The deleted of this Payee. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 25e8fd1..06c8c7f 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -75,6 +75,8 @@ def id(self, id): :param id: The id of this PayeeLocation. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -96,6 +98,8 @@ def payee_id(self, payee_id): :param payee_id: The payee_id of this PayeeLocation. # noqa: E501 :type: str """ + if payee_id is None: + raise ValueError("Invalid value for `payee_id`, must not be `None`") # noqa: E501 self._payee_id = payee_id @@ -117,6 +121,8 @@ def latitude(self, latitude): :param latitude: The latitude of this PayeeLocation. # noqa: E501 :type: str """ + if latitude is None: + raise ValueError("Invalid value for `latitude`, must not be `None`") # noqa: E501 self._latitude = latitude @@ -138,6 +144,8 @@ def longitude(self, longitude): :param longitude: The longitude of this PayeeLocation. # noqa: E501 :type: str """ + if longitude is None: + raise ValueError("Invalid value for `longitude`, must not be `None`") # noqa: E501 self._longitude = longitude @@ -161,6 +169,8 @@ def deleted(self, deleted): :param deleted: The deleted of this PayeeLocation. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 1c026b2..ccbf3a0 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this PayeeLocationResponse. # noqa: E501 :type: PayeeLocationResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index 8deeb51..680bc80 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this PayeeLocationsResponse. # noqa: E501 :type: PayeeLocationsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index c120d7d..0e91585 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this PayeeResponse. # noqa: E501 :type: PayeeResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index 1f1c10a..2d6bf81 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this PayeesResponse. # noqa: E501 :type: PayeesResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/save_account.py b/ynab/models/save_account.py index 1f9c72a..bcebcda 100644 --- a/ynab/models/save_account.py +++ b/ynab/models/save_account.py @@ -69,6 +69,8 @@ def name(self, name): :param name: The name of this SaveAccount. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -92,6 +94,8 @@ def type(self, type): :param type: The type of this SaveAccount. # noqa: E501 :type: str """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 allowed_values = ["checking", "savings", "creditCard", "cash", "lineOfCredit", "otherAsset", "otherLiability"] # noqa: E501 if type not in allowed_values: raise ValueError( @@ -121,6 +125,8 @@ def balance(self, balance): :param balance: The balance of this SaveAccount. # noqa: E501 :type: int """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 self._balance = balance diff --git a/ynab/models/save_account_wrapper.py b/ynab/models/save_account_wrapper.py index 3b4dd1d..d3205bb 100644 --- a/ynab/models/save_account_wrapper.py +++ b/ynab/models/save_account_wrapper.py @@ -59,6 +59,8 @@ def account(self, account): :param account: The account of this SaveAccountWrapper. # noqa: E501 :type: SaveAccount """ + if account is None: + raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 self._account = account diff --git a/ynab/models/save_category_response.py b/ynab/models/save_category_response.py index cfa1b29..721f978 100644 --- a/ynab/models/save_category_response.py +++ b/ynab/models/save_category_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this SaveCategoryResponse. # noqa: E501 :type: SaveCategoryResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py index 0697461..b78298c 100644 --- a/ynab/models/save_month_category.py +++ b/ynab/models/save_month_category.py @@ -61,6 +61,8 @@ def budgeted(self, budgeted): :param budgeted: The budgeted of this SaveMonthCategory. # noqa: E501 :type: int """ + if budgeted is None: + raise ValueError("Invalid value for `budgeted`, must not be `None`") # noqa: E501 self._budgeted = budgeted diff --git a/ynab/models/save_month_category_wrapper.py b/ynab/models/save_month_category_wrapper.py index b3ed64a..1fd6dff 100644 --- a/ynab/models/save_month_category_wrapper.py +++ b/ynab/models/save_month_category_wrapper.py @@ -59,6 +59,8 @@ def category(self, category): :param category: The category of this SaveMonthCategoryWrapper. # noqa: E501 :type: SaveMonthCategory """ + if category is None: + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 self._category = category diff --git a/ynab/models/save_sub_transaction.py b/ynab/models/save_sub_transaction.py index 39911e5..51523c1 100644 --- a/ynab/models/save_sub_transaction.py +++ b/ynab/models/save_sub_transaction.py @@ -81,6 +81,8 @@ def amount(self, amount): :param amount: The amount of this SaveSubTransaction. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount diff --git a/ynab/models/save_transaction.py b/ynab/models/save_transaction.py index 8df25fb..eb11c3f 100644 --- a/ynab/models/save_transaction.py +++ b/ynab/models/save_transaction.py @@ -112,6 +112,8 @@ def account_id(self, account_id): :param account_id: The account_id of this SaveTransaction. # noqa: E501 :type: str """ + if account_id is None: + raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 self._account_id = account_id @@ -135,6 +137,8 @@ def _date(self, _date): :param _date: The _date of this SaveTransaction. # noqa: E501 :type: date """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 self.__date = _date @@ -158,6 +162,8 @@ def amount(self, amount): :param amount: The amount of this SaveTransaction. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount diff --git a/ynab/models/save_transaction_wrapper.py b/ynab/models/save_transaction_wrapper.py index 26000ef..7b9c5e2 100644 --- a/ynab/models/save_transaction_wrapper.py +++ b/ynab/models/save_transaction_wrapper.py @@ -59,6 +59,8 @@ def transaction(self, transaction): :param transaction: The transaction of this SaveTransactionWrapper. # noqa: E501 :type: SaveTransaction """ + if transaction is None: + raise ValueError("Invalid value for `transaction`, must not be `None`") # noqa: E501 self._transaction = transaction diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py index 7386438..88c4799 100644 --- a/ynab/models/save_transactions_response.py +++ b/ynab/models/save_transactions_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this SaveTransactionsResponse. # noqa: E501 :type: SaveTransactionsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index 6b616b3..2b67408 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -91,6 +91,8 @@ def id(self, id): :param id: The id of this ScheduledSubTransaction. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -112,6 +114,8 @@ def scheduled_transaction_id(self, scheduled_transaction_id): :param scheduled_transaction_id: The scheduled_transaction_id of this ScheduledSubTransaction. # noqa: E501 :type: str """ + if scheduled_transaction_id is None: + raise ValueError("Invalid value for `scheduled_transaction_id`, must not be `None`") # noqa: E501 self._scheduled_transaction_id = scheduled_transaction_id @@ -135,6 +139,8 @@ def amount(self, amount): :param amount: The amount of this ScheduledSubTransaction. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount @@ -244,6 +250,8 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledSubTransaction. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index df18741..a0bf762 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -79,6 +79,8 @@ def account_name(self, account_name): :param account_name: The account_name of this ScheduledTransactionDetail. # noqa: E501 :type: str """ + if account_name is None: + raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 self._account_name = account_name @@ -144,6 +146,8 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this ScheduledTransactionDetail. # noqa: E501 :type: list[ScheduledSubTransaction] """ + if subtransactions is None: + raise ValueError("Invalid value for `subtransactions`, must not be `None`") # noqa: E501 self._subtransactions = subtransactions diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index 1d1fe6b..0bafd06 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this ScheduledTransactionResponse. # noqa: E501 :type: ScheduledTransactionResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index ae582af..cba877c 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -108,6 +108,8 @@ def id(self, id): :param id: The id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -131,6 +133,8 @@ def date_first(self, date_first): :param date_first: The date_first of this ScheduledTransactionSummary. # noqa: E501 :type: date """ + if date_first is None: + raise ValueError("Invalid value for `date_first`, must not be `None`") # noqa: E501 self._date_first = date_first @@ -154,6 +158,8 @@ def date_next(self, date_next): :param date_next: The date_next of this ScheduledTransactionSummary. # noqa: E501 :type: date """ + if date_next is None: + raise ValueError("Invalid value for `date_next`, must not be `None`") # noqa: E501 self._date_next = date_next @@ -175,6 +181,8 @@ def frequency(self, frequency): :param frequency: The frequency of this ScheduledTransactionSummary. # noqa: E501 :type: str """ + if frequency is None: + raise ValueError("Invalid value for `frequency`, must not be `None`") # noqa: E501 allowed_values = ["never", "daily", "weekly", "everyOtherWeek", "twiceAMonth", "every4Weeks", "monthly", "everyOtherMonth", "every3Months", "every4Months", "twiceAYear", "yearly", "everyOtherYear"] # noqa: E501 if frequency not in allowed_values: raise ValueError( @@ -204,6 +212,8 @@ def amount(self, amount): :param amount: The amount of this ScheduledTransactionSummary. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount @@ -275,6 +285,8 @@ def account_id(self, account_id): :param account_id: The account_id of this ScheduledTransactionSummary. # noqa: E501 :type: str """ + if account_id is None: + raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 self._account_id = account_id @@ -363,6 +375,8 @@ def deleted(self, deleted): :param deleted: The deleted of this ScheduledTransactionSummary. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index 2f76851..b6a7b24 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this ScheduledTransactionsResponse. # noqa: E501 :type: ScheduledTransactionsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index fc4201a..6cc14c3 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -106,6 +106,8 @@ def id(self, id): :param id: The id of this SubTransaction. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -127,6 +129,8 @@ def transaction_id(self, transaction_id): :param transaction_id: The transaction_id of this SubTransaction. # noqa: E501 :type: str """ + if transaction_id is None: + raise ValueError("Invalid value for `transaction_id`, must not be `None`") # noqa: E501 self._transaction_id = transaction_id @@ -150,6 +154,8 @@ def amount(self, amount): :param amount: The amount of this SubTransaction. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount @@ -324,6 +330,8 @@ def deleted(self, deleted): :param deleted: The deleted of this SubTransaction. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index c6b3da6..5614a70 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -79,6 +79,8 @@ def account_name(self, account_name): :param account_name: The account_name of this TransactionDetail. # noqa: E501 :type: str """ + if account_name is None: + raise ValueError("Invalid value for `account_name`, must not be `None`") # noqa: E501 self._account_name = account_name @@ -144,6 +146,8 @@ def subtransactions(self, subtransactions): :param subtransactions: The subtransactions of this TransactionDetail. # noqa: E501 :type: list[SubTransaction] """ + if subtransactions is None: + raise ValueError("Invalid value for `subtransactions`, must not be `None`") # noqa: E501 self._subtransactions = subtransactions diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index f7ad93e..1fd45c3 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this TransactionResponse. # noqa: E501 :type: TransactionResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index a5e9090..539eb42 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -123,6 +123,8 @@ def id(self, id): :param id: The id of this TransactionSummary. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -146,6 +148,8 @@ def _date(self, _date): :param _date: The _date of this TransactionSummary. # noqa: E501 :type: date """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 self.__date = _date @@ -169,6 +173,8 @@ def amount(self, amount): :param amount: The amount of this TransactionSummary. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount @@ -213,6 +219,8 @@ def cleared(self, cleared): :param cleared: The cleared of this TransactionSummary. # noqa: E501 :type: str """ + if cleared is None: + raise ValueError("Invalid value for `cleared`, must not be `None`") # noqa: E501 allowed_values = ["cleared", "uncleared", "reconciled"] # noqa: E501 if cleared not in allowed_values: raise ValueError( @@ -242,6 +250,8 @@ def approved(self, approved): :param approved: The approved of this TransactionSummary. # noqa: E501 :type: bool """ + if approved is None: + raise ValueError("Invalid value for `approved`, must not be `None`") # noqa: E501 self._approved = approved @@ -292,6 +302,8 @@ def account_id(self, account_id): :param account_id: The account_id of this TransactionSummary. # noqa: E501 :type: str """ + if account_id is None: + raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 self._account_id = account_id @@ -449,6 +461,8 @@ def deleted(self, deleted): :param deleted: The deleted of this TransactionSummary. # noqa: E501 :type: bool """ + if deleted is None: + raise ValueError("Invalid value for `deleted`, must not be `None`") # noqa: E501 self._deleted = deleted diff --git a/ynab/models/transactions_import_response.py b/ynab/models/transactions_import_response.py index c9e43ff..460a62a 100644 --- a/ynab/models/transactions_import_response.py +++ b/ynab/models/transactions_import_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this TransactionsImportResponse. # noqa: E501 :type: TransactionsImportResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index e172f25..1391beb 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this TransactionsResponse. # noqa: E501 :type: TransactionsResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data diff --git a/ynab/models/update_transaction.py b/ynab/models/update_transaction.py index eb5a778..32b6b0a 100644 --- a/ynab/models/update_transaction.py +++ b/ynab/models/update_transaction.py @@ -112,6 +112,8 @@ def account_id(self, account_id): :param account_id: The account_id of this UpdateTransaction. # noqa: E501 :type: str """ + if account_id is None: + raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501 self._account_id = account_id @@ -135,6 +137,8 @@ def _date(self, _date): :param _date: The _date of this UpdateTransaction. # noqa: E501 :type: date """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 self.__date = _date @@ -158,6 +162,8 @@ def amount(self, amount): :param amount: The amount of this UpdateTransaction. # noqa: E501 :type: int """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 self._amount = amount diff --git a/ynab/models/update_transactions_wrapper.py b/ynab/models/update_transactions_wrapper.py index 78ec5cb..ecabe86 100644 --- a/ynab/models/update_transactions_wrapper.py +++ b/ynab/models/update_transactions_wrapper.py @@ -59,6 +59,8 @@ def transactions(self, transactions): :param transactions: The transactions of this UpdateTransactionsWrapper. # noqa: E501 :type: list[UpdateTransaction] """ + if transactions is None: + raise ValueError("Invalid value for `transactions`, must not be `None`") # noqa: E501 self._transactions = transactions diff --git a/ynab/models/user.py b/ynab/models/user.py index 2d09058..3c1af18 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -59,6 +59,8 @@ def id(self, id): :param id: The id of this User. # noqa: E501 :type: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index dd80b50..1d0f3cc 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -59,6 +59,8 @@ def data(self, data): :param data: The data of this UserResponse. # noqa: E501 :type: UserResponseData """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 self._data = data