From 7b27df5d4e1eb6aaf25264a116f7aa3c503a6f2b Mon Sep 17 00:00:00 2001 From: Brady Holt Date: Fri, 20 Feb 2026 12:25:17 -0600 Subject: [PATCH] Generate against v1.81.0 --- .gitignore | 2 +- .openapi-generator/FILES | 95 +- .openapi-generator/VERSION | 2 +- DEVELOPMENT.md | 2 +- README.md | 18 +- docs/Account.md | 10 +- docs/AccountsApi.md | 48 +- docs/BudgetDetail.md | 2 +- docs/BudgetSummary.md | 2 +- docs/CategoriesApi.md | 338 ++- docs/Category.md | 13 +- docs/CategoryGroup.md | 2 +- docs/CategoryGroupWithCategories.md | 4 +- docs/CurrencyFormat.md | 2 +- docs/DateFormat.md | 2 +- docs/ExistingCategory.md | 33 + docs/ExistingTransaction.md | 6 +- docs/HybridTransaction.md | 8 +- docs/MoneyMovement.md | 37 + docs/MoneyMovementGroup.md | 33 + docs/MoneyMovementGroupsResponse.md | 29 + docs/MoneyMovementGroupsResponseData.md | 30 + docs/MoneyMovementsApi.md | 332 +++ docs/MoneyMovementsResponse.md | 29 + docs/MoneyMovementsResponseData.md | 30 + docs/MonthDetail.md | 4 +- docs/MonthSummary.md | 2 +- docs/MonthsApi.md | 58 +- docs/NewCategory.md | 33 + docs/NewTransaction.md | 6 +- docs/PatchCategoryGroupWrapper.md | 29 + docs/PatchCategoryWrapper.md | 2 +- docs/Payee.md | 2 +- docs/PayeeLocation.md | 4 +- docs/PayeeLocationsApi.md | 45 +- docs/PayeesApi.md | 40 +- docs/PlanDetail.md | 45 + docs/PlanDetailResponse.md | 29 + docs/PlanDetailResponseData.md | 30 + docs/PlanSettings.md | 30 + docs/PlanSettingsResponse.md | 29 + docs/PlanSettingsResponseData.md | 29 + docs/PlanSummary.md | 36 + docs/PlanSummaryResponse.md | 29 + docs/PlanSummaryResponseData.md | 30 + docs/{BudgetsApi.md => PlansApi.md} | 101 +- docs/PostCategoryGroupWrapper.md | 29 + docs/PostCategoryWrapper.md | 29 + docs/SaveCategory.md | 5 +- docs/SaveCategoryGroup.md | 29 + docs/SaveCategoryGroupResponse.md | 29 + docs/SaveCategoryGroupResponseData.md | 30 + docs/SaveMonthCategory.md | 2 +- docs/SaveScheduledTransaction.md | 6 +- docs/SaveSubTransaction.md | 4 +- docs/SaveTransactionWithIdOrImportId.md | 6 +- docs/SaveTransactionWithOptionalFields.md | 6 +- docs/ScheduledSubTransaction.md | 10 +- docs/ScheduledTransactionDetail.md | 10 +- docs/ScheduledTransactionSummary.md | 10 +- docs/ScheduledTransactionsApi.md | 72 +- docs/SubTransaction.md | 6 +- docs/TransactionDetail.md | 8 +- docs/TransactionSummary.md | 8 +- docs/TransactionsApi.md | 161 +- docs/User.md | 2 +- docs/UserApi.md | 7 +- open_api_spec.yaml | 2065 +++++++++-------- openapi-generator-config.yaml | 2 +- poetry.lock | 10 +- pyproject.toml | 5 +- requirements.txt | 1 - test/test_existing_category.py | 55 + test/test_money_movement.py | 61 + test/test_money_movement_group.py | 58 + test/test_money_movement_groups_response.py | 70 + ...est_money_movement_groups_response_data.py | 68 + test/test_money_movements_api.py | 59 + test/test_money_movements_response.py | 78 + test/test_money_movements_response_data.py | 76 + test/test_months_api.py | 8 +- test/test_new_category.py | 55 + test/test_patch_category_group_wrapper.py | 54 + ...t_budget_detail.py => test_plan_detail.py} | 28 +- ...sponse.py => test_plan_detail_response.py} | 28 +- ...a.py => test_plan_detail_response_data.py} | 24 +- ...dget_settings.py => test_plan_settings.py} | 24 +- ...onse.py => test_plan_settings_response.py} | 32 +- ...py => test_plan_settings_response_data.py} | 28 +- ...budget_summary.py => test_plan_summary.py} | 24 +- ...ponse.py => test_plan_summary_response.py} | 46 +- ....py => test_plan_summary_response_data.py} | 30 +- ...{test_budgets_api.py => test_plans_api.py} | 28 +- test/test_post_category_group_wrapper.py | 54 + test/test_post_category_wrapper.py | 52 + test/test_save_category_group.py | 52 + test/test_save_category_group_response.py | 64 + .../test_save_category_group_response_data.py | 62 + ynab/__init__.py | 75 +- ynab/api/__init__.py | 3 +- ynab/api/accounts_api.py | 132 +- ynab/api/categories_api.py | 1150 ++++++++- ynab/api/money_movements_api.py | 1125 +++++++++ ynab/api/months_api.py | 133 +- ynab/api/payee_locations_api.py | 119 +- ynab/api/payees_api.py | 113 +- ynab/api/{budgets_api.py => plans_api.py} | 197 +- ynab/api/scheduled_transactions_api.py | 195 +- ynab/api/transactions_api.py | 447 ++-- ynab/api/user_api.py | 11 +- ynab/api_client.py | 30 +- ynab/configuration.py | 7 +- ynab/exceptions.py | 14 +- ynab/models/__init__.py | 36 +- ynab/models/account.py | 28 +- ynab/models/account_response.py | 2 +- ynab/models/account_response_data.py | 2 +- ynab/models/account_type.py | 2 +- ynab/models/accounts_response.py | 2 +- ynab/models/accounts_response_data.py | 2 +- ynab/models/budget_detail.py | 5 +- ynab/models/budget_detail_response.py | 2 +- ynab/models/budget_detail_response_data.py | 2 +- ynab/models/budget_settings.py | 2 +- ynab/models/budget_settings_response.py | 2 +- ynab/models/budget_settings_response_data.py | 2 +- ynab/models/budget_summary.py | 5 +- ynab/models/budget_summary_response.py | 2 +- ynab/models/budget_summary_response_data.py | 7 +- ynab/models/bulk_response.py | 2 +- ynab/models/bulk_response_data.py | 2 +- ynab/models/bulk_response_data_bulk.py | 2 +- ynab/models/bulk_transactions.py | 2 +- ynab/models/categories_response.py | 2 +- ynab/models/categories_response_data.py | 2 +- ynab/models/category.py | 24 +- ynab/models/category_group.py | 5 +- ynab/models/category_group_with_categories.py | 7 +- ynab/models/category_response.py | 2 +- ynab/models/category_response_data.py | 2 +- ynab/models/currency_format.py | 4 +- ynab/models/date_format.py | 4 +- ynab/models/error_detail.py | 2 +- ynab/models/error_response.py | 2 +- ynab/models/existing_category.py | 97 + ynab/models/existing_transaction.py | 31 +- ynab/models/hybrid_transaction.py | 61 +- ynab/models/hybrid_transactions_response.py | 2 +- .../hybrid_transactions_response_data.py | 2 +- ynab/models/money_movement.py | 140 ++ ynab/models/money_movement_group.py | 107 + ynab/models/money_movement_groups_response.py | 91 + .../money_movement_groups_response_data.py | 97 + ynab/models/money_movements_response.py | 91 + ynab/models/money_movements_response_data.py | 97 + ynab/models/month_detail.py | 16 +- ynab/models/month_detail_response.py | 2 +- ynab/models/month_detail_response_data.py | 2 +- ynab/models/month_summaries_response.py | 2 +- ynab/models/month_summaries_response_data.py | 2 +- ynab/models/month_summary.py | 4 +- ynab/models/new_category.py | 97 + ynab/models/new_transaction.py | 31 +- ynab/models/patch_category_group_wrapper.py | 91 + ynab/models/patch_category_wrapper.py | 8 +- ynab/models/patch_month_category_wrapper.py | 2 +- ynab/models/patch_payee_wrapper.py | 2 +- ynab/models/patch_transactions_wrapper.py | 2 +- ynab/models/payee.py | 5 +- ynab/models/payee_location.py | 7 +- ynab/models/payee_location_response.py | 2 +- ynab/models/payee_location_response_data.py | 2 +- ynab/models/payee_locations_response.py | 2 +- ynab/models/payee_locations_response_data.py | 2 +- ynab/models/payee_response.py | 2 +- ynab/models/payee_response_data.py | 2 +- ynab/models/payees_response.py | 2 +- ynab/models/payees_response_data.py | 2 +- ynab/models/plan_detail.py | 209 ++ ynab/models/plan_detail_response.py | 91 + ynab/models/plan_detail_response_data.py | 93 + ynab/models/plan_settings.py | 97 + ynab/models/plan_settings_response.py | 91 + ynab/models/plan_settings_response_data.py | 91 + ynab/models/plan_summary.py | 119 + ynab/models/plan_summary_response.py | 91 + ynab/models/plan_summary_response_data.py | 100 + ynab/models/post_account_wrapper.py | 2 +- ynab/models/post_category_group_wrapper.py | 91 + ynab/models/post_category_wrapper.py | 91 + .../post_scheduled_transaction_wrapper.py | 2 +- ynab/models/post_transactions_wrapper.py | 2 +- .../put_scheduled_transaction_wrapper.py | 2 +- ynab/models/put_transaction_wrapper.py | 2 +- ynab/models/save_account.py | 2 +- ynab/models/save_category.py | 19 +- ynab/models/save_category_group.py | 88 + ynab/models/save_category_group_response.py | 91 + .../save_category_group_response_data.py | 93 + ynab/models/save_category_response.py | 2 +- ynab/models/save_category_response_data.py | 2 +- ynab/models/save_month_category.py | 4 +- ynab/models/save_payee.py | 2 +- ynab/models/save_payee_response.py | 2 +- ynab/models/save_payee_response_data.py | 2 +- ynab/models/save_scheduled_transaction.py | 11 +- ynab/models/save_sub_transaction.py | 9 +- .../save_transaction_with_id_or_import_id.py | 29 +- .../save_transaction_with_optional_fields.py | 11 +- ynab/models/save_transactions_response.py | 2 +- .../models/save_transactions_response_data.py | 2 +- ynab/models/scheduled_sub_transaction.py | 13 +- ynab/models/scheduled_transaction_detail.py | 38 +- .../models/scheduled_transaction_frequency.py | 2 +- ynab/models/scheduled_transaction_response.py | 2 +- .../scheduled_transaction_response_data.py | 2 +- ynab/models/scheduled_transaction_summary.py | 13 +- .../models/scheduled_transactions_response.py | 2 +- .../scheduled_transactions_response_data.py | 2 +- ynab/models/sub_transaction.py | 9 +- ynab/models/transaction_cleared_status.py | 2 +- ynab/models/transaction_detail.py | 61 +- ynab/models/transaction_flag_color.py | 2 +- ynab/models/transaction_response.py | 2 +- ynab/models/transaction_response_data.py | 2 +- ynab/models/transaction_summary.py | 11 +- ynab/models/transactions_import_response.py | 2 +- .../transactions_import_response_data.py | 2 +- ynab/models/transactions_response.py | 2 +- ynab/models/transactions_response_data.py | 2 +- ynab/models/user.py | 7 +- ynab/models/user_response.py | 2 +- ynab/models/user_response_data.py | 2 +- ynab/rest.py | 3 +- 234 files changed, 9486 insertions(+), 2759 deletions(-) create mode 100644 docs/ExistingCategory.md create mode 100644 docs/MoneyMovement.md create mode 100644 docs/MoneyMovementGroup.md create mode 100644 docs/MoneyMovementGroupsResponse.md create mode 100644 docs/MoneyMovementGroupsResponseData.md create mode 100644 docs/MoneyMovementsApi.md create mode 100644 docs/MoneyMovementsResponse.md create mode 100644 docs/MoneyMovementsResponseData.md create mode 100644 docs/NewCategory.md create mode 100644 docs/PatchCategoryGroupWrapper.md create mode 100644 docs/PlanDetail.md create mode 100644 docs/PlanDetailResponse.md create mode 100644 docs/PlanDetailResponseData.md create mode 100644 docs/PlanSettings.md create mode 100644 docs/PlanSettingsResponse.md create mode 100644 docs/PlanSettingsResponseData.md create mode 100644 docs/PlanSummary.md create mode 100644 docs/PlanSummaryResponse.md create mode 100644 docs/PlanSummaryResponseData.md rename docs/{BudgetsApi.md => PlansApi.md} (59%) create mode 100644 docs/PostCategoryGroupWrapper.md create mode 100644 docs/PostCategoryWrapper.md create mode 100644 docs/SaveCategoryGroup.md create mode 100644 docs/SaveCategoryGroupResponse.md create mode 100644 docs/SaveCategoryGroupResponseData.md create mode 100644 test/test_existing_category.py create mode 100644 test/test_money_movement.py create mode 100644 test/test_money_movement_group.py create mode 100644 test/test_money_movement_groups_response.py create mode 100644 test/test_money_movement_groups_response_data.py create mode 100644 test/test_money_movements_api.py create mode 100644 test/test_money_movements_response.py create mode 100644 test/test_money_movements_response_data.py create mode 100644 test/test_new_category.py create mode 100644 test/test_patch_category_group_wrapper.py rename test/{test_budget_detail.py => test_plan_detail.py} (91%) rename test/{test_budget_detail_response.py => test_plan_detail_response.py} (59%) rename test/{test_budget_detail_response_data.py => test_plan_detail_response_data.py} (63%) rename test/{test_budget_settings.py => test_plan_settings.py} (79%) rename test/{test_budget_settings_response.py => test_plan_settings_response.py} (69%) rename test/{test_budget_settings_response_data.py => test_plan_settings_response_data.py} (72%) rename test/{test_budget_summary.py => test_plan_summary.py} (85%) rename test/{test_budget_summary_response.py => test_plan_summary_response.py} (76%) rename test/{test_budget_summary_response_data.py => test_plan_summary_response_data.py} (90%) rename test/{test_budgets_api.py => test_plans_api.py} (55%) create mode 100644 test/test_post_category_group_wrapper.py create mode 100644 test/test_post_category_wrapper.py create mode 100644 test/test_save_category_group.py create mode 100644 test/test_save_category_group_response.py create mode 100644 test/test_save_category_group_response_data.py create mode 100644 ynab/api/money_movements_api.py rename ynab/api/{budgets_api.py => plans_api.py} (81%) create mode 100644 ynab/models/existing_category.py create mode 100644 ynab/models/money_movement.py create mode 100644 ynab/models/money_movement_group.py create mode 100644 ynab/models/money_movement_groups_response.py create mode 100644 ynab/models/money_movement_groups_response_data.py create mode 100644 ynab/models/money_movements_response.py create mode 100644 ynab/models/money_movements_response_data.py create mode 100644 ynab/models/new_category.py create mode 100644 ynab/models/patch_category_group_wrapper.py create mode 100644 ynab/models/plan_detail.py create mode 100644 ynab/models/plan_detail_response.py create mode 100644 ynab/models/plan_detail_response_data.py create mode 100644 ynab/models/plan_settings.py create mode 100644 ynab/models/plan_settings_response.py create mode 100644 ynab/models/plan_settings_response_data.py create mode 100644 ynab/models/plan_summary.py create mode 100644 ynab/models/plan_summary_response.py create mode 100644 ynab/models/plan_summary_response_data.py create mode 100644 ynab/models/post_category_group_wrapper.py create mode 100644 ynab/models/post_category_wrapper.py create mode 100644 ynab/models/save_category_group.py create mode 100644 ynab/models/save_category_group_response.py create mode 100644 ynab/models/save_category_group_response_data.py diff --git a/.gitignore b/.gitignore index 43995bd..65b06b9 100644 --- a/.gitignore +++ b/.gitignore @@ -62,5 +62,5 @@ docs/_build/ # PyBuilder target/ -#Ipython Notebook +# Ipython Notebook .ipynb_checkpoints diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 44ff6a3..b2cbd8a 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -6,16 +6,6 @@ docs/AccountType.md docs/AccountsApi.md docs/AccountsResponse.md docs/AccountsResponseData.md -docs/BudgetDetail.md -docs/BudgetDetailResponse.md -docs/BudgetDetailResponseData.md -docs/BudgetSettings.md -docs/BudgetSettingsResponse.md -docs/BudgetSettingsResponseData.md -docs/BudgetSummary.md -docs/BudgetSummaryResponse.md -docs/BudgetSummaryResponseData.md -docs/BudgetsApi.md docs/BulkResponse.md docs/BulkResponseData.md docs/BulkResponseDataBulk.md @@ -32,10 +22,18 @@ docs/CurrencyFormat.md docs/DateFormat.md docs/ErrorDetail.md docs/ErrorResponse.md +docs/ExistingCategory.md docs/ExistingTransaction.md docs/HybridTransaction.md docs/HybridTransactionsResponse.md docs/HybridTransactionsResponseData.md +docs/MoneyMovement.md +docs/MoneyMovementGroup.md +docs/MoneyMovementGroupsResponse.md +docs/MoneyMovementGroupsResponseData.md +docs/MoneyMovementsApi.md +docs/MoneyMovementsResponse.md +docs/MoneyMovementsResponseData.md docs/MonthDetail.md docs/MonthDetailResponse.md docs/MonthDetailResponseData.md @@ -43,7 +41,9 @@ docs/MonthSummariesResponse.md docs/MonthSummariesResponseData.md docs/MonthSummary.md docs/MonthsApi.md +docs/NewCategory.md docs/NewTransaction.md +docs/PatchCategoryGroupWrapper.md docs/PatchCategoryWrapper.md docs/PatchMonthCategoryWrapper.md docs/PatchPayeeWrapper.md @@ -60,13 +60,28 @@ docs/PayeeResponseData.md docs/PayeesApi.md docs/PayeesResponse.md docs/PayeesResponseData.md +docs/PlanDetail.md +docs/PlanDetailResponse.md +docs/PlanDetailResponseData.md +docs/PlanSettings.md +docs/PlanSettingsResponse.md +docs/PlanSettingsResponseData.md +docs/PlanSummary.md +docs/PlanSummaryResponse.md +docs/PlanSummaryResponseData.md +docs/PlansApi.md docs/PostAccountWrapper.md +docs/PostCategoryGroupWrapper.md +docs/PostCategoryWrapper.md docs/PostScheduledTransactionWrapper.md docs/PostTransactionsWrapper.md docs/PutScheduledTransactionWrapper.md docs/PutTransactionWrapper.md docs/SaveAccount.md docs/SaveCategory.md +docs/SaveCategoryGroup.md +docs/SaveCategoryGroupResponse.md +docs/SaveCategoryGroupResponseData.md docs/SaveCategoryResponse.md docs/SaveCategoryResponseData.md docs/SaveMonthCategory.md @@ -108,15 +123,41 @@ pyproject.toml requirements.txt test-requirements.txt test/__init__.py +test/test_existing_category.py +test/test_money_movement.py +test/test_money_movement_group.py +test/test_money_movement_groups_response.py +test/test_money_movement_groups_response_data.py +test/test_money_movements_api.py +test/test_money_movements_response.py +test/test_money_movements_response_data.py +test/test_new_category.py +test/test_patch_category_group_wrapper.py +test/test_plan_detail.py +test/test_plan_detail_response.py +test/test_plan_detail_response_data.py +test/test_plan_settings.py +test/test_plan_settings_response.py +test/test_plan_settings_response_data.py +test/test_plan_summary.py +test/test_plan_summary_response.py +test/test_plan_summary_response_data.py +test/test_plans_api.py +test/test_post_category_group_wrapper.py +test/test_post_category_wrapper.py +test/test_save_category_group.py +test/test_save_category_group_response.py +test/test_save_category_group_response_data.py tox.ini ynab/__init__.py ynab/api/__init__.py ynab/api/accounts_api.py -ynab/api/budgets_api.py ynab/api/categories_api.py +ynab/api/money_movements_api.py ynab/api/months_api.py ynab/api/payee_locations_api.py ynab/api/payees_api.py +ynab/api/plans_api.py ynab/api/scheduled_transactions_api.py ynab/api/transactions_api.py ynab/api/user_api.py @@ -131,15 +172,6 @@ ynab/models/account_response_data.py ynab/models/account_type.py ynab/models/accounts_response.py ynab/models/accounts_response_data.py -ynab/models/budget_detail.py -ynab/models/budget_detail_response.py -ynab/models/budget_detail_response_data.py -ynab/models/budget_settings.py -ynab/models/budget_settings_response.py -ynab/models/budget_settings_response_data.py -ynab/models/budget_summary.py -ynab/models/budget_summary_response.py -ynab/models/budget_summary_response_data.py ynab/models/bulk_response.py ynab/models/bulk_response_data.py ynab/models/bulk_response_data_bulk.py @@ -155,17 +187,26 @@ ynab/models/currency_format.py ynab/models/date_format.py ynab/models/error_detail.py ynab/models/error_response.py +ynab/models/existing_category.py ynab/models/existing_transaction.py ynab/models/hybrid_transaction.py ynab/models/hybrid_transactions_response.py ynab/models/hybrid_transactions_response_data.py +ynab/models/money_movement.py +ynab/models/money_movement_group.py +ynab/models/money_movement_groups_response.py +ynab/models/money_movement_groups_response_data.py +ynab/models/money_movements_response.py +ynab/models/money_movements_response_data.py ynab/models/month_detail.py ynab/models/month_detail_response.py ynab/models/month_detail_response_data.py ynab/models/month_summaries_response.py ynab/models/month_summaries_response_data.py ynab/models/month_summary.py +ynab/models/new_category.py ynab/models/new_transaction.py +ynab/models/patch_category_group_wrapper.py ynab/models/patch_category_wrapper.py ynab/models/patch_month_category_wrapper.py ynab/models/patch_payee_wrapper.py @@ -180,13 +221,27 @@ ynab/models/payee_response.py ynab/models/payee_response_data.py ynab/models/payees_response.py ynab/models/payees_response_data.py +ynab/models/plan_detail.py +ynab/models/plan_detail_response.py +ynab/models/plan_detail_response_data.py +ynab/models/plan_settings.py +ynab/models/plan_settings_response.py +ynab/models/plan_settings_response_data.py +ynab/models/plan_summary.py +ynab/models/plan_summary_response.py +ynab/models/plan_summary_response_data.py ynab/models/post_account_wrapper.py +ynab/models/post_category_group_wrapper.py +ynab/models/post_category_wrapper.py ynab/models/post_scheduled_transaction_wrapper.py ynab/models/post_transactions_wrapper.py ynab/models/put_scheduled_transaction_wrapper.py ynab/models/put_transaction_wrapper.py ynab/models/save_account.py ynab/models/save_category.py +ynab/models/save_category_group.py +ynab/models/save_category_group_response.py +ynab/models/save_category_group_response_data.py ynab/models/save_category_response.py ynab/models/save_category_response_data.py ynab/models/save_month_category.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index e465da4..2540a3a 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.14.0 +7.20.0 diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cd5a670..f17b905 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,7 +2,7 @@ ## Setup -- Install Poetry: `pip install poetry` +- Install Poetry: `pipx install poetry` - Install dependencies: `poetry install` - Install [OpenAPI Generator](https://openapi-generator.tech/) (on macOS: `brew install openapi-generator`) - Run tests: `poetry run pytest` diff --git a/README.md b/README.md index bd29515..f67c2dd 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: budgets_api = ynab.BudgetsApi(api_client) - budgets_response = budgets_api.get_budgets() + budgets_response = budgets_api.get_plans() budgets = budgets_response.data.budgets for budget in budgets: @@ -57,16 +57,16 @@ Class | Method | Description **AccountsApi** | [**create_account**](docs/AccountsApi.md#create_account) | Create a new account   | [**get_account_by_id**](docs/AccountsApi.md#get_account_by_id) | Single account   | [**get_accounts**](docs/AccountsApi.md#get_accounts) | Account list -**BudgetsApi** | [**get_budget_by_id**](docs/BudgetsApi.md#get_budget_by_id) | Single budget -  | [**get_budget_settings_by_id**](docs/BudgetsApi.md#get_budget_settings_by_id) | Budget Settings -  | [**get_budgets**](docs/BudgetsApi.md#get_budgets) | List budgets +**BudgetsApi** | [**get_plan_by_id**](docs/BudgetsApi.md#get_plan_by_id) | Single plan +  | [**get_plan_settings_by_id**](docs/BudgetsApi.md#get_plan_settings_by_id) | Plan Settings +  | [**get_plans**](docs/BudgetsApi.md#get_plans) | List plans **CategoriesApi** | [**get_categories**](docs/CategoriesApi.md#get_categories) | List categories   | [**get_category_by_id**](docs/CategoriesApi.md#get_category_by_id) | Single category -  | [**get_month_category_by_id**](docs/CategoriesApi.md#get_month_category_by_id) | Single category for a specific budget month +  | [**get_month_category_by_id**](docs/CategoriesApi.md#get_month_category_by_id) | Single category for a specific plan month   | [**update_category**](docs/CategoriesApi.md#update_category) | Update a category -  | [**update_month_category**](docs/CategoriesApi.md#update_month_category) | Update a category for a specific month -**MonthsApi** | [**get_budget_month**](docs/MonthsApi.md#get_budget_month) | Single budget month -  | [**get_budget_months**](docs/MonthsApi.md#get_budget_months) | List budget months +  | [**update_month_category**](docs/CategoriesApi.md#update_month_category) | Update a category for a specific plan month +**MonthsApi** | [**get_plan_month**](docs/MonthsApi.md#get_plan_month) | Single plan month +  | [**get_plan_months**](docs/MonthsApi.md#get_plan_months) | List plan months **PayeeLocationsApi** | [**get_payee_location_by_id**](docs/PayeeLocationsApi.md#get_payee_location_by_id) | Single payee location   | [**get_payee_locations**](docs/PayeeLocationsApi.md#get_payee_locations) | List payee locations   | [**get_payee_locations_by_payee**](docs/PayeeLocationsApi.md#get_payee_locations_by_payee) | List locations for a payee @@ -96,6 +96,6 @@ The version of this client is defined in the `pyproject.toml` file and follows [ ## License -Copyright (c) 2025 You Need A Budget, LLC +Copyright (c) 2025 YNAB Licensed under the Apache-2.0 license diff --git a/docs/Account.md b/docs/Account.md index 833b729..e67627e 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -5,20 +5,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **name** | **str** | | **type** | [**AccountType**](AccountType.md) | | -**on_budget** | **bool** | Whether this account is on budget or not | +**on_budget** | **bool** | Whether this account is \"on budget\" or not | **closed** | **bool** | Whether this account is closed or not | **note** | **str** | | [optional] -**balance** | **int** | The current balance of the account in milliunits format | +**balance** | **int** | The current available 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 | +**transfer_payee_id** | **UUID** | 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] **last_reconciled_at** | **datetime** | A date/time specifying when the account was last reconciled. | [optional] -**debt_original_balance** | **int** | The original debt/loan account balance, specified in milliunits format. | [optional] +**debt_original_balance** | **int** | This field is deprecated and will always be null. | [optional] **debt_interest_rates** | **Dict[str, int]** | | [optional] **debt_minimum_payments** | **Dict[str, int]** | | [optional] **debt_escrow_amounts** | **Dict[str, int]** | | [optional] diff --git a/docs/AccountsApi.md b/docs/AccountsApi.md index 7c94e69..9405cfb 100644 --- a/docs/AccountsApi.md +++ b/docs/AccountsApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.ynab.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**](AccountsApi.md#create_account) | **POST** /budgets/{plan_id}/accounts | Create an account +[**get_account_by_id**](AccountsApi.md#get_account_by_id) | **GET** /budgets/{plan_id}/accounts/{account_id} | Get an account +[**get_accounts**](AccountsApi.md#get_accounts) | **GET** /budgets/{plan_id}/accounts | Get all accounts # **create_account** -> AccountResponse create_account(budget_id, data) +> AccountResponse create_account(plan_id, data) -Create a new account +Create an account Creates a new account @@ -47,12 +47,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.AccountsApi(api_client) - 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.ynab.com/#oauth-default-budget) + plan_id = 'plan_id_example' # str | The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) data = ynab.PostAccountWrapper() # PostAccountWrapper | The account to create. try: - # Create a new account - api_response = api_instance.create_account(budget_id, data) + # Create an account + api_response = api_instance.create_account(plan_id, data) print("The response of AccountsApi->create_account:\n") pprint(api_response) except Exception as e: @@ -66,7 +66,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget) | + **plan_id** | **str**| The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) | **data** | [**PostAccountWrapper**](PostAccountWrapper.md)| The account to create. | ### Return type @@ -92,9 +92,9 @@ 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_account_by_id** -> AccountResponse get_account_by_id(budget_id, account_id) +> AccountResponse get_account_by_id(plan_id, account_id) -Single account +Get an account Returns a single account @@ -128,12 +128,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.AccountsApi(api_client) - 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.ynab.com/#oauth-default-budget). - account_id = 'account_id_example' # str | The id of the account + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + account_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | The id of the account try: - # Single account - api_response = api_instance.get_account_by_id(budget_id, account_id) + # Get an account + api_response = api_instance.get_account_by_id(plan_id, account_id) print("The response of AccountsApi->get_account_by_id:\n") pprint(api_response) except Exception as e: @@ -147,8 +147,8 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | - **account_id** | **str**| The id of the account | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **account_id** | **UUID**| The id of the account | ### Return type @@ -169,14 +169,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested account | - | **404** | The requested account was not found | - | -**0** | An error occurred | - | [[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, last_knowledge_of_server=last_knowledge_of_server) +> AccountsResponse get_accounts(plan_id, last_knowledge_of_server=last_knowledge_of_server) -Account list +Get all accounts Returns all accounts @@ -210,12 +209,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.AccountsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # 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) + # Get all accounts + api_response = api_instance.get_accounts(plan_id, last_knowledge_of_server=last_knowledge_of_server) print("The response of AccountsApi->get_accounts:\n") pprint(api_response) except Exception as e: @@ -229,7 +228,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 @@ -251,7 +250,6 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested accounts | - | **404** | No accounts were found | - | -**0** | An error occurred | - | [[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/BudgetDetail.md b/docs/BudgetDetail.md index f2818c0..2dd7241 100644 --- a/docs/BudgetDetail.md +++ b/docs/BudgetDetail.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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] diff --git a/docs/BudgetSummary.md b/docs/BudgetSummary.md index cc0a8a0..5004b13 100644 --- a/docs/BudgetSummary.md +++ b/docs/BudgetSummary.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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] diff --git a/docs/CategoriesApi.md b/docs/CategoriesApi.md index 8db7e9e..e9f3d49 100644 --- a/docs/CategoriesApi.md +++ b/docs/CategoriesApi.md @@ -4,19 +4,186 @@ All URIs are relative to *https://api.ynab.com/v1* 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_category**](CategoriesApi.md#update_category) | **PATCH** /budgets/{budget_id}/categories/{category_id} | Update a category -[**update_month_category**](CategoriesApi.md#update_month_category) | **PATCH** /budgets/{budget_id}/months/{month}/categories/{category_id} | Update a category for a specific month +[**create_category**](CategoriesApi.md#create_category) | **POST** /budgets/{plan_id}/categories | Create a category +[**create_category_group**](CategoriesApi.md#create_category_group) | **POST** /budgets/{plan_id}/category_groups | Create a category group +[**get_categories**](CategoriesApi.md#get_categories) | **GET** /budgets/{plan_id}/categories | Get all categories +[**get_category_by_id**](CategoriesApi.md#get_category_by_id) | **GET** /budgets/{plan_id}/categories/{category_id} | Get a category +[**get_month_category_by_id**](CategoriesApi.md#get_month_category_by_id) | **GET** /budgets/{plan_id}/months/{month}/categories/{category_id} | Get a category for a specific plan month +[**update_category**](CategoriesApi.md#update_category) | **PATCH** /budgets/{plan_id}/categories/{category_id} | Update a category +[**update_category_group**](CategoriesApi.md#update_category_group) | **PATCH** /budgets/{plan_id}/category_groups/{category_group_id} | Update a category group +[**update_month_category**](CategoriesApi.md#update_month_category) | **PATCH** /budgets/{plan_id}/months/{month}/categories/{category_id} | Update a category for a specific month +# **create_category** +> SaveCategoryResponse create_category(plan_id, data) + +Create a category + +Creates a new category + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.post_category_wrapper import PostCategoryWrapper +from ynab.models.save_category_response import SaveCategoryResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.CategoriesApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) + data = ynab.PostCategoryWrapper() # PostCategoryWrapper | The category to create. + + try: + # Create a category + api_response = api_instance.create_category(plan_id, data) + print("The response of CategoriesApi->create_category:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->create_category: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) | + **data** | [**PostCategoryWrapper**](PostCategoryWrapper.md)| The category to create. | + +### Return type + +[**SaveCategoryResponse**](SaveCategoryResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | The category was successfully created | - | +**400** | The request could not be understood due to malformed syntax or validation error(s). | - | + +[[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_category_group** +> SaveCategoryGroupResponse create_category_group(plan_id, data) + +Create a category group + +Creates a new category group + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper +from ynab.models.save_category_group_response import SaveCategoryGroupResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.CategoriesApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) + data = ynab.PostCategoryGroupWrapper() # PostCategoryGroupWrapper | The category group to create. + + try: + # Create a category group + api_response = api_instance.create_category_group(plan_id, data) + print("The response of CategoriesApi->create_category_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->create_category_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) | + **data** | [**PostCategoryGroupWrapper**](PostCategoryGroupWrapper.md)| The category group to create. | + +### Return type + +[**SaveCategoryGroupResponse**](SaveCategoryGroupResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | The category group was successfully created | - | +**400** | The request could not be understood due to malformed syntax or validation error(s). | - | + +[[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_categories** -> CategoriesResponse get_categories(budget_id, last_knowledge_of_server=last_knowledge_of_server) +> CategoriesResponse get_categories(plan_id, last_knowledge_of_server=last_knowledge_of_server) -List categories +Get all categories -Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). +Returns all categories grouped by category group. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). ### Example @@ -48,12 +215,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.CategoriesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # 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, last_knowledge_of_server=last_knowledge_of_server) + # Get all categories + api_response = api_instance.get_categories(plan_id, last_knowledge_of_server=last_knowledge_of_server) print("The response of CategoriesApi->get_categories:\n") pprint(api_response) except Exception as e: @@ -67,7 +234,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 @@ -89,16 +256,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The categories grouped by category group | - | **404** | No categories were found | - | -**0** | An error occurred | - | [[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_category_by_id** -> CategoryResponse get_category_by_id(budget_id, category_id) +> CategoryResponse get_category_by_id(plan_id, category_id) -Single category +Get a category -Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). +Returns a single category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). ### Example @@ -130,12 +296,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.CategoriesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). category_id = 'category_id_example' # str | The id of the category try: - # Single category - api_response = api_instance.get_category_by_id(budget_id, category_id) + # Get a category + api_response = api_instance.get_category_by_id(plan_id, category_id) print("The response of CategoriesApi->get_category_by_id:\n") pprint(api_response) except Exception as e: @@ -149,7 +315,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **category_id** | **str**| The id of the category | ### Return type @@ -170,17 +336,16 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | The requested category | - | -**404** | The category not was found | - | -**0** | An error occurred | - | +**404** | The category was not found | - | [[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) +> CategoryResponse get_month_category_by_id(plan_id, month, category_id) -Single category for a specific budget month +Get a category for a specific plan month -Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). +Returns a single category for a specific plan month. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). ### Example @@ -212,13 +377,13 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.CategoriesApi(api_client) - 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.ynab.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)) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = '2013-10-20' # date | The plan 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) + # Get a category for a specific plan month + api_response = api_instance.get_month_category_by_id(plan_id, month, category_id) print("The response of CategoriesApi->get_month_category_by_id:\n") pprint(api_response) except Exception as e: @@ -232,8 +397,8 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.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)) | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **date**| The plan 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 @@ -255,12 +420,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested month category | - | **404** | The month category was not was found | - | -**0** | An error occurred | - | [[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_category** -> SaveCategoryResponse update_category(budget_id, category_id, data) +> SaveCategoryResponse update_category(plan_id, category_id, data) Update a category @@ -297,13 +461,13 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.CategoriesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). category_id = 'category_id_example' # str | The id of the category data = ynab.PatchCategoryWrapper() # PatchCategoryWrapper | The category to update try: # Update a category - api_response = api_instance.update_category(budget_id, category_id, data) + api_response = api_instance.update_category(plan_id, category_id, data) print("The response of CategoriesApi->update_category:\n") pprint(api_response) except Exception as e: @@ -317,7 +481,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **category_id** | **str**| The id of the category | **data** | [**PatchCategoryWrapper**](PatchCategoryWrapper.md)| The category to update | @@ -343,12 +507,96 @@ 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_category_group** +> SaveCategoryGroupResponse update_category_group(plan_id, category_group_id, data) + +Update a category group + +Update a category group + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper +from ynab.models.save_category_group_response import SaveCategoryGroupResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.CategoriesApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + category_group_id = 'category_group_id_example' # str | The id of the category group + data = ynab.PatchCategoryGroupWrapper() # PatchCategoryGroupWrapper | The category group to update + + try: + # Update a category group + api_response = api_instance.update_category_group(plan_id, category_group_id, data) + print("The response of CategoriesApi->update_category_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->update_category_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **category_group_id** | **str**| The id of the category group | + **data** | [**PatchCategoryGroupWrapper**](PatchCategoryGroupWrapper.md)| The category group to update | + +### Return type + +[**SaveCategoryGroupResponse**](SaveCategoryGroupResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The category group was successfully updated | - | +**400** | The request could not be understood due to malformed syntax or validation error(s) | - | + +[[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** -> SaveCategoryResponse update_month_category(budget_id, month, category_id, data) +> SaveCategoryResponse update_month_category(plan_id, month, category_id, data) Update a category for a specific month -Update a category for a specific month. Only `budgeted` amount can be updated. +Update a category for a specific month. Only `budgeted` (assigned) amount can be updated. ### Example @@ -381,14 +629,14 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.CategoriesApi(api_client) - 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.ynab.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)) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = '2013-10-20' # date | The plan 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 - data = ynab.PatchMonthCategoryWrapper() # PatchMonthCategoryWrapper | The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. + data = ynab.PatchMonthCategoryWrapper() # PatchMonthCategoryWrapper | The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored. try: # Update a category for a specific month - api_response = api_instance.update_month_category(budget_id, month, category_id, data) + api_response = api_instance.update_month_category(plan_id, month, category_id, data) print("The response of CategoriesApi->update_month_category:\n") pprint(api_response) except Exception as e: @@ -402,10 +650,10 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.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)) | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **date**| The plan 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 | - **data** | [**PatchMonthCategoryWrapper**](PatchMonthCategoryWrapper.md)| The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. | + **data** | [**PatchMonthCategoryWrapper**](PatchMonthCategoryWrapper.md)| The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored. | ### Return type diff --git a/docs/Category.md b/docs/Category.md index f918647..da7ebe5 100644 --- a/docs/Category.md +++ b/docs/Category.md @@ -5,16 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**category_group_id** | **str** | | +**id** | **UUID** | | +**category_group_id** | **UUID** | | **category_group_name** | **str** | | [optional] **name** | **str** | | **hidden** | **bool** | Whether or not the category is hidden | -**original_category_group_id** | **str** | DEPRECATED: No longer used. Value will always be null. | [optional] +**original_category_group_id** | **UUID** | DEPRECATED: No longer used. Value will always be null. | [optional] **note** | **str** | | [optional] -**budgeted** | **int** | Budgeted amount in milliunits format | +**budgeted** | **int** | Assigned (budgeted) amount in milliunits format | **activity** | **int** | Activity amount in milliunits format | -**balance** | **int** | Balance in milliunits format | +**balance** | **int** | Available balance in milliunits format | **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_needs_whole_amount** | **bool** | Indicates the monthly rollover behavior for \"NEED\"-type goals. When \"true\", the goal will always ask for the target amount in the new month (\"Set Aside\"). When \"false\", previous month category funding is used (\"Refill\"). For other goal types, this field will be null. | [optional] **goal_day** | **int** | A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month). | [optional] @@ -22,7 +22,8 @@ Name | Type | Description | Notes **goal_cadence_frequency** | **int** | The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored. | [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_target_month** | **date** | DEPRECATED: No longer used. Use `goal_target_date` instead. | [optional] +**goal_target_date** | **date** | The target date 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] diff --git a/docs/CategoryGroup.md b/docs/CategoryGroup.md index dfedec1..43f86cf 100644 --- a/docs/CategoryGroup.md +++ b/docs/CategoryGroup.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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. | diff --git a/docs/CategoryGroupWithCategories.md b/docs/CategoryGroupWithCategories.md index 7b27085..0efffea 100644 --- a/docs/CategoryGroupWithCategories.md +++ b/docs/CategoryGroupWithCategories.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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. | -**categories** | [**List[Category]**](Category.md) | Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). | +**categories** | [**List[Category]**](Category.md) | Category group categories. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). | ## Example diff --git a/docs/CurrencyFormat.md b/docs/CurrencyFormat.md index 1db3884..f44971d 100644 --- a/docs/CurrencyFormat.md +++ b/docs/CurrencyFormat.md @@ -1,6 +1,6 @@ # CurrencyFormat -The currency format setting for the budget. In some cases the format will not be available and will be specified as null. +The currency format setting for the plan. In some cases the format will not be available and will be specified as null. ## Properties diff --git a/docs/DateFormat.md b/docs/DateFormat.md index c911c05..72f0f62 100644 --- a/docs/DateFormat.md +++ b/docs/DateFormat.md @@ -1,6 +1,6 @@ # DateFormat -The date format setting for the budget. In some cases the format will not be available and will be specified as null. +The date format setting for the plan. In some cases the format will not be available and will be specified as null. ## Properties diff --git a/docs/ExistingCategory.md b/docs/ExistingCategory.md new file mode 100644 index 0000000..d62a64f --- /dev/null +++ b/docs/ExistingCategory.md @@ -0,0 +1,33 @@ +# ExistingCategory + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**note** | **str** | | [optional] +**category_group_id** | **UUID** | | [optional] +**goal_target** | **int** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount. | [optional] +**goal_target_date** | **date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] + +## Example + +```python +from ynab.models.existing_category import ExistingCategory + +# TODO update the JSON string below +json = "{}" +# create an instance of ExistingCategory from a JSON string +existing_category_instance = ExistingCategory.from_json(json) +# print the JSON string representation of the object +print(ExistingCategory.to_json()) + +# convert the object into a dict +existing_category_dict = existing_category_instance.to_dict() +# create an instance of ExistingCategory from a dict +existing_category_from_dict = ExistingCategory.from_dict(existing_category_dict) +``` +[[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/ExistingTransaction.md b/docs/ExistingTransaction.md index 1e0fdb2..a19dc1e 100644 --- a/docs/ExistingTransaction.md +++ b/docs/ExistingTransaction.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_id** | **str** | | [optional] +**account_id** | **UUID** | | [optional] **var_date** | **date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] **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. | [optional] -**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 `transfer_payee_id` on the account resource. | [optional] +**payee_id** | **UUID** | 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 `transfer_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] +**category_id** | **UUID** | 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** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] diff --git a/docs/HybridTransaction.md b/docs/HybridTransaction.md index 1a86c46..959b10a 100644 --- a/docs/HybridTransaction.md +++ b/docs/HybridTransaction.md @@ -13,10 +13,10 @@ Name | Type | Description | Notes **approved** | **bool** | Whether or not the transaction is approved | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **flag_name** | **str** | The customized name of a transaction flag | [optional] -**account_id** | **str** | | -**payee_id** | **str** | | [optional] -**category_id** | **str** | | [optional] -**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | [optional] +**account_id** | **UUID** | | +**payee_id** | **UUID** | | [optional] +**category_id** | **UUID** | | [optional] +**transfer_account_id** | **UUID** | 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] diff --git a/docs/MoneyMovement.md b/docs/MoneyMovement.md new file mode 100644 index 0000000..914840f --- /dev/null +++ b/docs/MoneyMovement.md @@ -0,0 +1,37 @@ +# MoneyMovement + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **UUID** | | +**month** | **date** | The month of the money movement in ISO format (e.g. 2024-01-01) | [optional] +**moved_at** | **datetime** | The date/time the money movement was processed on the server in ISO format (e.g. 2024-01-01T12:00:00Z) | [optional] +**note** | **str** | | [optional] +**money_movement_group_id** | **UUID** | The id of the money movement group this movement belongs to | [optional] +**performed_by_user_id** | **UUID** | The id of the user who performed the money movement | [optional] +**from_category_id** | **UUID** | The id of the category the money was moved from | [optional] +**to_category_id** | **UUID** | The id of the category the money was moved to | [optional] +**amount** | **int** | The amount of the money movement in milliunits format | + +## Example + +```python +from ynab.models.money_movement import MoneyMovement + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovement from a JSON string +money_movement_instance = MoneyMovement.from_json(json) +# print the JSON string representation of the object +print(MoneyMovement.to_json()) + +# convert the object into a dict +money_movement_dict = money_movement_instance.to_dict() +# create an instance of MoneyMovement from a dict +money_movement_from_dict = MoneyMovement.from_dict(money_movement_dict) +``` +[[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/MoneyMovementGroup.md b/docs/MoneyMovementGroup.md new file mode 100644 index 0000000..4f908b9 --- /dev/null +++ b/docs/MoneyMovementGroup.md @@ -0,0 +1,33 @@ +# MoneyMovementGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **UUID** | | +**group_created_at** | **datetime** | When the money movement group was created | +**month** | **date** | The month of the money movement group in ISO format (e.g. 2024-01-01) | +**note** | **str** | | [optional] +**performed_by_user_id** | **UUID** | The id of the user who performed the money movement group | [optional] + +## Example + +```python +from ynab.models.money_movement_group import MoneyMovementGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovementGroup from a JSON string +money_movement_group_instance = MoneyMovementGroup.from_json(json) +# print the JSON string representation of the object +print(MoneyMovementGroup.to_json()) + +# convert the object into a dict +money_movement_group_dict = money_movement_group_instance.to_dict() +# create an instance of MoneyMovementGroup from a dict +money_movement_group_from_dict = MoneyMovementGroup.from_dict(money_movement_group_dict) +``` +[[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/MoneyMovementGroupsResponse.md b/docs/MoneyMovementGroupsResponse.md new file mode 100644 index 0000000..67bfd30 --- /dev/null +++ b/docs/MoneyMovementGroupsResponse.md @@ -0,0 +1,29 @@ +# MoneyMovementGroupsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**MoneyMovementGroupsResponseData**](MoneyMovementGroupsResponseData.md) | | + +## Example + +```python +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovementGroupsResponse from a JSON string +money_movement_groups_response_instance = MoneyMovementGroupsResponse.from_json(json) +# print the JSON string representation of the object +print(MoneyMovementGroupsResponse.to_json()) + +# convert the object into a dict +money_movement_groups_response_dict = money_movement_groups_response_instance.to_dict() +# create an instance of MoneyMovementGroupsResponse from a dict +money_movement_groups_response_from_dict = MoneyMovementGroupsResponse.from_dict(money_movement_groups_response_dict) +``` +[[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/MoneyMovementGroupsResponseData.md b/docs/MoneyMovementGroupsResponseData.md new file mode 100644 index 0000000..5c962d8 --- /dev/null +++ b/docs/MoneyMovementGroupsResponseData.md @@ -0,0 +1,30 @@ +# MoneyMovementGroupsResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money_movement_groups** | [**List[MoneyMovementGroup]**](MoneyMovementGroup.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +## Example + +```python +from ynab.models.money_movement_groups_response_data import MoneyMovementGroupsResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovementGroupsResponseData from a JSON string +money_movement_groups_response_data_instance = MoneyMovementGroupsResponseData.from_json(json) +# print the JSON string representation of the object +print(MoneyMovementGroupsResponseData.to_json()) + +# convert the object into a dict +money_movement_groups_response_data_dict = money_movement_groups_response_data_instance.to_dict() +# create an instance of MoneyMovementGroupsResponseData from a dict +money_movement_groups_response_data_from_dict = MoneyMovementGroupsResponseData.from_dict(money_movement_groups_response_data_dict) +``` +[[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/MoneyMovementsApi.md b/docs/MoneyMovementsApi.md new file mode 100644 index 0000000..e481e68 --- /dev/null +++ b/docs/MoneyMovementsApi.md @@ -0,0 +1,332 @@ +# ynab.MoneyMovementsApi + +All URIs are relative to *https://api.ynab.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_money_movement_groups**](MoneyMovementsApi.md#get_money_movement_groups) | **GET** /budgets/{plan_id}/money_movement_groups | Get all money movement groups +[**get_money_movement_groups_by_month**](MoneyMovementsApi.md#get_money_movement_groups_by_month) | **GET** /budgets/{plan_id}/months/{month}/money_movement_groups | Get money movement groups for a plan month +[**get_money_movements**](MoneyMovementsApi.md#get_money_movements) | **GET** /budgets/{plan_id}/money_movements | Get all money movements +[**get_money_movements_by_month**](MoneyMovementsApi.md#get_money_movements_by_month) | **GET** /budgets/{plan_id}/months/{month}/money_movements | Get money movements for a plan month + + +# **get_money_movement_groups** +> MoneyMovementGroupsResponse get_money_movement_groups(plan_id) + +Get all money movement groups + +Returns all money movement groups + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.MoneyMovementsApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + + try: + # Get all money movement groups + api_response = api_instance.get_money_movement_groups(plan_id) + print("The response of MoneyMovementsApi->get_money_movement_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MoneyMovementsApi->get_money_movement_groups: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + +### Return type + +[**MoneyMovementGroupsResponse**](MoneyMovementGroupsResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of requested money movement groups | - | +**404** | No money movement groups were found | - | + +[[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_money_movement_groups_by_month** +> MoneyMovementGroupsResponse get_money_movement_groups_by_month(plan_id, month) + +Get money movement groups for a plan month + +Returns all money movement groups for a specific month + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.MoneyMovementsApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = '2013-10-20' # date | The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) + + try: + # Get money movement groups for a plan month + api_response = api_instance.get_money_movement_groups_by_month(plan_id, month) + print("The response of MoneyMovementsApi->get_money_movement_groups_by_month:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MoneyMovementsApi->get_money_movement_groups_by_month: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **date**| The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | + +### Return type + +[**MoneyMovementGroupsResponse**](MoneyMovementGroupsResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of requested money movement groups | - | +**404** | No money movement groups were found | - | + +[[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_money_movements** +> MoneyMovementsResponse get_money_movements(plan_id) + +Get all money movements + +Returns all money movements + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.money_movements_response import MoneyMovementsResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.MoneyMovementsApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + + try: + # Get all money movements + api_response = api_instance.get_money_movements(plan_id) + print("The response of MoneyMovementsApi->get_money_movements:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MoneyMovementsApi->get_money_movements: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + +### Return type + +[**MoneyMovementsResponse**](MoneyMovementsResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of requested money movements | - | +**404** | No money movements were found | - | + +[[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_money_movements_by_month** +> MoneyMovementsResponse get_money_movements_by_month(plan_id, month) + +Get money movements for a plan month + +Returns all money movements for a specific month + +### Example + +* Bearer Authentication (bearer): + +```python +import ynab +from ynab.models.money_movements_response import MoneyMovementsResponse +from ynab.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.ynab.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = ynab.Configuration( + host = "https://api.ynab.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearer +configuration = ynab.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ynab.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ynab.MoneyMovementsApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = '2013-10-20' # date | The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) + + try: + # Get money movements for a plan month + api_response = api_instance.get_money_movements_by_month(plan_id, month) + print("The response of MoneyMovementsApi->get_money_movements_by_month:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MoneyMovementsApi->get_money_movements_by_month: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **date**| The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | + +### Return type + +[**MoneyMovementsResponse**](MoneyMovementsResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of requested money movements | - | +**404** | No money movements were found | - | + +[[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/MoneyMovementsResponse.md b/docs/MoneyMovementsResponse.md new file mode 100644 index 0000000..23a96f1 --- /dev/null +++ b/docs/MoneyMovementsResponse.md @@ -0,0 +1,29 @@ +# MoneyMovementsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**MoneyMovementsResponseData**](MoneyMovementsResponseData.md) | | + +## Example + +```python +from ynab.models.money_movements_response import MoneyMovementsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovementsResponse from a JSON string +money_movements_response_instance = MoneyMovementsResponse.from_json(json) +# print the JSON string representation of the object +print(MoneyMovementsResponse.to_json()) + +# convert the object into a dict +money_movements_response_dict = money_movements_response_instance.to_dict() +# create an instance of MoneyMovementsResponse from a dict +money_movements_response_from_dict = MoneyMovementsResponse.from_dict(money_movements_response_dict) +``` +[[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/MoneyMovementsResponseData.md b/docs/MoneyMovementsResponseData.md new file mode 100644 index 0000000..8586656 --- /dev/null +++ b/docs/MoneyMovementsResponseData.md @@ -0,0 +1,30 @@ +# MoneyMovementsResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money_movements** | [**List[MoneyMovement]**](MoneyMovement.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +## Example + +```python +from ynab.models.money_movements_response_data import MoneyMovementsResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of MoneyMovementsResponseData from a JSON string +money_movements_response_data_instance = MoneyMovementsResponseData.from_json(json) +# print the JSON string representation of the object +print(MoneyMovementsResponseData.to_json()) + +# convert the object into a dict +money_movements_response_data_dict = money_movements_response_data_instance.to_dict() +# create an instance of MoneyMovementsResponseData from a dict +money_movements_response_data_from_dict = MoneyMovementsResponseData.from_dict(money_movements_response_data_dict) +``` +[[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 acf10b5..6972992 100644 --- a/docs/MonthDetail.md +++ b/docs/MonthDetail.md @@ -8,12 +8,12 @@ Name | Type | Description | Notes **month** | **date** | | **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 | +**budgeted** | **int** | The total amount assigned (budgeted) in 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. | -**categories** | [**List[Category]**](Category.md) | The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. | +**categories** | [**List[Category]**](Category.md) | The plan month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. | ## Example diff --git a/docs/MonthSummary.md b/docs/MonthSummary.md index a490ea2..bd4ac76 100644 --- a/docs/MonthSummary.md +++ b/docs/MonthSummary.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **month** | **date** | | **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 | +**budgeted** | **int** | The total amount assigned (budgeted) in 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] diff --git a/docs/MonthsApi.md b/docs/MonthsApi.md index 538bb87..afba82a 100644 --- a/docs/MonthsApi.md +++ b/docs/MonthsApi.md @@ -4,16 +4,16 @@ All URIs are relative to *https://api.ynab.com/v1* 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_plan_month**](MonthsApi.md#get_plan_month) | **GET** /budgets/{plan_id}/months/{month} | Get a plan month +[**get_plan_months**](MonthsApi.md#get_plan_months) | **GET** /budgets/{plan_id}/months | Get all plan months -# **get_budget_month** -> MonthDetailResponse get_budget_month(budget_id, month) +# **get_plan_month** +> MonthDetailResponse get_plan_month(plan_id, month) -Single budget month +Get a plan month -Returns a single budget month +Returns a single plan month ### Example @@ -45,16 +45,16 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.MonthsApi(api_client) - 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.ynab.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)) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = '2013-10-20' # date | The plan 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 - api_response = api_instance.get_budget_month(budget_id, month) - print("The response of MonthsApi->get_budget_month:\n") + # Get a plan month + api_response = api_instance.get_plan_month(plan_id, month) + print("The response of MonthsApi->get_plan_month:\n") pprint(api_response) except Exception as e: - print("Exception when calling MonthsApi->get_budget_month: %s\n" % e) + print("Exception when calling MonthsApi->get_plan_month: %s\n" % e) ``` @@ -64,8 +64,8 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.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)) | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **date**| The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | ### Return type @@ -84,18 +84,17 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The budget month detail | - | -**404** | The budget month was not found | - | -**0** | An error occurred | - | +**200** | The plan month detail | - | +**404** | The plan month was not found | - | [[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, last_knowledge_of_server=last_knowledge_of_server) +# **get_plan_months** +> MonthSummariesResponse get_plan_months(plan_id, last_knowledge_of_server=last_knowledge_of_server) -List budget months +Get all plan months -Returns all budget months +Returns all plan months ### Example @@ -127,16 +126,16 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.MonthsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # 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, last_knowledge_of_server=last_knowledge_of_server) - print("The response of MonthsApi->get_budget_months:\n") + # Get all plan months + api_response = api_instance.get_plan_months(plan_id, last_knowledge_of_server=last_knowledge_of_server) + print("The response of MonthsApi->get_plan_months:\n") pprint(api_response) except Exception as e: - print("Exception when calling MonthsApi->get_budget_months: %s\n" % e) + print("Exception when calling MonthsApi->get_plan_months: %s\n" % e) ``` @@ -146,7 +145,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 @@ -166,9 +165,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The list of budget months | - | -**404** | No budget months were found | - | -**0** | An error occurred | - | +**200** | The list of plan months | - | +**404** | No plan months were found | - | [[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/NewCategory.md b/docs/NewCategory.md new file mode 100644 index 0000000..3e66f6e --- /dev/null +++ b/docs/NewCategory.md @@ -0,0 +1,33 @@ +# NewCategory + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**note** | **str** | | [optional] +**category_group_id** | **UUID** | | [optional] +**goal_target** | **int** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount. | [optional] +**goal_target_date** | **date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] + +## Example + +```python +from ynab.models.new_category import NewCategory + +# TODO update the JSON string below +json = "{}" +# create an instance of NewCategory from a JSON string +new_category_instance = NewCategory.from_json(json) +# print the JSON string representation of the object +print(NewCategory.to_json()) + +# convert the object into a dict +new_category_dict = new_category_instance.to_dict() +# create an instance of NewCategory from a dict +new_category_from_dict = NewCategory.from_dict(new_category_dict) +``` +[[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/NewTransaction.md b/docs/NewTransaction.md index 9b83db0..7ce3d22 100644 --- a/docs/NewTransaction.md +++ b/docs/NewTransaction.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_id** | **str** | | [optional] +**account_id** | **UUID** | | [optional] **var_date** | **date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] **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. | [optional] -**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 `transfer_payee_id` on the account resource. | [optional] +**payee_id** | **UUID** | 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 `transfer_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] +**category_id** | **UUID** | 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** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] diff --git a/docs/PatchCategoryGroupWrapper.md b/docs/PatchCategoryGroupWrapper.md new file mode 100644 index 0000000..c5b36f6 --- /dev/null +++ b/docs/PatchCategoryGroupWrapper.md @@ -0,0 +1,29 @@ +# PatchCategoryGroupWrapper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_group** | [**SaveCategoryGroup**](SaveCategoryGroup.md) | | + +## Example + +```python +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchCategoryGroupWrapper from a JSON string +patch_category_group_wrapper_instance = PatchCategoryGroupWrapper.from_json(json) +# print the JSON string representation of the object +print(PatchCategoryGroupWrapper.to_json()) + +# convert the object into a dict +patch_category_group_wrapper_dict = patch_category_group_wrapper_instance.to_dict() +# create an instance of PatchCategoryGroupWrapper from a dict +patch_category_group_wrapper_from_dict = PatchCategoryGroupWrapper.from_dict(patch_category_group_wrapper_dict) +``` +[[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/PatchCategoryWrapper.md b/docs/PatchCategoryWrapper.md index 1c7a250..b5e853a 100644 --- a/docs/PatchCategoryWrapper.md +++ b/docs/PatchCategoryWrapper.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**category** | [**SaveCategory**](SaveCategory.md) | | +**category** | [**ExistingCategory**](ExistingCategory.md) | | ## Example diff --git a/docs/Payee.md b/docs/Payee.md index 70fea6b..84b630c 100644 --- a/docs/Payee.md +++ b/docs/Payee.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **name** | **str** | | **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. | diff --git a/docs/PayeeLocation.md b/docs/PayeeLocation.md index a2ff042..0b6bf0e 100644 --- a/docs/PayeeLocation.md +++ b/docs/PayeeLocation.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**payee_id** | **str** | | +**id** | **UUID** | | +**payee_id** | **UUID** | | **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. | diff --git a/docs/PayeeLocationsApi.md b/docs/PayeeLocationsApi.md index fdcecba..22c44d5 100644 --- a/docs/PayeeLocationsApi.md +++ b/docs/PayeeLocationsApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.ynab.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_payee_location_by_id**](PayeeLocationsApi.md#get_payee_location_by_id) | **GET** /budgets/{budget_id}/payee_locations/{payee_location_id} | Single payee location -[**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**](PayeeLocationsApi.md#get_payee_location_by_id) | **GET** /budgets/{plan_id}/payee_locations/{payee_location_id} | Get a payee location +[**get_payee_locations**](PayeeLocationsApi.md#get_payee_locations) | **GET** /budgets/{plan_id}/payee_locations | Get all payee locations +[**get_payee_locations_by_payee**](PayeeLocationsApi.md#get_payee_locations_by_payee) | **GET** /budgets/{plan_id}/payees/{payee_id}/payee_locations | Get all locations for a payee # **get_payee_location_by_id** -> PayeeLocationResponse get_payee_location_by_id(budget_id, payee_location_id) +> PayeeLocationResponse get_payee_location_by_id(plan_id, payee_location_id) -Single payee location +Get a payee location Returns a single payee location @@ -46,12 +46,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeeLocationsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). payee_location_id = 'payee_location_id_example' # str | id of payee location try: - # Single payee location - api_response = api_instance.get_payee_location_by_id(budget_id, payee_location_id) + # Get a payee location + api_response = api_instance.get_payee_location_by_id(plan_id, payee_location_id) print("The response of PayeeLocationsApi->get_payee_location_by_id:\n") pprint(api_response) except Exception as e: @@ -65,7 +65,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **payee_location_id** | **str**| id of payee location | ### Return type @@ -87,14 +87,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The payee location | - | **404** | The payee location was not found | - | -**0** | An error occurred | - | [[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_payee_locations** -> PayeeLocationsResponse get_payee_locations(budget_id) +> PayeeLocationsResponse get_payee_locations(plan_id) -List payee locations +Get all payee locations Returns all payee locations @@ -128,11 +127,11 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeeLocationsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). try: - # List payee locations - api_response = api_instance.get_payee_locations(budget_id) + # Get all payee locations + api_response = api_instance.get_payee_locations(plan_id) print("The response of PayeeLocationsApi->get_payee_locations:\n") pprint(api_response) except Exception as e: @@ -146,7 +145,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | ### Return type @@ -167,14 +166,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of payee locations | - | **404** | No payees locations were found | - | -**0** | An error occurred | - | [[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_payee_locations_by_payee** -> PayeeLocationsResponse get_payee_locations_by_payee(budget_id, payee_id) +> PayeeLocationsResponse get_payee_locations_by_payee(plan_id, payee_id) -List locations for a payee +Get all locations for a payee Returns all payee locations for a specified payee @@ -208,12 +206,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeeLocationsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). payee_id = 'payee_id_example' # str | id of payee try: - # List locations for a payee - api_response = api_instance.get_payee_locations_by_payee(budget_id, payee_id) + # Get all locations for a payee + api_response = api_instance.get_payee_locations_by_payee(plan_id, payee_id) print("The response of PayeeLocationsApi->get_payee_locations_by_payee:\n") pprint(api_response) except Exception as e: @@ -227,7 +225,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **payee_id** | **str**| id of payee | ### Return type @@ -249,7 +247,6 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested payee locations | - | **404** | No payees locations were found | - | -**0** | An error occurred | - | [[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/PayeesApi.md b/docs/PayeesApi.md index ece166e..a732c08 100644 --- a/docs/PayeesApi.md +++ b/docs/PayeesApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.ynab.com/v1* 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 -[**update_payee**](PayeesApi.md#update_payee) | **PATCH** /budgets/{budget_id}/payees/{payee_id} | Update a payee +[**get_payee_by_id**](PayeesApi.md#get_payee_by_id) | **GET** /budgets/{plan_id}/payees/{payee_id} | Get a payee +[**get_payees**](PayeesApi.md#get_payees) | **GET** /budgets/{plan_id}/payees | Get all payees +[**update_payee**](PayeesApi.md#update_payee) | **PATCH** /budgets/{plan_id}/payees/{payee_id} | Update a payee # **get_payee_by_id** -> PayeeResponse get_payee_by_id(budget_id, payee_id) +> PayeeResponse get_payee_by_id(plan_id, payee_id) -Single payee +Get a payee Returns a single payee @@ -46,12 +46,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). payee_id = 'payee_id_example' # str | The id of the payee try: - # Single payee - api_response = api_instance.get_payee_by_id(budget_id, payee_id) + # Get a payee + api_response = api_instance.get_payee_by_id(plan_id, payee_id) print("The response of PayeesApi->get_payee_by_id:\n") pprint(api_response) except Exception as e: @@ -65,7 +65,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **payee_id** | **str**| The id of the payee | ### Return type @@ -87,14 +87,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested payee | - | **404** | The payee was not found | - | -**0** | An error occurred | - | [[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, last_knowledge_of_server=last_knowledge_of_server) +> PayeesResponse get_payees(plan_id, last_knowledge_of_server=last_knowledge_of_server) -List payees +Get all payees Returns all payees @@ -128,12 +127,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # 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, last_knowledge_of_server=last_knowledge_of_server) + # Get all payees + api_response = api_instance.get_payees(plan_id, last_knowledge_of_server=last_knowledge_of_server) print("The response of PayeesApi->get_payees:\n") pprint(api_response) except Exception as e: @@ -147,7 +146,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 @@ -169,12 +168,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested list of payees | - | **404** | No payees were found | - | -**0** | An error occurred | - | [[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_payee** -> SavePayeeResponse update_payee(budget_id, payee_id, data) +> SavePayeeResponse update_payee(plan_id, payee_id, data) Update a payee @@ -211,13 +209,13 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.PayeesApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). payee_id = 'payee_id_example' # str | The id of the payee data = ynab.PatchPayeeWrapper() # PatchPayeeWrapper | The payee to update try: # Update a payee - api_response = api_instance.update_payee(budget_id, payee_id, data) + api_response = api_instance.update_payee(plan_id, payee_id, data) print("The response of PayeesApi->update_payee:\n") pprint(api_response) except Exception as e: @@ -231,7 +229,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **payee_id** | **str**| The id of the payee | **data** | [**PatchPayeeWrapper**](PatchPayeeWrapper.md)| The payee to update | diff --git a/docs/PlanDetail.md b/docs/PlanDetail.md new file mode 100644 index 0000000..55b4e04 --- /dev/null +++ b/docs/PlanDetail.md @@ -0,0 +1,45 @@ +# PlanDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **UUID** | | +**name** | **str** | | +**last_modified_on** | **datetime** | The last time any changes were made to the plan from either a web or mobile client | [optional] +**first_month** | **date** | The earliest plan month | [optional] +**last_month** | **date** | The latest plan month | [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] +**category_groups** | [**List[CategoryGroup]**](CategoryGroup.md) | | [optional] +**categories** | [**List[Category]**](Category.md) | | [optional] +**months** | [**List[MonthDetail]**](MonthDetail.md) | | [optional] +**transactions** | [**List[TransactionSummary]**](TransactionSummary.md) | | [optional] +**subtransactions** | [**List[SubTransaction]**](SubTransaction.md) | | [optional] +**scheduled_transactions** | [**List[ScheduledTransactionSummary]**](ScheduledTransactionSummary.md) | | [optional] +**scheduled_subtransactions** | [**List[ScheduledSubTransaction]**](ScheduledSubTransaction.md) | | [optional] + +## Example + +```python +from ynab.models.plan_detail import PlanDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanDetail from a JSON string +plan_detail_instance = PlanDetail.from_json(json) +# print the JSON string representation of the object +print(PlanDetail.to_json()) + +# convert the object into a dict +plan_detail_dict = plan_detail_instance.to_dict() +# create an instance of PlanDetail from a dict +plan_detail_from_dict = PlanDetail.from_dict(plan_detail_dict) +``` +[[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/PlanDetailResponse.md b/docs/PlanDetailResponse.md new file mode 100644 index 0000000..fffe428 --- /dev/null +++ b/docs/PlanDetailResponse.md @@ -0,0 +1,29 @@ +# PlanDetailResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PlanDetailResponseData**](PlanDetailResponseData.md) | | + +## Example + +```python +from ynab.models.plan_detail_response import PlanDetailResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanDetailResponse from a JSON string +plan_detail_response_instance = PlanDetailResponse.from_json(json) +# print the JSON string representation of the object +print(PlanDetailResponse.to_json()) + +# convert the object into a dict +plan_detail_response_dict = plan_detail_response_instance.to_dict() +# create an instance of PlanDetailResponse from a dict +plan_detail_response_from_dict = PlanDetailResponse.from_dict(plan_detail_response_dict) +``` +[[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/PlanDetailResponseData.md b/docs/PlanDetailResponseData.md new file mode 100644 index 0000000..72f2f3c --- /dev/null +++ b/docs/PlanDetailResponseData.md @@ -0,0 +1,30 @@ +# PlanDetailResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budget** | [**PlanDetail**](PlanDetail.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +## Example + +```python +from ynab.models.plan_detail_response_data import PlanDetailResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanDetailResponseData from a JSON string +plan_detail_response_data_instance = PlanDetailResponseData.from_json(json) +# print the JSON string representation of the object +print(PlanDetailResponseData.to_json()) + +# convert the object into a dict +plan_detail_response_data_dict = plan_detail_response_data_instance.to_dict() +# create an instance of PlanDetailResponseData from a dict +plan_detail_response_data_from_dict = PlanDetailResponseData.from_dict(plan_detail_response_data_dict) +``` +[[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/PlanSettings.md b/docs/PlanSettings.md new file mode 100644 index 0000000..2f23725 --- /dev/null +++ b/docs/PlanSettings.md @@ -0,0 +1,30 @@ +# PlanSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date_format** | [**DateFormat**](DateFormat.md) | | +**currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | + +## Example + +```python +from ynab.models.plan_settings import PlanSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSettings from a JSON string +plan_settings_instance = PlanSettings.from_json(json) +# print the JSON string representation of the object +print(PlanSettings.to_json()) + +# convert the object into a dict +plan_settings_dict = plan_settings_instance.to_dict() +# create an instance of PlanSettings from a dict +plan_settings_from_dict = PlanSettings.from_dict(plan_settings_dict) +``` +[[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/PlanSettingsResponse.md b/docs/PlanSettingsResponse.md new file mode 100644 index 0000000..6f68721 --- /dev/null +++ b/docs/PlanSettingsResponse.md @@ -0,0 +1,29 @@ +# PlanSettingsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PlanSettingsResponseData**](PlanSettingsResponseData.md) | | + +## Example + +```python +from ynab.models.plan_settings_response import PlanSettingsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSettingsResponse from a JSON string +plan_settings_response_instance = PlanSettingsResponse.from_json(json) +# print the JSON string representation of the object +print(PlanSettingsResponse.to_json()) + +# convert the object into a dict +plan_settings_response_dict = plan_settings_response_instance.to_dict() +# create an instance of PlanSettingsResponse from a dict +plan_settings_response_from_dict = PlanSettingsResponse.from_dict(plan_settings_response_dict) +``` +[[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/PlanSettingsResponseData.md b/docs/PlanSettingsResponseData.md new file mode 100644 index 0000000..d0ae59a --- /dev/null +++ b/docs/PlanSettingsResponseData.md @@ -0,0 +1,29 @@ +# PlanSettingsResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**PlanSettings**](PlanSettings.md) | | + +## Example + +```python +from ynab.models.plan_settings_response_data import PlanSettingsResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSettingsResponseData from a JSON string +plan_settings_response_data_instance = PlanSettingsResponseData.from_json(json) +# print the JSON string representation of the object +print(PlanSettingsResponseData.to_json()) + +# convert the object into a dict +plan_settings_response_data_dict = plan_settings_response_data_instance.to_dict() +# create an instance of PlanSettingsResponseData from a dict +plan_settings_response_data_from_dict = PlanSettingsResponseData.from_dict(plan_settings_response_data_dict) +``` +[[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/PlanSummary.md b/docs/PlanSummary.md new file mode 100644 index 0000000..1ea4a16 --- /dev/null +++ b/docs/PlanSummary.md @@ -0,0 +1,36 @@ +# PlanSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **UUID** | | +**name** | **str** | | +**last_modified_on** | **datetime** | The last time any changes were made to the plan from either a web or mobile client | [optional] +**first_month** | **date** | The earliest plan month | [optional] +**last_month** | **date** | The latest plan month | [optional] +**date_format** | [**DateFormat**](DateFormat.md) | | [optional] +**currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] +**accounts** | [**List[Account]**](Account.md) | The plan accounts (only included if `include_accounts=true` specified as query parameter) | [optional] + +## Example + +```python +from ynab.models.plan_summary import PlanSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSummary from a JSON string +plan_summary_instance = PlanSummary.from_json(json) +# print the JSON string representation of the object +print(PlanSummary.to_json()) + +# convert the object into a dict +plan_summary_dict = plan_summary_instance.to_dict() +# create an instance of PlanSummary from a dict +plan_summary_from_dict = PlanSummary.from_dict(plan_summary_dict) +``` +[[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/PlanSummaryResponse.md b/docs/PlanSummaryResponse.md new file mode 100644 index 0000000..0d7044f --- /dev/null +++ b/docs/PlanSummaryResponse.md @@ -0,0 +1,29 @@ +# PlanSummaryResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PlanSummaryResponseData**](PlanSummaryResponseData.md) | | + +## Example + +```python +from ynab.models.plan_summary_response import PlanSummaryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSummaryResponse from a JSON string +plan_summary_response_instance = PlanSummaryResponse.from_json(json) +# print the JSON string representation of the object +print(PlanSummaryResponse.to_json()) + +# convert the object into a dict +plan_summary_response_dict = plan_summary_response_instance.to_dict() +# create an instance of PlanSummaryResponse from a dict +plan_summary_response_from_dict = PlanSummaryResponse.from_dict(plan_summary_response_dict) +``` +[[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/PlanSummaryResponseData.md b/docs/PlanSummaryResponseData.md new file mode 100644 index 0000000..3d2a983 --- /dev/null +++ b/docs/PlanSummaryResponseData.md @@ -0,0 +1,30 @@ +# PlanSummaryResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budgets** | [**List[PlanSummary]**](PlanSummary.md) | | +**default_budget** | [**PlanSummary**](PlanSummary.md) | | [optional] + +## Example + +```python +from ynab.models.plan_summary_response_data import PlanSummaryResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSummaryResponseData from a JSON string +plan_summary_response_data_instance = PlanSummaryResponseData.from_json(json) +# print the JSON string representation of the object +print(PlanSummaryResponseData.to_json()) + +# convert the object into a dict +plan_summary_response_data_dict = plan_summary_response_data_instance.to_dict() +# create an instance of PlanSummaryResponseData from a dict +plan_summary_response_data_from_dict = PlanSummaryResponseData.from_dict(plan_summary_response_data_dict) +``` +[[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/PlansApi.md similarity index 59% rename from docs/BudgetsApi.md rename to docs/PlansApi.md index 3c453ca..4b6cef3 100644 --- a/docs/BudgetsApi.md +++ b/docs/PlansApi.md @@ -1,20 +1,20 @@ -# ynab.BudgetsApi +# ynab.PlansApi All URIs are relative to *https://api.ynab.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_plan_by_id**](PlansApi.md#get_plan_by_id) | **GET** /budgets/{plan_id} | Get a plan +[**get_plan_settings_by_id**](PlansApi.md#get_plan_settings_by_id) | **GET** /budgets/{plan_id}/settings | Get plan settings +[**get_plans**](PlansApi.md#get_plans) | **GET** /budgets | Get all plans -# **get_budget_by_id** -> BudgetDetailResponse get_budget_by_id(budget_id, last_knowledge_of_server=last_knowledge_of_server) +# **get_plan_by_id** +> PlanDetailResponse get_plan_by_id(plan_id, last_knowledge_of_server=last_knowledge_of_server) -Single budget +Get a plan -Returns a single budget with all related entities. This resource is effectively a full budget export. +Returns a single plan with all related entities. This resource is effectively a full plan export. ### Example @@ -22,7 +22,7 @@ Returns a single budget with all related entities. This resource is effectively ```python import ynab -from ynab.models.budget_detail_response import BudgetDetailResponse +from ynab.models.plan_detail_response import PlanDetailResponse from ynab.rest import ApiException from pprint import pprint @@ -45,17 +45,17 @@ configuration = ynab.Configuration( # Enter a context with an instance of the API client with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = ynab.BudgetsApi(api_client) - 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.ynab.com/#oauth-default-budget). + api_instance = ynab.PlansApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: - # Single budget - api_response = api_instance.get_budget_by_id(budget_id, last_knowledge_of_server=last_knowledge_of_server) - print("The response of BudgetsApi->get_budget_by_id:\n") + # Get a plan + api_response = api_instance.get_plan_by_id(plan_id, last_knowledge_of_server=last_knowledge_of_server) + print("The response of PlansApi->get_plan_by_id:\n") pprint(api_response) except Exception as e: - print("Exception when calling BudgetsApi->get_budget_by_id: %s\n" % e) + print("Exception when calling PlansApi->get_plan_by_id: %s\n" % e) ``` @@ -65,12 +65,12 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 -[**BudgetDetailResponse**](BudgetDetailResponse.md) +[**PlanDetailResponse**](PlanDetailResponse.md) ### Authorization @@ -85,18 +85,17 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The requested budget | - | -**404** | The specified budget was not found | - | -**0** | An error occurred | - | +**200** | The requested plan | - | +**404** | The specified plan was not found | - | [[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) +# **get_plan_settings_by_id** +> PlanSettingsResponse get_plan_settings_by_id(plan_id) -Budget Settings +Get plan settings -Returns settings for a budget +Returns settings for a plan ### Example @@ -104,7 +103,7 @@ Returns settings for a budget ```python import ynab -from ynab.models.budget_settings_response import BudgetSettingsResponse +from ynab.models.plan_settings_response import PlanSettingsResponse from ynab.rest import ApiException from pprint import pprint @@ -127,16 +126,16 @@ configuration = ynab.Configuration( # Enter a context with an instance of the API client with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = ynab.BudgetsApi(api_client) - 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.ynab.com/#oauth-default-budget). + api_instance = ynab.PlansApi(api_client) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). try: - # Budget Settings - api_response = api_instance.get_budget_settings_by_id(budget_id) - print("The response of BudgetsApi->get_budget_settings_by_id:\n") + # Get plan settings + api_response = api_instance.get_plan_settings_by_id(plan_id) + print("The response of PlansApi->get_plan_settings_by_id:\n") pprint(api_response) except Exception as e: - print("Exception when calling BudgetsApi->get_budget_settings_by_id: %s\n" % e) + print("Exception when calling PlansApi->get_plan_settings_by_id: %s\n" % e) ``` @@ -146,11 +145,11 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | ### Return type -[**BudgetSettingsResponse**](BudgetSettingsResponse.md) +[**PlanSettingsResponse**](PlanSettingsResponse.md) ### Authorization @@ -165,18 +164,17 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The requested budget settings | - | -**404** | The specified Budget was not found | - | -**0** | An error occurred | - | +**200** | The requested plan settings | - | +**404** | The specified plan was not found | - | [[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(include_accounts=include_accounts) +# **get_plans** +> PlanSummaryResponse get_plans(include_accounts=include_accounts) -List budgets +Get all plans -Returns budgets list with summary information +Returns plans list with summary information ### Example @@ -184,7 +182,7 @@ Returns budgets list with summary information ```python import ynab -from ynab.models.budget_summary_response import BudgetSummaryResponse +from ynab.models.plan_summary_response import PlanSummaryResponse from ynab.rest import ApiException from pprint import pprint @@ -207,16 +205,16 @@ configuration = ynab.Configuration( # Enter a context with an instance of the API client with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = ynab.BudgetsApi(api_client) - include_accounts = True # bool | Whether to include the list of budget accounts (optional) + api_instance = ynab.PlansApi(api_client) + include_accounts = True # bool | Whether to include the list of plan accounts (optional) try: - # List budgets - api_response = api_instance.get_budgets(include_accounts=include_accounts) - print("The response of BudgetsApi->get_budgets:\n") + # Get all plans + api_response = api_instance.get_plans(include_accounts=include_accounts) + print("The response of PlansApi->get_plans:\n") pprint(api_response) except Exception as e: - print("Exception when calling BudgetsApi->get_budgets: %s\n" % e) + print("Exception when calling PlansApi->get_plans: %s\n" % e) ``` @@ -226,11 +224,11 @@ with ynab.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **include_accounts** | **bool**| Whether to include the list of budget accounts | [optional] + **include_accounts** | **bool**| Whether to include the list of plan accounts | [optional] ### Return type -[**BudgetSummaryResponse**](BudgetSummaryResponse.md) +[**PlanSummaryResponse**](PlanSummaryResponse.md) ### Authorization @@ -245,9 +243,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The list of budgets | - | -**404** | No budgets were found | - | -**0** | An error occurred | - | +**200** | The list of plans | - | +**404** | No plans were found | - | [[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/PostCategoryGroupWrapper.md b/docs/PostCategoryGroupWrapper.md new file mode 100644 index 0000000..497030c --- /dev/null +++ b/docs/PostCategoryGroupWrapper.md @@ -0,0 +1,29 @@ +# PostCategoryGroupWrapper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_group** | [**SaveCategoryGroup**](SaveCategoryGroup.md) | | + +## Example + +```python +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper + +# TODO update the JSON string below +json = "{}" +# create an instance of PostCategoryGroupWrapper from a JSON string +post_category_group_wrapper_instance = PostCategoryGroupWrapper.from_json(json) +# print the JSON string representation of the object +print(PostCategoryGroupWrapper.to_json()) + +# convert the object into a dict +post_category_group_wrapper_dict = post_category_group_wrapper_instance.to_dict() +# create an instance of PostCategoryGroupWrapper from a dict +post_category_group_wrapper_from_dict = PostCategoryGroupWrapper.from_dict(post_category_group_wrapper_dict) +``` +[[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/PostCategoryWrapper.md b/docs/PostCategoryWrapper.md new file mode 100644 index 0000000..b02b543 --- /dev/null +++ b/docs/PostCategoryWrapper.md @@ -0,0 +1,29 @@ +# PostCategoryWrapper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**NewCategory**](NewCategory.md) | | + +## Example + +```python +from ynab.models.post_category_wrapper import PostCategoryWrapper + +# TODO update the JSON string below +json = "{}" +# create an instance of PostCategoryWrapper from a JSON string +post_category_wrapper_instance = PostCategoryWrapper.from_json(json) +# print the JSON string representation of the object +print(PostCategoryWrapper.to_json()) + +# convert the object into a dict +post_category_wrapper_dict = post_category_wrapper_instance.to_dict() +# create an instance of PostCategoryWrapper from a dict +post_category_wrapper_from_dict = PostCategoryWrapper.from_dict(post_category_wrapper_dict) +``` +[[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/SaveCategory.md b/docs/SaveCategory.md index 9861ff0..2eaf754 100644 --- a/docs/SaveCategory.md +++ b/docs/SaveCategory.md @@ -7,8 +7,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] **note** | **str** | | [optional] -**category_group_id** | **str** | | [optional] -**goal_target** | **int** | The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal (goal_type != null). | [optional] +**category_group_id** | **UUID** | | [optional] +**goal_target** | **int** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount. | [optional] +**goal_target_date** | **date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] ## Example diff --git a/docs/SaveCategoryGroup.md b/docs/SaveCategoryGroup.md new file mode 100644 index 0000000..a40c564 --- /dev/null +++ b/docs/SaveCategoryGroup.md @@ -0,0 +1,29 @@ +# SaveCategoryGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the category group. The name must be a maximum of 50 characters. | + +## Example + +```python +from ynab.models.save_category_group import SaveCategoryGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of SaveCategoryGroup from a JSON string +save_category_group_instance = SaveCategoryGroup.from_json(json) +# print the JSON string representation of the object +print(SaveCategoryGroup.to_json()) + +# convert the object into a dict +save_category_group_dict = save_category_group_instance.to_dict() +# create an instance of SaveCategoryGroup from a dict +save_category_group_from_dict = SaveCategoryGroup.from_dict(save_category_group_dict) +``` +[[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/SaveCategoryGroupResponse.md b/docs/SaveCategoryGroupResponse.md new file mode 100644 index 0000000..9f913da --- /dev/null +++ b/docs/SaveCategoryGroupResponse.md @@ -0,0 +1,29 @@ +# SaveCategoryGroupResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SaveCategoryGroupResponseData**](SaveCategoryGroupResponseData.md) | | + +## Example + +```python +from ynab.models.save_category_group_response import SaveCategoryGroupResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SaveCategoryGroupResponse from a JSON string +save_category_group_response_instance = SaveCategoryGroupResponse.from_json(json) +# print the JSON string representation of the object +print(SaveCategoryGroupResponse.to_json()) + +# convert the object into a dict +save_category_group_response_dict = save_category_group_response_instance.to_dict() +# create an instance of SaveCategoryGroupResponse from a dict +save_category_group_response_from_dict = SaveCategoryGroupResponse.from_dict(save_category_group_response_dict) +``` +[[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/SaveCategoryGroupResponseData.md b/docs/SaveCategoryGroupResponseData.md new file mode 100644 index 0000000..a26c5f3 --- /dev/null +++ b/docs/SaveCategoryGroupResponseData.md @@ -0,0 +1,30 @@ +# SaveCategoryGroupResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_group** | [**CategoryGroup**](CategoryGroup.md) | | +**server_knowledge** | **int** | The knowledge of the server | + +## Example + +```python +from ynab.models.save_category_group_response_data import SaveCategoryGroupResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of SaveCategoryGroupResponseData from a JSON string +save_category_group_response_data_instance = SaveCategoryGroupResponseData.from_json(json) +# print the JSON string representation of the object +print(SaveCategoryGroupResponseData.to_json()) + +# convert the object into a dict +save_category_group_response_data_dict = save_category_group_response_data_instance.to_dict() +# create an instance of SaveCategoryGroupResponseData from a dict +save_category_group_response_data_from_dict = SaveCategoryGroupResponseData.from_dict(save_category_group_response_data_dict) +``` +[[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/SaveMonthCategory.md b/docs/SaveMonthCategory.md index 2778831..79cba7e 100644 --- a/docs/SaveMonthCategory.md +++ b/docs/SaveMonthCategory.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**budgeted** | **int** | Budgeted amount in milliunits format | +**budgeted** | **int** | Assigned (budgeted) amount in milliunits format | ## Example diff --git a/docs/SaveScheduledTransaction.md b/docs/SaveScheduledTransaction.md index dcf4622..2bc4c37 100644 --- a/docs/SaveScheduledTransaction.md +++ b/docs/SaveScheduledTransaction.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_id** | **str** | | +**account_id** | **UUID** | | **var_date** | **date** | The scheduled transaction date in ISO format (e.g. 2016-12-01). This should be a future date no more than 5 years into the future. | **amount** | **int** | The scheduled transaction amount in milliunits format. | [optional] -**payee_id** | **str** | The payee for the scheduled transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] +**payee_id** | **UUID** | The payee for the scheduled transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] **payee_name** | **str** | The payee name for the the scheduled transaction. 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 payee with the same name or (2) creation of a new payee. | [optional] -**category_id** | **str** | The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported. | [optional] +**category_id** | **UUID** | The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported. | [optional] **memo** | **str** | | [optional] **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **frequency** | [**ScheduledTransactionFrequency**](ScheduledTransactionFrequency.md) | | [optional] diff --git a/docs/SaveSubTransaction.md b/docs/SaveSubTransaction.md index 57c6ee9..a79225d 100644 --- a/docs/SaveSubTransaction.md +++ b/docs/SaveSubTransaction.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **amount** | **int** | The subtransaction amount in milliunits format. | -**payee_id** | **str** | The payee for the subtransaction. | [optional] +**payee_id** | **UUID** | 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] +**category_id** | **UUID** | The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] **memo** | **str** | | [optional] ## Example diff --git a/docs/SaveTransactionWithIdOrImportId.md b/docs/SaveTransactionWithIdOrImportId.md index 105315f..dffc7be 100644 --- a/docs/SaveTransactionWithIdOrImportId.md +++ b/docs/SaveTransactionWithIdOrImportId.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_id** | **str** | | [optional] +**account_id** | **UUID** | | [optional] **var_date** | **date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] **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. | [optional] -**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 `transfer_payee_id` on the account resource. | [optional] +**payee_id** | **UUID** | 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 `transfer_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] +**category_id** | **UUID** | 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** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] diff --git a/docs/SaveTransactionWithOptionalFields.md b/docs/SaveTransactionWithOptionalFields.md index 1f135db..83c2b95 100644 --- a/docs/SaveTransactionWithOptionalFields.md +++ b/docs/SaveTransactionWithOptionalFields.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_id** | **str** | | [optional] +**account_id** | **UUID** | | [optional] **var_date** | **date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] **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. | [optional] -**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 `transfer_payee_id` on the account resource. | [optional] +**payee_id** | **UUID** | 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 `transfer_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] +**category_id** | **UUID** | 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** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] **approved** | **bool** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] diff --git a/docs/ScheduledSubTransaction.md b/docs/ScheduledSubTransaction.md index ae981e0..8ba03a6 100644 --- a/docs/ScheduledSubTransaction.md +++ b/docs/ScheduledSubTransaction.md @@ -5,15 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**scheduled_transaction_id** | **str** | | +**id** | **UUID** | | +**scheduled_transaction_id** | **UUID** | | **amount** | **int** | The scheduled subtransaction amount in milliunits format | **memo** | **str** | | [optional] -**payee_id** | **str** | | [optional] +**payee_id** | **UUID** | | [optional] **payee_name** | **str** | | [optional] -**category_id** | **str** | | [optional] +**category_id** | **UUID** | | [optional] **category_name** | **str** | | [optional] -**transfer_account_id** | **str** | If a transfer, the account_id which the scheduled subtransaction transfers to | [optional] +**transfer_account_id** | **UUID** | 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. | ## Example diff --git a/docs/ScheduledTransactionDetail.md b/docs/ScheduledTransactionDetail.md index 6be1c33..4b5a1ac 100644 --- a/docs/ScheduledTransactionDetail.md +++ b/docs/ScheduledTransactionDetail.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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** | | @@ -13,10 +13,10 @@ Name | Type | Description | Notes **memo** | **str** | | [optional] **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **flag_name** | **str** | The customized name of a transaction flag | [optional] -**account_id** | **str** | | -**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] +**account_id** | **UUID** | | +**payee_id** | **UUID** | | [optional] +**category_id** | **UUID** | | [optional] +**transfer_account_id** | **UUID** | 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. | **account_name** | **str** | | **payee_name** | **str** | | [optional] diff --git a/docs/ScheduledTransactionSummary.md b/docs/ScheduledTransactionSummary.md index bca7c93..42b1118 100644 --- a/docs/ScheduledTransactionSummary.md +++ b/docs/ScheduledTransactionSummary.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | **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** | | @@ -13,10 +13,10 @@ Name | Type | Description | Notes **memo** | **str** | | [optional] **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **flag_name** | **str** | The customized name of a transaction flag | [optional] -**account_id** | **str** | | -**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] +**account_id** | **UUID** | | +**payee_id** | **UUID** | | [optional] +**category_id** | **UUID** | | [optional] +**transfer_account_id** | **UUID** | 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. | ## Example diff --git a/docs/ScheduledTransactionsApi.md b/docs/ScheduledTransactionsApi.md index 7a252f1..d6fbd02 100644 --- a/docs/ScheduledTransactionsApi.md +++ b/docs/ScheduledTransactionsApi.md @@ -4,17 +4,17 @@ All URIs are relative to *https://api.ynab.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /budgets/{budget_id}/scheduled_transactions | Create a single scheduled transaction -[**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Deletes an existing scheduled transaction -[**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 -[**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Updates an existing scheduled transaction +[**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /budgets/{plan_id}/scheduled_transactions | Create a scheduled transaction +[**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Delete a scheduled transaction +[**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Get a scheduled transaction +[**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{plan_id}/scheduled_transactions | Get all scheduled transactions +[**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Update a scheduled transaction # **create_scheduled_transaction** -> ScheduledTransactionResponse create_scheduled_transaction(budget_id, data) +> ScheduledTransactionResponse create_scheduled_transaction(plan_id, data) -Create a single scheduled transaction +Create a scheduled transaction Creates a single scheduled transaction (a transaction with a future date). @@ -49,12 +49,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). data = ynab.PostScheduledTransactionWrapper() # PostScheduledTransactionWrapper | The scheduled transaction to create try: - # Create a single scheduled transaction - api_response = api_instance.create_scheduled_transaction(budget_id, data) + # Create a scheduled transaction + api_response = api_instance.create_scheduled_transaction(plan_id, data) print("The response of ScheduledTransactionsApi->create_scheduled_transaction:\n") pprint(api_response) except Exception as e: @@ -68,7 +68,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **data** | [**PostScheduledTransactionWrapper**](PostScheduledTransactionWrapper.md)| The scheduled transaction to create | ### Return type @@ -94,9 +94,9 @@ 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) # **delete_scheduled_transaction** -> ScheduledTransactionResponse delete_scheduled_transaction(budget_id, scheduled_transaction_id) +> ScheduledTransactionResponse delete_scheduled_transaction(plan_id, scheduled_transaction_id) -Deletes an existing scheduled transaction +Delete a scheduled transaction Deletes a scheduled transaction @@ -130,12 +130,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The id of the scheduled transaction try: - # Deletes an existing scheduled transaction - api_response = api_instance.delete_scheduled_transaction(budget_id, scheduled_transaction_id) + # Delete a scheduled transaction + api_response = api_instance.delete_scheduled_transaction(plan_id, scheduled_transaction_id) print("The response of ScheduledTransactionsApi->delete_scheduled_transaction:\n") pprint(api_response) except Exception as e: @@ -149,7 +149,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **scheduled_transaction_id** | **str**| The id of the scheduled transaction | ### Return type @@ -175,9 +175,9 @@ 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_transaction_by_id** -> ScheduledTransactionResponse get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id) +> ScheduledTransactionResponse get_scheduled_transaction_by_id(plan_id, scheduled_transaction_id) -Single scheduled transaction +Get a scheduled transaction Returns a single scheduled transaction @@ -211,12 +211,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The id of the scheduled transaction try: - # Single scheduled transaction - api_response = api_instance.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id) + # Get a scheduled transaction + api_response = api_instance.get_scheduled_transaction_by_id(plan_id, scheduled_transaction_id) print("The response of ScheduledTransactionsApi->get_scheduled_transaction_by_id:\n") pprint(api_response) except Exception as e: @@ -230,7 +230,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **scheduled_transaction_id** | **str**| The id of the scheduled transaction | ### Return type @@ -252,14 +252,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested Scheduled Transaction | - | **404** | The scheduled transaction was not found | - | -**0** | An error occurred | - | [[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, last_knowledge_of_server=last_knowledge_of_server) +> ScheduledTransactionsResponse get_scheduled_transactions(plan_id, last_knowledge_of_server=last_knowledge_of_server) -List scheduled transactions +Get all scheduled transactions Returns all scheduled transactions @@ -293,12 +292,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). last_knowledge_of_server = 56 # 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, last_knowledge_of_server=last_knowledge_of_server) + # Get all scheduled transactions + api_response = api_instance.get_scheduled_transactions(plan_id, last_knowledge_of_server=last_knowledge_of_server) print("The response of ScheduledTransactionsApi->get_scheduled_transactions:\n") pprint(api_response) except Exception as e: @@ -312,7 +311,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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 @@ -334,14 +333,13 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested scheduled transactions | - | **404** | No scheduled transactions were found | - | -**0** | An error occurred | - | [[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_scheduled_transaction** -> ScheduledTransactionResponse update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper) +> ScheduledTransactionResponse update_scheduled_transaction(plan_id, scheduled_transaction_id, put_scheduled_transaction_wrapper) -Updates an existing scheduled transaction +Update a scheduled transaction Updates a single scheduled transaction @@ -376,13 +374,13 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.ScheduledTransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). scheduled_transaction_id = 'scheduled_transaction_id_example' # str | The id of the scheduled transaction put_scheduled_transaction_wrapper = ynab.PutScheduledTransactionWrapper() # PutScheduledTransactionWrapper | The scheduled transaction to update try: - # Updates an existing scheduled transaction - api_response = api_instance.update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper) + # Update a scheduled transaction + api_response = api_instance.update_scheduled_transaction(plan_id, scheduled_transaction_id, put_scheduled_transaction_wrapper) print("The response of ScheduledTransactionsApi->update_scheduled_transaction:\n") pprint(api_response) except Exception as e: @@ -396,7 +394,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **scheduled_transaction_id** | **str**| The id of the scheduled transaction | **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md)| The scheduled transaction to update | diff --git a/docs/SubTransaction.md b/docs/SubTransaction.md index f38d96d..0ed6aad 100644 --- a/docs/SubTransaction.md +++ b/docs/SubTransaction.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **transaction_id** | **str** | | **amount** | **int** | The subtransaction amount in milliunits format | **memo** | **str** | | [optional] -**payee_id** | **str** | | [optional] +**payee_id** | **UUID** | | [optional] **payee_name** | **str** | | [optional] -**category_id** | **str** | | [optional] +**category_id** | **UUID** | | [optional] **category_name** | **str** | | [optional] -**transfer_account_id** | **str** | If a transfer, the account_id which the subtransaction transfers to | [optional] +**transfer_account_id** | **UUID** | 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. | diff --git a/docs/TransactionDetail.md b/docs/TransactionDetail.md index 2fc5c44..f2624a3 100644 --- a/docs/TransactionDetail.md +++ b/docs/TransactionDetail.md @@ -13,10 +13,10 @@ Name | Type | Description | Notes **approved** | **bool** | Whether or not the transaction is approved | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **flag_name** | **str** | The customized name of a transaction flag | [optional] -**account_id** | **str** | | -**payee_id** | **str** | | [optional] -**category_id** | **str** | | [optional] -**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | [optional] +**account_id** | **UUID** | | +**payee_id** | **UUID** | | [optional] +**category_id** | **UUID** | | [optional] +**transfer_account_id** | **UUID** | 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] diff --git a/docs/TransactionSummary.md b/docs/TransactionSummary.md index d0d54c8..7941337 100644 --- a/docs/TransactionSummary.md +++ b/docs/TransactionSummary.md @@ -13,10 +13,10 @@ Name | Type | Description | Notes **approved** | **bool** | Whether or not the transaction is approved | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] **flag_name** | **str** | The customized name of a transaction flag | [optional] -**account_id** | **str** | | -**payee_id** | **str** | | [optional] -**category_id** | **str** | | [optional] -**transfer_account_id** | **str** | If a transfer transaction, the account to which it transfers | [optional] +**account_id** | **UUID** | | +**payee_id** | **UUID** | | [optional] +**category_id** | **UUID** | | [optional] +**transfer_account_id** | **UUID** | 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] diff --git a/docs/TransactionsApi.md b/docs/TransactionsApi.md index 2d971af..d00c6b6 100644 --- a/docs/TransactionsApi.md +++ b/docs/TransactionsApi.md @@ -4,21 +4,21 @@ All URIs are relative to *https://api.ynab.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create a single transaction or multiple transactions -[**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /budgets/{budget_id}/transactions/{transaction_id} | Deletes an existing transaction -[**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, excluding any pending transactions -[**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /budgets/{budget_id}/months/{month}/transactions | List transactions in month, excluding any pending transactions -[**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions, excluding any pending 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 +[**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{plan_id}/transactions | Create a single transaction or multiple transactions +[**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /budgets/{plan_id}/transactions/{transaction_id} | Delete a transaction +[**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /budgets/{plan_id}/transactions/{transaction_id} | Get a transaction +[**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /budgets/{plan_id}/transactions | Get all transactions +[**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{plan_id}/accounts/{account_id}/transactions | Get all account transactions +[**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{plan_id}/categories/{category_id}/transactions | Get all category transactions +[**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /budgets/{plan_id}/months/{month}/transactions | Get all plan month transactions +[**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{plan_id}/payees/{payee_id}/transactions | Get all payee transactions +[**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /budgets/{plan_id}/transactions/import | Import transactions +[**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /budgets/{plan_id}/transactions/{transaction_id} | Update a transaction +[**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /budgets/{plan_id}/transactions | Update multiple transactions # **create_transaction** -> SaveTransactionsResponse create_transaction(budget_id, data) +> SaveTransactionsResponse create_transaction(plan_id, data) Create a single transaction or multiple transactions @@ -55,12 +55,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). data = ynab.PostTransactionsWrapper() # PostTransactionsWrapper | 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. try: # Create a single transaction or multiple transactions - api_response = api_instance.create_transaction(budget_id, data) + api_response = api_instance.create_transaction(plan_id, data) print("The response of TransactionsApi->create_transaction:\n") pprint(api_response) except Exception as e: @@ -74,7 +74,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **data** | [**PostTransactionsWrapper**](PostTransactionsWrapper.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. | ### Return type @@ -101,9 +101,9 @@ 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) # **delete_transaction** -> TransactionResponse delete_transaction(budget_id, transaction_id) +> TransactionResponse delete_transaction(plan_id, transaction_id) -Deletes an existing transaction +Delete a transaction Deletes a transaction @@ -137,12 +137,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). transaction_id = 'transaction_id_example' # str | The id of the transaction try: - # Deletes an existing transaction - api_response = api_instance.delete_transaction(budget_id, transaction_id) + # Delete a transaction + api_response = api_instance.delete_transaction(plan_id, transaction_id) print("The response of TransactionsApi->delete_transaction:\n") pprint(api_response) except Exception as e: @@ -156,7 +156,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **transaction_id** | **str**| The id of the transaction | ### Return type @@ -182,9 +182,9 @@ 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_transaction_by_id** -> TransactionResponse get_transaction_by_id(budget_id, transaction_id) +> TransactionResponse get_transaction_by_id(plan_id, transaction_id) -Single transaction +Get a transaction Returns a single transaction @@ -218,12 +218,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). transaction_id = 'transaction_id_example' # str | The id of the transaction try: - # Single transaction - api_response = api_instance.get_transaction_by_id(budget_id, transaction_id) + # Get a transaction + api_response = api_instance.get_transaction_by_id(plan_id, transaction_id) print("The response of TransactionsApi->get_transaction_by_id:\n") pprint(api_response) except Exception as e: @@ -237,7 +237,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **transaction_id** | **str**| The id of the transaction | ### Return type @@ -259,16 +259,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The requested transaction | - | **404** | The transaction was not found | - | -**0** | An error occurred | - | [[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, last_knowledge_of_server=last_knowledge_of_server) +> TransactionsResponse get_transactions(plan_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -List transactions +Get all transactions -Returns budget transactions, excluding any pending transactions +Returns plan transactions, excluding any pending transactions ### Example @@ -300,14 +299,14 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). 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 = 56 # 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, last_knowledge_of_server=last_knowledge_of_server) + # Get all transactions + api_response = api_instance.get_transactions(plan_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) print("The response of TransactionsApi->get_transactions:\n") pprint(api_response) except Exception as e: @@ -321,7 +320,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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] @@ -350,9 +349,9 @@ 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, type=type, last_knowledge_of_server=last_knowledge_of_server) +> TransactionsResponse get_transactions_by_account(plan_id, account_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -List account transactions +Get all account transactions Returns all transactions for a specified account, excluding any pending transactions @@ -386,15 +385,15 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). 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 = 56 # 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, type=type, last_knowledge_of_server=last_knowledge_of_server) + # Get all account transactions + api_response = api_instance.get_transactions_by_account(plan_id, account_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) print("The response of TransactionsApi->get_transactions_by_account:\n") pprint(api_response) except Exception as e: @@ -408,7 +407,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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] @@ -433,16 +432,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested transactions | - | **404** | No transactions were found | - | -**0** | An error occurred | - | [[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, type=type, last_knowledge_of_server=last_knowledge_of_server) +> HybridTransactionsResponse get_transactions_by_category(plan_id, category_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -List category transactions, excluding any pending transactions +Get all category transactions -Returns all transactions for a specified category +Returns all transactions for a specified category, excluding any pending transactions ### Example @@ -474,15 +472,15 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). 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 = 56 # 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, excluding any pending transactions - 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) + # Get all category transactions + api_response = api_instance.get_transactions_by_category(plan_id, category_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) print("The response of TransactionsApi->get_transactions_by_category:\n") pprint(api_response) except Exception as e: @@ -496,7 +494,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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] @@ -521,16 +519,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested transactions | - | **404** | No transactions were found | - | -**0** | An error occurred | - | [[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_month** -> TransactionsResponse get_transactions_by_month(budget_id, month, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) +> TransactionsResponse get_transactions_by_month(plan_id, month, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -List transactions in month, excluding any pending transactions +Get all plan month transactions -Returns all transactions for a specified month +Returns all transactions for a specified month, excluding any pending transactions ### Example @@ -562,15 +559,15 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). - month = 'month_example' # str | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). + month = 'month_example' # str | The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) 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 = 56 # int | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional) try: - # List transactions in month, excluding any pending transactions - api_response = api_instance.get_transactions_by_month(budget_id, month, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) + # Get all plan month transactions + api_response = api_instance.get_transactions_by_month(plan_id, month, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) print("The response of TransactionsApi->get_transactions_by_month:\n") pprint(api_response) except Exception as e: @@ -584,8 +581,8 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | - **month** | **str**| The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | + **month** | **str**| The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | **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] @@ -609,16 +606,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested transactions | - | **404** | No transactions were found | - | -**0** | An error occurred | - | [[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, type=type, last_knowledge_of_server=last_knowledge_of_server) +> HybridTransactionsResponse get_transactions_by_payee(plan_id, payee_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) -List payee transactions, excluding any pending transactions +Get all payee transactions -Returns all transactions for a specified payee +Returns all transactions for a specified payee, excluding any pending transactions ### Example @@ -650,15 +646,15 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). 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 = 56 # 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, excluding any pending 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) + # Get all payee transactions + api_response = api_instance.get_transactions_by_payee(plan_id, payee_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server) print("The response of TransactionsApi->get_transactions_by_payee:\n") pprint(api_response) except Exception as e: @@ -672,7 +668,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **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] @@ -697,16 +693,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | The list of requested transactions | - | **404** | No transactions were found | - | -**0** | An error occurred | - | [[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) +> TransactionsImportResponse import_transactions(plan_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. +Imports available transactions on all linked accounts for the given plan. 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 @@ -738,11 +733,11 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). try: # Import transactions - api_response = api_instance.import_transactions(budget_id) + api_response = api_instance.import_transactions(plan_id) print("The response of TransactionsApi->import_transactions:\n") pprint(api_response) except Exception as e: @@ -756,7 +751,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | ### Return type @@ -782,9 +777,9 @@ 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_transaction** -> TransactionResponse update_transaction(budget_id, transaction_id, data) +> TransactionResponse update_transaction(plan_id, transaction_id, data) -Updates an existing transaction +Update a transaction Updates a single transaction @@ -819,13 +814,13 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). transaction_id = 'transaction_id_example' # str | The id of the transaction data = ynab.PutTransactionWrapper() # PutTransactionWrapper | The transaction to update try: - # Updates an existing transaction - api_response = api_instance.update_transaction(budget_id, transaction_id, data) + # Update a transaction + api_response = api_instance.update_transaction(plan_id, transaction_id, data) print("The response of TransactionsApi->update_transaction:\n") pprint(api_response) except Exception as e: @@ -839,7 +834,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **transaction_id** | **str**| The id of the transaction | **data** | [**PutTransactionWrapper**](PutTransactionWrapper.md)| The transaction to update | @@ -866,7 +861,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) # **update_transactions** -> SaveTransactionsResponse update_transactions(budget_id, data) +> SaveTransactionsResponse update_transactions(plan_id, data) Update multiple transactions @@ -903,12 +898,12 @@ configuration = ynab.Configuration( with ynab.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ynab.TransactionsApi(api_client) - 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.ynab.com/#oauth-default-budget). + plan_id = 'plan_id_example' # str | The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). data = ynab.PatchTransactionsWrapper() # PatchTransactionsWrapper | 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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. try: # Update multiple transactions - api_response = api_instance.update_transactions(budget_id, data) + api_response = api_instance.update_transactions(plan_id, data) print("The response of TransactionsApi->update_transactions:\n") pprint(api_response) except Exception as e: @@ -922,7 +917,7 @@ with ynab.ApiClient(configuration) as api_client: 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.ynab.com/#oauth-default-budget). | + **plan_id** | **str**| The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | **data** | [**PatchTransactionsWrapper**](PatchTransactionsWrapper.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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. | ### Return type diff --git a/docs/User.md b/docs/User.md index 862c575..db377e6 100644 --- a/docs/User.md +++ b/docs/User.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | +**id** | **UUID** | | ## Example diff --git a/docs/UserApi.md b/docs/UserApi.md index 751a91d..71ee183 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -4,13 +4,13 @@ All URIs are relative to *https://api.ynab.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_user**](UserApi.md#get_user) | **GET** /user | User info +[**get_user**](UserApi.md#get_user) | **GET** /user | Get user # **get_user** > UserResponse get_user() -User info +Get user Returns authenticated user information @@ -46,7 +46,7 @@ with ynab.ApiClient(configuration) as api_client: api_instance = ynab.UserApi(api_client) try: - # User info + # Get user api_response = api_instance.get_user() print("The response of UserApi->get_user:\n") pprint(api_response) @@ -78,7 +78,6 @@ This endpoint does not need any parameter. | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | The user info | - | -**0** | An error occurred | - | [[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/open_api_spec.yaml b/open_api_spec.yaml index 4b65608..553735d 100644 --- a/open_api_spec.yaml +++ b/open_api_spec.yaml @@ -1,48 +1,47 @@ -openapi: 3.0.0 +openapi: 3.1.1 info: title: YNAB API Endpoints - 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.ynab.com - version: 1.76.0 + 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.ynab.com + version: 1.81.0 servers: - url: https://api.ynab.com/v1 security: - bearer: [] tags: - name: User - - name: Budgets + - name: Plans - name: Accounts - description: The accounts for a budget + description: The accounts for a plan - name: Categories - description: The categories for a budget + description: The categories for a plan - name: Payees - description: The payees for a budget + description: The payees for a plan - 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. + 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 Ready to Assign, - Age of Money and category (budgeted / activity / balances) amounts are - available. + description: Each plan contains one or more months, which is where Ready to + Assign, Age of Money and category (assigned / activity / available) + amounts are available. + - name: Money Movements + description: The money movements for a plan - name: Transactions - description: The transactions for a budget + description: The transactions for a plan - name: Scheduled Transactions - description: The scheduled transactions for a budget + description: The scheduled transactions for a plan paths: /user: get: tags: - User - summary: User info + summary: Get user description: Returns authenticated user information operationId: getUser responses: @@ -52,148 +51,118 @@ paths: application/json: schema: $ref: "#/components/schemas/UserResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" /budgets: get: tags: - - Budgets - summary: List budgets - description: Returns budgets list with summary information - operationId: getBudgets + - Plans + summary: Get all plans + description: Returns plans list with summary information + operationId: getPlans parameters: - name: include_accounts in: query - description: Whether to include the list of budget accounts + description: Whether to include the list of plan accounts schema: type: boolean responses: "200": - description: The list of budgets + description: The list of plans content: application/json: schema: - $ref: "#/components/schemas/BudgetSummaryResponse" + $ref: "#/components/schemas/PlanSummaryResponse" "404": - description: No budgets were found + description: No plans were found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}: + /budgets/{plan_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 + - Plans + summary: Get a plan + description: Returns a single plan with all related entities. This resource is + effectively a full plan export. + operationId: getPlanById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 responses: "200": - description: The requested budget + description: The requested plan content: application/json: schema: - $ref: "#/components/schemas/BudgetDetailResponse" + $ref: "#/components/schemas/PlanDetailResponse" "404": - description: The specified budget was not found - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred + description: The specified plan was not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/settings: + /budgets/{plan_id}/settings: get: tags: - - Budgets - summary: Budget Settings - description: Returns settings for a budget - operationId: getBudgetSettingsById + - Plans + summary: Get plan settings + description: Returns settings for a plan + operationId: getPlanSettingsById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string responses: "200": - description: The requested budget settings + description: The requested plan settings content: application/json: schema: - $ref: "#/components/schemas/BudgetSettingsResponse" + $ref: "#/components/schemas/PlanSettingsResponse" "404": - description: The specified Budget was not found + description: The specified plan was not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/accounts: + /budgets/{plan_id}/accounts: get: tags: - Accounts - summary: Account list + summary: Get all accounts description: Returns all accounts operationId: getAccounts parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 @@ -210,32 +179,25 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" post: tags: - Accounts - summary: Create a new account + summary: Create an account description: Creates a new account operationId: createAccount parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget) + description: 'The id of the plan ("last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan)' required: true schema: type: string requestBody: description: The account to create. content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PostAccountWrapper" required: true @@ -247,28 +209,26 @@ paths: schema: $ref: "#/components/schemas/AccountResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s). content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/accounts/{account_id}: + /budgets/{plan_id}/accounts/{account_id}: get: tags: - Accounts - summary: Single account + summary: Get an account description: Returns a single account operationId: getAccountById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -292,36 +252,28 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/categories: + /budgets/{plan_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). + summary: Get all categories + description: Returns all categories grouped by category group. Amounts + (assigned, activity, available, etc.) are specific to the current plan + month (UTC). operationId: getCategories parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 @@ -338,28 +290,57 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred + post: + tags: + - Categories + summary: Create a category + description: Creates a new category + operationId: createCategory + parameters: + - name: plan_id + in: path + description: 'The id of the plan ("last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan)' + required: true + schema: + type: string + requestBody: + description: The category to create. + content: + application/json: + schema: + $ref: "#/components/schemas/PostCategoryWrapper" + required: true + responses: + "201": + description: The category was successfully created + content: + application/json: + schema: + $ref: "#/components/schemas/SaveCategoryResponse" + "400": + description: The request could not be understood due to malformed syntax or + validation error(s). content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/categories/{category_id}: + x-codegen-request-body-name: data + /budgets/{plan_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). + summary: Get a category + description: Returns a single category. Amounts (assigned, activity, available, + etc.) are specific to the current plan month (UTC). operationId: getCategoryById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -377,13 +358,7 @@ paths: schema: $ref: "#/components/schemas/CategoryResponse" "404": - description: The category not was found - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred + description: The category was not found content: application/json: schema: @@ -392,16 +367,14 @@ paths: tags: - Categories summary: Update a category - description: >- - Update a category + description: Update a category operationId: updateCategory parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -412,10 +385,9 @@ paths: schema: type: string requestBody: - description: >- - The category to update + description: The category to update content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PatchCategoryWrapper" required: true @@ -427,38 +399,34 @@ paths: schema: $ref: "#/components/schemas/SaveCategoryResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/months/{month}/categories/{category_id}: + /budgets/{plan_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 + summary: Get a category for a specific plan month + description: Returns a single category for a specific plan month. Amounts + (assigned, activity, available, etc.) are specific to the current plan month (UTC). operationId: getMonthCategoryById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string - name: month in: path - description: >- - The budget month in ISO format (e.g. 2016-12-01) ("current" can also + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also be used to specify the current calendar month (UTC)) required: true schema: @@ -483,34 +451,25 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" patch: tags: - Categories summary: Update a category for a specific month - description: >- - Update a category for a specific month. Only `budgeted` amount can be - updated. + description: Update a category for a specific month. Only `budgeted` (assigned) + amount can be updated. operationId: updateMonthCategory parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string - name: month in: path - description: >- - The budget month in ISO format (e.g. 2016-12-01) ("current" can also + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also be used to specify the current calendar month (UTC)) required: true schema: @@ -523,11 +482,10 @@ paths: schema: type: string requestBody: - description: >- - The category to update. Only `budgeted` amount can be updated and any - other fields specified will be ignored. + description: The category to update. Only `budgeted` (assigned) amount can be + updated and any other fields specified will be ignored. content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PatchMonthCategoryWrapper" required: true @@ -539,36 +497,115 @@ paths: schema: $ref: "#/components/schemas/SaveCategoryResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or + validation error(s) + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + x-codegen-request-body-name: data + /budgets/{plan_id}/category_groups: + post: + tags: + - Categories + summary: Create a category group + description: Creates a new category group + operationId: createCategoryGroup + parameters: + - name: plan_id + in: path + description: 'The id of the plan ("last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan)' + required: true + schema: + type: string + requestBody: + description: The category group to create. + content: + application/json: + schema: + $ref: "#/components/schemas/PostCategoryGroupWrapper" + required: true + responses: + "201": + description: The category group was successfully created + content: + application/json: + schema: + $ref: "#/components/schemas/SaveCategoryGroupResponse" + "400": + description: The request could not be understood due to malformed syntax or + validation error(s). + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + x-codegen-request-body-name: data + /budgets/{plan_id}/category_groups/{category_group_id}: + patch: + tags: + - Categories + summary: Update a category group + description: Update a category group + operationId: updateCategoryGroup + parameters: + - name: plan_id + in: path + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' + required: true + schema: + type: string + - name: category_group_id + in: path + description: The id of the category group + required: true + schema: + type: string + requestBody: + description: The category group to update + content: + application/json: + schema: + $ref: "#/components/schemas/PatchCategoryGroupWrapper" + required: true + responses: + "200": + description: The category group was successfully updated + content: + application/json: + schema: + $ref: "#/components/schemas/SaveCategoryGroupResponse" + "400": + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/payees: + /budgets/{plan_id}/payees: get: tags: - Payees - summary: List payees + summary: Get all payees description: Returns all payees operationId: getPayees parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 @@ -585,26 +622,19 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/payees/{payee_id}: + /budgets/{plan_id}/payees/{payee_id}: get: tags: - Payees - summary: Single payee + summary: Get a payee description: Returns a single payee operationId: getPayeeById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -627,26 +657,18 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" patch: tags: - Payees summary: Update a payee - description: >- - Update a payee + description: Update a payee operationId: updatePayee parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -657,10 +679,9 @@ paths: schema: type: string requestBody: - description: >- - The payee to update + description: The payee to update content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PatchPayeeWrapper" required: true @@ -672,28 +693,26 @@ paths: schema: $ref: "#/components/schemas/SavePayeeResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/payee_locations: + /budgets/{plan_id}/payee_locations: get: tags: - Payee Locations - summary: List payee locations + summary: Get all payee locations description: Returns all payee locations operationId: getPayeeLocations parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -710,26 +729,19 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/payee_locations/{payee_location_id}: + /budgets/{plan_id}/payee_locations/{payee_location_id}: get: tags: - Payee Locations - summary: Single payee location + summary: Get a payee location description: Returns a single payee location operationId: getPayeeLocationById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -752,26 +764,19 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/payees/{payee_id}/payee_locations: + /budgets/{plan_id}/payees/{payee_id}/payee_locations: get: tags: - Payee Locations - summary: List locations for a payee + summary: Get all locations for a payee description: Returns all payee locations for a specified payee operationId: getPayeeLocationsByPayee parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -794,77 +799,127 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/months: + /budgets/{plan_id}/months: get: tags: - Months - summary: List budget months - description: Returns all budget months - operationId: getBudgetMonths + summary: Get all plan months + description: Returns all plan months + operationId: getPlanMonths parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 responses: "200": - description: The list of budget months + description: The list of plan months content: application/json: schema: $ref: "#/components/schemas/MonthSummariesResponse" "404": - description: No budget months were found + description: No plan months were found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred + /budgets/{plan_id}/months/{month}: + get: + tags: + - Months + summary: Get a plan month + description: Returns a single plan month + operationId: getPlanMonth + parameters: + - name: plan_id + in: path + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' + required: true + schema: + type: string + - name: month + in: path + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also + be used to specify the current calendar month (UTC)) + required: true + schema: + type: string + format: date + responses: + "200": + description: The plan month detail + content: + application/json: + schema: + $ref: "#/components/schemas/MonthDetailResponse" + "404": + description: The plan month was not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/months/{month}: + /budgets/{plan_id}/money_movements: get: tags: - - Months - summary: Single budget month - description: Returns a single budget month - operationId: getBudgetMonth + - Money Movements + summary: Get all money movements + description: Returns all money movements + operationId: getMoneyMovements parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' + required: true + schema: + type: string + responses: + "200": + description: The list of requested money movements + content: + application/json: + schema: + $ref: "#/components/schemas/MoneyMovementsResponse" + "404": + description: No money movements were found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + /budgets/{plan_id}/months/{month}/money_movements: + get: + tags: + - Money Movements + summary: Get money movements for a plan month + description: Returns all money movements for a specific month + operationId: getMoneyMovementsByMonth + parameters: + - name: plan_id + in: path + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string - name: month in: path - description: >- - The budget month in ISO format (e.g. 2016-12-01) ("current" can also + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also be used to specify the current calendar month (UTC)) required: true schema: @@ -872,52 +927,109 @@ paths: format: date responses: "200": - description: The budget month detail + description: The list of requested money movements content: application/json: schema: - $ref: "#/components/schemas/MonthDetailResponse" + $ref: "#/components/schemas/MoneyMovementsResponse" "404": - description: The budget month was not found + description: No money movements were found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred + /budgets/{plan_id}/money_movement_groups: + get: + tags: + - Money Movements + summary: Get all money movement groups + description: Returns all money movement groups + operationId: getMoneyMovementGroups + parameters: + - name: plan_id + in: path + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' + required: true + schema: + type: string + responses: + "200": + description: The list of requested money movement groups + content: + application/json: + schema: + $ref: "#/components/schemas/MoneyMovementGroupsResponse" + "404": + description: No money movement groups were found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + /budgets/{plan_id}/months/{month}/money_movement_groups: + get: + tags: + - Money Movements + summary: Get money movement groups for a plan month + description: Returns all money movement groups for a specific month + operationId: getMoneyMovementGroupsByMonth + parameters: + - name: plan_id + in: path + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' + required: true + schema: + type: string + - name: month + in: path + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also + be used to specify the current calendar month (UTC)) + required: true + schema: + type: string + format: date + responses: + "200": + description: The list of requested money movement groups + content: + application/json: + schema: + $ref: "#/components/schemas/MoneyMovementGroupsResponse" + "404": + description: No money movement groups were found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/transactions: + /budgets/{plan_id}/transactions: get: tags: - Transactions - summary: List transactions - description: Returns budget transactions, excluding any pending transactions + summary: Get all transactions + description: Returns plan transactions, excluding any pending transactions operationId: getTransactions parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string - name: since_date in: query - description: >- - If specified, only transactions on or after this date will be + description: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). schema: type: string format: date - name: type in: query - description: >- - If specified, only transactions of the specified type will be + description: If specified, only transactions of the specified type will be included. "uncategorized" and "unapproved" are currently supported. schema: type: string @@ -926,9 +1038,8 @@ paths: - 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. + description: The starting server knowledge. If provided, only entities that + have changed since `last_knowledge_of_server` will be included. schema: type: integer format: int64 @@ -955,32 +1066,29 @@ paths: 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. Scheduled transactions (transactions with a future date) - cannot be created on this endpoint. + 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 + (transactions with a future date) cannot be created on this endpoint. operationId: createTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string requestBody: - description: >- - The transaction or transactions to create. To create a single + 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. content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PostTransactionsWrapper" required: true @@ -992,16 +1100,14 @@ paths: schema: $ref: "#/components/schemas/SaveTransactionsResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s). content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "409": - description: >- - A transaction on the same account with the same `import_id` already + description: A transaction on the same account with the same `import_id` already exists. content: application/json: @@ -1015,26 +1121,25 @@ paths: description: Updates multiple transactions, by `id` or `import_id`. operationId: updateTransactions parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string requestBody: - 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 - its `import_id`. If an `id` is specified, it will always be used for - lookup. You should not specify both `id` and `import_id`. Updating - an `import_id` on an existing transaction is not allowed; if an `import_id` - is specified, it will only be used to lookup the transaction. + 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 its `import_id`. If an `id` is specified, it will always + be used for lookup. You should not specify both `id` and + `import_id`. Updating an `import_id` on an existing transaction is + not allowed; if an `import_id` is specified, it will only be used to + lookup the transaction. content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PatchTransactionsWrapper" required: true @@ -1046,35 +1151,32 @@ paths: schema: $ref: "#/components/schemas/SaveTransactionsResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s). content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/transactions/import: + /budgets/{plan_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 + description: Imports available transactions on all linked accounts for the given + plan. 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 parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1092,27 +1194,25 @@ paths: schema: $ref: "#/components/schemas/TransactionsImportResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/transactions/{transaction_id}: + /budgets/{plan_id}/transactions/{transaction_id}: get: tags: - Transactions - summary: Single transaction + summary: Get a transaction description: Returns a single transaction operationId: getTransactionById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1135,25 +1235,18 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" put: tags: - Transactions - summary: Updates an existing transaction + summary: Update a transaction description: Updates a single transaction operationId: updateTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1166,7 +1259,7 @@ paths: requestBody: description: The transaction to update content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PutTransactionWrapper" required: true @@ -1178,8 +1271,7 @@ paths: schema: $ref: "#/components/schemas/TransactionResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: @@ -1189,16 +1281,15 @@ paths: delete: tags: - Transactions - summary: Deletes an existing transaction + summary: Delete a transaction description: Deletes a transaction operationId: deleteTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1221,20 +1312,20 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/accounts/{account_id}/transactions: + /budgets/{plan_id}/accounts/{account_id}/transactions: get: tags: - Transactions - summary: List account transactions - description: Returns all transactions for a specified account, excluding any pending transactions + summary: Get all account transactions + description: Returns all transactions for a specified account, excluding any + pending transactions operationId: getTransactionsByAccount parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1246,16 +1337,14 @@ paths: type: string - name: since_date in: query - description: >- - If specified, only transactions on or after this date will be + description: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). schema: type: string format: date - name: type in: query - description: >- - If specified, only transactions of the specified type will be + description: If specified, only transactions of the specified type will be included. "uncategorized" and "unapproved" are currently supported. schema: type: string @@ -1264,9 +1353,8 @@ paths: - 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. + description: The starting server knowledge. If provided, only entities that + have changed since `last_knowledge_of_server` will be included. schema: type: integer format: int64 @@ -1283,26 +1371,20 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/categories/{category_id}/transactions: + /budgets/{plan_id}/categories/{category_id}/transactions: get: tags: - Transactions - summary: List category transactions, excluding any pending transactions - description: Returns all transactions for a specified category + summary: Get all category transactions + description: Returns all transactions for a specified category, excluding any + pending transactions operationId: getTransactionsByCategory parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1314,16 +1396,14 @@ paths: type: string - name: since_date in: query - description: >- - If specified, only transactions on or after this date will be + description: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). schema: type: string format: date - name: type in: query - description: >- - If specified, only transactions of the specified type will be + description: If specified, only transactions of the specified type will be included. "uncategorized" and "unapproved" are currently supported. schema: type: string @@ -1332,9 +1412,8 @@ paths: - 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. + description: The starting server knowledge. If provided, only entities that + have changed since `last_knowledge_of_server` will be included. schema: type: integer format: int64 @@ -1351,26 +1430,20 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/payees/{payee_id}/transactions: + /budgets/{plan_id}/payees/{payee_id}/transactions: get: tags: - Transactions - summary: List payee transactions, excluding any pending transactions - description: Returns all transactions for a specified payee + summary: Get all payee transactions + description: Returns all transactions for a specified payee, excluding any + pending transactions operationId: getTransactionsByPayee parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1382,16 +1455,14 @@ paths: type: string - name: since_date in: query - description: >- - If specified, only transactions on or after this date will be + description: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). schema: type: string format: date - name: type in: query - description: >- - If specified, only transactions of the specified type will be + description: If specified, only transactions of the specified type will be included. "uncategorized" and "unapproved" are currently supported. schema: type: string @@ -1400,9 +1471,8 @@ paths: - 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. + description: The starting server knowledge. If provided, only entities that + have changed since `last_knowledge_of_server` will be included. schema: type: integer format: int64 @@ -1419,49 +1489,40 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/months/{month}/transactions: + /budgets/{plan_id}/months/{month}/transactions: get: tags: - Transactions - summary: List transactions in month, excluding any pending transactions - description: Returns all transactions for a specified month + summary: Get all plan month transactions + description: Returns all transactions for a specified month, excluding any + pending transactions operationId: getTransactionsByMonth parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string - name: month in: path - description: >- - The budget month in ISO format (e.g. 2016-12-01) ("current" can also + description: The plan month in ISO format (e.g. 2016-12-01) ("current" can also be used to specify the current calendar month (UTC)) required: true schema: type: string - name: since_date in: query - description: >- - If specified, only transactions on or after this date will be + description: If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). schema: type: string format: date - name: type in: query - description: >- - If specified, only transactions of the specified type will be + description: If specified, only transactions of the specified type will be included. "uncategorized" and "unapproved" are currently supported. schema: type: string @@ -1470,9 +1531,8 @@ paths: - 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. + description: The starting server knowledge. If provided, only entities that + have changed since `last_knowledge_of_server` will be included. schema: type: integer format: int64 @@ -1489,34 +1549,26 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - /budgets/{budget_id}/scheduled_transactions: + /budgets/{plan_id}/scheduled_transactions: get: tags: - Scheduled Transactions - summary: List scheduled transactions + summary: Get all scheduled transactions description: Returns all scheduled transactions operationId: getScheduledTransactions parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: 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. schema: type: integer format: int64 @@ -1533,34 +1585,26 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" post: tags: - Scheduled Transactions - summary: Create a single scheduled transaction - description: >- - Creates a single scheduled transaction (a transaction with a future date). + summary: Create a scheduled transaction + description: Creates a single scheduled transaction (a transaction with a future + date). operationId: createScheduledTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string requestBody: - description: >- - The scheduled transaction to create + description: The scheduled transaction to create content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PostScheduledTransactionWrapper" required: true @@ -1572,28 +1616,26 @@ paths: schema: $ref: "#/components/schemas/ScheduledTransactionResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s). content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" x-codegen-request-body-name: data - /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}: + /budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id}: get: tags: - Scheduled Transactions - summary: Single scheduled transaction + summary: Get a scheduled transaction description: Returns a single scheduled transaction operationId: getScheduledTransactionById parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1616,25 +1658,18 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" - default: - description: An error occurred - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" put: tags: - Scheduled Transactions - summary: Updates an existing scheduled transaction + summary: Update a scheduled transaction description: Updates a single scheduled transaction operationId: updateScheduledTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1647,7 +1682,7 @@ paths: requestBody: description: The scheduled transaction to update content: - "application/json": + application/json: schema: $ref: "#/components/schemas/PutScheduledTransactionWrapper" required: true @@ -1659,8 +1694,7 @@ paths: schema: $ref: "#/components/schemas/ScheduledTransactionResponse" "400": - description: >- - The request could not be understood due to malformed syntax or + description: The request could not be understood due to malformed syntax or validation error(s) content: application/json: @@ -1669,16 +1703,15 @@ paths: delete: tags: - Scheduled Transactions - summary: Deletes an existing scheduled transaction + summary: Delete a scheduled transaction description: Deletes a scheduled transaction operationId: deleteScheduledTransaction parameters: - - name: budget_id + - name: plan_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.ynab.com/#oauth-default-budget). + description: 'The id of the plan. "last-used" can be used to specify the last + used plan and "default" can be used if default plan selection is + enabled (see: https://api.ynab.com/#oauth-default-plan).' required: true schema: type: string @@ -1746,14 +1779,14 @@ components: DateFormat: required: - format - type: object + type: + - object + - "null" properties: format: type: string - nullable: true - description: >- - The date format setting for the budget. In some cases the format will - not be available and will be specified as null. + description: The date format setting for the plan. In some cases the format + will not be available and will be specified as null. CurrencyFormat: required: - currency_symbol @@ -1764,7 +1797,9 @@ components: - group_separator - iso_code - symbol_first - type: object + type: + - object + - "null" properties: iso_code: type: string @@ -1783,11 +1818,9 @@ components: type: string display_symbol: type: boolean - nullable: true - description: >- - The currency format setting for the budget. In some cases the format + description: The currency format setting for the plan. In some cases the format will not be available and will be specified as null. - BudgetSummaryResponse: + PlanSummaryResponse: required: - data type: object @@ -1800,10 +1833,12 @@ components: budgets: type: array items: - $ref: "#/components/schemas/BudgetSummary" + $ref: "#/components/schemas/PlanSummary" default_budget: - $ref: "#/components/schemas/BudgetSummary" - BudgetSummary: + allOf: + - $ref: "#/components/schemas/PlanSummary" + nullable: true + PlanSummary: required: - id - name @@ -1816,17 +1851,16 @@ components: type: string last_modified_on: type: string - description: >- - The last time any changes were made to the budget from either a web + description: The last time any changes were made to the plan from either a web or mobile client format: date-time first_month: type: string - description: The earliest budget month + description: The earliest plan month format: date last_month: type: string - description: The latest budget month + description: The latest plan month format: date date_format: $ref: "#/components/schemas/DateFormat" @@ -1834,12 +1868,11 @@ components: $ref: "#/components/schemas/CurrencyFormat" accounts: type: array - description: >- - The budget accounts (only included if `include_accounts=true` + description: The plan accounts (only included if `include_accounts=true` specified as query parameter) items: $ref: "#/components/schemas/Account" - BudgetDetailResponse: + PlanDetailResponse: required: - data type: object @@ -1851,14 +1884,14 @@ components: type: object properties: budget: - $ref: "#/components/schemas/BudgetDetail" + $ref: "#/components/schemas/PlanDetail" server_knowledge: type: integer description: The knowledge of the server format: int64 - BudgetDetail: + PlanDetail: allOf: - - $ref: "#/components/schemas/BudgetSummary" + - $ref: "#/components/schemas/PlanSummary" - type: object properties: accounts: @@ -1901,7 +1934,7 @@ components: type: array items: $ref: "#/components/schemas/ScheduledSubTransaction" - BudgetSettingsResponse: + PlanSettingsResponse: required: - data type: object @@ -1912,8 +1945,8 @@ components: type: object properties: settings: - $ref: "#/components/schemas/BudgetSettings" - BudgetSettings: + $ref: "#/components/schemas/PlanSettings" + PlanSettings: required: - currency_format - date_format @@ -1977,16 +2010,17 @@ components: $ref: "#/components/schemas/AccountType" on_budget: type: boolean - description: Whether this account is on budget or not + description: Whether this account is "on budget" or not closed: type: boolean description: Whether this account is closed or not note: - type: string - nullable: true + type: + - string + - "null" balance: type: integer - description: The current balance of the account in milliunits format + description: The current available balance of the account in milliunits format format: int64 cleared_balance: type: integer @@ -1997,32 +2031,31 @@ components: description: The current uncleared balance of the account in milliunits format format: int64 transfer_payee_id: - type: string - nullable: true + type: + - string + - "null" description: The payee id which should be used when transferring to this account format: uuid direct_import_linked: type: boolean - description: >- - Whether or not the account is linked to a financial institution for + 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 + 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. last_reconciled_at: - type: string - nullable: true + type: + - string + - "null" description: A date/time specifying when the account was last reconciled. format: date-time debt_original_balance: - type: integer - nullable: true - description: >- - The original debt/loan account balance, specified in milliunits - format. + type: + - integer + - "null" + description: This field is deprecated and will always be null. format: int64 debt_interest_rates: $ref: "#/components/schemas/LoanAccountPeriodicValue" @@ -2032,8 +2065,7 @@ components: $ref: "#/components/schemas/LoanAccountPeriodicValue" deleted: type: boolean - description: >- - Whether or not the account has been deleted. Deleted accounts will + description: Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. PostAccountWrapper: required: @@ -2059,8 +2091,9 @@ components: description: The current balance of the account in milliunits format format: int64 LoanAccountPeriodicValue: - type: object - nullable: true + type: + - object + - "null" additionalProperties: type: integer format: int64 @@ -2121,9 +2154,8 @@ components: properties: categories: type: array - description: >- - Category group categories. Amounts (budgeted, activity, - balance, etc.) are specific to the current budget month (UTC). + description: Category group categories. Amounts (assigned, activity, available, + etc.) are specific to the current plan month (UTC). items: $ref: "#/components/schemas/Category" CategoryGroup: @@ -2144,8 +2176,7 @@ components: description: Whether or not the category group is hidden deleted: type: boolean - description: >- - Whether or not the category group has been deleted. Deleted + description: Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. Category: required: @@ -2173,16 +2204,18 @@ components: type: boolean description: Whether or not the category is hidden original_category_group_id: - type: string + type: + - string + - "null" description: "DEPRECATED: No longer used. Value will always be null." format: uuid - nullable: true note: - type: string - nullable: true + type: + - string + - "null" budgeted: type: integer - description: Budgeted amount in milliunits format + description: Assigned (budgeted) amount in milliunits format format: int64 activity: type: integer @@ -2190,12 +2223,13 @@ components: format: int64 balance: type: integer - description: Balance in milliunits format + description: Available balance in milliunits format format: int64 goal_type: - type: string - description: >- - The type of goal, if the category has a goal (TB='Target Category + type: + - string + - "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') enum: @@ -2205,30 +2239,30 @@ components: - NEED - DEBT - null - nullable: true goal_needs_whole_amount: - type: boolean - description: >- - Indicates the monthly rollover behavior for "NEED"-type goals. When + type: + - boolean + - "null" + description: Indicates the monthly rollover behavior for "NEED"-type goals. When "true", the goal will always ask for the target amount in the new - month ("Set Aside"). When "false", previous month category funding is - used ("Refill"). For other goal types, this field will be null. - nullable: true + month ("Set Aside"). When "false", previous month category funding + is used ("Refill"). For other goal types, this field will be null. default: null goal_day: - type: integer - description: >- - A day offset modifier for the goal's due date. When goal_cadence is + type: + - integer + - "null" + description: A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month). format: int32 - nullable: true goal_cadence: - type: integer - description: >- - The goal cadence. Value in range 0-14. There are two subsets of + type: + - integer + - "null" + description: The goal cadence. Value in range 0-14. There are two subsets of these values which behave differently. For values 0, 1, 2, and 13, the goal's due date repeats every goal_cadence * goal_cadence_frequency, where 0 = None, 1 = Monthly, 2 = Weekly, and @@ -2238,50 +2272,59 @@ components: every goal_cadence, where 3 = Every 2 Months, 4 = Every 3 Months, ..., 12 = Every 11 Months, and 14 = Every 2 Years. format: int32 - nullable: true goal_cadence_frequency: - type: integer - description: >- - The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a + type: + - integer + - "null" + description: The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored. format: int32 - nullable: true goal_creation_month: - type: string + type: + - string + - "null" description: The month a goal was created format: date - nullable: true goal_target: - type: integer + type: + - integer + - "null" description: The goal target amount in milliunits format: int64 - nullable: true goal_target_month: - type: string - description: >- - The original target month for the goal to be completed. Only some - goal types specify this date. + type: + - string + - "null" + description: "DEPRECATED: No longer used. Use `goal_target_date` instead." + format: date + goal_target_date: + type: + - string + - "null" + description: The target date for the goal to be completed. Only some goal types + specify this date. format: date - nullable: true goal_percentage_complete: - type: integer + type: + - integer + - "null" description: The percentage completion of the goal format: int32 - nullable: true goal_months_to_budget: - type: integer - description: >- - The number of months, including the current month, left in the + type: + - integer + - "null" + description: The number of months, including the current month, left in the current goal period. format: int32 - nullable: true goal_under_funded: - type: integer - description: >- - The amount of funding still needed in the current month to stay on + type: + - integer + - "null" + 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 @@ -2289,32 +2332,30 @@ components: clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month. format: int64 - nullable: true goal_overall_funded: - type: integer - description: >- - The total amount funded towards the goal within the current goal + type: + - integer + - "null" + description: The total amount funded towards the goal within the current goal period. format: int64 - nullable: true goal_overall_left: - type: integer - description: >- - The amount of funding still needed to complete the goal within the + type: + - integer + - "null" + description: The amount of funding still needed to complete the goal within the current goal period. format: int64 - nullable: true goal_snoozed_at: - type: string - description: >- - The date/time the goal was snoozed. If the goal is not snoozed, this - will be null. + type: + - string + - "null" + description: The date/time the goal was snoozed. If the goal is not snoozed, + this will be null. format: date-time - nullable: true deleted: type: boolean - description: >- - Whether or not the category has been deleted. Deleted categories + description: Whether or not the category has been deleted. Deleted categories will only be included in delta requests. SaveCategoryResponse: required: @@ -2333,6 +2374,23 @@ components: type: integer description: The knowledge of the server format: int64 + SaveCategoryGroupResponse: + required: + - data + type: object + properties: + data: + required: + - category_group + - server_knowledge + type: object + properties: + category_group: + $ref: "#/components/schemas/CategoryGroup" + server_knowledge: + type: integer + description: The knowledge of the server + format: int64 PayeesResponse: required: - data @@ -2394,16 +2452,15 @@ components: name: type: string transfer_account_id: - type: string - nullable: true - description: >- - If a transfer payee, the `account_id` to which this payee transfers + type: + - string + - "null" + description: If a transfer payee, the `account_id` to which this payee transfers to deleted: type: boolean - description: >- - Whether or not the payee has been deleted. Deleted payees will only - be included in delta requests. + description: Whether or not the payee has been deleted. Deleted payees will + only be included in delta requests. PayeeLocationsResponse: required: - data @@ -2451,8 +2508,7 @@ components: type: string deleted: type: boolean - description: >- - Whether or not the payee location has been deleted. Deleted payee + description: Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests. TransactionsResponse: required: @@ -2527,48 +2583,48 @@ components: properties: import_id: maxLength: 36 - type: string - nullable: true - description: >- - If specified, a 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" transaction 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). + type: + - string + - "null" + description: "If specified, a 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\" transaction + 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)." SaveTransactionWithIdOrImportId: allOf: - type: object properties: id: - type: string - nullable: true - description: >- - If specified, this id will be used to lookup a transaction by - its `id` for the purpose of updating the transaction itself. - If not specified, an `import_id` should be supplied. + type: + - string + - "null" + description: If specified, this id will be used to lookup a transaction by its + `id` for the purpose of updating the transaction itself. If not + specified, an `import_id` should be supplied. import_id: maxLength: 36 - type: string - nullable: true - description: >- - If specified, this id will be used to lookup a transaction by - its `import_id` for the purpose of updating the transaction itself. + type: + - string + - "null" + description: If specified, this id will be used to lookup a transaction by its + `import_id` for the purpose of updating the transaction itself. If not specified, an `id` should be supplied. You may not - provide both an `id` and an `import_id` and updating an `import_id` - on an existing transaction is not allowed. + provide both an `id` and an `import_id` and updating an + `import_id` on an existing transaction is not allowed. - $ref: "#/components/schemas/SaveTransactionWithOptionalFields" SaveTransactionWithOptionalFields: type: object @@ -2578,44 +2634,42 @@ components: format: uuid date: type: string - description: >- - The transaction date in ISO format (e.g. 2016-12-01). Future dates + 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. format: date amount: type: integer - description: >- - The transaction amount in milliunits format. Split transaction + description: The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. format: int64 payee_id: - type: string - nullable: true - description: >- - The payee for the transaction. To create a transfer between two + type: + - string + - "null" + 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 `transfer_payee_id` on the account resource. format: uuid payee_name: maxLength: 200 - type: string - nullable: true - description: >- - The payee name. If a `payee_name` value is provided and `payee_id` + type: + - string + - "null" + 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 - nullable: true - description: >- - The category for the transaction. To configure a split transaction, - you can specify null for `category_id` and provide a + type: + - string + - "null" + 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 @@ -2623,21 +2677,20 @@ components: format: uuid memo: maxLength: 500 - type: string - nullable: true + type: + - string + - "null" cleared: $ref: "#/components/schemas/TransactionClearedStatus" approved: type: boolean - description: >- - Whether or not the transaction is approved. If not supplied, + description: Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. flag_color: $ref: "#/components/schemas/TransactionFlagColor" subtransactions: type: array - description: >- - An array of subtransactions to configure a transaction as a split. + description: An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. items: @@ -2652,31 +2705,33 @@ components: description: The subtransaction amount in milliunits format. format: int64 payee_id: - type: string - nullable: true + type: + - string + - "null" description: The payee for the subtransaction. format: uuid payee_name: maxLength: 200 - type: string - nullable: true - description: >- - The payee name. If a `payee_name` value is provided and `payee_id` + type: + - string + - "null" + 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 - nullable: true - description: >- - The category for the subtransaction. Credit Card Payment categories - are not permitted and will be ignored if supplied. + type: + - string + - "null" + description: The category for the subtransaction. Credit Card Payment + categories are not permitted and will be ignored if supplied. format: uuid memo: maxLength: 500 - type: string - nullable: true + type: + - string + - "null" SaveTransactionsResponse: required: - data @@ -2697,17 +2752,15 @@ components: $ref: "#/components/schemas/TransactionDetail" transactions: type: array - description: >- - If multiple transactions were specified, the transactions that - were saved + description: If multiple transactions were specified, the transactions that were + saved items: $ref: "#/components/schemas/TransactionDetail" duplicate_import_ids: type: array - 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 + 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: @@ -2753,8 +2806,9 @@ components: description: The transaction amount in milliunits format format: int64 memo: - type: string - nullable: true + type: + - string + - "null" cleared: $ref: "#/components/schemas/TransactionClearedStatus" approved: @@ -2768,57 +2822,63 @@ components: type: string format: uuid payee_id: - type: string - nullable: true + type: + - string + - "null" format: uuid category_id: - type: string - nullable: true + type: + - string + - "null" format: uuid transfer_account_id: - type: string - nullable: true + type: + - string + - "null" description: If a transfer transaction, the account to which it transfers format: uuid transfer_transaction_id: - type: string - nullable: true - description: >- - If a transfer transaction, the id of transaction on the other side + type: + - string + - "null" + description: If a transfer transaction, the id of transaction on the other side of the transfer matched_transaction_id: - type: string - nullable: true + type: + - string + - "null" description: If transaction is matched, the id of the matched transaction import_id: - type: string - nullable: true - 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: + type: + - string + - "null" + 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'. + and same amount, its import_id would be + 'YNAB:-294230:2015-12-30:2'." import_payee_name: - type: string - nullable: true - description: >- - If the transaction was imported, the payee name that was used when + type: + - string + - "null" + description: If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules import_payee_name_original: - type: string - nullable: true - description: >- - If the transaction was imported, the original payee name as it + type: + - string + - "null" + description: If the transaction was imported, the original payee name as it appeared on the statement debt_transaction_type: - type: string - description: >- - If the transaction is a debt/loan account transaction, the type of + type: + - string + - "null" + description: If the transaction is a debt/loan account transaction, the type of transaction enum: - payment @@ -2830,11 +2890,9 @@ components: - credit - charge - null - nullable: true deleted: type: boolean - description: >- - Whether or not the transaction has been deleted. Deleted + description: Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. TransactionDetail: allOf: @@ -2847,13 +2905,14 @@ components: account_name: type: string payee_name: - type: string - nullable: true + type: + - string + - "null" category_name: - type: string - nullable: true - description: >- - The name of the category. If a split transaction, this will be + type: + - string + - "null" + description: The name of the category. If a split transaction, this will be 'Split'. subtransactions: type: array @@ -2870,28 +2929,27 @@ components: properties: type: type: string - description: >- - Whether the hybrid transaction represents a regular transaction - or a subtransaction + description: Whether the hybrid transaction represents a regular transaction or + a subtransaction enum: - transaction - subtransaction parent_transaction_id: - type: string - nullable: true - description: >- - For subtransaction types, this is the id of the parent + type: + - string + - "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 payee_name: - type: string - nullable: true + type: + - string + - "null" category_name: type: string - description: >- - The name of the category. If a split transaction, this will be + description: The name of the category. If a split transaction, this will be 'Split'. PatchPayeeWrapper: required: @@ -2908,30 +2966,83 @@ components: nullable: false maxLength: 500 description: The name of the payee. The name must be a maximum of 500 characters. + PostCategoryWrapper: + required: + - category + type: object + properties: + category: + $ref: "#/components/schemas/NewCategory" + PostCategoryGroupWrapper: + required: + - category_group + type: object + properties: + category_group: + $ref: "#/components/schemas/SaveCategoryGroup" + PatchCategoryGroupWrapper: + required: + - category_group + type: object + properties: + category_group: + $ref: "#/components/schemas/SaveCategoryGroup" + SaveCategoryGroup: + required: + - name + type: object + properties: + name: + type: string + description: The name of the category group. The name must be a maximum of 50 + characters. + maxLength: 50 PatchCategoryWrapper: required: - category type: object properties: category: - $ref: "#/components/schemas/SaveCategory" + $ref: "#/components/schemas/ExistingCategory" SaveCategory: type: object properties: name: - type: string - nullable: true + type: + - string + - "null" note: - type: string - nullable: true + type: + - string + - "null" category_group_id: type: string format: uuid goal_target: - type: integer - description: The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal (goal_type != null). + type: + - integer + - "null" + description: The goal target amount in milliunits format. If value is specified + and goal has not already been configured for category, a monthly + 'Needed for Spending' goal will be created for the category with + this target amount. format: int64 - nullable: true + goal_target_date: + type: + - string + - "null" + description: The goal target date in ISO format (e.g. 2016-12-01). + format: date + ExistingCategory: + allOf: + - $ref: "#/components/schemas/SaveCategory" + - type: object + NewCategory: + allOf: + - $ref: "#/components/schemas/SaveCategory" + - required: + - name + - category_group_id PatchMonthCategoryWrapper: required: - category @@ -2946,7 +3057,7 @@ components: properties: budgeted: type: integer - description: Budgeted amount in milliunits format + description: Assigned (budgeted) amount in milliunits format format: int64 TransactionsImportResponse: required: @@ -2986,8 +3097,7 @@ components: type: string duplicate_import_ids: type: array - description: >- - If any Transactions were not created because they had an + 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. @@ -3019,37 +3129,42 @@ components: description: The subtransaction amount in milliunits format format: int64 memo: - type: string - nullable: true + type: + - string + - "null" payee_id: - type: string + type: + - string + - "null" format: uuid - nullable: true payee_name: - type: string - nullable: true + type: + - string + - "null" category_id: - type: string - nullable: true + type: + - string + - "null" format: uuid category_name: - type: string - nullable: true + type: + - string + - "null" transfer_account_id: - type: string - nullable: true + type: + - string + - "null" description: If a transfer, the account_id which the subtransaction transfers to format: uuid transfer_transaction_id: - type: string - nullable: true - description: >- - If a transfer, the id of transaction on the other side of the + type: + - string + - "null" + 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 + description: Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. ScheduledTransactionsResponse: required: @@ -3107,42 +3222,45 @@ components: format: uuid date: type: string - description: >- - The scheduled transaction date in ISO format (e.g. 2016-12-01). This should be a future date no more than 5 years into the future. + description: The scheduled transaction date in ISO format (e.g. + 2016-12-01). This should be a future date no more than 5 years into + the future. format: date amount: type: integer - description: >- - The scheduled transaction amount in milliunits format. + description: The scheduled transaction amount in milliunits format. format: int64 payee_id: - type: string - nullable: true - description: >- - The payee for the scheduled transaction. To create a transfer between two - accounts, use the account transfer payee pointing to the target - account. Account transfer payees are specified as + type: + - string + - "null" + description: The payee for the scheduled transaction. To create a transfer + between two accounts, use the account transfer payee pointing to the + target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. format: uuid payee_name: maxLength: 200 - type: string - nullable: true - description: >- - The payee name for the the scheduled transaction. 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 payee with the same name or (2) creation of a new payee. + type: + - string + - "null" + description: The payee name for the the scheduled transaction. 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 + payee with the same name or (2) creation of a new payee. category_id: - type: string - nullable: true - description: >- - The category for the scheduled transaction. Credit Card Payment categories are not permitted. - Creating a split scheduled transaction is not currently supported. + type: + - string + - "null" + description: The category for the scheduled transaction. Credit Card Payment + categories are not permitted. Creating a split scheduled transaction + is not currently supported. format: uuid memo: maxLength: 500 - type: string - nullable: true + type: + - string + - "null" flag_color: $ref: "#/components/schemas/TransactionFlagColor" frequency: @@ -3190,8 +3308,9 @@ components: description: The scheduled transaction amount in milliunits format format: int64 memo: - type: string - nullable: true + type: + - string + - "null" flag_color: $ref: "#/components/schemas/TransactionFlagColor" flag_name: @@ -3200,24 +3319,25 @@ components: type: string format: uuid payee_id: - type: string - nullable: true + type: + - string + - "null" format: uuid category_id: - type: string - nullable: true + type: + - string + - "null" format: uuid transfer_account_id: - type: string - nullable: true - description: >- - If a transfer, the account_id which the scheduled transaction + type: + - string + - "null" + description: If a transfer, the account_id which the scheduled transaction transfers to format: uuid deleted: type: boolean - description: >- - Whether or not the scheduled transaction has been deleted. Deleted + description: Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. ScheduledTransactionDetail: allOf: @@ -3230,14 +3350,15 @@ components: account_name: type: string payee_name: - type: string - nullable: true + type: + - string + - "null" category_name: - type: string - nullable: true - description: >- - The name of the category. If a split scheduled transaction, - this will be 'Split'. + type: + - string + - "null" + description: The name of the category. If a split scheduled transaction, this + will be 'Split'. subtransactions: type: array description: If a split scheduled transaction, the subtransactions. @@ -3262,33 +3383,37 @@ components: description: The scheduled subtransaction amount in milliunits format format: int64 memo: - type: string - nullable: true + type: + - string + - "null" payee_id: - type: string - nullable: true + type: + - string + - "null" format: uuid payee_name: - type: string - nullable: true + type: + - string + - "null" category_id: - type: string - nullable: true + type: + - string + - "null" format: uuid category_name: - type: string - nullable: true + type: + - string + - "null" transfer_account_id: - type: string - nullable: true - description: >- - If a transfer, the account_id which the scheduled subtransaction + type: + - string + - "null" + description: If a transfer, the account_id which the scheduled subtransaction transfers to format: uuid deleted: type: boolean - description: >- - Whether or not the scheduled subtransaction has been deleted. + description: Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. MonthSummariesResponse: @@ -3336,38 +3461,37 @@ components: type: string format: date note: - type: string - nullable: true + type: + - string + - "null" income: type: integer - description: >- - The total amount of transactions categorized to 'Inflow: Ready to - Assign' in the month + description: "The total amount of transactions categorized to 'Inflow: Ready to + Assign' in the month" format: int64 budgeted: type: integer - description: The total amount budgeted in the month + description: The total amount assigned (budgeted) in the month format: int64 activity: type: integer - description: >- - The total amount of transactions in the month, excluding those - categorized to 'Inflow: Ready to Assign' + description: "The total amount of transactions in the month, excluding those + categorized to 'Inflow: Ready to Assign'" format: int64 to_be_budgeted: type: integer description: The available amount for 'Ready to Assign' format: int64 age_of_money: - type: integer + type: + - integer + - "null" description: The Age of Money as of the month format: int32 - nullable: true deleted: type: boolean - description: >- - Whether or not the month has been deleted. Deleted months will only - be included in delta requests. + description: Whether or not the month has been deleted. Deleted months will + only be included in delta requests. MonthDetail: allOf: - $ref: "#/components/schemas/MonthSummary" @@ -3377,13 +3501,14 @@ components: properties: categories: type: array - description: >- - The budget month categories. Amounts (budgeted, activity, - balance, etc.) are specific to the {month} parameter specified. + description: The plan month categories. Amounts (budgeted, activity, balance, + etc.) are specific to the {month} parameter specified. items: $ref: "#/components/schemas/Category" TransactionFlagColor: - type: string + type: + - string + - "null" description: The transaction flag enum: - red @@ -3394,11 +3519,11 @@ components: - purple - "" - null - nullable: true TransactionFlagName: - type: string + type: + - string + - "null" description: The customized name of a transaction flag - nullable: true TransactionClearedStatus: type: string description: The cleared status of the transaction @@ -3423,6 +3548,126 @@ components: - twiceAYear - yearly - everyOtherYear + MoneyMovementsResponse: + required: + - data + type: object + properties: + data: + required: + - money_movements + - server_knowledge + type: object + properties: + money_movements: + type: array + items: + $ref: "#/components/schemas/MoneyMovement" + server_knowledge: + type: integer + description: The knowledge of the server + format: int64 + MoneyMovement: + required: + - id + - amount + type: object + properties: + id: + type: string + format: uuid + month: + type: + - string + - "null" + description: The month of the money movement in ISO format (e.g. 2024-01-01) + format: date + moved_at: + type: + - string + - "null" + description: The date/time the money movement was processed on the server in ISO + format (e.g. 2024-01-01T12:00:00Z) + format: date-time + note: + type: + - string + - "null" + money_movement_group_id: + type: + - string + - "null" + description: The id of the money movement group this movement belongs to + format: uuid + performed_by_user_id: + type: + - string + - "null" + description: The id of the user who performed the money movement + format: uuid + from_category_id: + type: + - string + - "null" + description: The id of the category the money was moved from + format: uuid + to_category_id: + type: + - string + - "null" + description: The id of the category the money was moved to + format: uuid + amount: + type: integer + description: The amount of the money movement in milliunits format + format: int64 + MoneyMovementGroupsResponse: + required: + - data + type: object + properties: + data: + required: + - money_movement_groups + - server_knowledge + type: object + properties: + money_movement_groups: + type: array + items: + $ref: "#/components/schemas/MoneyMovementGroup" + server_knowledge: + type: integer + description: The knowledge of the server + format: int64 + MoneyMovementGroup: + required: + - id + - group_created_at + - month + type: object + properties: + id: + type: string + format: uuid + group_created_at: + type: string + description: When the money movement group was created + format: date-time + month: + type: string + description: The month of the money movement group in ISO format (e.g. 2024-01-01) + format: date + note: + type: + - string + - "null" + performed_by_user_id: + type: + - string + - "null" + description: The id of the user who performed the money movement group + format: uuid securitySchemes: bearer: type: http diff --git a/openapi-generator-config.yaml b/openapi-generator-config.yaml index fe1a1f4..fd06b88 100644 --- a/openapi-generator-config.yaml +++ b/openapi-generator-config.yaml @@ -1,5 +1,5 @@ packageName: ynab -packageVersion: 1.9.0 +packageVersion: 2.0.0 packageDescription: Official Python client for the YNAB API. API documentation available at https://api.ynab.com. licenseInfo: name: Apache-2.0 diff --git a/poetry.lock b/poetry.lock index 71a68b4..83bbe24 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.2 and should not be changed by hand. [[package]] name = "annotated-types" @@ -29,14 +29,14 @@ files = [ [[package]] name = "certifi" -version = "2025.10.5" +version = "2026.1.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" groups = ["main"] files = [ - {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, - {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, + {file = "certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c"}, + {file = "certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120"}, ] [[package]] @@ -738,4 +738,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.1" python-versions = "^3.8" -content-hash = "498907059ed6a564cbe40a8c3ff4d0cf6d02c468e15953b686bb600d0d7dd6fd" +content-hash = "bf40a2e95382025984a59632e54afd1b00f171cdc8edbb75534b00f3ecfd0e14" diff --git a/pyproject.toml b/pyproject.toml index ef75caa..adb6f86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "ynab" -version = "1.9.0" -description = "Official Python client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.76.0" +version = "2.0.0" +description = "Official Python client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.81.0" authors = ["YNAB"] license = "Apache-2.0" readme = "README.md" @@ -14,7 +14,6 @@ urllib3 = ">= 1.25.3 < 3.0.0" python-dateutil = ">= 2.8.2" pydantic = ">= 2" typing-extensions = ">= 4.7.1" -certifi = ">= 14.05.14" [tool.poetry.group.dev.dependencies] pytest = ">= 7.2.1" diff --git a/requirements.txt b/requirements.txt index 0e04235..6cbb2b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ urllib3 >= 2.1.0, < 3.0.0 python_dateutil >= 2.8.2 pydantic >= 2 typing-extensions >= 4.7.1 -certifi >= 14.05.14 diff --git a/test/test_existing_category.py b/test/test_existing_category.py new file mode 100644 index 0000000..9dae486 --- /dev/null +++ b/test/test_existing_category.py @@ -0,0 +1,55 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.existing_category import ExistingCategory + +class TestExistingCategory(unittest.TestCase): + """ExistingCategory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExistingCategory: + """Test ExistingCategory + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ExistingCategory` + """ + model = ExistingCategory() + if include_optional: + return ExistingCategory( + name = '', + note = '', + category_group_id = '', + goal_target = 56, + goal_target_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ) + else: + return ExistingCategory( + ) + """ + + def testExistingCategory(self): + """Test ExistingCategory""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movement.py b/test/test_money_movement.py new file mode 100644 index 0000000..6967eb4 --- /dev/null +++ b/test/test_money_movement.py @@ -0,0 +1,61 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movement import MoneyMovement + +class TestMoneyMovement(unittest.TestCase): + """MoneyMovement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovement: + """Test MoneyMovement + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovement` + """ + model = MoneyMovement() + if include_optional: + return MoneyMovement( + id = '', + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + moved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + note = '', + money_movement_group_id = '', + performed_by_user_id = '', + from_category_id = '', + to_category_id = '', + amount = 56 + ) + else: + return MoneyMovement( + id = '', + amount = 56, + ) + """ + + def testMoneyMovement(self): + """Test MoneyMovement""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movement_group.py b/test/test_money_movement_group.py new file mode 100644 index 0000000..892b9d3 --- /dev/null +++ b/test/test_money_movement_group.py @@ -0,0 +1,58 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movement_group import MoneyMovementGroup + +class TestMoneyMovementGroup(unittest.TestCase): + """MoneyMovementGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovementGroup: + """Test MoneyMovementGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovementGroup` + """ + model = MoneyMovementGroup() + if include_optional: + return MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + note = '', + performed_by_user_id = '' + ) + else: + return MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + ) + """ + + def testMoneyMovementGroup(self): + """Test MoneyMovementGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movement_groups_response.py b/test/test_money_movement_groups_response.py new file mode 100644 index 0000000..967f20f --- /dev/null +++ b/test/test_money_movement_groups_response.py @@ -0,0 +1,70 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse + +class TestMoneyMovementGroupsResponse(unittest.TestCase): + """MoneyMovementGroupsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovementGroupsResponse: + """Test MoneyMovementGroupsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovementGroupsResponse` + """ + model = MoneyMovementGroupsResponse() + if include_optional: + return MoneyMovementGroupsResponse( + data = ynab.models.money_movement_groups_response_data.MoneyMovementGroupsResponse_data( + money_movement_groups = [ + ynab.models.money_movement_group.MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + note = '', + performed_by_user_id = '', ) + ], + server_knowledge = 56, ) + ) + else: + return MoneyMovementGroupsResponse( + data = ynab.models.money_movement_groups_response_data.MoneyMovementGroupsResponse_data( + money_movement_groups = [ + ynab.models.money_movement_group.MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + note = '', + performed_by_user_id = '', ) + ], + server_knowledge = 56, ), + ) + """ + + def testMoneyMovementGroupsResponse(self): + """Test MoneyMovementGroupsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movement_groups_response_data.py b/test/test_money_movement_groups_response_data.py new file mode 100644 index 0000000..32ec79c --- /dev/null +++ b/test/test_money_movement_groups_response_data.py @@ -0,0 +1,68 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movement_groups_response_data import MoneyMovementGroupsResponseData + +class TestMoneyMovementGroupsResponseData(unittest.TestCase): + """MoneyMovementGroupsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovementGroupsResponseData: + """Test MoneyMovementGroupsResponseData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovementGroupsResponseData` + """ + model = MoneyMovementGroupsResponseData() + if include_optional: + return MoneyMovementGroupsResponseData( + money_movement_groups = [ + ynab.models.money_movement_group.MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + note = '', + performed_by_user_id = '', ) + ], + server_knowledge = 56 + ) + else: + return MoneyMovementGroupsResponseData( + money_movement_groups = [ + ynab.models.money_movement_group.MoneyMovementGroup( + id = '', + group_created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + note = '', + performed_by_user_id = '', ) + ], + server_knowledge = 56, + ) + """ + + def testMoneyMovementGroupsResponseData(self): + """Test MoneyMovementGroupsResponseData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movements_api.py b/test/test_money_movements_api.py new file mode 100644 index 0000000..3508006 --- /dev/null +++ b/test/test_money_movements_api.py @@ -0,0 +1,59 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.api.money_movements_api import MoneyMovementsApi + + +class TestMoneyMovementsApi(unittest.TestCase): + """MoneyMovementsApi unit test stubs""" + + def setUp(self) -> None: + self.api = MoneyMovementsApi() + + def tearDown(self) -> None: + pass + + def test_get_money_movement_groups(self) -> None: + """Test case for get_money_movement_groups + + Get all money movement groups + """ + pass + + def test_get_money_movement_groups_by_month(self) -> None: + """Test case for get_money_movement_groups_by_month + + Get money movement groups for a plan month + """ + pass + + def test_get_money_movements(self) -> None: + """Test case for get_money_movements + + Get all money movements + """ + pass + + def test_get_money_movements_by_month(self) -> None: + """Test case for get_money_movements_by_month + + Get money movements for a plan month + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movements_response.py b/test/test_money_movements_response.py new file mode 100644 index 0000000..f6c4ad1 --- /dev/null +++ b/test/test_money_movements_response.py @@ -0,0 +1,78 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movements_response import MoneyMovementsResponse + +class TestMoneyMovementsResponse(unittest.TestCase): + """MoneyMovementsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovementsResponse: + """Test MoneyMovementsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovementsResponse` + """ + model = MoneyMovementsResponse() + if include_optional: + return MoneyMovementsResponse( + data = ynab.models.money_movements_response_data.MoneyMovementsResponse_data( + money_movements = [ + ynab.models.money_movement.MoneyMovement( + id = '', + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + moved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + note = '', + money_movement_group_id = '', + performed_by_user_id = '', + from_category_id = '', + to_category_id = '', + amount = 56, ) + ], + server_knowledge = 56, ) + ) + else: + return MoneyMovementsResponse( + data = ynab.models.money_movements_response_data.MoneyMovementsResponse_data( + money_movements = [ + ynab.models.money_movement.MoneyMovement( + id = '', + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + moved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + note = '', + money_movement_group_id = '', + performed_by_user_id = '', + from_category_id = '', + to_category_id = '', + amount = 56, ) + ], + server_knowledge = 56, ), + ) + """ + + def testMoneyMovementsResponse(self): + """Test MoneyMovementsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_money_movements_response_data.py b/test/test_money_movements_response_data.py new file mode 100644 index 0000000..ab1f0fa --- /dev/null +++ b/test/test_money_movements_response_data.py @@ -0,0 +1,76 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.money_movements_response_data import MoneyMovementsResponseData + +class TestMoneyMovementsResponseData(unittest.TestCase): + """MoneyMovementsResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoneyMovementsResponseData: + """Test MoneyMovementsResponseData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoneyMovementsResponseData` + """ + model = MoneyMovementsResponseData() + if include_optional: + return MoneyMovementsResponseData( + money_movements = [ + ynab.models.money_movement.MoneyMovement( + id = '', + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + moved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + note = '', + money_movement_group_id = '', + performed_by_user_id = '', + from_category_id = '', + to_category_id = '', + amount = 56, ) + ], + server_knowledge = 56 + ) + else: + return MoneyMovementsResponseData( + money_movements = [ + ynab.models.money_movement.MoneyMovement( + id = '', + month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + moved_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + note = '', + money_movement_group_id = '', + performed_by_user_id = '', + from_category_id = '', + to_category_id = '', + amount = 56, ) + ], + server_knowledge = 56, + ) + """ + + def testMoneyMovementsResponseData(self): + """Test MoneyMovementsResponseData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_months_api.py b/test/test_months_api.py index 524f3ce..cf12464 100644 --- a/test/test_months_api.py +++ b/test/test_months_api.py @@ -26,15 +26,15 @@ def setUp(self) -> None: def tearDown(self) -> None: pass - def test_get_budget_month(self) -> None: - """Test case for get_budget_month + def test_get_plan_month(self) -> None: + """Test case for get_plan_month Single budget month """ pass - def test_get_budget_months(self) -> None: - """Test case for get_budget_months + def test_get_plan_months(self) -> None: + """Test case for get_plan_months List budget months """ diff --git a/test/test_new_category.py b/test/test_new_category.py new file mode 100644 index 0000000..f6af085 --- /dev/null +++ b/test/test_new_category.py @@ -0,0 +1,55 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.new_category import NewCategory + +class TestNewCategory(unittest.TestCase): + """NewCategory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewCategory: + """Test NewCategory + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NewCategory` + """ + model = NewCategory() + if include_optional: + return NewCategory( + name = '', + note = '', + category_group_id = '', + goal_target = 56, + goal_target_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ) + else: + return NewCategory( + ) + """ + + def testNewCategory(self): + """Test NewCategory""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_patch_category_group_wrapper.py b/test/test_patch_category_group_wrapper.py new file mode 100644 index 0000000..0c7339f --- /dev/null +++ b/test/test_patch_category_group_wrapper.py @@ -0,0 +1,54 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper + +class TestPatchCategoryGroupWrapper(unittest.TestCase): + """PatchCategoryGroupWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PatchCategoryGroupWrapper: + """Test PatchCategoryGroupWrapper + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PatchCategoryGroupWrapper` + """ + model = PatchCategoryGroupWrapper() + if include_optional: + return PatchCategoryGroupWrapper( + category_group = ynab.models.save_category_group.SaveCategoryGroup( + name = '', ) + ) + else: + return PatchCategoryGroupWrapper( + category_group = ynab.models.save_category_group.SaveCategoryGroup( + name = '', ), + ) + """ + + def testPatchCategoryGroupWrapper(self): + """Test PatchCategoryGroupWrapper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_budget_detail.py b/test/test_plan_detail.py similarity index 91% rename from test/test_budget_detail.py rename to test/test_plan_detail.py index 99566bb..ae45ca2 100644 --- a/test/test_budget_detail.py +++ b/test/test_plan_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_detail import BudgetDetail +from ynab.models.plan_detail import PlanDetail -class TestBudgetDetail(unittest.TestCase): - """BudgetDetail unit test stubs""" +class TestPlanDetail(unittest.TestCase): + """PlanDetail unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetDetail: - """Test BudgetDetail + def make_instance(self, include_optional) -> PlanDetail: + """Test PlanDetail include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetDetail` + # uncomment below to create an instance of `PlanDetail` """ - model = BudgetDetail() + model = PlanDetail() if include_optional: - return BudgetDetail( + return PlanDetail( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -118,11 +118,13 @@ def make_instance(self, include_optional) -> BudgetDetail: goal_creation_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), goal_target = 56, goal_target_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + goal_target_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), goal_percentage_complete = 56, goal_months_to_budget = 56, goal_under_funded = 56, goal_overall_funded = 56, goal_overall_left = 56, + goal_snoozed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), deleted = True, ) ], months = [ @@ -187,20 +189,22 @@ def make_instance(self, include_optional) -> BudgetDetail: amount = 56, memo = '', payee_id = '', + payee_name = '', category_id = '', + category_name = '', transfer_account_id = '', deleted = True, ) ] ) else: - return BudgetDetail( + return PlanDetail( id = '', name = '', ) """ - def testBudgetDetail(self): - """Test BudgetDetail""" + def testPlanDetail(self): + """Test PlanDetail""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_detail_response.py b/test/test_plan_detail_response.py similarity index 59% rename from test/test_budget_detail_response.py rename to test/test_plan_detail_response.py index 595927c..8b30dd3 100644 --- a/test/test_budget_detail_response.py +++ b/test/test_plan_detail_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_detail_response import BudgetDetailResponse +from ynab.models.plan_detail_response import PlanDetailResponse -class TestBudgetDetailResponse(unittest.TestCase): - """BudgetDetailResponse unit test stubs""" +class TestPlanDetailResponse(unittest.TestCase): + """PlanDetailResponse unit test stubs""" def setUp(self): pass @@ -25,30 +25,30 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetDetailResponse: - """Test BudgetDetailResponse + def make_instance(self, include_optional) -> PlanDetailResponse: + """Test PlanDetailResponse include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetDetailResponse` + # uncomment below to create an instance of `PlanDetailResponse` """ - model = BudgetDetailResponse() + model = PlanDetailResponse() if include_optional: - return BudgetDetailResponse( - data = ynab.models.budget_detail_response_data.BudgetDetailResponse_data( + return PlanDetailResponse( + data = ynab.models.plan_detail_response_data.PlanDetailResponse_data( budget = null, server_knowledge = 56, ) ) else: - return BudgetDetailResponse( - data = ynab.models.budget_detail_response_data.BudgetDetailResponse_data( + return PlanDetailResponse( + data = ynab.models.plan_detail_response_data.PlanDetailResponse_data( budget = null, server_knowledge = 56, ), ) """ - def testBudgetDetailResponse(self): - """Test BudgetDetailResponse""" + def testPlanDetailResponse(self): + """Test PlanDetailResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_detail_response_data.py b/test/test_plan_detail_response_data.py similarity index 63% rename from test/test_budget_detail_response_data.py rename to test/test_plan_detail_response_data.py index 55fcf0e..9325c39 100644 --- a/test/test_budget_detail_response_data.py +++ b/test/test_plan_detail_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_detail_response_data import BudgetDetailResponseData +from ynab.models.plan_detail_response_data import PlanDetailResponseData -class TestBudgetDetailResponseData(unittest.TestCase): - """BudgetDetailResponseData unit test stubs""" +class TestPlanDetailResponseData(unittest.TestCase): + """PlanDetailResponseData unit test stubs""" def setUp(self): pass @@ -25,28 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetDetailResponseData: - """Test BudgetDetailResponseData + def make_instance(self, include_optional) -> PlanDetailResponseData: + """Test PlanDetailResponseData include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetDetailResponseData` + # uncomment below to create an instance of `PlanDetailResponseData` """ - model = BudgetDetailResponseData() + model = PlanDetailResponseData() if include_optional: - return BudgetDetailResponseData( + return PlanDetailResponseData( budget = None, server_knowledge = 56 ) else: - return BudgetDetailResponseData( + return PlanDetailResponseData( budget = None, server_knowledge = 56, ) """ - def testBudgetDetailResponseData(self): - """Test BudgetDetailResponseData""" + def testPlanDetailResponseData(self): + """Test PlanDetailResponseData""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_settings.py b/test/test_plan_settings.py similarity index 79% rename from test/test_budget_settings.py rename to test/test_plan_settings.py index 4d2c02d..152030f 100644 --- a/test/test_budget_settings.py +++ b/test/test_plan_settings.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_settings import BudgetSettings +from ynab.models.plan_settings import PlanSettings -class TestBudgetSettings(unittest.TestCase): - """BudgetSettings unit test stubs""" +class TestPlanSettings(unittest.TestCase): + """PlanSettings unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSettings: - """Test BudgetSettings + def make_instance(self, include_optional) -> PlanSettings: + """Test PlanSettings include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSettings` + # uncomment below to create an instance of `PlanSettings` """ - model = BudgetSettings() + model = PlanSettings() if include_optional: - return BudgetSettings( + return PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> BudgetSettings: display_symbol = True, ) ) else: - return BudgetSettings( + return PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -63,8 +63,8 @@ def make_instance(self, include_optional) -> BudgetSettings: ) """ - def testBudgetSettings(self): - """Test BudgetSettings""" + def testPlanSettings(self): + """Test PlanSettings""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_settings_response.py b/test/test_plan_settings_response.py similarity index 69% rename from test/test_budget_settings_response.py rename to test/test_plan_settings_response.py index a48c428..97fd35e 100644 --- a/test/test_budget_settings_response.py +++ b/test/test_plan_settings_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_settings_response import BudgetSettingsResponse +from ynab.models.plan_settings_response import PlanSettingsResponse -class TestBudgetSettingsResponse(unittest.TestCase): - """BudgetSettingsResponse unit test stubs""" +class TestPlanSettingsResponse(unittest.TestCase): + """PlanSettingsResponse unit test stubs""" def setUp(self): pass @@ -25,18 +25,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSettingsResponse: - """Test BudgetSettingsResponse + def make_instance(self, include_optional) -> PlanSettingsResponse: + """Test PlanSettingsResponse include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSettingsResponse` + # uncomment below to create an instance of `PlanSettingsResponse` """ - model = BudgetSettingsResponse() + model = PlanSettingsResponse() if include_optional: - return BudgetSettingsResponse( - data = ynab.models.budget_settings_response_data.BudgetSettingsResponse_data( - settings = ynab.models.budget_settings.BudgetSettings( + return PlanSettingsResponse( + data = ynab.models.plan_settings_response_data.PlanSettingsResponse_data( + settings = ynab.models.plan_settings.PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -50,9 +50,9 @@ def make_instance(self, include_optional) -> BudgetSettingsResponse: display_symbol = True, ), ), ) ) else: - return BudgetSettingsResponse( - data = ynab.models.budget_settings_response_data.BudgetSettingsResponse_data( - settings = ynab.models.budget_settings.BudgetSettings( + return PlanSettingsResponse( + data = ynab.models.plan_settings_response_data.PlanSettingsResponse_data( + settings = ynab.models.plan_settings.PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -67,8 +67,8 @@ def make_instance(self, include_optional) -> BudgetSettingsResponse: ) """ - def testBudgetSettingsResponse(self): - """Test BudgetSettingsResponse""" + def testPlanSettingsResponse(self): + """Test PlanSettingsResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_settings_response_data.py b/test/test_plan_settings_response_data.py similarity index 72% rename from test/test_budget_settings_response_data.py rename to test/test_plan_settings_response_data.py index 2b7470c..d2351d7 100644 --- a/test/test_budget_settings_response_data.py +++ b/test/test_plan_settings_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_settings_response_data import BudgetSettingsResponseData +from ynab.models.plan_settings_response_data import PlanSettingsResponseData -class TestBudgetSettingsResponseData(unittest.TestCase): - """BudgetSettingsResponseData unit test stubs""" +class TestPlanSettingsResponseData(unittest.TestCase): + """PlanSettingsResponseData unit test stubs""" def setUp(self): pass @@ -25,17 +25,17 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSettingsResponseData: - """Test BudgetSettingsResponseData + def make_instance(self, include_optional) -> PlanSettingsResponseData: + """Test PlanSettingsResponseData include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSettingsResponseData` + # uncomment below to create an instance of `PlanSettingsResponseData` """ - model = BudgetSettingsResponseData() + model = PlanSettingsResponseData() if include_optional: - return BudgetSettingsResponseData( - settings = ynab.models.budget_settings.BudgetSettings( + return PlanSettingsResponseData( + settings = ynab.models.plan_settings.PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -49,8 +49,8 @@ def make_instance(self, include_optional) -> BudgetSettingsResponseData: display_symbol = True, ), ) ) else: - return BudgetSettingsResponseData( - settings = ynab.models.budget_settings.BudgetSettings( + return PlanSettingsResponseData( + settings = ynab.models.plan_settings.PlanSettings( date_format = ynab.models.date_format.DateFormat( format = '', ), currency_format = ynab.models.currency_format.CurrencyFormat( @@ -65,8 +65,8 @@ def make_instance(self, include_optional) -> BudgetSettingsResponseData: ) """ - def testBudgetSettingsResponseData(self): - """Test BudgetSettingsResponseData""" + def testPlanSettingsResponseData(self): + """Test PlanSettingsResponseData""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_summary.py b/test/test_plan_summary.py similarity index 85% rename from test/test_budget_summary.py rename to test/test_plan_summary.py index b068a06..f9def68 100644 --- a/test/test_budget_summary.py +++ b/test/test_plan_summary.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_summary import BudgetSummary +from ynab.models.plan_summary import PlanSummary -class TestBudgetSummary(unittest.TestCase): - """BudgetSummary unit test stubs""" +class TestPlanSummary(unittest.TestCase): + """PlanSummary unit test stubs""" def setUp(self): pass @@ -25,16 +25,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSummary: - """Test BudgetSummary + def make_instance(self, include_optional) -> PlanSummary: + """Test PlanSummary include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSummary` + # uncomment below to create an instance of `PlanSummary` """ - model = BudgetSummary() + model = PlanSummary() if include_optional: - return BudgetSummary( + return PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -78,14 +78,14 @@ def make_instance(self, include_optional) -> BudgetSummary: ] ) else: - return BudgetSummary( + return PlanSummary( id = '', name = '', ) """ - def testBudgetSummary(self): - """Test BudgetSummary""" + def testPlanSummary(self): + """Test PlanSummary""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_summary_response.py b/test/test_plan_summary_response.py similarity index 76% rename from test/test_budget_summary_response.py rename to test/test_plan_summary_response.py index 1413d8d..5e54294 100644 --- a/test/test_budget_summary_response.py +++ b/test/test_plan_summary_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_summary_response import BudgetSummaryResponse +from ynab.models.plan_summary_response import PlanSummaryResponse -class TestBudgetSummaryResponse(unittest.TestCase): - """BudgetSummaryResponse unit test stubs""" +class TestPlanSummaryResponse(unittest.TestCase): + """PlanSummaryResponse unit test stubs""" def setUp(self): pass @@ -25,19 +25,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSummaryResponse: - """Test BudgetSummaryResponse + def make_instance(self, include_optional) -> PlanSummaryResponse: + """Test PlanSummaryResponse include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSummaryResponse` + # uncomment below to create an instance of `PlanSummaryResponse` """ - model = BudgetSummaryResponse() + model = PlanSummaryResponse() if include_optional: - return BudgetSummaryResponse( - data = ynab.models.budget_summary_response_data.BudgetSummaryResponse_data( + return PlanSummaryResponse( + data = ynab.models.plan_summary_response_data.PlanSummaryResponse_data( budgets = [ - ynab.models.budget_summary.BudgetSummary( + ynab.models.plan_summary.PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -80,18 +80,13 @@ def make_instance(self, include_optional) -> BudgetSummaryResponse: deleted = True, ) ], ) ], - default_budget = ynab.models.budget_summary.BudgetSummary( - id = '', - name = '', - last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - first_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - last_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), ), ) + default_budget = null, ) ) else: - return BudgetSummaryResponse( - data = ynab.models.budget_summary_response_data.BudgetSummaryResponse_data( + return PlanSummaryResponse( + data = ynab.models.plan_summary_response_data.PlanSummaryResponse_data( budgets = [ - ynab.models.budget_summary.BudgetSummary( + ynab.models.plan_summary.PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -134,17 +129,12 @@ def make_instance(self, include_optional) -> BudgetSummaryResponse: deleted = True, ) ], ) ], - default_budget = ynab.models.budget_summary.BudgetSummary( - id = '', - name = '', - last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - first_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - last_month = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), ), ), + default_budget = null, ), ) """ - def testBudgetSummaryResponse(self): - """Test BudgetSummaryResponse""" + def testPlanSummaryResponse(self): + """Test PlanSummaryResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budget_summary_response_data.py b/test/test_plan_summary_response_data.py similarity index 90% rename from test/test_budget_summary_response_data.py rename to test/test_plan_summary_response_data.py index 76e3346..419672d 100644 --- a/test/test_budget_summary_response_data.py +++ b/test/test_plan_summary_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,10 +14,10 @@ import unittest -from ynab.models.budget_summary_response_data import BudgetSummaryResponseData +from ynab.models.plan_summary_response_data import PlanSummaryResponseData -class TestBudgetSummaryResponseData(unittest.TestCase): - """BudgetSummaryResponseData unit test stubs""" +class TestPlanSummaryResponseData(unittest.TestCase): + """PlanSummaryResponseData unit test stubs""" def setUp(self): pass @@ -25,18 +25,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BudgetSummaryResponseData: - """Test BudgetSummaryResponseData + def make_instance(self, include_optional) -> PlanSummaryResponseData: + """Test PlanSummaryResponseData include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BudgetSummaryResponseData` + # uncomment below to create an instance of `PlanSummaryResponseData` """ - model = BudgetSummaryResponseData() + model = PlanSummaryResponseData() if include_optional: - return BudgetSummaryResponseData( + return PlanSummaryResponseData( budgets = [ - ynab.models.budget_summary.BudgetSummary( + ynab.models.plan_summary.PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -79,7 +79,7 @@ def make_instance(self, include_optional) -> BudgetSummaryResponseData: deleted = True, ) ], ) ], - default_budget = ynab.models.budget_summary.BudgetSummary( + default_budget = ynab.models.plan_summary.PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -123,9 +123,9 @@ def make_instance(self, include_optional) -> BudgetSummaryResponseData: ], ) ) else: - return BudgetSummaryResponseData( + return PlanSummaryResponseData( budgets = [ - ynab.models.budget_summary.BudgetSummary( + ynab.models.plan_summary.PlanSummary( id = '', name = '', last_modified_on = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -171,8 +171,8 @@ def make_instance(self, include_optional) -> BudgetSummaryResponseData: ) """ - def testBudgetSummaryResponseData(self): - """Test BudgetSummaryResponseData""" + def testPlanSummaryResponseData(self): + """Test PlanSummaryResponseData""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_budgets_api.py b/test/test_plans_api.py similarity index 55% rename from test/test_budgets_api.py rename to test/test_plans_api.py index 41e444b..91fd95d 100644 --- a/test/test_budgets_api.py +++ b/test/test_plans_api.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.72.1 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,36 +14,36 @@ import unittest -from ynab.api.budgets_api import BudgetsApi +from ynab.api.plans_api import PlansApi -class TestBudgetsApi(unittest.TestCase): - """BudgetsApi unit test stubs""" +class TestPlansApi(unittest.TestCase): + """PlansApi unit test stubs""" def setUp(self) -> None: - self.api = BudgetsApi() + self.api = PlansApi() def tearDown(self) -> None: pass - def test_get_budget_by_id(self) -> None: - """Test case for get_budget_by_id + def test_get_plan_by_id(self) -> None: + """Test case for get_plan_by_id - Single budget + Get a plan """ pass - def test_get_budget_settings_by_id(self) -> None: - """Test case for get_budget_settings_by_id + def test_get_plan_settings_by_id(self) -> None: + """Test case for get_plan_settings_by_id - Budget Settings + Get plan settings """ pass - def test_get_budgets(self) -> None: - """Test case for get_budgets + def test_get_plans(self) -> None: + """Test case for get_plans - List budgets + Get all plans """ pass diff --git a/test/test_post_category_group_wrapper.py b/test/test_post_category_group_wrapper.py new file mode 100644 index 0000000..0bad1d2 --- /dev/null +++ b/test/test_post_category_group_wrapper.py @@ -0,0 +1,54 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper + +class TestPostCategoryGroupWrapper(unittest.TestCase): + """PostCategoryGroupWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostCategoryGroupWrapper: + """Test PostCategoryGroupWrapper + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostCategoryGroupWrapper` + """ + model = PostCategoryGroupWrapper() + if include_optional: + return PostCategoryGroupWrapper( + category_group = ynab.models.save_category_group.SaveCategoryGroup( + name = '', ) + ) + else: + return PostCategoryGroupWrapper( + category_group = ynab.models.save_category_group.SaveCategoryGroup( + name = '', ), + ) + """ + + def testPostCategoryGroupWrapper(self): + """Test PostCategoryGroupWrapper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_post_category_wrapper.py b/test/test_post_category_wrapper.py new file mode 100644 index 0000000..73de836 --- /dev/null +++ b/test/test_post_category_wrapper.py @@ -0,0 +1,52 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.post_category_wrapper import PostCategoryWrapper + +class TestPostCategoryWrapper(unittest.TestCase): + """PostCategoryWrapper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostCategoryWrapper: + """Test PostCategoryWrapper + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostCategoryWrapper` + """ + model = PostCategoryWrapper() + if include_optional: + return PostCategoryWrapper( + category = None + ) + else: + return PostCategoryWrapper( + category = None, + ) + """ + + def testPostCategoryWrapper(self): + """Test PostCategoryWrapper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_category_group.py b/test/test_save_category_group.py new file mode 100644 index 0000000..73988a3 --- /dev/null +++ b/test/test_save_category_group.py @@ -0,0 +1,52 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.save_category_group import SaveCategoryGroup + +class TestSaveCategoryGroup(unittest.TestCase): + """SaveCategoryGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SaveCategoryGroup: + """Test SaveCategoryGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SaveCategoryGroup` + """ + model = SaveCategoryGroup() + if include_optional: + return SaveCategoryGroup( + name = '' + ) + else: + return SaveCategoryGroup( + name = '', + ) + """ + + def testSaveCategoryGroup(self): + """Test SaveCategoryGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_category_group_response.py b/test/test_save_category_group_response.py new file mode 100644 index 0000000..68d3933 --- /dev/null +++ b/test/test_save_category_group_response.py @@ -0,0 +1,64 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.save_category_group_response import SaveCategoryGroupResponse + +class TestSaveCategoryGroupResponse(unittest.TestCase): + """SaveCategoryGroupResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SaveCategoryGroupResponse: + """Test SaveCategoryGroupResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SaveCategoryGroupResponse` + """ + model = SaveCategoryGroupResponse() + if include_optional: + return SaveCategoryGroupResponse( + data = ynab.models.save_category_group_response_data.SaveCategoryGroupResponse_data( + category_group = ynab.models.category_group.CategoryGroup( + id = '', + name = '', + hidden = True, + deleted = True, ), + server_knowledge = 56, ) + ) + else: + return SaveCategoryGroupResponse( + data = ynab.models.save_category_group_response_data.SaveCategoryGroupResponse_data( + category_group = ynab.models.category_group.CategoryGroup( + id = '', + name = '', + hidden = True, + deleted = True, ), + server_knowledge = 56, ), + ) + """ + + def testSaveCategoryGroupResponse(self): + """Test SaveCategoryGroupResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_save_category_group_response_data.py b/test/test_save_category_group_response_data.py new file mode 100644 index 0000000..70eb4f7 --- /dev/null +++ b/test/test_save_category_group_response_data.py @@ -0,0 +1,62 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from ynab.models.save_category_group_response_data import SaveCategoryGroupResponseData + +class TestSaveCategoryGroupResponseData(unittest.TestCase): + """SaveCategoryGroupResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SaveCategoryGroupResponseData: + """Test SaveCategoryGroupResponseData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SaveCategoryGroupResponseData` + """ + model = SaveCategoryGroupResponseData() + if include_optional: + return SaveCategoryGroupResponseData( + category_group = ynab.models.category_group.CategoryGroup( + id = '', + name = '', + hidden = True, + deleted = True, ), + server_knowledge = 56 + ) + else: + return SaveCategoryGroupResponseData( + category_group = ynab.models.category_group.CategoryGroup( + id = '', + name = '', + hidden = True, + deleted = True, ), + server_knowledge = 56, + ) + """ + + def testSaveCategoryGroupResponseData(self): + """Test SaveCategoryGroupResponseData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/ynab/__init__.py b/ynab/__init__.py index ab9bd51..cf62dc6 100644 --- a/ynab/__init__.py +++ b/ynab/__init__.py @@ -7,23 +7,24 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 -__version__ = "1.7.0" +__version__ = "2.0.0" # Define package exports __all__ = [ "AccountsApi", - "BudgetsApi", "CategoriesApi", + "MoneyMovementsApi", "MonthsApi", "PayeeLocationsApi", "PayeesApi", + "PlansApi", "ScheduledTransactionsApi", "TransactionsApi", "UserApi", @@ -42,15 +43,6 @@ "AccountType", "AccountsResponse", "AccountsResponseData", - "BudgetDetail", - "BudgetDetailResponse", - "BudgetDetailResponseData", - "BudgetSettings", - "BudgetSettingsResponse", - "BudgetSettingsResponseData", - "BudgetSummary", - "BudgetSummaryResponse", - "BudgetSummaryResponseData", "BulkResponse", "BulkResponseData", "BulkResponseDataBulk", @@ -66,17 +58,26 @@ "DateFormat", "ErrorDetail", "ErrorResponse", + "ExistingCategory", "ExistingTransaction", "HybridTransaction", "HybridTransactionsResponse", "HybridTransactionsResponseData", + "MoneyMovement", + "MoneyMovementGroup", + "MoneyMovementGroupsResponse", + "MoneyMovementGroupsResponseData", + "MoneyMovementsResponse", + "MoneyMovementsResponseData", "MonthDetail", "MonthDetailResponse", "MonthDetailResponseData", "MonthSummariesResponse", "MonthSummariesResponseData", "MonthSummary", + "NewCategory", "NewTransaction", + "PatchCategoryGroupWrapper", "PatchCategoryWrapper", "PatchMonthCategoryWrapper", "PatchPayeeWrapper", @@ -91,13 +92,27 @@ "PayeeResponseData", "PayeesResponse", "PayeesResponseData", + "PlanDetail", + "PlanDetailResponse", + "PlanDetailResponseData", + "PlanSettings", + "PlanSettingsResponse", + "PlanSettingsResponseData", + "PlanSummary", + "PlanSummaryResponse", + "PlanSummaryResponseData", "PostAccountWrapper", + "PostCategoryGroupWrapper", + "PostCategoryWrapper", "PostScheduledTransactionWrapper", "PostTransactionsWrapper", "PutScheduledTransactionWrapper", "PutTransactionWrapper", "SaveAccount", "SaveCategory", + "SaveCategoryGroup", + "SaveCategoryGroupResponse", + "SaveCategoryGroupResponseData", "SaveCategoryResponse", "SaveCategoryResponseData", "SaveMonthCategory", @@ -136,11 +151,12 @@ # import apis into sdk package from ynab.api.accounts_api import AccountsApi as AccountsApi -from ynab.api.budgets_api import BudgetsApi as BudgetsApi from ynab.api.categories_api import CategoriesApi as CategoriesApi +from ynab.api.money_movements_api import MoneyMovementsApi as MoneyMovementsApi from ynab.api.months_api import MonthsApi as MonthsApi from ynab.api.payee_locations_api import PayeeLocationsApi as PayeeLocationsApi from ynab.api.payees_api import PayeesApi as PayeesApi +from ynab.api.plans_api import PlansApi as PlansApi from ynab.api.scheduled_transactions_api import ScheduledTransactionsApi as ScheduledTransactionsApi from ynab.api.transactions_api import TransactionsApi as TransactionsApi from ynab.api.user_api import UserApi as UserApi @@ -163,15 +179,6 @@ from ynab.models.account_type import AccountType as AccountType from ynab.models.accounts_response import AccountsResponse as AccountsResponse from ynab.models.accounts_response_data import AccountsResponseData as AccountsResponseData -from ynab.models.budget_detail import BudgetDetail as BudgetDetail -from ynab.models.budget_detail_response import BudgetDetailResponse as BudgetDetailResponse -from ynab.models.budget_detail_response_data import BudgetDetailResponseData as BudgetDetailResponseData -from ynab.models.budget_settings import BudgetSettings as BudgetSettings -from ynab.models.budget_settings_response import BudgetSettingsResponse as BudgetSettingsResponse -from ynab.models.budget_settings_response_data import BudgetSettingsResponseData as BudgetSettingsResponseData -from ynab.models.budget_summary import BudgetSummary as BudgetSummary -from ynab.models.budget_summary_response import BudgetSummaryResponse as BudgetSummaryResponse -from ynab.models.budget_summary_response_data import BudgetSummaryResponseData as BudgetSummaryResponseData from ynab.models.bulk_response import BulkResponse as BulkResponse from ynab.models.bulk_response_data import BulkResponseData as BulkResponseData from ynab.models.bulk_response_data_bulk import BulkResponseDataBulk as BulkResponseDataBulk @@ -187,17 +194,26 @@ from ynab.models.date_format import DateFormat as DateFormat from ynab.models.error_detail import ErrorDetail as ErrorDetail from ynab.models.error_response import ErrorResponse as ErrorResponse +from ynab.models.existing_category import ExistingCategory as ExistingCategory from ynab.models.existing_transaction import ExistingTransaction as ExistingTransaction from ynab.models.hybrid_transaction import HybridTransaction as HybridTransaction from ynab.models.hybrid_transactions_response import HybridTransactionsResponse as HybridTransactionsResponse from ynab.models.hybrid_transactions_response_data import HybridTransactionsResponseData as HybridTransactionsResponseData +from ynab.models.money_movement import MoneyMovement as MoneyMovement +from ynab.models.money_movement_group import MoneyMovementGroup as MoneyMovementGroup +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse as MoneyMovementGroupsResponse +from ynab.models.money_movement_groups_response_data import MoneyMovementGroupsResponseData as MoneyMovementGroupsResponseData +from ynab.models.money_movements_response import MoneyMovementsResponse as MoneyMovementsResponse +from ynab.models.money_movements_response_data import MoneyMovementsResponseData as MoneyMovementsResponseData from ynab.models.month_detail import MonthDetail as MonthDetail from ynab.models.month_detail_response import MonthDetailResponse as MonthDetailResponse from ynab.models.month_detail_response_data import MonthDetailResponseData as MonthDetailResponseData from ynab.models.month_summaries_response import MonthSummariesResponse as MonthSummariesResponse from ynab.models.month_summaries_response_data import MonthSummariesResponseData as MonthSummariesResponseData from ynab.models.month_summary import MonthSummary as MonthSummary +from ynab.models.new_category import NewCategory as NewCategory from ynab.models.new_transaction import NewTransaction as NewTransaction +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper as PatchCategoryGroupWrapper from ynab.models.patch_category_wrapper import PatchCategoryWrapper as PatchCategoryWrapper from ynab.models.patch_month_category_wrapper import PatchMonthCategoryWrapper as PatchMonthCategoryWrapper from ynab.models.patch_payee_wrapper import PatchPayeeWrapper as PatchPayeeWrapper @@ -212,13 +228,27 @@ from ynab.models.payee_response_data import PayeeResponseData as PayeeResponseData from ynab.models.payees_response import PayeesResponse as PayeesResponse from ynab.models.payees_response_data import PayeesResponseData as PayeesResponseData +from ynab.models.plan_detail import PlanDetail as PlanDetail +from ynab.models.plan_detail_response import PlanDetailResponse as PlanDetailResponse +from ynab.models.plan_detail_response_data import PlanDetailResponseData as PlanDetailResponseData +from ynab.models.plan_settings import PlanSettings as PlanSettings +from ynab.models.plan_settings_response import PlanSettingsResponse as PlanSettingsResponse +from ynab.models.plan_settings_response_data import PlanSettingsResponseData as PlanSettingsResponseData +from ynab.models.plan_summary import PlanSummary as PlanSummary +from ynab.models.plan_summary_response import PlanSummaryResponse as PlanSummaryResponse +from ynab.models.plan_summary_response_data import PlanSummaryResponseData as PlanSummaryResponseData from ynab.models.post_account_wrapper import PostAccountWrapper as PostAccountWrapper +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper as PostCategoryGroupWrapper +from ynab.models.post_category_wrapper import PostCategoryWrapper as PostCategoryWrapper from ynab.models.post_scheduled_transaction_wrapper import PostScheduledTransactionWrapper as PostScheduledTransactionWrapper from ynab.models.post_transactions_wrapper import PostTransactionsWrapper as PostTransactionsWrapper from ynab.models.put_scheduled_transaction_wrapper import PutScheduledTransactionWrapper as PutScheduledTransactionWrapper from ynab.models.put_transaction_wrapper import PutTransactionWrapper as PutTransactionWrapper from ynab.models.save_account import SaveAccount as SaveAccount from ynab.models.save_category import SaveCategory as SaveCategory +from ynab.models.save_category_group import SaveCategoryGroup as SaveCategoryGroup +from ynab.models.save_category_group_response import SaveCategoryGroupResponse as SaveCategoryGroupResponse +from ynab.models.save_category_group_response_data import SaveCategoryGroupResponseData as SaveCategoryGroupResponseData from ynab.models.save_category_response import SaveCategoryResponse as SaveCategoryResponse from ynab.models.save_category_response_data import SaveCategoryResponseData as SaveCategoryResponseData from ynab.models.save_month_category import SaveMonthCategory as SaveMonthCategory @@ -253,3 +283,4 @@ from ynab.models.user import User as User from ynab.models.user_response import UserResponse as UserResponse from ynab.models.user_response_data import UserResponseData as UserResponseData + diff --git a/ynab/api/__init__.py b/ynab/api/__init__.py index 8441ef9..7a10c37 100644 --- a/ynab/api/__init__.py +++ b/ynab/api/__init__.py @@ -2,11 +2,12 @@ # 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.money_movements_api import MoneyMovementsApi 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.plans_api import PlansApi 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 index 074b73d..cbee75a 100644 --- a/ynab/api/accounts_api.py +++ b/ynab/api/accounts_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,6 +18,7 @@ from pydantic import Field, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.account_response import AccountResponse from ynab.models.accounts_response import AccountsResponse from ynab.models.post_account_wrapper import PostAccountWrapper @@ -44,7 +44,7 @@ def __init__(self, api_client=None) -> None: @validate_call def create_account( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget)")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], data: Annotated[PostAccountWrapper, Field(description="The account to create.")], _request_timeout: Union[ None, @@ -59,12 +59,12 @@ def create_account( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountResponse: - """Create a new account + """Create an account Creates a new account - :param 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.ynab.com/#oauth-default-budget) (required) - :type budget_id: str + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str :param data: The account to create. (required) :type data: PostAccountWrapper :param _request_timeout: timeout setting for this request. If one @@ -90,7 +90,7 @@ def create_account( """ # noqa: E501 _param = self._create_account_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -116,7 +116,7 @@ def create_account( @validate_call def create_account_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget)")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], data: Annotated[PostAccountWrapper, Field(description="The account to create.")], _request_timeout: Union[ None, @@ -131,12 +131,12 @@ def create_account_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AccountResponse]: - """Create a new account + """Create an account Creates a new account - :param 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.ynab.com/#oauth-default-budget) (required) - :type budget_id: str + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str :param data: The account to create. (required) :type data: PostAccountWrapper :param _request_timeout: timeout setting for this request. If one @@ -162,7 +162,7 @@ def create_account_with_http_info( """ # noqa: E501 _param = self._create_account_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -188,7 +188,7 @@ def create_account_with_http_info( @validate_call def create_account_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget)")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], data: Annotated[PostAccountWrapper, Field(description="The account to create.")], _request_timeout: Union[ None, @@ -203,12 +203,12 @@ def create_account_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a new account + """Create an account Creates a new account - :param 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.ynab.com/#oauth-default-budget) (required) - :type budget_id: str + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str :param data: The account to create. (required) :type data: PostAccountWrapper :param _request_timeout: timeout setting for this request. If one @@ -234,7 +234,7 @@ def create_account_without_preload_content( """ # noqa: E501 _param = self._create_account_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -255,7 +255,7 @@ def create_account_without_preload_content( def _create_account_serialize( self, - budget_id, + plan_id, data, _request_auth, _content_type, @@ -278,8 +278,8 @@ def _create_account_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -317,7 +317,7 @@ def _create_account_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/budgets/{budget_id}/accounts', + resource_path='/budgets/{plan_id}/accounts', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -336,8 +336,8 @@ def _create_account_serialize( @validate_call def get_account_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - account_id: Annotated[StrictStr, Field(description="The id of the account")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + account_id: Annotated[UUID, Field(description="The id of the account")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -351,14 +351,14 @@ def get_account_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountResponse: - """Single account + """Get an account Returns a single account - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) - :type account_id: str + :type account_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -382,7 +382,7 @@ def get_account_by_id( """ # noqa: E501 _param = self._get_account_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, _request_auth=_request_auth, _content_type=_content_type, @@ -408,8 +408,8 @@ def get_account_by_id( @validate_call def get_account_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - account_id: Annotated[StrictStr, Field(description="The id of the account")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + account_id: Annotated[UUID, Field(description="The id of the account")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -423,14 +423,14 @@ def get_account_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AccountResponse]: - """Single account + """Get an account Returns a single account - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) - :type account_id: str + :type account_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -454,7 +454,7 @@ def get_account_by_id_with_http_info( """ # noqa: E501 _param = self._get_account_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, _request_auth=_request_auth, _content_type=_content_type, @@ -480,8 +480,8 @@ def get_account_by_id_with_http_info( @validate_call def get_account_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - account_id: Annotated[StrictStr, Field(description="The id of the account")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + account_id: Annotated[UUID, Field(description="The id of the account")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -495,14 +495,14 @@ def get_account_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single account + """Get an account Returns a single account - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) - :type account_id: str + :type account_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -526,7 +526,7 @@ def get_account_by_id_without_preload_content( """ # noqa: E501 _param = self._get_account_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, _request_auth=_request_auth, _content_type=_content_type, @@ -547,7 +547,7 @@ def get_account_by_id_without_preload_content( def _get_account_by_id_serialize( self, - budget_id, + plan_id, account_id, _request_auth, _content_type, @@ -570,8 +570,8 @@ def _get_account_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if account_id is not None: _path_params['account_id'] = account_id # process the query parameters @@ -596,7 +596,7 @@ def _get_account_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/accounts/{account_id}', + resource_path='/budgets/{plan_id}/accounts/{account_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -615,7 +615,7 @@ def _get_account_by_id_serialize( @validate_call def get_accounts( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -630,12 +630,12 @@ def get_accounts( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountsResponse: - """Account list + """Get all accounts Returns all accounts - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -661,7 +661,7 @@ def get_accounts( """ # noqa: E501 _param = self._get_accounts_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -687,7 +687,7 @@ def get_accounts( @validate_call def get_accounts_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -702,12 +702,12 @@ def get_accounts_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AccountsResponse]: - """Account list + """Get all accounts Returns all accounts - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -733,7 +733,7 @@ def get_accounts_with_http_info( """ # noqa: E501 _param = self._get_accounts_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -759,7 +759,7 @@ def get_accounts_with_http_info( @validate_call def get_accounts_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -774,12 +774,12 @@ def get_accounts_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Account list + """Get all accounts Returns all accounts - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -805,7 +805,7 @@ def get_accounts_without_preload_content( """ # noqa: E501 _param = self._get_accounts_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -826,7 +826,7 @@ def get_accounts_without_preload_content( def _get_accounts_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -849,8 +849,8 @@ def _get_accounts_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -877,7 +877,7 @@ def _get_accounts_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/accounts', + resource_path='/budgets/{plan_id}/accounts', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/categories_api.py b/ynab/api/categories_api.py index d916141..08fc70f 100644 --- a/ynab/api/categories_api.py +++ b/ynab/api/categories_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -22,8 +21,12 @@ from typing_extensions import Annotated from ynab.models.categories_response import CategoriesResponse from ynab.models.category_response import CategoryResponse +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper from ynab.models.patch_category_wrapper import PatchCategoryWrapper from ynab.models.patch_month_category_wrapper import PatchMonthCategoryWrapper +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper +from ynab.models.post_category_wrapper import PostCategoryWrapper +from ynab.models.save_category_group_response import SaveCategoryGroupResponse from ynab.models.save_category_response import SaveCategoryResponse from ynab.api_client import ApiClient, RequestSerialized @@ -35,19 +38,603 @@ class CategoriesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_category( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryWrapper, Field(description="The category to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SaveCategoryResponse: + """Create a category + + Creates a new category + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category to create. (required) + :type data: PostCategoryWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_category_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryWrapper, Field(description="The category to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SaveCategoryResponse]: + """Create a category + + Creates a new category + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category to create. (required) + :type data: PostCategoryWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_category_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryWrapper, Field(description="The category to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a category + + Creates a new category + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category to create. (required) + :type data: PostCategoryWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_category_serialize( + self, + plan_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/budgets/{plan_id}/categories', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_category_group( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryGroupWrapper, Field(description="The category group to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SaveCategoryGroupResponse: + """Create a category group + + Creates a new category group + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category group to create. (required) + :type data: PostCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_group_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_category_group_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryGroupWrapper, Field(description="The category group to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SaveCategoryGroupResponse]: + """Create a category group + + Creates a new category group + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category group to create. (required) + :type data: PostCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_group_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_category_group_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan)")], + data: Annotated[PostCategoryGroupWrapper, Field(description="The category group to create.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a category group + + Creates a new category group + + :param plan_id: The id of the plan (\"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan) (required) + :type plan_id: str + :param data: The category group to create. (required) + :type data: PostCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_category_group_serialize( + plan_id=plan_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_category_group_serialize( + self, + plan_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/budgets/{plan_id}/category_groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client @validate_call def get_categories( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -62,12 +649,12 @@ def get_categories( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> CategoriesResponse: - """List categories + """Get all categories - Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns all categories grouped by category group. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -93,7 +680,7 @@ def get_categories( """ # noqa: E501 _param = self._get_categories_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -119,7 +706,7 @@ def get_categories( @validate_call def get_categories_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -134,12 +721,12 @@ def get_categories_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[CategoriesResponse]: - """List categories + """Get all categories - Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns all categories grouped by category group. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -165,7 +752,7 @@ def get_categories_with_http_info( """ # noqa: E501 _param = self._get_categories_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -191,7 +778,7 @@ def get_categories_with_http_info( @validate_call def get_categories_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -206,12 +793,12 @@ def get_categories_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List categories + """Get all categories - Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns all categories grouped by category group. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -237,7 +824,7 @@ def get_categories_without_preload_content( """ # noqa: E501 _param = self._get_categories_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -258,7 +845,7 @@ def get_categories_without_preload_content( def _get_categories_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -281,8 +868,8 @@ def _get_categories_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -309,7 +896,7 @@ def _get_categories_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/categories', + resource_path='/budgets/{plan_id}/categories', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -328,7 +915,7 @@ def _get_categories_serialize( @validate_call def get_category_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -343,12 +930,12 @@ def get_category_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> CategoryResponse: - """Single category + """Get a category - Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param _request_timeout: timeout setting for this request. If one @@ -374,7 +961,7 @@ def get_category_by_id( """ # noqa: E501 _param = self._get_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, _request_auth=_request_auth, _content_type=_content_type, @@ -400,7 +987,7 @@ def get_category_by_id( @validate_call def get_category_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -415,12 +1002,12 @@ def get_category_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[CategoryResponse]: - """Single category + """Get a category - Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param _request_timeout: timeout setting for this request. If one @@ -446,7 +1033,7 @@ def get_category_by_id_with_http_info( """ # noqa: E501 _param = self._get_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, _request_auth=_request_auth, _content_type=_content_type, @@ -472,7 +1059,7 @@ def get_category_by_id_with_http_info( @validate_call def get_category_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -487,12 +1074,12 @@ def get_category_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single category + """Get a category - Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param _request_timeout: timeout setting for this request. If one @@ -518,7 +1105,7 @@ def get_category_by_id_without_preload_content( """ # noqa: E501 _param = self._get_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, _request_auth=_request_auth, _content_type=_content_type, @@ -539,7 +1126,7 @@ def get_category_by_id_without_preload_content( def _get_category_by_id_serialize( self, - budget_id, + plan_id, category_id, _request_auth, _content_type, @@ -562,8 +1149,8 @@ def _get_category_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if category_id is not None: _path_params['category_id'] = category_id # process the query parameters @@ -588,7 +1175,7 @@ def _get_category_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/categories/{category_id}', + resource_path='/budgets/{plan_id}/categories/{category_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -607,8 +1194,8 @@ def _get_category_by_id_serialize( @validate_call def get_month_category_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -623,13 +1210,13 @@ def get_month_category_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> CategoryResponse: - """Single category for a specific budget month + """Get a category for a specific plan month - Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category for a specific plan month. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str @@ -656,7 +1243,7 @@ def get_month_category_by_id( """ # noqa: E501 _param = self._get_month_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, _request_auth=_request_auth, @@ -683,8 +1270,8 @@ def get_month_category_by_id( @validate_call def get_month_category_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -699,13 +1286,13 @@ def get_month_category_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[CategoryResponse]: - """Single category for a specific budget month + """Get a category for a specific plan month - Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category for a specific plan month. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str @@ -732,7 +1319,7 @@ def get_month_category_by_id_with_http_info( """ # noqa: E501 _param = self._get_month_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, _request_auth=_request_auth, @@ -759,8 +1346,8 @@ def get_month_category_by_id_with_http_info( @validate_call def get_month_category_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], _request_timeout: Union[ None, @@ -775,13 +1362,13 @@ def get_month_category_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single category for a specific budget month + """Get a category for a specific plan month - Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). + Returns a single category for a specific plan month. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str @@ -808,7 +1395,7 @@ def get_month_category_by_id_without_preload_content( """ # noqa: E501 _param = self._get_month_category_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, _request_auth=_request_auth, @@ -830,7 +1417,7 @@ def get_month_category_by_id_without_preload_content( def _get_month_category_by_id_serialize( self, - budget_id, + plan_id, month, category_id, _request_auth, @@ -854,8 +1441,8 @@ def _get_month_category_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if month is not None: _path_params['month'] = month if category_id is not None: @@ -882,7 +1469,7 @@ def _get_month_category_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/months/{month}/categories/{category_id}', + resource_path='/budgets/{plan_id}/months/{month}/categories/{category_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -901,7 +1488,7 @@ def _get_month_category_by_id_serialize( @validate_call def update_category( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], data: Annotated[PatchCategoryWrapper, Field(description="The category to update")], _request_timeout: Union[ @@ -921,8 +1508,8 @@ def update_category( Update a category - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param data: The category to update (required) @@ -950,7 +1537,7 @@ def update_category( """ # noqa: E501 _param = self._update_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, data=data, _request_auth=_request_auth, @@ -977,7 +1564,7 @@ def update_category( @validate_call def update_category_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], data: Annotated[PatchCategoryWrapper, Field(description="The category to update")], _request_timeout: Union[ @@ -997,8 +1584,8 @@ def update_category_with_http_info( Update a category - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param data: The category to update (required) @@ -1026,7 +1613,7 @@ def update_category_with_http_info( """ # noqa: E501 _param = self._update_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, data=data, _request_auth=_request_auth, @@ -1053,7 +1640,7 @@ def update_category_with_http_info( @validate_call def update_category_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], data: Annotated[PatchCategoryWrapper, Field(description="The category to update")], _request_timeout: Union[ @@ -1073,8 +1660,8 @@ def update_category_without_preload_content( Update a category - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param data: The category to update (required) @@ -1102,7 +1689,7 @@ def update_category_without_preload_content( """ # noqa: E501 _param = self._update_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, data=data, _request_auth=_request_auth, @@ -1124,7 +1711,7 @@ def update_category_without_preload_content( def _update_category_serialize( self, - budget_id, + plan_id, category_id, data, _request_auth, @@ -1148,8 +1735,8 @@ def _update_category_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if category_id is not None: _path_params['category_id'] = category_id # process the query parameters @@ -1189,7 +1776,314 @@ def _update_category_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/budgets/{budget_id}/categories/{category_id}', + resource_path='/budgets/{plan_id}/categories/{category_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_category_group( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + category_group_id: Annotated[StrictStr, Field(description="The id of the category group")], + data: Annotated[PatchCategoryGroupWrapper, Field(description="The category group to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SaveCategoryGroupResponse: + """Update a category group + + Update a category group + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param category_group_id: The id of the category group (required) + :type category_group_id: str + :param data: The category group to update (required) + :type data: PatchCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_category_group_serialize( + plan_id=plan_id, + category_group_id=category_group_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_category_group_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + category_group_id: Annotated[StrictStr, Field(description="The id of the category group")], + data: Annotated[PatchCategoryGroupWrapper, Field(description="The category group to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SaveCategoryGroupResponse]: + """Update a category group + + Update a category group + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param category_group_id: The id of the category group (required) + :type category_group_id: str + :param data: The category group to update (required) + :type data: PatchCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_category_group_serialize( + plan_id=plan_id, + category_group_id=category_group_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_category_group_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + category_group_id: Annotated[StrictStr, Field(description="The id of the category group")], + data: Annotated[PatchCategoryGroupWrapper, Field(description="The category group to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a category group + + Update a category group + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param category_group_id: The id of the category group (required) + :type category_group_id: str + :param data: The category group to update (required) + :type data: PatchCategoryGroupWrapper + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_category_group_serialize( + plan_id=plan_id, + category_group_id=category_group_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SaveCategoryGroupResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_category_group_serialize( + self, + plan_id, + category_group_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + if category_group_id is not None: + _path_params['category_group_id'] = category_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/budgets/{plan_id}/category_groups/{category_group_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1208,10 +2102,10 @@ def _update_category_serialize( @validate_call def update_month_category( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], - data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.")], + data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1227,15 +2121,15 @@ def update_month_category( ) -> SaveCategoryResponse: """Update a category for a specific month - Update a category for a specific month. Only `budgeted` amount can be updated. + Update a category for a specific month. Only `budgeted` (assigned) amount can be updated. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str - :param data: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) + :param data: The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored. (required) :type data: PatchMonthCategoryWrapper :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1260,7 +2154,7 @@ def update_month_category( """ # noqa: E501 _param = self._update_month_category_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, data=data, @@ -1288,10 +2182,10 @@ def update_month_category( @validate_call def update_month_category_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], - data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.")], + data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1307,15 +2201,15 @@ def update_month_category_with_http_info( ) -> ApiResponse[SaveCategoryResponse]: """Update a category for a specific month - Update a category for a specific month. Only `budgeted` amount can be updated. + Update a category for a specific month. Only `budgeted` (assigned) amount can be updated. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str - :param data: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) + :param data: The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored. (required) :type data: PatchMonthCategoryWrapper :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1340,7 +2234,7 @@ def update_month_category_with_http_info( """ # noqa: E501 _param = self._update_month_category_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, data=data, @@ -1368,10 +2262,10 @@ def update_month_category_with_http_info( @validate_call def update_month_category_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], category_id: Annotated[StrictStr, Field(description="The id of the category")], - data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.")], + data: Annotated[PatchMonthCategoryWrapper, Field(description="The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1387,15 +2281,15 @@ def update_month_category_without_preload_content( ) -> RESTResponseType: """Update a category for a specific month - Update a category for a specific month. Only `budgeted` amount can be updated. + Update a category for a specific month. Only `budgeted` (assigned) amount can be updated. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param category_id: The id of the category (required) :type category_id: str - :param data: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) + :param data: The category to update. Only `budgeted` (assigned) amount can be updated and any other fields specified will be ignored. (required) :type data: PatchMonthCategoryWrapper :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1420,7 +2314,7 @@ def update_month_category_without_preload_content( """ # noqa: E501 _param = self._update_month_category_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, category_id=category_id, data=data, @@ -1443,7 +2337,7 @@ def update_month_category_without_preload_content( def _update_month_category_serialize( self, - budget_id, + plan_id, month, category_id, data, @@ -1468,8 +2362,8 @@ def _update_month_category_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if month is not None: _path_params['month'] = month if category_id is not None: @@ -1511,7 +2405,7 @@ def _update_month_category_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/budgets/{budget_id}/months/{month}/categories/{category_id}', + resource_path='/budgets/{plan_id}/months/{month}/categories/{category_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/money_movements_api.py b/ynab/api/money_movements_api.py new file mode 100644 index 0000000..6545897 --- /dev/null +++ b/ynab/api/money_movements_api.py @@ -0,0 +1,1125 @@ +""" + 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import date +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse +from ynab.models.money_movements_response import MoneyMovementsResponse + +from ynab.api_client import ApiClient, RequestSerialized +from ynab.api_response import ApiResponse +from ynab.rest import RESTResponseType + + +class MoneyMovementsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_money_movement_groups( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MoneyMovementGroupsResponse: + """Get all money movement groups + + Returns all money movement groups + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_money_movement_groups_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MoneyMovementGroupsResponse]: + """Get all money movement groups + + Returns all money movement groups + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_money_movement_groups_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get all money movement groups + + Returns all money movement groups + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_money_movement_groups_serialize( + self, + plan_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/budgets/{plan_id}/money_movement_groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_money_movement_groups_by_month( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MoneyMovementGroupsResponse: + """Get money movement groups for a plan month + + Returns all money movement groups for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_money_movement_groups_by_month_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MoneyMovementGroupsResponse]: + """Get money movement groups for a plan month + + Returns all money movement groups for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_money_movement_groups_by_month_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get money movement groups for a plan month + + Returns all money movement groups for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movement_groups_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementGroupsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_money_movement_groups_by_month_serialize( + self, + plan_id, + month, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + if month is not None: + _path_params['month'] = month + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/budgets/{plan_id}/months/{month}/money_movement_groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_money_movements( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MoneyMovementsResponse: + """Get all money movements + + Returns all money movements + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_money_movements_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MoneyMovementsResponse]: + """Get all money movements + + Returns all money movements + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_money_movements_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get all money movements + + Returns all money movements + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_serialize( + plan_id=plan_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_money_movements_serialize( + self, + plan_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/budgets/{plan_id}/money_movements', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_money_movements_by_month( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MoneyMovementsResponse: + """Get money movements for a plan month + + Returns all money movements for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_money_movements_by_month_with_http_info( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MoneyMovementsResponse]: + """Get money movements for a plan month + + Returns all money movements for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_money_movements_by_month_without_preload_content( + self, + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get money movements for a plan month + + Returns all money movements for a specific month + + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) + :type month: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_money_movements_by_month_serialize( + plan_id=plan_id, + month=month, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MoneyMovementsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_money_movements_by_month_serialize( + self, + plan_id, + month, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if plan_id is not None: + _path_params['plan_id'] = plan_id + if month is not None: + _path_params['month'] = month + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/budgets/{plan_id}/months/{month}/money_movements', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/ynab/api/months_api.py b/ynab/api/months_api.py index 4eed1a3..192b36e 100644 --- a/ynab/api/months_api.py +++ b/ynab/api/months_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -42,10 +41,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def get_budget_month( + def get_plan_month( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -59,13 +58,13 @@ def get_budget_month( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MonthDetailResponse: - """Single budget month + """Get a plan month - Returns a single budget month + Returns a single plan month - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -89,8 +88,8 @@ def get_budget_month( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_month_serialize( - budget_id=budget_id, + _param = self._get_plan_month_serialize( + plan_id=plan_id, month=month, _request_auth=_request_auth, _content_type=_content_type, @@ -114,10 +113,10 @@ def get_budget_month( @validate_call - def get_budget_month_with_http_info( + def get_plan_month_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -131,13 +130,13 @@ def get_budget_month_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MonthDetailResponse]: - """Single budget month + """Get a plan month - Returns a single budget month + Returns a single plan month - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -161,8 +160,8 @@ def get_budget_month_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_month_serialize( - budget_id=budget_id, + _param = self._get_plan_month_serialize( + plan_id=plan_id, month=month, _request_auth=_request_auth, _content_type=_content_type, @@ -186,10 +185,10 @@ def get_budget_month_with_http_info( @validate_call - def get_budget_month_without_preload_content( + def get_plan_month_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[date, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[date, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -203,13 +202,13 @@ def get_budget_month_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single budget month + """Get a plan month - Returns a single budget month + Returns a single plan month - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: date :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -233,8 +232,8 @@ def get_budget_month_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_month_serialize( - budget_id=budget_id, + _param = self._get_plan_month_serialize( + plan_id=plan_id, month=month, _request_auth=_request_auth, _content_type=_content_type, @@ -253,9 +252,9 @@ def get_budget_month_without_preload_content( return response_data.response - def _get_budget_month_serialize( + def _get_plan_month_serialize( self, - budget_id, + plan_id, month, _request_auth, _content_type, @@ -278,8 +277,8 @@ def _get_budget_month_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if month is not None: _path_params['month'] = month # process the query parameters @@ -304,7 +303,7 @@ def _get_budget_month_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/months/{month}', + resource_path='/budgets/{plan_id}/months/{month}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -321,9 +320,9 @@ def _get_budget_month_serialize( @validate_call - def get_budget_months( + def get_plan_months( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -338,12 +337,12 @@ def get_budget_months( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> MonthSummariesResponse: - """List budget months + """Get all plan months - Returns all budget months + Returns all plan months - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -368,8 +367,8 @@ def get_budget_months( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_months_serialize( - budget_id=budget_id, + _param = self._get_plan_months_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -393,9 +392,9 @@ def get_budget_months( @validate_call - def get_budget_months_with_http_info( + def get_plan_months_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -410,12 +409,12 @@ def get_budget_months_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[MonthSummariesResponse]: - """List budget months + """Get all plan months - Returns all budget months + Returns all plan months - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -440,8 +439,8 @@ def get_budget_months_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_months_serialize( - budget_id=budget_id, + _param = self._get_plan_months_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -465,9 +464,9 @@ def get_budget_months_with_http_info( @validate_call - def get_budget_months_without_preload_content( + def get_plan_months_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -482,12 +481,12 @@ def get_budget_months_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List budget months + """Get all plan months - Returns all budget months + Returns all plan months - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -512,8 +511,8 @@ def get_budget_months_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_months_serialize( - budget_id=budget_id, + _param = self._get_plan_months_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -532,9 +531,9 @@ def get_budget_months_without_preload_content( return response_data.response - def _get_budget_months_serialize( + def _get_plan_months_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -557,8 +556,8 @@ def _get_budget_months_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -585,7 +584,7 @@ def _get_budget_months_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/months', + resource_path='/budgets/{plan_id}/months', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/payee_locations_api.py b/ynab/api/payee_locations_api.py index 9647f08..87467ee 100644 --- a/ynab/api/payee_locations_api.py +++ b/ynab/api/payee_locations_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -42,7 +41,7 @@ def __init__(self, api_client=None) -> None: @validate_call def get_payee_location_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_location_id: Annotated[StrictStr, Field(description="id of payee location")], _request_timeout: Union[ None, @@ -57,12 +56,12 @@ def get_payee_location_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> PayeeLocationResponse: - """Single payee location + """Get a payee location Returns a single payee location - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_location_id: id of payee location (required) :type payee_location_id: str :param _request_timeout: timeout setting for this request. If one @@ -88,7 +87,7 @@ def get_payee_location_by_id( """ # noqa: E501 _param = self._get_payee_location_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_location_id=payee_location_id, _request_auth=_request_auth, _content_type=_content_type, @@ -114,7 +113,7 @@ def get_payee_location_by_id( @validate_call def get_payee_location_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_location_id: Annotated[StrictStr, Field(description="id of payee location")], _request_timeout: Union[ None, @@ -129,12 +128,12 @@ def get_payee_location_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[PayeeLocationResponse]: - """Single payee location + """Get a payee location Returns a single payee location - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_location_id: id of payee location (required) :type payee_location_id: str :param _request_timeout: timeout setting for this request. If one @@ -160,7 +159,7 @@ def get_payee_location_by_id_with_http_info( """ # noqa: E501 _param = self._get_payee_location_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_location_id=payee_location_id, _request_auth=_request_auth, _content_type=_content_type, @@ -186,7 +185,7 @@ def get_payee_location_by_id_with_http_info( @validate_call def get_payee_location_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_location_id: Annotated[StrictStr, Field(description="id of payee location")], _request_timeout: Union[ None, @@ -201,12 +200,12 @@ def get_payee_location_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single payee location + """Get a payee location Returns a single payee location - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_location_id: id of payee location (required) :type payee_location_id: str :param _request_timeout: timeout setting for this request. If one @@ -232,7 +231,7 @@ def get_payee_location_by_id_without_preload_content( """ # noqa: E501 _param = self._get_payee_location_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_location_id=payee_location_id, _request_auth=_request_auth, _content_type=_content_type, @@ -253,7 +252,7 @@ def get_payee_location_by_id_without_preload_content( def _get_payee_location_by_id_serialize( self, - budget_id, + plan_id, payee_location_id, _request_auth, _content_type, @@ -276,8 +275,8 @@ def _get_payee_location_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if payee_location_id is not None: _path_params['payee_location_id'] = payee_location_id # process the query parameters @@ -302,7 +301,7 @@ def _get_payee_location_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payee_locations/{payee_location_id}', + resource_path='/budgets/{plan_id}/payee_locations/{payee_location_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -321,7 +320,7 @@ def _get_payee_location_by_id_serialize( @validate_call def get_payee_locations( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -335,12 +334,12 @@ def get_payee_locations( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> PayeeLocationsResponse: - """List payee locations + """Get all payee locations Returns all payee locations - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -364,7 +363,7 @@ def get_payee_locations( """ # noqa: E501 _param = self._get_payee_locations_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -389,7 +388,7 @@ def get_payee_locations( @validate_call def get_payee_locations_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -403,12 +402,12 @@ def get_payee_locations_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[PayeeLocationsResponse]: - """List payee locations + """Get all payee locations Returns all payee locations - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -432,7 +431,7 @@ def get_payee_locations_with_http_info( """ # noqa: E501 _param = self._get_payee_locations_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -457,7 +456,7 @@ def get_payee_locations_with_http_info( @validate_call def get_payee_locations_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -471,12 +470,12 @@ def get_payee_locations_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List payee locations + """Get all payee locations Returns all payee locations - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -500,7 +499,7 @@ def get_payee_locations_without_preload_content( """ # noqa: E501 _param = self._get_payee_locations_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -520,7 +519,7 @@ def get_payee_locations_without_preload_content( def _get_payee_locations_serialize( self, - budget_id, + plan_id, _request_auth, _content_type, _headers, @@ -542,8 +541,8 @@ def _get_payee_locations_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -566,7 +565,7 @@ def _get_payee_locations_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payee_locations', + resource_path='/budgets/{plan_id}/payee_locations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -585,7 +584,7 @@ def _get_payee_locations_serialize( @validate_call def get_payee_locations_by_payee( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="id of payee")], _request_timeout: Union[ None, @@ -600,12 +599,12 @@ def get_payee_locations_by_payee( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> PayeeLocationsResponse: - """List locations for a payee + """Get all locations for a payee Returns all payee locations for a specified payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: id of payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -631,7 +630,7 @@ def get_payee_locations_by_payee( """ # noqa: E501 _param = self._get_payee_locations_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -657,7 +656,7 @@ def get_payee_locations_by_payee( @validate_call def get_payee_locations_by_payee_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="id of payee")], _request_timeout: Union[ None, @@ -672,12 +671,12 @@ def get_payee_locations_by_payee_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[PayeeLocationsResponse]: - """List locations for a payee + """Get all locations for a payee Returns all payee locations for a specified payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: id of payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -703,7 +702,7 @@ def get_payee_locations_by_payee_with_http_info( """ # noqa: E501 _param = self._get_payee_locations_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -729,7 +728,7 @@ def get_payee_locations_by_payee_with_http_info( @validate_call def get_payee_locations_by_payee_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="id of payee")], _request_timeout: Union[ None, @@ -744,12 +743,12 @@ def get_payee_locations_by_payee_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List locations for a payee + """Get all locations for a payee Returns all payee locations for a specified payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: id of payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -775,7 +774,7 @@ def get_payee_locations_by_payee_without_preload_content( """ # noqa: E501 _param = self._get_payee_locations_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -796,7 +795,7 @@ def get_payee_locations_by_payee_without_preload_content( def _get_payee_locations_by_payee_serialize( self, - budget_id, + plan_id, payee_id, _request_auth, _content_type, @@ -819,8 +818,8 @@ def _get_payee_locations_by_payee_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if payee_id is not None: _path_params['payee_id'] = payee_id # process the query parameters @@ -845,7 +844,7 @@ def _get_payee_locations_by_payee_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payees/{payee_id}/payee_locations', + resource_path='/budgets/{plan_id}/payees/{payee_id}/payee_locations', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/payees_api.py b/ynab/api/payees_api.py index 954a0c7..303382d 100644 --- a/ynab/api/payees_api.py +++ b/ynab/api/payees_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -45,7 +44,7 @@ def __init__(self, api_client=None) -> None: @validate_call def get_payee_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], _request_timeout: Union[ None, @@ -60,12 +59,12 @@ def get_payee_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> PayeeResponse: - """Single payee + """Get a payee Returns a single payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -91,7 +90,7 @@ def get_payee_by_id( """ # noqa: E501 _param = self._get_payee_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -117,7 +116,7 @@ def get_payee_by_id( @validate_call def get_payee_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], _request_timeout: Union[ None, @@ -132,12 +131,12 @@ def get_payee_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[PayeeResponse]: - """Single payee + """Get a payee Returns a single payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -163,7 +162,7 @@ def get_payee_by_id_with_http_info( """ # noqa: E501 _param = self._get_payee_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -189,7 +188,7 @@ def get_payee_by_id_with_http_info( @validate_call def get_payee_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], _request_timeout: Union[ None, @@ -204,12 +203,12 @@ def get_payee_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single payee + """Get a payee Returns a single payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param _request_timeout: timeout setting for this request. If one @@ -235,7 +234,7 @@ def get_payee_by_id_without_preload_content( """ # noqa: E501 _param = self._get_payee_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, _request_auth=_request_auth, _content_type=_content_type, @@ -256,7 +255,7 @@ def get_payee_by_id_without_preload_content( def _get_payee_by_id_serialize( self, - budget_id, + plan_id, payee_id, _request_auth, _content_type, @@ -279,8 +278,8 @@ def _get_payee_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if payee_id is not None: _path_params['payee_id'] = payee_id # process the query parameters @@ -305,7 +304,7 @@ def _get_payee_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payees/{payee_id}', + resource_path='/budgets/{plan_id}/payees/{payee_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -324,7 +323,7 @@ def _get_payee_by_id_serialize( @validate_call def get_payees( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -339,12 +338,12 @@ def get_payees( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> PayeesResponse: - """List payees + """Get all payees Returns all payees - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -370,7 +369,7 @@ def get_payees( """ # noqa: E501 _param = self._get_payees_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -396,7 +395,7 @@ def get_payees( @validate_call def get_payees_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -411,12 +410,12 @@ def get_payees_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[PayeesResponse]: - """List payees + """Get all payees Returns all payees - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -442,7 +441,7 @@ def get_payees_with_http_info( """ # noqa: E501 _param = self._get_payees_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -468,7 +467,7 @@ def get_payees_with_http_info( @validate_call def get_payees_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -483,12 +482,12 @@ def get_payees_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List payees + """Get all payees Returns all payees - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -514,7 +513,7 @@ def get_payees_without_preload_content( """ # noqa: E501 _param = self._get_payees_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -535,7 +534,7 @@ def get_payees_without_preload_content( def _get_payees_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -558,8 +557,8 @@ def _get_payees_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -586,7 +585,7 @@ def _get_payees_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payees', + resource_path='/budgets/{plan_id}/payees', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -605,7 +604,7 @@ def _get_payees_serialize( @validate_call def update_payee( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], data: Annotated[PatchPayeeWrapper, Field(description="The payee to update")], _request_timeout: Union[ @@ -625,8 +624,8 @@ def update_payee( Update a payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param data: The payee to update (required) @@ -654,7 +653,7 @@ def update_payee( """ # noqa: E501 _param = self._update_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, data=data, _request_auth=_request_auth, @@ -681,7 +680,7 @@ def update_payee( @validate_call def update_payee_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], data: Annotated[PatchPayeeWrapper, Field(description="The payee to update")], _request_timeout: Union[ @@ -701,8 +700,8 @@ def update_payee_with_http_info( Update a payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param data: The payee to update (required) @@ -730,7 +729,7 @@ def update_payee_with_http_info( """ # noqa: E501 _param = self._update_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, data=data, _request_auth=_request_auth, @@ -757,7 +756,7 @@ def update_payee_with_http_info( @validate_call def update_payee_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], data: Annotated[PatchPayeeWrapper, Field(description="The payee to update")], _request_timeout: Union[ @@ -777,8 +776,8 @@ def update_payee_without_preload_content( Update a payee - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param data: The payee to update (required) @@ -806,7 +805,7 @@ def update_payee_without_preload_content( """ # noqa: E501 _param = self._update_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, data=data, _request_auth=_request_auth, @@ -828,7 +827,7 @@ def update_payee_without_preload_content( def _update_payee_serialize( self, - budget_id, + plan_id, payee_id, data, _request_auth, @@ -852,8 +851,8 @@ def _update_payee_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if payee_id is not None: _path_params['payee_id'] = payee_id # process the query parameters @@ -893,7 +892,7 @@ def _update_payee_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/budgets/{budget_id}/payees/{payee_id}', + resource_path='/budgets/{plan_id}/payees/{payee_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/budgets_api.py b/ynab/api/plans_api.py similarity index 81% rename from ynab/api/budgets_api.py rename to ynab/api/plans_api.py index 04b763e..5374e5c 100644 --- a/ynab/api/budgets_api.py +++ b/ynab/api/plans_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -19,16 +18,16 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated -from ynab.models.budget_detail_response import BudgetDetailResponse -from ynab.models.budget_settings_response import BudgetSettingsResponse -from ynab.models.budget_summary_response import BudgetSummaryResponse +from ynab.models.plan_detail_response import PlanDetailResponse +from ynab.models.plan_settings_response import PlanSettingsResponse +from ynab.models.plan_summary_response import PlanSummaryResponse from ynab.api_client import ApiClient, RequestSerialized from ynab.api_response import ApiResponse from ynab.rest import RESTResponseType -class BudgetsApi: +class PlansApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -42,9 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def get_budget_by_id( + def get_plan_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -58,13 +57,13 @@ def get_budget_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BudgetDetailResponse: - """Single budget + ) -> PlanDetailResponse: + """Get a plan - Returns a single budget with all related entities. This resource is effectively a full budget export. + Returns a single plan with all related entities. This resource is effectively a full plan export. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -89,8 +88,8 @@ def get_budget_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_by_id_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -99,7 +98,7 @@ def get_budget_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetDetailResponse", + '200': "PlanDetailResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -114,9 +113,9 @@ def get_budget_by_id( @validate_call - def get_budget_by_id_with_http_info( + def get_plan_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -130,13 +129,13 @@ def get_budget_by_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BudgetDetailResponse]: - """Single budget + ) -> ApiResponse[PlanDetailResponse]: + """Get a plan - Returns a single budget with all related entities. This resource is effectively a full budget export. + Returns a single plan with all related entities. This resource is effectively a full plan export. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -161,8 +160,8 @@ def get_budget_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_by_id_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -171,7 +170,7 @@ def get_budget_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetDetailResponse", + '200': "PlanDetailResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -186,9 +185,9 @@ def get_budget_by_id_with_http_info( @validate_call - def get_budget_by_id_without_preload_content( + def get_plan_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -203,12 +202,12 @@ def get_budget_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single budget + """Get a plan - Returns a single budget with all related entities. This resource is effectively a full budget export. + Returns a single plan with all related entities. This resource is effectively a full plan export. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -233,8 +232,8 @@ def get_budget_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_by_id_serialize( + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -243,7 +242,7 @@ def get_budget_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetDetailResponse", + '200': "PlanDetailResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -253,9 +252,9 @@ def get_budget_by_id_without_preload_content( return response_data.response - def _get_budget_by_id_serialize( + def _get_plan_by_id_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -278,8 +277,8 @@ def _get_budget_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -306,7 +305,7 @@ def _get_budget_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}', + resource_path='/budgets/{plan_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -323,9 +322,9 @@ def _get_budget_by_id_serialize( @validate_call - def get_budget_settings_by_id( + def get_plan_settings_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -338,13 +337,13 @@ def get_budget_settings_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BudgetSettingsResponse: - """Budget Settings + ) -> PlanSettingsResponse: + """Get plan settings - Returns settings for a budget + Returns settings for a plan - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -367,8 +366,8 @@ def get_budget_settings_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_settings_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_settings_by_id_serialize( + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -376,7 +375,7 @@ def get_budget_settings_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSettingsResponse", + '200': "PlanSettingsResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -391,9 +390,9 @@ def get_budget_settings_by_id( @validate_call - def get_budget_settings_by_id_with_http_info( + def get_plan_settings_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -406,13 +405,13 @@ def get_budget_settings_by_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BudgetSettingsResponse]: - """Budget Settings + ) -> ApiResponse[PlanSettingsResponse]: + """Get plan settings - Returns settings for a budget + Returns settings for a plan - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -435,8 +434,8 @@ def get_budget_settings_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_settings_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_settings_by_id_serialize( + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -444,7 +443,7 @@ def get_budget_settings_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSettingsResponse", + '200': "PlanSettingsResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -459,9 +458,9 @@ def get_budget_settings_by_id_with_http_info( @validate_call - def get_budget_settings_by_id_without_preload_content( + def get_plan_settings_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -475,12 +474,12 @@ def get_budget_settings_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Budget Settings + """Get plan settings - Returns settings for a budget + Returns settings for a plan - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -503,8 +502,8 @@ def get_budget_settings_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budget_settings_by_id_serialize( - budget_id=budget_id, + _param = self._get_plan_settings_by_id_serialize( + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -512,7 +511,7 @@ def get_budget_settings_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSettingsResponse", + '200': "PlanSettingsResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -522,9 +521,9 @@ def get_budget_settings_by_id_without_preload_content( return response_data.response - def _get_budget_settings_by_id_serialize( + def _get_plan_settings_by_id_serialize( self, - budget_id, + plan_id, _request_auth, _content_type, _headers, @@ -546,8 +545,8 @@ def _get_budget_settings_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -570,7 +569,7 @@ def _get_budget_settings_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/settings', + resource_path='/budgets/{plan_id}/settings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -587,9 +586,9 @@ def _get_budget_settings_by_id_serialize( @validate_call - def get_budgets( + def get_plans( self, - include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of budget accounts")] = None, + include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of plan accounts")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -602,12 +601,12 @@ def get_budgets( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BudgetSummaryResponse: - """List budgets + ) -> PlanSummaryResponse: + """Get all plans - Returns budgets list with summary information + Returns plans list with summary information - :param include_accounts: Whether to include the list of budget accounts + :param include_accounts: Whether to include the list of plan accounts :type include_accounts: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -631,7 +630,7 @@ def get_budgets( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budgets_serialize( + _param = self._get_plans_serialize( include_accounts=include_accounts, _request_auth=_request_auth, _content_type=_content_type, @@ -640,7 +639,7 @@ def get_budgets( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSummaryResponse", + '200': "PlanSummaryResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -655,9 +654,9 @@ def get_budgets( @validate_call - def get_budgets_with_http_info( + def get_plans_with_http_info( self, - include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of budget accounts")] = None, + include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of plan accounts")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -670,12 +669,12 @@ def get_budgets_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BudgetSummaryResponse]: - """List budgets + ) -> ApiResponse[PlanSummaryResponse]: + """Get all plans - Returns budgets list with summary information + Returns plans list with summary information - :param include_accounts: Whether to include the list of budget accounts + :param include_accounts: Whether to include the list of plan accounts :type include_accounts: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -699,7 +698,7 @@ def get_budgets_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budgets_serialize( + _param = self._get_plans_serialize( include_accounts=include_accounts, _request_auth=_request_auth, _content_type=_content_type, @@ -708,7 +707,7 @@ def get_budgets_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSummaryResponse", + '200': "PlanSummaryResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -723,9 +722,9 @@ def get_budgets_with_http_info( @validate_call - def get_budgets_without_preload_content( + def get_plans_without_preload_content( self, - include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of budget accounts")] = None, + include_accounts: Annotated[Optional[StrictBool], Field(description="Whether to include the list of plan accounts")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -739,11 +738,11 @@ def get_budgets_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List budgets + """Get all plans - Returns budgets list with summary information + Returns plans list with summary information - :param include_accounts: Whether to include the list of budget accounts + :param include_accounts: Whether to include the list of plan accounts :type include_accounts: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -767,7 +766,7 @@ def get_budgets_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_budgets_serialize( + _param = self._get_plans_serialize( include_accounts=include_accounts, _request_auth=_request_auth, _content_type=_content_type, @@ -776,7 +775,7 @@ def get_budgets_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BudgetSummaryResponse", + '200': "PlanSummaryResponse", '404': "ErrorResponse", } response_data = self.api_client.call_api( @@ -786,7 +785,7 @@ def get_budgets_without_preload_content( return response_data.response - def _get_budgets_serialize( + def _get_plans_serialize( self, include_accounts, _request_auth, diff --git a/ynab/api/scheduled_transactions_api.py b/ynab/api/scheduled_transactions_api.py index 6c4ad52..18df43a 100644 --- a/ynab/api/scheduled_transactions_api.py +++ b/ynab/api/scheduled_transactions_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -45,7 +44,7 @@ def __init__(self, api_client=None) -> None: @validate_call def create_scheduled_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostScheduledTransactionWrapper, Field(description="The scheduled transaction to create")], _request_timeout: Union[ None, @@ -60,12 +59,12 @@ def create_scheduled_transaction( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ScheduledTransactionResponse: - """Create a single scheduled transaction + """Create a scheduled transaction Creates a single scheduled transaction (a transaction with a future date). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: The scheduled transaction to create (required) :type data: PostScheduledTransactionWrapper :param _request_timeout: timeout setting for this request. If one @@ -91,7 +90,7 @@ def create_scheduled_transaction( """ # noqa: E501 _param = self._create_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -117,7 +116,7 @@ def create_scheduled_transaction( @validate_call def create_scheduled_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostScheduledTransactionWrapper, Field(description="The scheduled transaction to create")], _request_timeout: Union[ None, @@ -132,12 +131,12 @@ def create_scheduled_transaction_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ScheduledTransactionResponse]: - """Create a single scheduled transaction + """Create a scheduled transaction Creates a single scheduled transaction (a transaction with a future date). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: The scheduled transaction to create (required) :type data: PostScheduledTransactionWrapper :param _request_timeout: timeout setting for this request. If one @@ -163,7 +162,7 @@ def create_scheduled_transaction_with_http_info( """ # noqa: E501 _param = self._create_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -189,7 +188,7 @@ def create_scheduled_transaction_with_http_info( @validate_call def create_scheduled_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostScheduledTransactionWrapper, Field(description="The scheduled transaction to create")], _request_timeout: Union[ None, @@ -204,12 +203,12 @@ def create_scheduled_transaction_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a single scheduled transaction + """Create a scheduled transaction Creates a single scheduled transaction (a transaction with a future date). - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: The scheduled transaction to create (required) :type data: PostScheduledTransactionWrapper :param _request_timeout: timeout setting for this request. If one @@ -235,7 +234,7 @@ def create_scheduled_transaction_without_preload_content( """ # noqa: E501 _param = self._create_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -256,7 +255,7 @@ def create_scheduled_transaction_without_preload_content( def _create_scheduled_transaction_serialize( self, - budget_id, + plan_id, data, _request_auth, _content_type, @@ -279,8 +278,8 @@ def _create_scheduled_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -318,7 +317,7 @@ def _create_scheduled_transaction_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/budgets/{budget_id}/scheduled_transactions', + resource_path='/budgets/{plan_id}/scheduled_transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -337,7 +336,7 @@ def _create_scheduled_transaction_serialize( @validate_call def delete_scheduled_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -352,12 +351,12 @@ def delete_scheduled_transaction( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ScheduledTransactionResponse: - """Deletes an existing scheduled transaction + """Delete a scheduled transaction Deletes a scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -383,7 +382,7 @@ def delete_scheduled_transaction( """ # noqa: E501 _param = self._delete_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -409,7 +408,7 @@ def delete_scheduled_transaction( @validate_call def delete_scheduled_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -424,12 +423,12 @@ def delete_scheduled_transaction_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ScheduledTransactionResponse]: - """Deletes an existing scheduled transaction + """Delete a scheduled transaction Deletes a scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -455,7 +454,7 @@ def delete_scheduled_transaction_with_http_info( """ # noqa: E501 _param = self._delete_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -481,7 +480,7 @@ def delete_scheduled_transaction_with_http_info( @validate_call def delete_scheduled_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -496,12 +495,12 @@ def delete_scheduled_transaction_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Deletes an existing scheduled transaction + """Delete a scheduled transaction Deletes a scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -527,7 +526,7 @@ def delete_scheduled_transaction_without_preload_content( """ # noqa: E501 _param = self._delete_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -548,7 +547,7 @@ def delete_scheduled_transaction_without_preload_content( def _delete_scheduled_transaction_serialize( self, - budget_id, + plan_id, scheduled_transaction_id, _request_auth, _content_type, @@ -571,8 +570,8 @@ def _delete_scheduled_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if scheduled_transaction_id is not None: _path_params['scheduled_transaction_id'] = scheduled_transaction_id # process the query parameters @@ -597,7 +596,7 @@ def _delete_scheduled_transaction_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}', + resource_path='/budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -616,7 +615,7 @@ def _delete_scheduled_transaction_serialize( @validate_call def get_scheduled_transaction_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -631,12 +630,12 @@ def get_scheduled_transaction_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ScheduledTransactionResponse: - """Single scheduled transaction + """Get a scheduled transaction Returns a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -662,7 +661,7 @@ def get_scheduled_transaction_by_id( """ # noqa: E501 _param = self._get_scheduled_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -688,7 +687,7 @@ def get_scheduled_transaction_by_id( @validate_call def get_scheduled_transaction_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -703,12 +702,12 @@ def get_scheduled_transaction_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ScheduledTransactionResponse]: - """Single scheduled transaction + """Get a scheduled transaction Returns a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -734,7 +733,7 @@ def get_scheduled_transaction_by_id_with_http_info( """ # noqa: E501 _param = self._get_scheduled_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -760,7 +759,7 @@ def get_scheduled_transaction_by_id_with_http_info( @validate_call def get_scheduled_transaction_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], _request_timeout: Union[ None, @@ -775,12 +774,12 @@ def get_scheduled_transaction_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single scheduled transaction + """Get a scheduled transaction Returns a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -806,7 +805,7 @@ def get_scheduled_transaction_by_id_without_preload_content( """ # noqa: E501 _param = self._get_scheduled_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -827,7 +826,7 @@ def get_scheduled_transaction_by_id_without_preload_content( def _get_scheduled_transaction_by_id_serialize( self, - budget_id, + plan_id, scheduled_transaction_id, _request_auth, _content_type, @@ -850,8 +849,8 @@ def _get_scheduled_transaction_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if scheduled_transaction_id is not None: _path_params['scheduled_transaction_id'] = scheduled_transaction_id # process the query parameters @@ -876,7 +875,7 @@ def _get_scheduled_transaction_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}', + resource_path='/budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -895,7 +894,7 @@ def _get_scheduled_transaction_by_id_serialize( @validate_call def get_scheduled_transactions( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -910,12 +909,12 @@ def get_scheduled_transactions( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ScheduledTransactionsResponse: - """List scheduled transactions + """Get all scheduled transactions Returns all scheduled transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -941,7 +940,7 @@ def get_scheduled_transactions( """ # noqa: E501 _param = self._get_scheduled_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -967,7 +966,7 @@ def get_scheduled_transactions( @validate_call def get_scheduled_transactions_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -982,12 +981,12 @@ def get_scheduled_transactions_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ScheduledTransactionsResponse]: - """List scheduled transactions + """Get all scheduled transactions Returns all scheduled transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -1013,7 +1012,7 @@ def get_scheduled_transactions_with_http_info( """ # noqa: E501 _param = self._get_scheduled_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -1039,7 +1038,7 @@ def get_scheduled_transactions_with_http_info( @validate_call def get_scheduled_transactions_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, _request_timeout: Union[ None, @@ -1054,12 +1053,12 @@ def get_scheduled_transactions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List scheduled transactions + """Get all scheduled transactions Returns all scheduled transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :type last_knowledge_of_server: int :param _request_timeout: timeout setting for this request. If one @@ -1085,7 +1084,7 @@ def get_scheduled_transactions_without_preload_content( """ # noqa: E501 _param = self._get_scheduled_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, last_knowledge_of_server=last_knowledge_of_server, _request_auth=_request_auth, _content_type=_content_type, @@ -1106,7 +1105,7 @@ def get_scheduled_transactions_without_preload_content( def _get_scheduled_transactions_serialize( self, - budget_id, + plan_id, last_knowledge_of_server, _request_auth, _content_type, @@ -1129,8 +1128,8 @@ def _get_scheduled_transactions_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if last_knowledge_of_server is not None: @@ -1157,7 +1156,7 @@ def _get_scheduled_transactions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/scheduled_transactions', + resource_path='/budgets/{plan_id}/scheduled_transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1176,7 +1175,7 @@ def _get_scheduled_transactions_serialize( @validate_call def update_scheduled_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], put_scheduled_transaction_wrapper: Annotated[PutScheduledTransactionWrapper, Field(description="The scheduled transaction to update")], _request_timeout: Union[ @@ -1192,12 +1191,12 @@ def update_scheduled_transaction( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ScheduledTransactionResponse: - """Updates an existing scheduled transaction + """Update a scheduled transaction Updates a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param put_scheduled_transaction_wrapper: The scheduled transaction to update (required) @@ -1225,7 +1224,7 @@ def update_scheduled_transaction( """ # noqa: E501 _param = self._update_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, put_scheduled_transaction_wrapper=put_scheduled_transaction_wrapper, _request_auth=_request_auth, @@ -1252,7 +1251,7 @@ def update_scheduled_transaction( @validate_call def update_scheduled_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], put_scheduled_transaction_wrapper: Annotated[PutScheduledTransactionWrapper, Field(description="The scheduled transaction to update")], _request_timeout: Union[ @@ -1268,12 +1267,12 @@ def update_scheduled_transaction_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ScheduledTransactionResponse]: - """Updates an existing scheduled transaction + """Update a scheduled transaction Updates a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param put_scheduled_transaction_wrapper: The scheduled transaction to update (required) @@ -1301,7 +1300,7 @@ def update_scheduled_transaction_with_http_info( """ # noqa: E501 _param = self._update_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, put_scheduled_transaction_wrapper=put_scheduled_transaction_wrapper, _request_auth=_request_auth, @@ -1328,7 +1327,7 @@ def update_scheduled_transaction_with_http_info( @validate_call def update_scheduled_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], scheduled_transaction_id: Annotated[StrictStr, Field(description="The id of the scheduled transaction")], put_scheduled_transaction_wrapper: Annotated[PutScheduledTransactionWrapper, Field(description="The scheduled transaction to update")], _request_timeout: Union[ @@ -1344,12 +1343,12 @@ def update_scheduled_transaction_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Updates an existing scheduled transaction + """Update a scheduled transaction Updates a single scheduled transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param scheduled_transaction_id: The id of the scheduled transaction (required) :type scheduled_transaction_id: str :param put_scheduled_transaction_wrapper: The scheduled transaction to update (required) @@ -1377,7 +1376,7 @@ def update_scheduled_transaction_without_preload_content( """ # noqa: E501 _param = self._update_scheduled_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, scheduled_transaction_id=scheduled_transaction_id, put_scheduled_transaction_wrapper=put_scheduled_transaction_wrapper, _request_auth=_request_auth, @@ -1399,7 +1398,7 @@ def update_scheduled_transaction_without_preload_content( def _update_scheduled_transaction_serialize( self, - budget_id, + plan_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, _request_auth, @@ -1423,8 +1422,8 @@ def _update_scheduled_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if scheduled_transaction_id is not None: _path_params['scheduled_transaction_id'] = scheduled_transaction_id # process the query parameters @@ -1464,7 +1463,7 @@ def _update_scheduled_transaction_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}', + resource_path='/budgets/{plan_id}/scheduled_transactions/{scheduled_transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/transactions_api.py b/ynab/api/transactions_api.py index ab6f6ef..e292788 100644 --- a/ynab/api/transactions_api.py +++ b/ynab/api/transactions_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -50,7 +49,7 @@ def __init__(self, api_client=None) -> None: @validate_call def create_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostTransactionsWrapper, Field(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.")], _request_timeout: Union[ None, @@ -69,8 +68,8 @@ def create_transaction( 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 (transactions with a future date) cannot be created on this endpoint. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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) :type data: PostTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -96,7 +95,7 @@ def create_transaction( """ # noqa: E501 _param = self._create_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -123,7 +122,7 @@ def create_transaction( @validate_call def create_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostTransactionsWrapper, Field(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.")], _request_timeout: Union[ None, @@ -142,8 +141,8 @@ def create_transaction_with_http_info( 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 (transactions with a future date) cannot be created on this endpoint. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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) :type data: PostTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -169,7 +168,7 @@ def create_transaction_with_http_info( """ # noqa: E501 _param = self._create_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -196,7 +195,7 @@ def create_transaction_with_http_info( @validate_call def create_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PostTransactionsWrapper, Field(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.")], _request_timeout: Union[ None, @@ -215,8 +214,8 @@ def create_transaction_without_preload_content( 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 (transactions with a future date) cannot be created on this endpoint. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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) :type data: PostTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -242,7 +241,7 @@ def create_transaction_without_preload_content( """ # noqa: E501 _param = self._create_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -264,7 +263,7 @@ def create_transaction_without_preload_content( def _create_transaction_serialize( self, - budget_id, + plan_id, data, _request_auth, _content_type, @@ -287,8 +286,8 @@ def _create_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -326,7 +325,7 @@ def _create_transaction_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/budgets/{budget_id}/transactions', + resource_path='/budgets/{plan_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -345,7 +344,7 @@ def _create_transaction_serialize( @validate_call def delete_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -360,12 +359,12 @@ def delete_transaction( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionResponse: - """Deletes an existing transaction + """Delete a transaction Deletes a transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -391,7 +390,7 @@ def delete_transaction( """ # noqa: E501 _param = self._delete_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -417,7 +416,7 @@ def delete_transaction( @validate_call def delete_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -432,12 +431,12 @@ def delete_transaction_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionResponse]: - """Deletes an existing transaction + """Delete a transaction Deletes a transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -463,7 +462,7 @@ def delete_transaction_with_http_info( """ # noqa: E501 _param = self._delete_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -489,7 +488,7 @@ def delete_transaction_with_http_info( @validate_call def delete_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -504,12 +503,12 @@ def delete_transaction_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Deletes an existing transaction + """Delete a transaction Deletes a transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -535,7 +534,7 @@ def delete_transaction_without_preload_content( """ # noqa: E501 _param = self._delete_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -556,7 +555,7 @@ def delete_transaction_without_preload_content( def _delete_transaction_serialize( self, - budget_id, + plan_id, transaction_id, _request_auth, _content_type, @@ -579,8 +578,8 @@ def _delete_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if transaction_id is not None: _path_params['transaction_id'] = transaction_id # process the query parameters @@ -605,7 +604,7 @@ def _delete_transaction_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/budgets/{budget_id}/transactions/{transaction_id}', + resource_path='/budgets/{plan_id}/transactions/{transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -624,7 +623,7 @@ def _delete_transaction_serialize( @validate_call def get_transaction_by_id( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -639,12 +638,12 @@ def get_transaction_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionResponse: - """Single transaction + """Get a transaction Returns a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -670,7 +669,7 @@ def get_transaction_by_id( """ # noqa: E501 _param = self._get_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -696,7 +695,7 @@ def get_transaction_by_id( @validate_call def get_transaction_by_id_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -711,12 +710,12 @@ def get_transaction_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionResponse]: - """Single transaction + """Get a transaction Returns a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -742,7 +741,7 @@ def get_transaction_by_id_with_http_info( """ # noqa: E501 _param = self._get_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -768,7 +767,7 @@ def get_transaction_by_id_with_http_info( @validate_call def get_transaction_by_id_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], _request_timeout: Union[ None, @@ -783,12 +782,12 @@ def get_transaction_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Single transaction + """Get a transaction Returns a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param _request_timeout: timeout setting for this request. If one @@ -814,7 +813,7 @@ def get_transaction_by_id_without_preload_content( """ # noqa: E501 _param = self._get_transaction_by_id_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, _request_auth=_request_auth, _content_type=_content_type, @@ -835,7 +834,7 @@ def get_transaction_by_id_without_preload_content( def _get_transaction_by_id_serialize( self, - budget_id, + plan_id, transaction_id, _request_auth, _content_type, @@ -858,8 +857,8 @@ def _get_transaction_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if transaction_id is not None: _path_params['transaction_id'] = transaction_id # process the query parameters @@ -884,7 +883,7 @@ def _get_transaction_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/transactions/{transaction_id}', + resource_path='/budgets/{plan_id}/transactions/{transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -903,7 +902,7 @@ def _get_transaction_by_id_serialize( @validate_call def get_transactions( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -920,12 +919,12 @@ def get_transactions( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionsResponse: - """List transactions + """Get all transactions - Returns budget transactions, excluding any pending transactions + Returns plan transactions, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param 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). :type since_date: date :param type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. @@ -955,7 +954,7 @@ def get_transactions( """ # noqa: E501 _param = self._get_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server, @@ -984,7 +983,7 @@ def get_transactions( @validate_call def get_transactions_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -1001,12 +1000,12 @@ def get_transactions_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionsResponse]: - """List transactions + """Get all transactions - Returns budget transactions, excluding any pending transactions + Returns plan transactions, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param 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). :type since_date: date :param type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. @@ -1036,7 +1035,7 @@ def get_transactions_with_http_info( """ # noqa: E501 _param = self._get_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server, @@ -1065,7 +1064,7 @@ def get_transactions_with_http_info( @validate_call def get_transactions_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -1082,12 +1081,12 @@ def get_transactions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List transactions + """Get all transactions - Returns budget transactions, excluding any pending transactions + Returns plan transactions, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param 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). :type since_date: date :param type: If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported. @@ -1117,7 +1116,7 @@ def get_transactions_without_preload_content( """ # noqa: E501 _param = self._get_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, since_date=since_date, type=type, last_knowledge_of_server=last_knowledge_of_server, @@ -1141,7 +1140,7 @@ def get_transactions_without_preload_content( def _get_transactions_serialize( self, - budget_id, + plan_id, since_date, type, last_knowledge_of_server, @@ -1166,8 +1165,8 @@ def _get_transactions_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters if since_date is not None: if isinstance(since_date, date): @@ -1211,7 +1210,7 @@ def _get_transactions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/transactions', + resource_path='/budgets/{plan_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1230,7 +1229,7 @@ def _get_transactions_serialize( @validate_call def get_transactions_by_account( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], account_id: Annotated[StrictStr, Field(description="The id of the account")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1248,12 +1247,12 @@ def get_transactions_by_account( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionsResponse: - """List account transactions + """Get all account transactions Returns all transactions for a specified account, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) :type account_id: str :param 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). @@ -1285,7 +1284,7 @@ def get_transactions_by_account( """ # noqa: E501 _param = self._get_transactions_by_account_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, since_date=since_date, type=type, @@ -1314,7 +1313,7 @@ def get_transactions_by_account( @validate_call def get_transactions_by_account_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], account_id: Annotated[StrictStr, Field(description="The id of the account")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1332,12 +1331,12 @@ def get_transactions_by_account_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionsResponse]: - """List account transactions + """Get all account transactions Returns all transactions for a specified account, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) :type account_id: str :param 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). @@ -1369,7 +1368,7 @@ def get_transactions_by_account_with_http_info( """ # noqa: E501 _param = self._get_transactions_by_account_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, since_date=since_date, type=type, @@ -1398,7 +1397,7 @@ def get_transactions_by_account_with_http_info( @validate_call def get_transactions_by_account_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], account_id: Annotated[StrictStr, Field(description="The id of the account")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1416,12 +1415,12 @@ def get_transactions_by_account_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List account transactions + """Get all account transactions Returns all transactions for a specified account, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param account_id: The id of the account (required) :type account_id: str :param 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). @@ -1453,7 +1452,7 @@ def get_transactions_by_account_without_preload_content( """ # noqa: E501 _param = self._get_transactions_by_account_serialize( - budget_id=budget_id, + plan_id=plan_id, account_id=account_id, since_date=since_date, type=type, @@ -1477,7 +1476,7 @@ def get_transactions_by_account_without_preload_content( def _get_transactions_by_account_serialize( self, - budget_id, + plan_id, account_id, since_date, type, @@ -1503,8 +1502,8 @@ def _get_transactions_by_account_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if account_id is not None: _path_params['account_id'] = account_id # process the query parameters @@ -1550,7 +1549,7 @@ def _get_transactions_by_account_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/accounts/{account_id}/transactions', + resource_path='/budgets/{plan_id}/accounts/{account_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1569,7 +1568,7 @@ def _get_transactions_by_account_serialize( @validate_call def get_transactions_by_category( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1587,12 +1586,12 @@ def get_transactions_by_category( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> HybridTransactionsResponse: - """List category transactions, excluding any pending transactions + """Get all category transactions - Returns all transactions for a specified category + Returns all transactions for a specified category, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param 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). @@ -1624,7 +1623,7 @@ def get_transactions_by_category( """ # noqa: E501 _param = self._get_transactions_by_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, since_date=since_date, type=type, @@ -1653,7 +1652,7 @@ def get_transactions_by_category( @validate_call def get_transactions_by_category_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1671,12 +1670,12 @@ def get_transactions_by_category_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[HybridTransactionsResponse]: - """List category transactions, excluding any pending transactions + """Get all category transactions - Returns all transactions for a specified category + Returns all transactions for a specified category, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param 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). @@ -1708,7 +1707,7 @@ def get_transactions_by_category_with_http_info( """ # noqa: E501 _param = self._get_transactions_by_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, since_date=since_date, type=type, @@ -1737,7 +1736,7 @@ def get_transactions_by_category_with_http_info( @validate_call def get_transactions_by_category_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], category_id: Annotated[StrictStr, Field(description="The id of the category")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -1755,12 +1754,12 @@ def get_transactions_by_category_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List category transactions, excluding any pending transactions + """Get all category transactions - Returns all transactions for a specified category + Returns all transactions for a specified category, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param category_id: The id of the category (required) :type category_id: str :param 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). @@ -1792,7 +1791,7 @@ def get_transactions_by_category_without_preload_content( """ # noqa: E501 _param = self._get_transactions_by_category_serialize( - budget_id=budget_id, + plan_id=plan_id, category_id=category_id, since_date=since_date, type=type, @@ -1816,7 +1815,7 @@ def get_transactions_by_category_without_preload_content( def _get_transactions_by_category_serialize( self, - budget_id, + plan_id, category_id, since_date, type, @@ -1842,8 +1841,8 @@ def _get_transactions_by_category_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if category_id is not None: _path_params['category_id'] = category_id # process the query parameters @@ -1889,7 +1888,7 @@ def _get_transactions_by_category_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/categories/{category_id}/transactions', + resource_path='/budgets/{plan_id}/categories/{category_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1908,8 +1907,8 @@ def _get_transactions_by_category_serialize( @validate_call def get_transactions_by_month( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[StrictStr, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[StrictStr, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -1926,13 +1925,13 @@ def get_transactions_by_month( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionsResponse: - """List transactions in month, excluding any pending transactions + """Get all plan month transactions - Returns all transactions for a specified month + Returns all transactions for a specified month, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: str :param 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). :type since_date: date @@ -1963,7 +1962,7 @@ def get_transactions_by_month( """ # noqa: E501 _param = self._get_transactions_by_month_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, since_date=since_date, type=type, @@ -1992,8 +1991,8 @@ def get_transactions_by_month( @validate_call def get_transactions_by_month_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[StrictStr, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[StrictStr, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -2010,13 +2009,13 @@ def get_transactions_by_month_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionsResponse]: - """List transactions in month, excluding any pending transactions + """Get all plan month transactions - Returns all transactions for a specified month + Returns all transactions for a specified month, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: str :param 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). :type since_date: date @@ -2047,7 +2046,7 @@ def get_transactions_by_month_with_http_info( """ # noqa: E501 _param = self._get_transactions_by_month_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, since_date=since_date, type=type, @@ -2076,8 +2075,8 @@ def get_transactions_by_month_with_http_info( @validate_call def get_transactions_by_month_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], - month: Annotated[StrictStr, Field(description="The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], + month: Annotated[StrictStr, Field(description="The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, last_knowledge_of_server: Annotated[Optional[StrictInt], Field(description="The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.")] = None, @@ -2094,13 +2093,13 @@ def get_transactions_by_month_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List transactions in month, excluding any pending transactions + """Get all plan month transactions - Returns all transactions for a specified month + Returns all transactions for a specified month, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str - :param 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 plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str + :param month: The plan month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :type month: str :param 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). :type since_date: date @@ -2131,7 +2130,7 @@ def get_transactions_by_month_without_preload_content( """ # noqa: E501 _param = self._get_transactions_by_month_serialize( - budget_id=budget_id, + plan_id=plan_id, month=month, since_date=since_date, type=type, @@ -2155,7 +2154,7 @@ def get_transactions_by_month_without_preload_content( def _get_transactions_by_month_serialize( self, - budget_id, + plan_id, month, since_date, type, @@ -2181,8 +2180,8 @@ def _get_transactions_by_month_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if month is not None: _path_params['month'] = month # process the query parameters @@ -2228,7 +2227,7 @@ def _get_transactions_by_month_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/months/{month}/transactions', + resource_path='/budgets/{plan_id}/months/{month}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2247,7 +2246,7 @@ def _get_transactions_by_month_serialize( @validate_call def get_transactions_by_payee( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -2265,12 +2264,12 @@ def get_transactions_by_payee( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> HybridTransactionsResponse: - """List payee transactions, excluding any pending transactions + """Get all payee transactions - Returns all transactions for a specified payee + Returns all transactions for a specified payee, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param 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). @@ -2302,7 +2301,7 @@ def get_transactions_by_payee( """ # noqa: E501 _param = self._get_transactions_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, since_date=since_date, type=type, @@ -2331,7 +2330,7 @@ def get_transactions_by_payee( @validate_call def get_transactions_by_payee_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -2349,12 +2348,12 @@ def get_transactions_by_payee_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[HybridTransactionsResponse]: - """List payee transactions, excluding any pending transactions + """Get all payee transactions - Returns all transactions for a specified payee + Returns all transactions for a specified payee, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param 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). @@ -2386,7 +2385,7 @@ def get_transactions_by_payee_with_http_info( """ # noqa: E501 _param = self._get_transactions_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, since_date=since_date, type=type, @@ -2415,7 +2414,7 @@ def get_transactions_by_payee_with_http_info( @validate_call def get_transactions_by_payee_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], payee_id: Annotated[StrictStr, Field(description="The id of the payee")], since_date: Annotated[Optional[date], Field(description="If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).")] = None, type: Annotated[Optional[StrictStr], Field(description="If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.")] = None, @@ -2433,12 +2432,12 @@ def get_transactions_by_payee_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List payee transactions, excluding any pending transactions + """Get all payee transactions - Returns all transactions for a specified payee + Returns all transactions for a specified payee, excluding any pending transactions - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param payee_id: The id of the payee (required) :type payee_id: str :param 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). @@ -2470,7 +2469,7 @@ def get_transactions_by_payee_without_preload_content( """ # noqa: E501 _param = self._get_transactions_by_payee_serialize( - budget_id=budget_id, + plan_id=plan_id, payee_id=payee_id, since_date=since_date, type=type, @@ -2494,7 +2493,7 @@ def get_transactions_by_payee_without_preload_content( def _get_transactions_by_payee_serialize( self, - budget_id, + plan_id, payee_id, since_date, type, @@ -2520,8 +2519,8 @@ def _get_transactions_by_payee_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if payee_id is not None: _path_params['payee_id'] = payee_id # process the query parameters @@ -2567,7 +2566,7 @@ def _get_transactions_by_payee_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/budgets/{budget_id}/payees/{payee_id}/transactions', + resource_path='/budgets/{plan_id}/payees/{payee_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2586,7 +2585,7 @@ def _get_transactions_by_payee_serialize( @validate_call def import_transactions( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2602,10 +2601,10 @@ def import_transactions( ) -> TransactionsImportResponse: """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. + Imports available transactions on all linked accounts for the given plan. 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. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2629,7 +2628,7 @@ def import_transactions( """ # noqa: E501 _param = self._import_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2655,7 +2654,7 @@ def import_transactions( @validate_call def import_transactions_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2671,10 +2670,10 @@ def import_transactions_with_http_info( ) -> ApiResponse[TransactionsImportResponse]: """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. + Imports available transactions on all linked accounts for the given plan. 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. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2698,7 +2697,7 @@ def import_transactions_with_http_info( """ # noqa: E501 _param = self._import_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2724,7 +2723,7 @@ def import_transactions_with_http_info( @validate_call def import_transactions_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2740,10 +2739,10 @@ def import_transactions_without_preload_content( ) -> RESTResponseType: """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. + Imports available transactions on all linked accounts for the given plan. 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. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2767,7 +2766,7 @@ def import_transactions_without_preload_content( """ # noqa: E501 _param = self._import_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2788,7 +2787,7 @@ def import_transactions_without_preload_content( def _import_transactions_serialize( self, - budget_id, + plan_id, _request_auth, _content_type, _headers, @@ -2810,8 +2809,8 @@ def _import_transactions_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -2834,7 +2833,7 @@ def _import_transactions_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/budgets/{budget_id}/transactions/import', + resource_path='/budgets/{plan_id}/transactions/import', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2853,7 +2852,7 @@ def _import_transactions_serialize( @validate_call def update_transaction( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], data: Annotated[PutTransactionWrapper, Field(description="The transaction to update")], _request_timeout: Union[ @@ -2869,12 +2868,12 @@ def update_transaction( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TransactionResponse: - """Updates an existing transaction + """Update a transaction Updates a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param data: The transaction to update (required) @@ -2902,7 +2901,7 @@ def update_transaction( """ # noqa: E501 _param = self._update_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, data=data, _request_auth=_request_auth, @@ -2929,7 +2928,7 @@ def update_transaction( @validate_call def update_transaction_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], data: Annotated[PutTransactionWrapper, Field(description="The transaction to update")], _request_timeout: Union[ @@ -2945,12 +2944,12 @@ def update_transaction_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[TransactionResponse]: - """Updates an existing transaction + """Update a transaction Updates a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param data: The transaction to update (required) @@ -2978,7 +2977,7 @@ def update_transaction_with_http_info( """ # noqa: E501 _param = self._update_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, data=data, _request_auth=_request_auth, @@ -3005,7 +3004,7 @@ def update_transaction_with_http_info( @validate_call def update_transaction_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], transaction_id: Annotated[StrictStr, Field(description="The id of the transaction")], data: Annotated[PutTransactionWrapper, Field(description="The transaction to update")], _request_timeout: Union[ @@ -3021,12 +3020,12 @@ def update_transaction_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Updates an existing transaction + """Update a transaction Updates a single transaction - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param transaction_id: The id of the transaction (required) :type transaction_id: str :param data: The transaction to update (required) @@ -3054,7 +3053,7 @@ def update_transaction_without_preload_content( """ # noqa: E501 _param = self._update_transaction_serialize( - budget_id=budget_id, + plan_id=plan_id, transaction_id=transaction_id, data=data, _request_auth=_request_auth, @@ -3076,7 +3075,7 @@ def update_transaction_without_preload_content( def _update_transaction_serialize( self, - budget_id, + plan_id, transaction_id, data, _request_auth, @@ -3100,8 +3099,8 @@ def _update_transaction_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id if transaction_id is not None: _path_params['transaction_id'] = transaction_id # process the query parameters @@ -3141,7 +3140,7 @@ def _update_transaction_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/budgets/{budget_id}/transactions/{transaction_id}', + resource_path='/budgets/{plan_id}/transactions/{transaction_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3160,7 +3159,7 @@ def _update_transaction_serialize( @validate_call def update_transactions( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PatchTransactionsWrapper, Field(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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction.")], _request_timeout: Union[ None, @@ -3179,8 +3178,8 @@ def update_transactions( Updates multiple transactions, by `id` or `import_id`. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. (required) :type data: PatchTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -3206,7 +3205,7 @@ def update_transactions( """ # noqa: E501 _param = self._update_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -3232,7 +3231,7 @@ def update_transactions( @validate_call def update_transactions_with_http_info( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PatchTransactionsWrapper, Field(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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction.")], _request_timeout: Union[ None, @@ -3251,8 +3250,8 @@ def update_transactions_with_http_info( Updates multiple transactions, by `id` or `import_id`. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. (required) :type data: PatchTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -3278,7 +3277,7 @@ def update_transactions_with_http_info( """ # noqa: E501 _param = self._update_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -3304,7 +3303,7 @@ def update_transactions_with_http_info( @validate_call def update_transactions_without_preload_content( self, - budget_id: Annotated[StrictStr, Field(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.ynab.com/#oauth-default-budget).")], + plan_id: Annotated[StrictStr, Field(description="The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).")], data: Annotated[PatchTransactionsWrapper, Field(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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction.")], _request_timeout: Union[ None, @@ -3323,8 +3322,8 @@ def update_transactions_without_preload_content( Updates multiple transactions, by `id` or `import_id`. - :param 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.ynab.com/#oauth-default-budget). (required) - :type budget_id: str + :param plan_id: The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). (required) + :type plan_id: str :param data: 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 its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction. (required) :type data: PatchTransactionsWrapper :param _request_timeout: timeout setting for this request. If one @@ -3350,7 +3349,7 @@ def update_transactions_without_preload_content( """ # noqa: E501 _param = self._update_transactions_serialize( - budget_id=budget_id, + plan_id=plan_id, data=data, _request_auth=_request_auth, _content_type=_content_type, @@ -3371,7 +3370,7 @@ def update_transactions_without_preload_content( def _update_transactions_serialize( self, - budget_id, + plan_id, data, _request_auth, _content_type, @@ -3394,8 +3393,8 @@ def _update_transactions_serialize( _body_params: Optional[bytes] = None # process the path parameters - if budget_id is not None: - _path_params['budget_id'] = budget_id + if plan_id is not None: + _path_params['plan_id'] = plan_id # process the query parameters # process the header parameters # process the form parameters @@ -3433,7 +3432,7 @@ def _update_transactions_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/budgets/{budget_id}/transactions', + resource_path='/budgets/{plan_id}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/ynab/api/user_api.py b/ynab/api/user_api.py index 3540464..23a72d2 100644 --- a/ynab/api/user_api.py +++ b/ynab/api/user_api.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -52,7 +51,7 @@ def get_user( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserResponse: - """User info + """Get user Returns authenticated user information @@ -115,7 +114,7 @@ def get_user_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[UserResponse]: - """User info + """Get user Returns authenticated user information @@ -178,7 +177,7 @@ def get_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """User info + """Get user Returns authenticated user information diff --git a/ynab/api_client.py b/ynab/api_client.py index 877f7a1..cd2f58b 100644 --- a/ynab/api_client.py +++ b/ynab/api_client.py @@ -1,17 +1,16 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import datetime from dateutil.parser import parse from enum import Enum @@ -21,6 +20,7 @@ import os import re import tempfile +import uuid from urllib.parse import quote from typing import Tuple, Optional, List, Dict, Union @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.7.0/python' + self.user_agent = 'OpenAPI-Generator/2.0.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -311,7 +311,7 @@ def response_deserialize( return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader('content-type') + content_type = response_data.headers.get('content-type') if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" @@ -328,7 +328,7 @@ def response_deserialize( return ApiResponse( status_code = response_data.status, data = return_data, - headers = response_data.getheaders(), + headers = response_data.headers, raw_data = response_data.data ) @@ -356,6 +356,8 @@ def sanitize_for_serialization(self, obj): return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): return [ self.sanitize_for_serialization(sub_obj) for sub_obj in obj @@ -408,7 +410,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): if response_text == "": data = "" else: @@ -457,13 +459,13 @@ def __deserialize(self, data, klass): if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass == object: + elif klass is object: return self.__deserialize_object(data) - elif klass == datetime.date: + elif klass is datetime.date: return self.__deserialize_date(data) - elif klass == datetime.datetime: + elif klass is datetime.datetime: return self.__deserialize_datetime(data) - elif klass == decimal.Decimal: + elif klass is decimal.Decimal: return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) @@ -698,14 +700,16 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") + content_disposition = response.headers.get("Content-Disposition") if content_disposition: m = re.search( r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition ) assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/ynab/configuration.py b/ynab/configuration.py index b3c559e..f24eda1 100644 --- a/ynab/configuration.py +++ b/ynab/configuration.py @@ -5,13 +5,12 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 - import copy import http.client as httplib import logging @@ -505,8 +504,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.76.0\n"\ - "SDK Package Version: 1.7.0".\ + "Version of the API: 1.81.0\n"\ + "SDK Package Version: 2.0.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/ynab/exceptions.py b/ynab/exceptions.py index c499542..c633645 100644 --- a/ynab/exceptions.py +++ b/ynab/exceptions.py @@ -1,16 +1,15 @@ -# 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.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + from typing import Any, Optional from typing_extensions import Self @@ -128,7 +127,7 @@ def __init__( self.body = http_resp.data.decode('utf-8') except Exception: pass - self.headers = http_resp.getheaders() + self.headers = http_resp.headers @classmethod def from_response( @@ -169,8 +168,11 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) return error_message diff --git a/ynab/models/__init__.py b/ynab/models/__init__.py index 909496a..7922dc0 100644 --- a/ynab/models/__init__.py +++ b/ynab/models/__init__.py @@ -6,13 +6,12 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 - # import models into model package from ynab.models.account import Account from ynab.models.account_response import AccountResponse @@ -20,15 +19,6 @@ from ynab.models.account_type import AccountType 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 @@ -44,17 +34,26 @@ from ynab.models.date_format import DateFormat from ynab.models.error_detail import ErrorDetail from ynab.models.error_response import ErrorResponse +from ynab.models.existing_category import ExistingCategory from ynab.models.existing_transaction import ExistingTransaction 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.money_movement import MoneyMovement +from ynab.models.money_movement_group import MoneyMovementGroup +from ynab.models.money_movement_groups_response import MoneyMovementGroupsResponse +from ynab.models.money_movement_groups_response_data import MoneyMovementGroupsResponseData +from ynab.models.money_movements_response import MoneyMovementsResponse +from ynab.models.money_movements_response_data import MoneyMovementsResponseData 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.new_category import NewCategory from ynab.models.new_transaction import NewTransaction +from ynab.models.patch_category_group_wrapper import PatchCategoryGroupWrapper from ynab.models.patch_category_wrapper import PatchCategoryWrapper from ynab.models.patch_month_category_wrapper import PatchMonthCategoryWrapper from ynab.models.patch_payee_wrapper import PatchPayeeWrapper @@ -69,13 +68,27 @@ 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.plan_detail import PlanDetail +from ynab.models.plan_detail_response import PlanDetailResponse +from ynab.models.plan_detail_response_data import PlanDetailResponseData +from ynab.models.plan_settings import PlanSettings +from ynab.models.plan_settings_response import PlanSettingsResponse +from ynab.models.plan_settings_response_data import PlanSettingsResponseData +from ynab.models.plan_summary import PlanSummary +from ynab.models.plan_summary_response import PlanSummaryResponse +from ynab.models.plan_summary_response_data import PlanSummaryResponseData from ynab.models.post_account_wrapper import PostAccountWrapper +from ynab.models.post_category_group_wrapper import PostCategoryGroupWrapper +from ynab.models.post_category_wrapper import PostCategoryWrapper from ynab.models.post_scheduled_transaction_wrapper import PostScheduledTransactionWrapper from ynab.models.post_transactions_wrapper import PostTransactionsWrapper from ynab.models.put_scheduled_transaction_wrapper import PutScheduledTransactionWrapper from ynab.models.put_transaction_wrapper import PutTransactionWrapper from ynab.models.save_account import SaveAccount from ynab.models.save_category import SaveCategory +from ynab.models.save_category_group import SaveCategoryGroup +from ynab.models.save_category_group_response import SaveCategoryGroupResponse +from ynab.models.save_category_group_response_data import SaveCategoryGroupResponseData 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 @@ -110,3 +123,4 @@ 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 f2084c1..f89d18c 100644 --- a/ynab/models/account.py +++ b/ynab/models/account.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.account_type import AccountType from typing import Optional, Set from typing_extensions import Self @@ -28,20 +29,20 @@ class Account(BaseModel): """ Account """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr type: AccountType - on_budget: StrictBool = Field(description="Whether this account is on budget or not") + on_budget: StrictBool = Field(description="Whether this account is \"on budget\" or not") closed: StrictBool = Field(description="Whether this account is closed or not") note: Optional[StrictStr] = None - balance: StrictInt = Field(description="The current balance of the account in milliunits format") + balance: StrictInt = Field(description="The current available balance of the account in milliunits format") cleared_balance: StrictInt = Field(description="The current cleared balance of the account in milliunits format") uncleared_balance: StrictInt = Field(description="The current uncleared balance of the account in milliunits format") - transfer_payee_id: Optional[StrictStr] = Field(description="The payee id which should be used when transferring to this account") + transfer_payee_id: Optional[UUID] = Field(description="The payee id which should be used when transferring to this account") direct_import_linked: Optional[StrictBool] = Field(default=None, description="Whether or not the account is linked to a financial institution for automatic transaction import.") direct_import_in_error: Optional[StrictBool] = Field(default=None, 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.") last_reconciled_at: Optional[datetime] = Field(default=None, description="A date/time specifying when the account was last reconciled.") - debt_original_balance: Optional[StrictInt] = Field(default=None, description="The original debt/loan account balance, specified in milliunits format.") + debt_original_balance: Optional[StrictInt] = Field(default=None, description="This field is deprecated and will always be null.") debt_interest_rates: Optional[Dict[str, StrictInt]] = None debt_minimum_payments: Optional[Dict[str, StrictInt]] = None debt_escrow_amounts: Optional[Dict[str, StrictInt]] = None @@ -107,21 +108,6 @@ def to_dict(self) -> Dict[str, Any]: if self.debt_original_balance is None and "debt_original_balance" in self.model_fields_set: _dict['debt_original_balance'] = None - # set to None if debt_interest_rates (nullable) is None - # and model_fields_set contains the field - if self.debt_interest_rates is None and "debt_interest_rates" in self.model_fields_set: - _dict['debt_interest_rates'] = None - - # set to None if debt_minimum_payments (nullable) is None - # and model_fields_set contains the field - if self.debt_minimum_payments is None and "debt_minimum_payments" in self.model_fields_set: - _dict['debt_minimum_payments'] = None - - # set to None if debt_escrow_amounts (nullable) is None - # and model_fields_set contains the field - if self.debt_escrow_amounts is None and "debt_escrow_amounts" in self.model_fields_set: - _dict['debt_escrow_amounts'] = None - return _dict @classmethod diff --git a/ynab/models/account_response.py b/ynab/models/account_response.py index 6f607f7..d79f1fe 100644 --- a/ynab/models/account_response.py +++ b/ynab/models/account_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/account_response_data.py b/ynab/models/account_response_data.py index 6c60fed..b7e1222 100644 --- a/ynab/models/account_response_data.py +++ b/ynab/models/account_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/account_type.py b/ynab/models/account_type.py index 8c32970..928e016 100644 --- a/ynab/models/account_type.py +++ b/ynab/models/account_type.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/accounts_response.py b/ynab/models/accounts_response.py index 2f4e6ee..1d58fd4 100644 --- a/ynab/models/accounts_response.py +++ b/ynab/models/accounts_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/accounts_response_data.py b/ynab/models/accounts_response_data.py index c8b0361..bfa2a95 100644 --- a/ynab/models/accounts_response_data.py +++ b/ynab/models/accounts_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_detail.py b/ynab/models/budget_detail.py index 84bd03c..4a4e1a0 100644 --- a/ynab/models/budget_detail.py +++ b/ynab/models/budget_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.account import Account from ynab.models.category import Category from ynab.models.category_group import CategoryGroup @@ -39,7 +40,7 @@ class BudgetDetail(BaseModel): """ BudgetDetail """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr last_modified_on: Optional[datetime] = Field(default=None, description="The last time any changes were made to the budget from either a web or mobile client") first_month: Optional[date] = Field(default=None, description="The earliest budget month") diff --git a/ynab/models/budget_detail_response.py b/ynab/models/budget_detail_response.py index 9d69634..0ffb3ec 100644 --- a/ynab/models/budget_detail_response.py +++ b/ynab/models/budget_detail_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_detail_response_data.py b/ynab/models/budget_detail_response_data.py index 6b3475f..dc4b243 100644 --- a/ynab/models/budget_detail_response_data.py +++ b/ynab/models/budget_detail_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_settings.py b/ynab/models/budget_settings.py index b9dbca6..0ce4ada 100644 --- a/ynab/models/budget_settings.py +++ b/ynab/models/budget_settings.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_settings_response.py b/ynab/models/budget_settings_response.py index 301df15..409c490 100644 --- a/ynab/models/budget_settings_response.py +++ b/ynab/models/budget_settings_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_settings_response_data.py b/ynab/models/budget_settings_response_data.py index 3c1e134..4964262 100644 --- a/ynab/models/budget_settings_response_data.py +++ b/ynab/models/budget_settings_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_summary.py b/ynab/models/budget_summary.py index 2493a31..f81cc8f 100644 --- a/ynab/models/budget_summary.py +++ b/ynab/models/budget_summary.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.account import Account from ynab.models.currency_format import CurrencyFormat from ynab.models.date_format import DateFormat @@ -30,7 +31,7 @@ class BudgetSummary(BaseModel): """ BudgetSummary """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr last_modified_on: Optional[datetime] = Field(default=None, description="The last time any changes were made to the budget from either a web or mobile client") first_month: Optional[date] = Field(default=None, description="The earliest budget month") diff --git a/ynab/models/budget_summary_response.py b/ynab/models/budget_summary_response.py index f89429c..2de31a6 100644 --- a/ynab/models/budget_summary_response.py +++ b/ynab/models/budget_summary_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/budget_summary_response_data.py b/ynab/models/budget_summary_response_data.py index d100f66..f5d7713 100644 --- a/ynab/models/budget_summary_response_data.py +++ b/ynab/models/budget_summary_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.77.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -80,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of default_budget if self.default_budget: _dict['default_budget'] = self.default_budget.to_dict() + # set to None if default_budget (nullable) is None + # and model_fields_set contains the field + if self.default_budget is None and "default_budget" in self.model_fields_set: + _dict['default_budget'] = None + return _dict @classmethod diff --git a/ynab/models/bulk_response.py b/ynab/models/bulk_response.py index cfebf62..b4bb040 100644 --- a/ynab/models/bulk_response.py +++ b/ynab/models/bulk_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/bulk_response_data.py b/ynab/models/bulk_response_data.py index 5551f24..9ae256a 100644 --- a/ynab/models/bulk_response_data.py +++ b/ynab/models/bulk_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/bulk_response_data_bulk.py b/ynab/models/bulk_response_data_bulk.py index a5f29ba..7b4dbeb 100644 --- a/ynab/models/bulk_response_data_bulk.py +++ b/ynab/models/bulk_response_data_bulk.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/bulk_transactions.py b/ynab/models/bulk_transactions.py index eb9277a..cb52ec7 100644 --- a/ynab/models/bulk_transactions.py +++ b/ynab/models/bulk_transactions.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/categories_response.py b/ynab/models/categories_response.py index 985ee87..acf6d7c 100644 --- a/ynab/models/categories_response.py +++ b/ynab/models/categories_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/categories_response_data.py b/ynab/models/categories_response_data.py index de7f7fd..4422141 100644 --- a/ynab/models/categories_response_data.py +++ b/ynab/models/categories_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/category.py b/ynab/models/category.py index 495b40d..6f30849 100644 --- a/ynab/models/category.py +++ b/ynab/models/category.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -27,16 +28,16 @@ class Category(BaseModel): """ Category """ # noqa: E501 - id: StrictStr - category_group_id: StrictStr + id: UUID + category_group_id: UUID category_group_name: Optional[StrictStr] = None name: StrictStr hidden: StrictBool = Field(description="Whether or not the category is hidden") - original_category_group_id: Optional[StrictStr] = Field(default=None, description="DEPRECATED: No longer used. Value will always be null.") + original_category_group_id: Optional[UUID] = Field(default=None, description="DEPRECATED: No longer used. Value will always be null.") note: Optional[StrictStr] = None - budgeted: StrictInt = Field(description="Budgeted amount in milliunits format") + budgeted: StrictInt = Field(description="Assigned (budgeted) amount in milliunits format") activity: StrictInt = Field(description="Activity amount in milliunits format") - balance: StrictInt = Field(description="Balance in milliunits format") + balance: StrictInt = Field(description="Available balance in milliunits format") goal_type: Optional[StrictStr] = Field(default=None, 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_needs_whole_amount: Optional[StrictBool] = Field(default=None, description="Indicates the monthly rollover behavior for \"NEED\"-type goals. When \"true\", the goal will always ask for the target amount in the new month (\"Set Aside\"). When \"false\", previous month category funding is used (\"Refill\"). For other goal types, this field will be null.") goal_day: Optional[StrictInt] = Field(default=None, description="A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month).") @@ -44,7 +45,8 @@ class Category(BaseModel): goal_cadence_frequency: Optional[StrictInt] = Field(default=None, description="The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored.") goal_creation_month: Optional[date] = Field(default=None, description="The month a goal was created") goal_target: Optional[StrictInt] = Field(default=None, description="The goal target amount in milliunits") - goal_target_month: Optional[date] = Field(default=None, description="The original target month for the goal to be completed. Only some goal types specify this date.") + goal_target_month: Optional[date] = Field(default=None, description="DEPRECATED: No longer used. Use `goal_target_date` instead.") + goal_target_date: Optional[date] = Field(default=None, description="The target date for the goal to be completed. Only some goal types specify this date.") goal_percentage_complete: Optional[StrictInt] = Field(default=None, description="The percentage completion of the goal") goal_months_to_budget: Optional[StrictInt] = Field(default=None, description="The number of months, including the current month, left in the current goal period.") goal_under_funded: Optional[StrictInt] = Field(default=None, 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.") @@ -52,7 +54,7 @@ class Category(BaseModel): goal_overall_left: Optional[StrictInt] = Field(default=None, description="The amount of funding still needed to complete the goal within the current goal period.") goal_snoozed_at: Optional[datetime] = Field(default=None, description="The date/time the goal was snoozed. If the goal is not snoozed, this will be null.") deleted: StrictBool = Field(description="Whether or not the category has been deleted. Deleted categories will only be included in delta requests.") - __properties: ClassVar[List[str]] = ["id", "category_group_id", "category_group_name", "name", "hidden", "original_category_group_id", "note", "budgeted", "activity", "balance", "goal_type", "goal_needs_whole_amount", "goal_day", "goal_cadence", "goal_cadence_frequency", "goal_creation_month", "goal_target", "goal_target_month", "goal_percentage_complete", "goal_months_to_budget", "goal_under_funded", "goal_overall_funded", "goal_overall_left", "goal_snoozed_at", "deleted"] + __properties: ClassVar[List[str]] = ["id", "category_group_id", "category_group_name", "name", "hidden", "original_category_group_id", "note", "budgeted", "activity", "balance", "goal_type", "goal_needs_whole_amount", "goal_day", "goal_cadence", "goal_cadence_frequency", "goal_creation_month", "goal_target", "goal_target_month", "goal_target_date", "goal_percentage_complete", "goal_months_to_budget", "goal_under_funded", "goal_overall_funded", "goal_overall_left", "goal_snoozed_at", "deleted"] @field_validator('goal_type') def goal_type_validate_enum(cls, value): @@ -153,6 +155,11 @@ def to_dict(self) -> Dict[str, Any]: if self.goal_target_month is None and "goal_target_month" in self.model_fields_set: _dict['goal_target_month'] = None + # set to None if goal_target_date (nullable) is None + # and model_fields_set contains the field + if self.goal_target_date is None and "goal_target_date" in self.model_fields_set: + _dict['goal_target_date'] = None + # set to None if goal_percentage_complete (nullable) is None # and model_fields_set contains the field if self.goal_percentage_complete is None and "goal_percentage_complete" in self.model_fields_set: @@ -213,6 +220,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "goal_creation_month": obj.get("goal_creation_month"), "goal_target": obj.get("goal_target"), "goal_target_month": obj.get("goal_target_month"), + "goal_target_date": obj.get("goal_target_date"), "goal_percentage_complete": obj.get("goal_percentage_complete"), "goal_months_to_budget": obj.get("goal_months_to_budget"), "goal_under_funded": obj.get("goal_under_funded"), diff --git a/ynab/models/category_group.py b/ynab/models/category_group.py index 43520bb..fd9e7f7 100644 --- a/ynab/models/category_group.py +++ b/ynab/models/category_group.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -26,7 +27,7 @@ class CategoryGroup(BaseModel): """ CategoryGroup """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr hidden: StrictBool = Field(description="Whether or not the category group is hidden") deleted: StrictBool = Field(description="Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests.") diff --git a/ynab/models/category_group_with_categories.py b/ynab/models/category_group_with_categories.py index d36e301..0d992d9 100644 --- a/ynab/models/category_group_with_categories.py +++ b/ynab/models/category_group_with_categories.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List +from uuid import UUID from ynab.models.category import Category from typing import Optional, Set from typing_extensions import Self @@ -27,11 +28,11 @@ class CategoryGroupWithCategories(BaseModel): """ CategoryGroupWithCategories """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr hidden: StrictBool = Field(description="Whether or not the category group is hidden") deleted: StrictBool = Field(description="Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests.") - categories: List[Category] = Field(description="Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).") + categories: List[Category] = Field(description="Category group categories. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC).") __properties: ClassVar[List[str]] = ["id", "name", "hidden", "deleted", "categories"] model_config = ConfigDict( diff --git a/ynab/models/category_response.py b/ynab/models/category_response.py index 94ffc55..e618ba1 100644 --- a/ynab/models/category_response.py +++ b/ynab/models/category_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/category_response_data.py b/ynab/models/category_response_data.py index f380ca7..62c2072 100644 --- a/ynab/models/category_response_data.py +++ b/ynab/models/category_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/currency_format.py b/ynab/models/currency_format.py index dbbc3a8..32692a8 100644 --- a/ynab/models/currency_format.py +++ b/ynab/models/currency_format.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -24,7 +24,7 @@ class CurrencyFormat(BaseModel): """ - The currency format setting for the budget. In some cases the format will not be available and will be specified as null. + The currency format setting for the plan. In some cases the format will not be available and will be specified as null. """ # noqa: E501 iso_code: StrictStr example_format: StrictStr diff --git a/ynab/models/date_format.py b/ynab/models/date_format.py index e80d3e4..4b85115 100644 --- a/ynab/models/date_format.py +++ b/ynab/models/date_format.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -24,7 +24,7 @@ class DateFormat(BaseModel): """ - The date format setting for the budget. In some cases the format will not be available and will be specified as null. + The date format setting for the plan. In some cases the format will not be available and will be specified as null. """ # noqa: E501 format: StrictStr __properties: ClassVar[List[str]] = ["format"] diff --git a/ynab/models/error_detail.py b/ynab/models/error_detail.py index eb43424..5bd17c0 100644 --- a/ynab/models/error_detail.py +++ b/ynab/models/error_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/error_response.py b/ynab/models/error_response.py index c99242e..92d9a4f 100644 --- a/ynab/models/error_response.py +++ b/ynab/models/error_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/existing_category.py b/ynab/models/existing_category.py new file mode 100644 index 0000000..c35a881 --- /dev/null +++ b/ynab/models/existing_category.py @@ -0,0 +1,97 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class ExistingCategory(BaseModel): + """ + ExistingCategory + """ # noqa: E501 + name: Optional[StrictStr] = None + note: Optional[StrictStr] = None + category_group_id: Optional[UUID] = None + goal_target: Optional[StrictInt] = Field(default=None, description="The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount.") + goal_target_date: Optional[date] = Field(default=None, description="The goal target date in ISO format (e.g. 2016-12-01).") + __properties: ClassVar[List[str]] = ["name", "note", "category_group_id", "goal_target", "goal_target_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExistingCategory from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExistingCategory from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "note": obj.get("note"), + "category_group_id": obj.get("category_group_id"), + "goal_target": obj.get("goal_target"), + "goal_target_date": obj.get("goal_target_date") + }) + return _obj + + diff --git a/ynab/models/existing_transaction.py b/ynab/models/existing_transaction.py index 7f59bf7..7a0eebb 100644 --- a/ynab/models/existing_transaction.py +++ b/ynab/models/existing_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,9 +18,10 @@ import json from datetime import date -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor @@ -31,12 +32,12 @@ class ExistingTransaction(BaseModel): """ ExistingTransaction """ # noqa: E501 - account_id: Optional[StrictStr] = None + account_id: Optional[UUID] = None var_date: Optional[date] = Field(default=None, 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.", alias="date") amount: Optional[StrictInt] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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 `transfer_payee_id` on the account resource.") + payee_id: Optional[UUID] = Field(default=None, 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 `transfer_payee_id` on the account resource.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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.") + category_id: Optional[UUID] = Field(default=None, 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: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None cleared: Optional[TransactionClearedStatus] = None approved: Optional[StrictBool] = Field(default=None, description="Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.") @@ -90,26 +91,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_subtransactions: _items.append(_item_subtransactions.to_dict()) _dict['subtransactions'] = _items - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if payee_name (nullable) is None - # and model_fields_set contains the field - if self.payee_name is None and "payee_name" in self.model_fields_set: - _dict['payee_name'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: diff --git a/ynab/models/hybrid_transaction.py b/ynab/models/hybrid_transaction.py index e7b8f37..c5ed1f9 100644 --- a/ynab/models/hybrid_transaction.py +++ b/ynab/models/hybrid_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor from typing import Optional, Set @@ -37,10 +38,10 @@ class HybridTransaction(BaseModel): approved: StrictBool = Field(description="Whether or not the transaction is approved") flag_color: Optional[TransactionFlagColor] = None flag_name: Optional[StrictStr] = Field(default=None, description="The customized name of a transaction flag") - account_id: StrictStr - payee_id: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the account to which it transfers") + account_id: UUID + payee_id: Optional[UUID] = None + category_id: Optional[UUID] = None + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer transaction, the account to which it transfers") transfer_transaction_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the id of transaction on the other side of the transfer") matched_transaction_id: Optional[StrictStr] = Field(default=None, description="If transaction is matched, the id of the matched transaction") import_id: Optional[StrictStr] = Field(default=None, 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'.") @@ -111,61 +112,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: _dict['flag_color'] = None - # set to None if flag_name (nullable) is None - # and model_fields_set contains the field - if self.flag_name is None and "flag_name" in self.model_fields_set: - _dict['flag_name'] = None - - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if transfer_account_id (nullable) is None - # and model_fields_set contains the field - if self.transfer_account_id is None and "transfer_account_id" in self.model_fields_set: - _dict['transfer_account_id'] = None - - # set to None if transfer_transaction_id (nullable) is None - # and model_fields_set contains the field - if self.transfer_transaction_id is None and "transfer_transaction_id" in self.model_fields_set: - _dict['transfer_transaction_id'] = None - - # set to None if matched_transaction_id (nullable) is None - # and model_fields_set contains the field - if self.matched_transaction_id is None and "matched_transaction_id" in self.model_fields_set: - _dict['matched_transaction_id'] = None - - # set to None if import_id (nullable) is None - # and model_fields_set contains the field - if self.import_id is None and "import_id" in self.model_fields_set: - _dict['import_id'] = None - - # set to None if import_payee_name (nullable) is None - # and model_fields_set contains the field - if self.import_payee_name is None and "import_payee_name" in self.model_fields_set: - _dict['import_payee_name'] = None - - # set to None if import_payee_name_original (nullable) is None - # and model_fields_set contains the field - if self.import_payee_name_original is None and "import_payee_name_original" in self.model_fields_set: - _dict['import_payee_name_original'] = None - # set to None if debt_transaction_type (nullable) is None # and model_fields_set contains the field if self.debt_transaction_type is None and "debt_transaction_type" in self.model_fields_set: diff --git a/ynab/models/hybrid_transactions_response.py b/ynab/models/hybrid_transactions_response.py index d0c9f68..127bd8a 100644 --- a/ynab/models/hybrid_transactions_response.py +++ b/ynab/models/hybrid_transactions_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/hybrid_transactions_response_data.py b/ynab/models/hybrid_transactions_response_data.py index 9506e81..5032e91 100644 --- a/ynab/models/hybrid_transactions_response_data.py +++ b/ynab/models/hybrid_transactions_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/money_movement.py b/ynab/models/money_movement.py new file mode 100644 index 0000000..39887a0 --- /dev/null +++ b/ynab/models/money_movement.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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovement(BaseModel): + """ + MoneyMovement + """ # noqa: E501 + id: UUID + month: Optional[date] = Field(default=None, description="The month of the money movement in ISO format (e.g. 2024-01-01)") + moved_at: Optional[datetime] = Field(default=None, description="The date/time the money movement was processed on the server in ISO format (e.g. 2024-01-01T12:00:00Z)") + note: Optional[StrictStr] = None + money_movement_group_id: Optional[UUID] = Field(default=None, description="The id of the money movement group this movement belongs to") + performed_by_user_id: Optional[UUID] = Field(default=None, description="The id of the user who performed the money movement") + from_category_id: Optional[UUID] = Field(default=None, description="The id of the category the money was moved from") + to_category_id: Optional[UUID] = Field(default=None, description="The id of the category the money was moved to") + amount: StrictInt = Field(description="The amount of the money movement in milliunits format") + __properties: ClassVar[List[str]] = ["id", "month", "moved_at", "note", "money_movement_group_id", "performed_by_user_id", "from_category_id", "to_category_id", "amount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovement from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if month (nullable) is None + # and model_fields_set contains the field + if self.month is None and "month" in self.model_fields_set: + _dict['month'] = None + + # set to None if moved_at (nullable) is None + # and model_fields_set contains the field + if self.moved_at is None and "moved_at" in self.model_fields_set: + _dict['moved_at'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if money_movement_group_id (nullable) is None + # and model_fields_set contains the field + if self.money_movement_group_id is None and "money_movement_group_id" in self.model_fields_set: + _dict['money_movement_group_id'] = None + + # set to None if performed_by_user_id (nullable) is None + # and model_fields_set contains the field + if self.performed_by_user_id is None and "performed_by_user_id" in self.model_fields_set: + _dict['performed_by_user_id'] = None + + # set to None if from_category_id (nullable) is None + # and model_fields_set contains the field + if self.from_category_id is None and "from_category_id" in self.model_fields_set: + _dict['from_category_id'] = None + + # set to None if to_category_id (nullable) is None + # and model_fields_set contains the field + if self.to_category_id is None and "to_category_id" in self.model_fields_set: + _dict['to_category_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "month": obj.get("month"), + "moved_at": obj.get("moved_at"), + "note": obj.get("note"), + "money_movement_group_id": obj.get("money_movement_group_id"), + "performed_by_user_id": obj.get("performed_by_user_id"), + "from_category_id": obj.get("from_category_id"), + "to_category_id": obj.get("to_category_id"), + "amount": obj.get("amount") + }) + return _obj + + diff --git a/ynab/models/money_movement_group.py b/ynab/models/money_movement_group.py new file mode 100644 index 0000000..7bed214 --- /dev/null +++ b/ynab/models/money_movement_group.py @@ -0,0 +1,107 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovementGroup(BaseModel): + """ + MoneyMovementGroup + """ # noqa: E501 + id: UUID + group_created_at: datetime = Field(description="When the money movement group was created") + month: date = Field(description="The month of the money movement group in ISO format (e.g. 2024-01-01)") + note: Optional[StrictStr] = None + performed_by_user_id: Optional[UUID] = Field(default=None, description="The id of the user who performed the money movement group") + __properties: ClassVar[List[str]] = ["id", "group_created_at", "month", "note", "performed_by_user_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovementGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if performed_by_user_id (nullable) is None + # and model_fields_set contains the field + if self.performed_by_user_id is None and "performed_by_user_id" in self.model_fields_set: + _dict['performed_by_user_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovementGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "group_created_at": obj.get("group_created_at"), + "month": obj.get("month"), + "note": obj.get("note"), + "performed_by_user_id": obj.get("performed_by_user_id") + }) + return _obj + + diff --git a/ynab/models/money_movement_groups_response.py b/ynab/models/money_movement_groups_response.py new file mode 100644 index 0000000..6be8c29 --- /dev/null +++ b/ynab/models/money_movement_groups_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.money_movement_groups_response_data import MoneyMovementGroupsResponseData +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovementGroupsResponse(BaseModel): + """ + MoneyMovementGroupsResponse + """ # noqa: E501 + data: MoneyMovementGroupsResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovementGroupsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovementGroupsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": MoneyMovementGroupsResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/money_movement_groups_response_data.py b/ynab/models/money_movement_groups_response_data.py new file mode 100644 index 0000000..606c1a5 --- /dev/null +++ b/ynab/models/money_movement_groups_response_data.py @@ -0,0 +1,97 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from ynab.models.money_movement_group import MoneyMovementGroup +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovementGroupsResponseData(BaseModel): + """ + MoneyMovementGroupsResponseData + """ # noqa: E501 + money_movement_groups: List[MoneyMovementGroup] + server_knowledge: StrictInt = Field(description="The knowledge of the server") + __properties: ClassVar[List[str]] = ["money_movement_groups", "server_knowledge"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovementGroupsResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in money_movement_groups (list) + _items = [] + if self.money_movement_groups: + for _item_money_movement_groups in self.money_movement_groups: + if _item_money_movement_groups: + _items.append(_item_money_movement_groups.to_dict()) + _dict['money_movement_groups'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovementGroupsResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "money_movement_groups": [MoneyMovementGroup.from_dict(_item) for _item in obj["money_movement_groups"]] if obj.get("money_movement_groups") is not None else None, + "server_knowledge": obj.get("server_knowledge") + }) + return _obj + + diff --git a/ynab/models/money_movements_response.py b/ynab/models/money_movements_response.py new file mode 100644 index 0000000..3664d40 --- /dev/null +++ b/ynab/models/money_movements_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.money_movements_response_data import MoneyMovementsResponseData +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovementsResponse(BaseModel): + """ + MoneyMovementsResponse + """ # noqa: E501 + data: MoneyMovementsResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovementsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovementsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": MoneyMovementsResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/money_movements_response_data.py b/ynab/models/money_movements_response_data.py new file mode 100644 index 0000000..884ad7e --- /dev/null +++ b/ynab/models/money_movements_response_data.py @@ -0,0 +1,97 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from ynab.models.money_movement import MoneyMovement +from typing import Optional, Set +from typing_extensions import Self + +class MoneyMovementsResponseData(BaseModel): + """ + MoneyMovementsResponseData + """ # noqa: E501 + money_movements: List[MoneyMovement] + server_knowledge: StrictInt = Field(description="The knowledge of the server") + __properties: ClassVar[List[str]] = ["money_movements", "server_knowledge"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoneyMovementsResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in money_movements (list) + _items = [] + if self.money_movements: + for _item_money_movements in self.money_movements: + if _item_money_movements: + _items.append(_item_money_movements.to_dict()) + _dict['money_movements'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoneyMovementsResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "money_movements": [MoneyMovement.from_dict(_item) for _item in obj["money_movements"]] if obj.get("money_movements") is not None else None, + "server_knowledge": obj.get("server_knowledge") + }) + return _obj + + diff --git a/ynab/models/month_detail.py b/ynab/models/month_detail.py index 725d7d4..0d974cb 100644 --- a/ynab/models/month_detail.py +++ b/ynab/models/month_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -31,12 +31,12 @@ class MonthDetail(BaseModel): month: date note: Optional[StrictStr] = None income: StrictInt = Field(description="The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month") - budgeted: StrictInt = Field(description="The total amount budgeted in the month") + budgeted: StrictInt = Field(description="The total amount assigned (budgeted) in the month") activity: StrictInt = Field(description="The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign'") to_be_budgeted: StrictInt = Field(description="The available amount for 'Ready to Assign'") age_of_money: Optional[StrictInt] = Field(default=None, description="The Age of Money as of the month") deleted: StrictBool = Field(description="Whether or not the month has been deleted. Deleted months will only be included in delta requests.") - categories: List[Category] = Field(description="The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified.") + categories: List[Category] = Field(description="The plan month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified.") __properties: ClassVar[List[str]] = ["month", "note", "income", "budgeted", "activity", "to_be_budgeted", "age_of_money", "deleted", "categories"] model_config = ConfigDict( @@ -85,16 +85,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_categories: _items.append(_item_categories.to_dict()) _dict['categories'] = _items - # set to None if note (nullable) is None - # and model_fields_set contains the field - if self.note is None and "note" in self.model_fields_set: - _dict['note'] = None - - # set to None if age_of_money (nullable) is None - # and model_fields_set contains the field - if self.age_of_money is None and "age_of_money" in self.model_fields_set: - _dict['age_of_money'] = None - return _dict @classmethod diff --git a/ynab/models/month_detail_response.py b/ynab/models/month_detail_response.py index 753cdad..c740eb9 100644 --- a/ynab/models/month_detail_response.py +++ b/ynab/models/month_detail_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/month_detail_response_data.py b/ynab/models/month_detail_response_data.py index 6fe91d5..5f5386e 100644 --- a/ynab/models/month_detail_response_data.py +++ b/ynab/models/month_detail_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/month_summaries_response.py b/ynab/models/month_summaries_response.py index dbb7ee5..e1bb401 100644 --- a/ynab/models/month_summaries_response.py +++ b/ynab/models/month_summaries_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/month_summaries_response_data.py b/ynab/models/month_summaries_response_data.py index 0fb200d..7ad24ba 100644 --- a/ynab/models/month_summaries_response_data.py +++ b/ynab/models/month_summaries_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/month_summary.py b/ynab/models/month_summary.py index 688c4dd..75364b2 100644 --- a/ynab/models/month_summary.py +++ b/ynab/models/month_summary.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -30,7 +30,7 @@ class MonthSummary(BaseModel): month: date note: Optional[StrictStr] = None income: StrictInt = Field(description="The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month") - budgeted: StrictInt = Field(description="The total amount budgeted in the month") + budgeted: StrictInt = Field(description="The total amount assigned (budgeted) in the month") activity: StrictInt = Field(description="The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign'") to_be_budgeted: StrictInt = Field(description="The available amount for 'Ready to Assign'") age_of_money: Optional[StrictInt] = Field(default=None, description="The Age of Money as of the month") diff --git a/ynab/models/new_category.py b/ynab/models/new_category.py new file mode 100644 index 0000000..541dbae --- /dev/null +++ b/ynab/models/new_category.py @@ -0,0 +1,97 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class NewCategory(BaseModel): + """ + NewCategory + """ # noqa: E501 + name: Optional[StrictStr] = None + note: Optional[StrictStr] = None + category_group_id: Optional[UUID] = None + goal_target: Optional[StrictInt] = Field(default=None, description="The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount.") + goal_target_date: Optional[date] = Field(default=None, description="The goal target date in ISO format (e.g. 2016-12-01).") + __properties: ClassVar[List[str]] = ["name", "note", "category_group_id", "goal_target", "goal_target_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NewCategory from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NewCategory from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "note": obj.get("note"), + "category_group_id": obj.get("category_group_id"), + "goal_target": obj.get("goal_target"), + "goal_target_date": obj.get("goal_target_date") + }) + return _obj + + diff --git a/ynab/models/new_transaction.py b/ynab/models/new_transaction.py index b0ac369..1fbe2b2 100644 --- a/ynab/models/new_transaction.py +++ b/ynab/models/new_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,9 +18,10 @@ import json from datetime import date -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor @@ -31,12 +32,12 @@ class NewTransaction(BaseModel): """ NewTransaction """ # noqa: E501 - account_id: Optional[StrictStr] = None + account_id: Optional[UUID] = None var_date: Optional[date] = Field(default=None, 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.", alias="date") amount: Optional[StrictInt] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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 `transfer_payee_id` on the account resource.") + payee_id: Optional[UUID] = Field(default=None, 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 `transfer_payee_id` on the account resource.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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.") + category_id: Optional[UUID] = Field(default=None, 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: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None cleared: Optional[TransactionClearedStatus] = None approved: Optional[StrictBool] = Field(default=None, description="Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.") @@ -91,26 +92,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_subtransactions: _items.append(_item_subtransactions.to_dict()) _dict['subtransactions'] = _items - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if payee_name (nullable) is None - # and model_fields_set contains the field - if self.payee_name is None and "payee_name" in self.model_fields_set: - _dict['payee_name'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: diff --git a/ynab/models/patch_category_group_wrapper.py b/ynab/models/patch_category_group_wrapper.py new file mode 100644 index 0000000..c9dc6ec --- /dev/null +++ b/ynab/models/patch_category_group_wrapper.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.save_category_group import SaveCategoryGroup +from typing import Optional, Set +from typing_extensions import Self + +class PatchCategoryGroupWrapper(BaseModel): + """ + PatchCategoryGroupWrapper + """ # noqa: E501 + category_group: SaveCategoryGroup + __properties: ClassVar[List[str]] = ["category_group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PatchCategoryGroupWrapper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of category_group + if self.category_group: + _dict['category_group'] = self.category_group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchCategoryGroupWrapper from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category_group": SaveCategoryGroup.from_dict(obj["category_group"]) if obj.get("category_group") is not None else None + }) + return _obj + + diff --git a/ynab/models/patch_category_wrapper.py b/ynab/models/patch_category_wrapper.py index 167aac3..b362422 100644 --- a/ynab/models/patch_category_wrapper.py +++ b/ynab/models/patch_category_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from ynab.models.save_category import SaveCategory +from ynab.models.existing_category import ExistingCategory from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,7 @@ class PatchCategoryWrapper(BaseModel): """ PatchCategoryWrapper """ # noqa: E501 - category: SaveCategory + category: ExistingCategory __properties: ClassVar[List[str]] = ["category"] model_config = ConfigDict( @@ -84,7 +84,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "category": SaveCategory.from_dict(obj["category"]) if obj.get("category") is not None else None + "category": ExistingCategory.from_dict(obj["category"]) if obj.get("category") is not None else None }) return _obj diff --git a/ynab/models/patch_month_category_wrapper.py b/ynab/models/patch_month_category_wrapper.py index f29cd9c..b529d6e 100644 --- a/ynab/models/patch_month_category_wrapper.py +++ b/ynab/models/patch_month_category_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/patch_payee_wrapper.py b/ynab/models/patch_payee_wrapper.py index f958f84..fc2fc02 100644 --- a/ynab/models/patch_payee_wrapper.py +++ b/ynab/models/patch_payee_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/patch_transactions_wrapper.py b/ynab/models/patch_transactions_wrapper.py index d53e72c..573692a 100644 --- a/ynab/models/patch_transactions_wrapper.py +++ b/ynab/models/patch_transactions_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee.py b/ynab/models/payee.py index 6d73d98..71e5061 100644 --- a/ynab/models/payee.py +++ b/ynab/models/payee.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -26,7 +27,7 @@ class Payee(BaseModel): """ Payee """ # noqa: E501 - id: StrictStr + id: UUID name: StrictStr transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer payee, the `account_id` to which this payee transfers to") deleted: StrictBool = Field(description="Whether or not the payee has been deleted. Deleted payees will only be included in delta requests.") diff --git a/ynab/models/payee_location.py b/ynab/models/payee_location.py index 29f29ad..d71db17 100644 --- a/ynab/models/payee_location.py +++ b/ynab/models/payee_location.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -26,8 +27,8 @@ class PayeeLocation(BaseModel): """ PayeeLocation """ # noqa: E501 - id: StrictStr - payee_id: StrictStr + id: UUID + payee_id: UUID latitude: StrictStr longitude: StrictStr deleted: StrictBool = Field(description="Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests.") diff --git a/ynab/models/payee_location_response.py b/ynab/models/payee_location_response.py index 6850adf..9e0bdd1 100644 --- a/ynab/models/payee_location_response.py +++ b/ynab/models/payee_location_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee_location_response_data.py b/ynab/models/payee_location_response_data.py index 5dc76a6..9028c1e 100644 --- a/ynab/models/payee_location_response_data.py +++ b/ynab/models/payee_location_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee_locations_response.py b/ynab/models/payee_locations_response.py index 354173e..c550411 100644 --- a/ynab/models/payee_locations_response.py +++ b/ynab/models/payee_locations_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee_locations_response_data.py b/ynab/models/payee_locations_response_data.py index 7b68917..c41382e 100644 --- a/ynab/models/payee_locations_response_data.py +++ b/ynab/models/payee_locations_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee_response.py b/ynab/models/payee_response.py index 1f76452..a7cc7e1 100644 --- a/ynab/models/payee_response.py +++ b/ynab/models/payee_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payee_response_data.py b/ynab/models/payee_response_data.py index 6c7b906..5e51387 100644 --- a/ynab/models/payee_response_data.py +++ b/ynab/models/payee_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payees_response.py b/ynab/models/payees_response.py index ede7e8c..11da24f 100644 --- a/ynab/models/payees_response.py +++ b/ynab/models/payees_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/payees_response_data.py b/ynab/models/payees_response_data.py index b65bc09..d575d3a 100644 --- a/ynab/models/payees_response_data.py +++ b/ynab/models/payees_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/plan_detail.py b/ynab/models/plan_detail.py new file mode 100644 index 0000000..3a43a21 --- /dev/null +++ b/ynab/models/plan_detail.py @@ -0,0 +1,209 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from ynab.models.account import Account +from ynab.models.category import Category +from ynab.models.category_group import CategoryGroup +from ynab.models.currency_format import CurrencyFormat +from ynab.models.date_format import DateFormat +from ynab.models.month_detail import MonthDetail +from ynab.models.payee import Payee +from ynab.models.payee_location import PayeeLocation +from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction +from ynab.models.scheduled_transaction_summary import ScheduledTransactionSummary +from ynab.models.sub_transaction import SubTransaction +from ynab.models.transaction_summary import TransactionSummary +from typing import Optional, Set +from typing_extensions import Self + +class PlanDetail(BaseModel): + """ + PlanDetail + """ # noqa: E501 + id: UUID + name: StrictStr + last_modified_on: Optional[datetime] = Field(default=None, description="The last time any changes were made to the plan from either a web or mobile client") + first_month: Optional[date] = Field(default=None, description="The earliest plan month") + last_month: Optional[date] = Field(default=None, description="The latest plan month") + date_format: Optional[DateFormat] = None + currency_format: Optional[CurrencyFormat] = None + accounts: Optional[List[Account]] = None + payees: Optional[List[Payee]] = None + payee_locations: Optional[List[PayeeLocation]] = None + category_groups: Optional[List[CategoryGroup]] = None + categories: Optional[List[Category]] = None + months: Optional[List[MonthDetail]] = None + transactions: Optional[List[TransactionSummary]] = None + subtransactions: Optional[List[SubTransaction]] = None + scheduled_transactions: Optional[List[ScheduledTransactionSummary]] = None + scheduled_subtransactions: Optional[List[ScheduledSubTransaction]] = None + __properties: ClassVar[List[str]] = ["id", "name", "last_modified_on", "first_month", "last_month", "date_format", "currency_format", "accounts", "payees", "payee_locations", "category_groups", "categories", "months", "transactions", "subtransactions", "scheduled_transactions", "scheduled_subtransactions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of date_format + if self.date_format: + _dict['date_format'] = self.date_format.to_dict() + # override the default output from pydantic by calling `to_dict()` of currency_format + if self.currency_format: + _dict['currency_format'] = self.currency_format.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in payees (list) + _items = [] + if self.payees: + for _item_payees in self.payees: + if _item_payees: + _items.append(_item_payees.to_dict()) + _dict['payees'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in payee_locations (list) + _items = [] + if self.payee_locations: + for _item_payee_locations in self.payee_locations: + if _item_payee_locations: + _items.append(_item_payee_locations.to_dict()) + _dict['payee_locations'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in category_groups (list) + _items = [] + if self.category_groups: + for _item_category_groups in self.category_groups: + if _item_category_groups: + _items.append(_item_category_groups.to_dict()) + _dict['category_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in categories (list) + _items = [] + if self.categories: + for _item_categories in self.categories: + if _item_categories: + _items.append(_item_categories.to_dict()) + _dict['categories'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in months (list) + _items = [] + if self.months: + for _item_months in self.months: + if _item_months: + _items.append(_item_months.to_dict()) + _dict['months'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in transactions (list) + _items = [] + if self.transactions: + for _item_transactions in self.transactions: + if _item_transactions: + _items.append(_item_transactions.to_dict()) + _dict['transactions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in subtransactions (list) + _items = [] + if self.subtransactions: + for _item_subtransactions in self.subtransactions: + if _item_subtransactions: + _items.append(_item_subtransactions.to_dict()) + _dict['subtransactions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in scheduled_transactions (list) + _items = [] + if self.scheduled_transactions: + for _item_scheduled_transactions in self.scheduled_transactions: + if _item_scheduled_transactions: + _items.append(_item_scheduled_transactions.to_dict()) + _dict['scheduled_transactions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in scheduled_subtransactions (list) + _items = [] + if self.scheduled_subtransactions: + for _item_scheduled_subtransactions in self.scheduled_subtransactions: + if _item_scheduled_subtransactions: + _items.append(_item_scheduled_subtransactions.to_dict()) + _dict['scheduled_subtransactions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "last_modified_on": obj.get("last_modified_on"), + "first_month": obj.get("first_month"), + "last_month": obj.get("last_month"), + "date_format": DateFormat.from_dict(obj["date_format"]) if obj.get("date_format") is not None else None, + "currency_format": CurrencyFormat.from_dict(obj["currency_format"]) if obj.get("currency_format") is not None else None, + "accounts": [Account.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None, + "payees": [Payee.from_dict(_item) for _item in obj["payees"]] if obj.get("payees") is not None else None, + "payee_locations": [PayeeLocation.from_dict(_item) for _item in obj["payee_locations"]] if obj.get("payee_locations") is not None else None, + "category_groups": [CategoryGroup.from_dict(_item) for _item in obj["category_groups"]] if obj.get("category_groups") is not None else None, + "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, + "months": [MonthDetail.from_dict(_item) for _item in obj["months"]] if obj.get("months") is not None else None, + "transactions": [TransactionSummary.from_dict(_item) for _item in obj["transactions"]] if obj.get("transactions") is not None else None, + "subtransactions": [SubTransaction.from_dict(_item) for _item in obj["subtransactions"]] if obj.get("subtransactions") is not None else None, + "scheduled_transactions": [ScheduledTransactionSummary.from_dict(_item) for _item in obj["scheduled_transactions"]] if obj.get("scheduled_transactions") is not None else None, + "scheduled_subtransactions": [ScheduledSubTransaction.from_dict(_item) for _item in obj["scheduled_subtransactions"]] if obj.get("scheduled_subtransactions") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_detail_response.py b/ynab/models/plan_detail_response.py new file mode 100644 index 0000000..7425d41 --- /dev/null +++ b/ynab/models/plan_detail_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.plan_detail_response_data import PlanDetailResponseData +from typing import Optional, Set +from typing_extensions import Self + +class PlanDetailResponse(BaseModel): + """ + PlanDetailResponse + """ # noqa: E501 + data: PlanDetailResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanDetailResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanDetailResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": PlanDetailResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_detail_response_data.py b/ynab/models/plan_detail_response_data.py new file mode 100644 index 0000000..5041675 --- /dev/null +++ b/ynab/models/plan_detail_response_data.py @@ -0,0 +1,93 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from ynab.models.plan_detail import PlanDetail +from typing import Optional, Set +from typing_extensions import Self + +class PlanDetailResponseData(BaseModel): + """ + PlanDetailResponseData + """ # noqa: E501 + budget: PlanDetail + server_knowledge: StrictInt = Field(description="The knowledge of the server") + __properties: ClassVar[List[str]] = ["budget", "server_knowledge"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanDetailResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of budget + if self.budget: + _dict['budget'] = self.budget.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanDetailResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "budget": PlanDetail.from_dict(obj["budget"]) if obj.get("budget") is not None else None, + "server_knowledge": obj.get("server_knowledge") + }) + return _obj + + diff --git a/ynab/models/plan_settings.py b/ynab/models/plan_settings.py new file mode 100644 index 0000000..684269a --- /dev/null +++ b/ynab/models/plan_settings.py @@ -0,0 +1,97 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.currency_format import CurrencyFormat +from ynab.models.date_format import DateFormat +from typing import Optional, Set +from typing_extensions import Self + +class PlanSettings(BaseModel): + """ + PlanSettings + """ # noqa: E501 + date_format: DateFormat + currency_format: CurrencyFormat + __properties: ClassVar[List[str]] = ["date_format", "currency_format"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSettings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of date_format + if self.date_format: + _dict['date_format'] = self.date_format.to_dict() + # override the default output from pydantic by calling `to_dict()` of currency_format + if self.currency_format: + _dict['currency_format'] = self.currency_format.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date_format": DateFormat.from_dict(obj["date_format"]) if obj.get("date_format") is not None else None, + "currency_format": CurrencyFormat.from_dict(obj["currency_format"]) if obj.get("currency_format") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_settings_response.py b/ynab/models/plan_settings_response.py new file mode 100644 index 0000000..a68087f --- /dev/null +++ b/ynab/models/plan_settings_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.plan_settings_response_data import PlanSettingsResponseData +from typing import Optional, Set +from typing_extensions import Self + +class PlanSettingsResponse(BaseModel): + """ + PlanSettingsResponse + """ # noqa: E501 + data: PlanSettingsResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSettingsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSettingsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": PlanSettingsResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_settings_response_data.py b/ynab/models/plan_settings_response_data.py new file mode 100644 index 0000000..fc5e3c7 --- /dev/null +++ b/ynab/models/plan_settings_response_data.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.plan_settings import PlanSettings +from typing import Optional, Set +from typing_extensions import Self + +class PlanSettingsResponseData(BaseModel): + """ + PlanSettingsResponseData + """ # noqa: E501 + settings: PlanSettings + __properties: ClassVar[List[str]] = ["settings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSettingsResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of settings + if self.settings: + _dict['settings'] = self.settings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSettingsResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "settings": PlanSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_summary.py b/ynab/models/plan_summary.py new file mode 100644 index 0000000..305f60f --- /dev/null +++ b/ynab/models/plan_summary.py @@ -0,0 +1,119 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from ynab.models.account import Account +from ynab.models.currency_format import CurrencyFormat +from ynab.models.date_format import DateFormat +from typing import Optional, Set +from typing_extensions import Self + +class PlanSummary(BaseModel): + """ + PlanSummary + """ # noqa: E501 + id: UUID + name: StrictStr + last_modified_on: Optional[datetime] = Field(default=None, description="The last time any changes were made to the plan from either a web or mobile client") + first_month: Optional[date] = Field(default=None, description="The earliest plan month") + last_month: Optional[date] = Field(default=None, description="The latest plan month") + date_format: Optional[DateFormat] = None + currency_format: Optional[CurrencyFormat] = None + accounts: Optional[List[Account]] = Field(default=None, description="The plan accounts (only included if `include_accounts=true` specified as query parameter)") + __properties: ClassVar[List[str]] = ["id", "name", "last_modified_on", "first_month", "last_month", "date_format", "currency_format", "accounts"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of date_format + if self.date_format: + _dict['date_format'] = self.date_format.to_dict() + # override the default output from pydantic by calling `to_dict()` of currency_format + if self.currency_format: + _dict['currency_format'] = self.currency_format.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "last_modified_on": obj.get("last_modified_on"), + "first_month": obj.get("first_month"), + "last_month": obj.get("last_month"), + "date_format": DateFormat.from_dict(obj["date_format"]) if obj.get("date_format") is not None else None, + "currency_format": CurrencyFormat.from_dict(obj["currency_format"]) if obj.get("currency_format") is not None else None, + "accounts": [Account.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_summary_response.py b/ynab/models/plan_summary_response.py new file mode 100644 index 0000000..1c49cce --- /dev/null +++ b/ynab/models/plan_summary_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.plan_summary_response_data import PlanSummaryResponseData +from typing import Optional, Set +from typing_extensions import Self + +class PlanSummaryResponse(BaseModel): + """ + PlanSummaryResponse + """ # noqa: E501 + data: PlanSummaryResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSummaryResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSummaryResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": PlanSummaryResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/plan_summary_response_data.py b/ynab/models/plan_summary_response_data.py new file mode 100644 index 0000000..c11a7dd --- /dev/null +++ b/ynab/models/plan_summary_response_data.py @@ -0,0 +1,100 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from ynab.models.plan_summary import PlanSummary +from typing import Optional, Set +from typing_extensions import Self + +class PlanSummaryResponseData(BaseModel): + """ + PlanSummaryResponseData + """ # noqa: E501 + budgets: List[PlanSummary] + default_budget: Optional[PlanSummary] = None + __properties: ClassVar[List[str]] = ["budgets", "default_budget"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlanSummaryResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in budgets (list) + _items = [] + if self.budgets: + for _item_budgets in self.budgets: + if _item_budgets: + _items.append(_item_budgets.to_dict()) + _dict['budgets'] = _items + # override the default output from pydantic by calling `to_dict()` of default_budget + if self.default_budget: + _dict['default_budget'] = self.default_budget.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSummaryResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "budgets": [PlanSummary.from_dict(_item) for _item in obj["budgets"]] if obj.get("budgets") is not None else None, + "default_budget": PlanSummary.from_dict(obj["default_budget"]) if obj.get("default_budget") is not None else None + }) + return _obj + + diff --git a/ynab/models/post_account_wrapper.py b/ynab/models/post_account_wrapper.py index 49ce7ab..c5690dc 100644 --- a/ynab/models/post_account_wrapper.py +++ b/ynab/models/post_account_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/post_category_group_wrapper.py b/ynab/models/post_category_group_wrapper.py new file mode 100644 index 0000000..4790d61 --- /dev/null +++ b/ynab/models/post_category_group_wrapper.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.save_category_group import SaveCategoryGroup +from typing import Optional, Set +from typing_extensions import Self + +class PostCategoryGroupWrapper(BaseModel): + """ + PostCategoryGroupWrapper + """ # noqa: E501 + category_group: SaveCategoryGroup + __properties: ClassVar[List[str]] = ["category_group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostCategoryGroupWrapper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of category_group + if self.category_group: + _dict['category_group'] = self.category_group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostCategoryGroupWrapper from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category_group": SaveCategoryGroup.from_dict(obj["category_group"]) if obj.get("category_group") is not None else None + }) + return _obj + + diff --git a/ynab/models/post_category_wrapper.py b/ynab/models/post_category_wrapper.py new file mode 100644 index 0000000..b3798c9 --- /dev/null +++ b/ynab/models/post_category_wrapper.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.new_category import NewCategory +from typing import Optional, Set +from typing_extensions import Self + +class PostCategoryWrapper(BaseModel): + """ + PostCategoryWrapper + """ # noqa: E501 + category: NewCategory + __properties: ClassVar[List[str]] = ["category"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostCategoryWrapper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of category + if self.category: + _dict['category'] = self.category.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostCategoryWrapper from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": NewCategory.from_dict(obj["category"]) if obj.get("category") is not None else None + }) + return _obj + + diff --git a/ynab/models/post_scheduled_transaction_wrapper.py b/ynab/models/post_scheduled_transaction_wrapper.py index 438fbdc..aec5528 100644 --- a/ynab/models/post_scheduled_transaction_wrapper.py +++ b/ynab/models/post_scheduled_transaction_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/post_transactions_wrapper.py b/ynab/models/post_transactions_wrapper.py index 80b085d..3d30bae 100644 --- a/ynab/models/post_transactions_wrapper.py +++ b/ynab/models/post_transactions_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/put_scheduled_transaction_wrapper.py b/ynab/models/put_scheduled_transaction_wrapper.py index ee7d37e..31b194c 100644 --- a/ynab/models/put_scheduled_transaction_wrapper.py +++ b/ynab/models/put_scheduled_transaction_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/put_transaction_wrapper.py b/ynab/models/put_transaction_wrapper.py index d47e523..bc9d1a6 100644 --- a/ynab/models/put_transaction_wrapper.py +++ b/ynab/models/put_transaction_wrapper.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_account.py b/ynab/models/save_account.py index 538f02a..3628e52 100644 --- a/ynab/models/save_account.py +++ b/ynab/models/save_account.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_category.py b/ynab/models/save_category.py index 997432b..54a575e 100644 --- a/ynab/models/save_category.py +++ b/ynab/models/save_category.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,8 +17,10 @@ import re # noqa: F401 import json +from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -28,9 +30,10 @@ class SaveCategory(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = None note: Optional[StrictStr] = None - category_group_id: Optional[StrictStr] = None - goal_target: Optional[StrictInt] = Field(default=None, description="The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal (goal_type != null).") - __properties: ClassVar[List[str]] = ["name", "note", "category_group_id", "goal_target"] + category_group_id: Optional[UUID] = None + goal_target: Optional[StrictInt] = Field(default=None, description="The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly 'Needed for Spending' goal will be created for the category with this target amount.") + goal_target_date: Optional[date] = Field(default=None, description="The goal target date in ISO format (e.g. 2016-12-01).") + __properties: ClassVar[List[str]] = ["name", "note", "category_group_id", "goal_target", "goal_target_date"] model_config = ConfigDict( populate_by_name=True, @@ -86,6 +89,11 @@ def to_dict(self) -> Dict[str, Any]: if self.goal_target is None and "goal_target" in self.model_fields_set: _dict['goal_target'] = None + # set to None if goal_target_date (nullable) is None + # and model_fields_set contains the field + if self.goal_target_date is None and "goal_target_date" in self.model_fields_set: + _dict['goal_target_date'] = None + return _dict @classmethod @@ -101,7 +109,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "note": obj.get("note"), "category_group_id": obj.get("category_group_id"), - "goal_target": obj.get("goal_target") + "goal_target": obj.get("goal_target"), + "goal_target_date": obj.get("goal_target_date") }) return _obj diff --git a/ynab/models/save_category_group.py b/ynab/models/save_category_group.py new file mode 100644 index 0000000..05e31a2 --- /dev/null +++ b/ynab/models/save_category_group.py @@ -0,0 +1,88 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SaveCategoryGroup(BaseModel): + """ + SaveCategoryGroup + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=50)] = Field(description="The name of the category group. The name must be a maximum of 50 characters.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SaveCategoryGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SaveCategoryGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/ynab/models/save_category_group_response.py b/ynab/models/save_category_group_response.py new file mode 100644 index 0000000..f42ec67 --- /dev/null +++ b/ynab/models/save_category_group_response.py @@ -0,0 +1,91 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from ynab.models.save_category_group_response_data import SaveCategoryGroupResponseData +from typing import Optional, Set +from typing_extensions import Self + +class SaveCategoryGroupResponse(BaseModel): + """ + SaveCategoryGroupResponse + """ # noqa: E501 + data: SaveCategoryGroupResponseData + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SaveCategoryGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SaveCategoryGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": SaveCategoryGroupResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/ynab/models/save_category_group_response_data.py b/ynab/models/save_category_group_response_data.py new file mode 100644 index 0000000..9ef08b5 --- /dev/null +++ b/ynab/models/save_category_group_response_data.py @@ -0,0 +1,93 @@ +# 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.ynab.com + + The version of the OpenAPI document: 1.81.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from ynab.models.category_group import CategoryGroup +from typing import Optional, Set +from typing_extensions import Self + +class SaveCategoryGroupResponseData(BaseModel): + """ + SaveCategoryGroupResponseData + """ # noqa: E501 + category_group: CategoryGroup + server_knowledge: StrictInt = Field(description="The knowledge of the server") + __properties: ClassVar[List[str]] = ["category_group", "server_knowledge"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SaveCategoryGroupResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of category_group + if self.category_group: + _dict['category_group'] = self.category_group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SaveCategoryGroupResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category_group": CategoryGroup.from_dict(obj["category_group"]) if obj.get("category_group") is not None else None, + "server_knowledge": obj.get("server_knowledge") + }) + return _obj + + diff --git a/ynab/models/save_category_response.py b/ynab/models/save_category_response.py index 6bf49b6..c46212b 100644 --- a/ynab/models/save_category_response.py +++ b/ynab/models/save_category_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_category_response_data.py b/ynab/models/save_category_response_data.py index c83831f..89d6c2b 100644 --- a/ynab/models/save_category_response_data.py +++ b/ynab/models/save_category_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_month_category.py b/ynab/models/save_month_category.py index 1ebd6ec..0b54020 100644 --- a/ynab/models/save_month_category.py +++ b/ynab/models/save_month_category.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -26,7 +26,7 @@ class SaveMonthCategory(BaseModel): """ SaveMonthCategory """ # noqa: E501 - budgeted: StrictInt = Field(description="Budgeted amount in milliunits format") + budgeted: StrictInt = Field(description="Assigned (budgeted) amount in milliunits format") __properties: ClassVar[List[str]] = ["budgeted"] model_config = ConfigDict( diff --git a/ynab/models/save_payee.py b/ynab/models/save_payee.py index 22f31d4..c4a3c7b 100644 --- a/ynab/models/save_payee.py +++ b/ynab/models/save_payee.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_payee_response.py b/ynab/models/save_payee_response.py index 8b7910b..3195bd6 100644 --- a/ynab/models/save_payee_response.py +++ b/ynab/models/save_payee_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_payee_response_data.py b/ynab/models/save_payee_response_data.py index e906cf0..368b4e3 100644 --- a/ynab/models/save_payee_response_data.py +++ b/ynab/models/save_payee_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_scheduled_transaction.py b/ynab/models/save_scheduled_transaction.py index 2a2f871..37a4a61 100644 --- a/ynab/models/save_scheduled_transaction.py +++ b/ynab/models/save_scheduled_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,9 +18,10 @@ import json from datetime import date -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.scheduled_transaction_frequency import ScheduledTransactionFrequency from ynab.models.transaction_flag_color import TransactionFlagColor from typing import Optional, Set @@ -30,12 +31,12 @@ class SaveScheduledTransaction(BaseModel): """ SaveScheduledTransaction """ # noqa: E501 - account_id: StrictStr + account_id: UUID var_date: date = Field(description="The scheduled transaction date in ISO format (e.g. 2016-12-01). This should be a future date no more than 5 years into the future.", alias="date") amount: Optional[StrictInt] = Field(default=None, description="The scheduled transaction amount in milliunits format.") - payee_id: Optional[StrictStr] = Field(default=None, description="The payee for the scheduled transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource.") + payee_id: Optional[UUID] = Field(default=None, description="The payee for the scheduled transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The payee name for the the scheduled transaction. 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 payee with the same name or (2) creation of a new payee.") - category_id: Optional[StrictStr] = Field(default=None, description="The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported.") + category_id: Optional[UUID] = Field(default=None, description="The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported.") memo: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None flag_color: Optional[TransactionFlagColor] = None frequency: Optional[ScheduledTransactionFrequency] = None diff --git a/ynab/models/save_sub_transaction.py b/ynab/models/save_sub_transaction.py index c77f2d5..806e23a 100644 --- a/ynab/models/save_sub_transaction.py +++ b/ynab/models/save_sub_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,9 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -28,9 +29,9 @@ class SaveSubTransaction(BaseModel): SaveSubTransaction """ # noqa: E501 amount: StrictInt = Field(description="The subtransaction amount in milliunits format.") - payee_id: Optional[StrictStr] = Field(default=None, description="The payee for the subtransaction.") + payee_id: Optional[UUID] = Field(default=None, description="The payee for the subtransaction.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, description="The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied.") + category_id: Optional[UUID] = Field(default=None, description="The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied.") memo: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None __properties: ClassVar[List[str]] = ["amount", "payee_id", "payee_name", "category_id", "memo"] diff --git a/ynab/models/save_transaction_with_id_or_import_id.py b/ynab/models/save_transaction_with_id_or_import_id.py index a7e68b0..959460a 100644 --- a/ynab/models/save_transaction_with_id_or_import_id.py +++ b/ynab/models/save_transaction_with_id_or_import_id.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor @@ -31,12 +32,12 @@ class SaveTransactionWithIdOrImportId(BaseModel): """ SaveTransactionWithIdOrImportId """ # noqa: E501 - account_id: Optional[StrictStr] = None + account_id: Optional[UUID] = None var_date: Optional[date] = Field(default=None, 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.", alias="date") amount: Optional[StrictInt] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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 `transfer_payee_id` on the account resource.") + payee_id: Optional[UUID] = Field(default=None, 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 `transfer_payee_id` on the account resource.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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.") + category_id: Optional[UUID] = Field(default=None, 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: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None cleared: Optional[TransactionClearedStatus] = None approved: Optional[StrictBool] = Field(default=None, description="Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.") @@ -92,26 +93,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_subtransactions: _items.append(_item_subtransactions.to_dict()) _dict['subtransactions'] = _items - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if payee_name (nullable) is None - # and model_fields_set contains the field - if self.payee_name is None and "payee_name" in self.model_fields_set: - _dict['payee_name'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: diff --git a/ynab/models/save_transaction_with_optional_fields.py b/ynab/models/save_transaction_with_optional_fields.py index c1823f0..2443c6c 100644 --- a/ynab/models/save_transaction_with_optional_fields.py +++ b/ynab/models/save_transaction_with_optional_fields.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,9 +18,10 @@ import json from datetime import date -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from ynab.models.save_sub_transaction import SaveSubTransaction from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor @@ -31,12 +32,12 @@ class SaveTransactionWithOptionalFields(BaseModel): """ SaveTransactionWithOptionalFields """ # noqa: E501 - account_id: Optional[StrictStr] = None + account_id: Optional[UUID] = None var_date: Optional[date] = Field(default=None, 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.", alias="date") amount: Optional[StrictInt] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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 `transfer_payee_id` on the account resource.") + payee_id: Optional[UUID] = Field(default=None, 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 `transfer_payee_id` on the account resource.") payee_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, 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: Optional[StrictStr] = Field(default=None, 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.") + category_id: Optional[UUID] = Field(default=None, 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: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None cleared: Optional[TransactionClearedStatus] = None approved: Optional[StrictBool] = Field(default=None, description="Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.") diff --git a/ynab/models/save_transactions_response.py b/ynab/models/save_transactions_response.py index c6fbd1f..c48fd10 100644 --- a/ynab/models/save_transactions_response.py +++ b/ynab/models/save_transactions_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/save_transactions_response_data.py b/ynab/models/save_transactions_response_data.py index 84aa38f..be088b5 100644 --- a/ynab/models/save_transactions_response_data.py +++ b/ynab/models/save_transactions_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/scheduled_sub_transaction.py b/ynab/models/scheduled_sub_transaction.py index b0a1f36..663fb1c 100644 --- a/ynab/models/scheduled_sub_transaction.py +++ b/ynab/models/scheduled_sub_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -26,15 +27,15 @@ class ScheduledSubTransaction(BaseModel): """ ScheduledSubTransaction """ # noqa: E501 - id: StrictStr - scheduled_transaction_id: StrictStr + id: UUID + scheduled_transaction_id: UUID amount: StrictInt = Field(description="The scheduled subtransaction amount in milliunits format") memo: Optional[StrictStr] = None - payee_id: Optional[StrictStr] = None + payee_id: Optional[UUID] = None payee_name: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None + category_id: Optional[UUID] = None category_name: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer, the account_id which the scheduled subtransaction transfers to") + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer, the account_id which the scheduled subtransaction transfers to") deleted: StrictBool = Field(description="Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests.") __properties: ClassVar[List[str]] = ["id", "scheduled_transaction_id", "amount", "memo", "payee_id", "payee_name", "category_id", "category_name", "transfer_account_id", "deleted"] diff --git a/ynab/models/scheduled_transaction_detail.py b/ynab/models/scheduled_transaction_detail.py index 7cd29c2..da5126d 100644 --- a/ynab/models/scheduled_transaction_detail.py +++ b/ynab/models/scheduled_transaction_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.scheduled_sub_transaction import ScheduledSubTransaction from ynab.models.transaction_flag_color import TransactionFlagColor from typing import Optional, Set @@ -29,7 +30,7 @@ class ScheduledTransactionDetail(BaseModel): """ ScheduledTransactionDetail """ # noqa: E501 - id: StrictStr + id: UUID date_first: date = Field(description="The first date for which the Scheduled Transaction was scheduled.") date_next: date = Field(description="The next date for which the Scheduled Transaction is scheduled.") frequency: StrictStr @@ -37,10 +38,10 @@ class ScheduledTransactionDetail(BaseModel): memo: Optional[StrictStr] = None flag_color: Optional[TransactionFlagColor] = None flag_name: Optional[StrictStr] = Field(default=None, description="The customized name of a transaction flag") - account_id: StrictStr - payee_id: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer, the account_id which the scheduled transaction transfers to") + account_id: UUID + payee_id: Optional[UUID] = None + category_id: Optional[UUID] = None + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer, the account_id which the scheduled transaction transfers to") deleted: StrictBool = Field(description="Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests.") account_name: StrictStr payee_name: Optional[StrictStr] = None @@ -101,36 +102,11 @@ def to_dict(self) -> Dict[str, Any]: if _item_subtransactions: _items.append(_item_subtransactions.to_dict()) _dict['subtransactions'] = _items - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: _dict['flag_color'] = None - # set to None if flag_name (nullable) is None - # and model_fields_set contains the field - if self.flag_name is None and "flag_name" in self.model_fields_set: - _dict['flag_name'] = None - - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if transfer_account_id (nullable) is None - # and model_fields_set contains the field - if self.transfer_account_id is None and "transfer_account_id" in self.model_fields_set: - _dict['transfer_account_id'] = None - # set to None if payee_name (nullable) is None # and model_fields_set contains the field if self.payee_name is None and "payee_name" in self.model_fields_set: diff --git a/ynab/models/scheduled_transaction_frequency.py b/ynab/models/scheduled_transaction_frequency.py index 8ea94ad..efcd3f4 100644 --- a/ynab/models/scheduled_transaction_frequency.py +++ b/ynab/models/scheduled_transaction_frequency.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/scheduled_transaction_response.py b/ynab/models/scheduled_transaction_response.py index 288ee2d..fc83653 100644 --- a/ynab/models/scheduled_transaction_response.py +++ b/ynab/models/scheduled_transaction_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/scheduled_transaction_response_data.py b/ynab/models/scheduled_transaction_response_data.py index bfe6b66..1ae6db0 100644 --- a/ynab/models/scheduled_transaction_response_data.py +++ b/ynab/models/scheduled_transaction_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/scheduled_transaction_summary.py b/ynab/models/scheduled_transaction_summary.py index acbc4a1..150aaf9 100644 --- a/ynab/models/scheduled_transaction_summary.py +++ b/ynab/models/scheduled_transaction_summary.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.transaction_flag_color import TransactionFlagColor from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class ScheduledTransactionSummary(BaseModel): """ ScheduledTransactionSummary """ # noqa: E501 - id: StrictStr + id: UUID date_first: date = Field(description="The first date for which the Scheduled Transaction was scheduled.") date_next: date = Field(description="The next date for which the Scheduled Transaction is scheduled.") frequency: StrictStr @@ -36,10 +37,10 @@ class ScheduledTransactionSummary(BaseModel): memo: Optional[StrictStr] = None flag_color: Optional[TransactionFlagColor] = None flag_name: Optional[StrictStr] = Field(default=None, description="The customized name of a transaction flag") - account_id: StrictStr - payee_id: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer, the account_id which the scheduled transaction transfers to") + account_id: UUID + payee_id: Optional[UUID] = None + category_id: Optional[UUID] = None + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer, the account_id which the scheduled transaction transfers to") deleted: StrictBool = Field(description="Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests.") __properties: ClassVar[List[str]] = ["id", "date_first", "date_next", "frequency", "amount", "memo", "flag_color", "flag_name", "account_id", "payee_id", "category_id", "transfer_account_id", "deleted"] diff --git a/ynab/models/scheduled_transactions_response.py b/ynab/models/scheduled_transactions_response.py index 9a21b86..9f9ce84 100644 --- a/ynab/models/scheduled_transactions_response.py +++ b/ynab/models/scheduled_transactions_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/scheduled_transactions_response_data.py b/ynab/models/scheduled_transactions_response_data.py index 5033041..bd50ca0 100644 --- a/ynab/models/scheduled_transactions_response_data.py +++ b/ynab/models/scheduled_transactions_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/sub_transaction.py b/ynab/models/sub_transaction.py index 2fc2759..2b9e341 100644 --- a/ynab/models/sub_transaction.py +++ b/ynab/models/sub_transaction.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -30,11 +31,11 @@ class SubTransaction(BaseModel): transaction_id: StrictStr amount: StrictInt = Field(description="The subtransaction amount in milliunits format") memo: Optional[StrictStr] = None - payee_id: Optional[StrictStr] = None + payee_id: Optional[UUID] = None payee_name: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None + category_id: Optional[UUID] = None category_name: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer, the account_id which the subtransaction transfers to") + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer, the account_id which the subtransaction transfers to") transfer_transaction_id: Optional[StrictStr] = Field(default=None, description="If a transfer, the id of transaction on the other side of the transfer") deleted: StrictBool = Field(description="Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests.") __properties: ClassVar[List[str]] = ["id", "transaction_id", "amount", "memo", "payee_id", "payee_name", "category_id", "category_name", "transfer_account_id", "transfer_transaction_id", "deleted"] diff --git a/ynab/models/transaction_cleared_status.py b/ynab/models/transaction_cleared_status.py index 43ea985..c4f7b86 100644 --- a/ynab/models/transaction_cleared_status.py +++ b/ynab/models/transaction_cleared_status.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transaction_detail.py b/ynab/models/transaction_detail.py index fa1ae75..90dd8cc 100644 --- a/ynab/models/transaction_detail.py +++ b/ynab/models/transaction_detail.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.sub_transaction import SubTransaction from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor @@ -38,10 +39,10 @@ class TransactionDetail(BaseModel): approved: StrictBool = Field(description="Whether or not the transaction is approved") flag_color: Optional[TransactionFlagColor] = None flag_name: Optional[StrictStr] = Field(default=None, description="The customized name of a transaction flag") - account_id: StrictStr - payee_id: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the account to which it transfers") + account_id: UUID + payee_id: Optional[UUID] = None + category_id: Optional[UUID] = None + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer transaction, the account to which it transfers") transfer_transaction_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the id of transaction on the other side of the transfer") matched_transaction_id: Optional[StrictStr] = Field(default=None, description="If transaction is matched, the id of the matched transaction") import_id: Optional[StrictStr] = Field(default=None, 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'.") @@ -111,61 +112,11 @@ def to_dict(self) -> Dict[str, Any]: if _item_subtransactions: _items.append(_item_subtransactions.to_dict()) _dict['subtransactions'] = _items - # set to None if memo (nullable) is None - # and model_fields_set contains the field - if self.memo is None and "memo" in self.model_fields_set: - _dict['memo'] = None - # set to None if flag_color (nullable) is None # and model_fields_set contains the field if self.flag_color is None and "flag_color" in self.model_fields_set: _dict['flag_color'] = None - # set to None if flag_name (nullable) is None - # and model_fields_set contains the field - if self.flag_name is None and "flag_name" in self.model_fields_set: - _dict['flag_name'] = None - - # set to None if payee_id (nullable) is None - # and model_fields_set contains the field - if self.payee_id is None and "payee_id" in self.model_fields_set: - _dict['payee_id'] = None - - # set to None if category_id (nullable) is None - # and model_fields_set contains the field - if self.category_id is None and "category_id" in self.model_fields_set: - _dict['category_id'] = None - - # set to None if transfer_account_id (nullable) is None - # and model_fields_set contains the field - if self.transfer_account_id is None and "transfer_account_id" in self.model_fields_set: - _dict['transfer_account_id'] = None - - # set to None if transfer_transaction_id (nullable) is None - # and model_fields_set contains the field - if self.transfer_transaction_id is None and "transfer_transaction_id" in self.model_fields_set: - _dict['transfer_transaction_id'] = None - - # set to None if matched_transaction_id (nullable) is None - # and model_fields_set contains the field - if self.matched_transaction_id is None and "matched_transaction_id" in self.model_fields_set: - _dict['matched_transaction_id'] = None - - # set to None if import_id (nullable) is None - # and model_fields_set contains the field - if self.import_id is None and "import_id" in self.model_fields_set: - _dict['import_id'] = None - - # set to None if import_payee_name (nullable) is None - # and model_fields_set contains the field - if self.import_payee_name is None and "import_payee_name" in self.model_fields_set: - _dict['import_payee_name'] = None - - # set to None if import_payee_name_original (nullable) is None - # and model_fields_set contains the field - if self.import_payee_name_original is None and "import_payee_name_original" in self.model_fields_set: - _dict['import_payee_name_original'] = None - # set to None if debt_transaction_type (nullable) is None # and model_fields_set contains the field if self.debt_transaction_type is None and "debt_transaction_type" in self.model_fields_set: diff --git a/ynab/models/transaction_flag_color.py b/ynab/models/transaction_flag_color.py index a041529..d26d320 100644 --- a/ynab/models/transaction_flag_color.py +++ b/ynab/models/transaction_flag_color.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transaction_response.py b/ynab/models/transaction_response.py index e34121b..6d91a2c 100644 --- a/ynab/models/transaction_response.py +++ b/ynab/models/transaction_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transaction_response_data.py b/ynab/models/transaction_response_data.py index 15d5276..a6c1254 100644 --- a/ynab/models/transaction_response_data.py +++ b/ynab/models/transaction_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transaction_summary.py b/ynab/models/transaction_summary.py index 960cdc3..bc4f887 100644 --- a/ynab/models/transaction_summary.py +++ b/ynab/models/transaction_summary.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from ynab.models.transaction_cleared_status import TransactionClearedStatus from ynab.models.transaction_flag_color import TransactionFlagColor from typing import Optional, Set @@ -37,10 +38,10 @@ class TransactionSummary(BaseModel): approved: StrictBool = Field(description="Whether or not the transaction is approved") flag_color: Optional[TransactionFlagColor] = None flag_name: Optional[StrictStr] = Field(default=None, description="The customized name of a transaction flag") - account_id: StrictStr - payee_id: Optional[StrictStr] = None - category_id: Optional[StrictStr] = None - transfer_account_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the account to which it transfers") + account_id: UUID + payee_id: Optional[UUID] = None + category_id: Optional[UUID] = None + transfer_account_id: Optional[UUID] = Field(default=None, description="If a transfer transaction, the account to which it transfers") transfer_transaction_id: Optional[StrictStr] = Field(default=None, description="If a transfer transaction, the id of transaction on the other side of the transfer") matched_transaction_id: Optional[StrictStr] = Field(default=None, description="If transaction is matched, the id of the matched transaction") import_id: Optional[StrictStr] = Field(default=None, 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'.") diff --git a/ynab/models/transactions_import_response.py b/ynab/models/transactions_import_response.py index bb610c9..71c0b6e 100644 --- a/ynab/models/transactions_import_response.py +++ b/ynab/models/transactions_import_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transactions_import_response_data.py b/ynab/models/transactions_import_response_data.py index 38917f5..3dae882 100644 --- a/ynab/models/transactions_import_response_data.py +++ b/ynab/models/transactions_import_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transactions_response.py b/ynab/models/transactions_response.py index 6afd492..716cacd 100644 --- a/ynab/models/transactions_response.py +++ b/ynab/models/transactions_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/transactions_response_data.py b/ynab/models/transactions_response_data.py index 8d3c277..816a852 100644 --- a/ynab/models/transactions_response_data.py +++ b/ynab/models/transactions_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/user.py b/ynab/models/user.py index 0369552..9fed5e3 100644 --- a/ynab/models/user.py +++ b/ynab/models/user.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -26,7 +27,7 @@ class User(BaseModel): """ User """ # noqa: E501 - id: StrictStr + id: UUID __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( diff --git a/ynab/models/user_response.py b/ynab/models/user_response.py index aa00281..2e74755 100644 --- a/ynab/models/user_response.py +++ b/ynab/models/user_response.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/models/user_response_data.py b/ynab/models/user_response_data.py index 076f2b1..b3888a1 100644 --- a/ynab/models/user_response_data.py +++ b/ynab/models/user_response_data.py @@ -5,7 +5,7 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/ynab/rest.py b/ynab/rest.py index ebad6f4..8d750d0 100644 --- a/ynab/rest.py +++ b/ynab/rest.py @@ -5,13 +5,12 @@ Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com - The version of the OpenAPI document: 1.76.0 + The version of the OpenAPI document: 1.81.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 - import io import json import re