From 45e282d299fd16207fdde804d2821b40a2172314 Mon Sep 17 00:00:00 2001 From: Justin Flannery Date: Thu, 26 Dec 2024 16:51:06 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8D=20python=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clients/python/.github/workflows/python.yml | 30 + clients/python/.gitignore | 66 + clients/python/.gitlab-ci.yml | 31 + clients/python/.openapi-generator-ignore | 23 + clients/python/.openapi-generator/FILES | 146 ++ clients/python/.openapi-generator/VERSION | 1 + clients/python/.travis.yml | 17 + clients/python/README.md | 211 +++ clients/python/docs/AccountTypeEnum.md | 25 + clients/python/docs/CategoriesApi.md | 454 ++++++ clients/python/docs/CategoryObject.md | 40 + ...reateCategoryRequestObjectChildrenInner.md | 36 + .../docs/CreateNewTransactions201Response.md | 28 + .../docs/CreateNewTransactionsRequest.md | 30 + clients/python/docs/CurrencyEnum.md | 331 ++++ ...egoryResponseWithDependenciesDependents.md | 32 + ...teTagResponseWithDependenciesDependents.md | 28 + .../python/docs/DeleteTransactionsRequest.md | 27 + clients/python/docs/ErrorResponseObject.md | 28 + .../docs/GetAllCategories200Response.md | 27 + .../docs/GetAllManualAccounts200Response.md | 27 + .../docs/GetAllPlaidAccounts200Response.md | 27 + .../python/docs/GetAllRecurring200Response.md | 27 + clients/python/docs/GetAllTags200Response.md | 27 + .../docs/GetAllTransactions200Response.md | 29 + .../docs/GroupTransactions201Response.md | 27 + .../python/docs/GroupTransactionsRequest.md | 33 + .../docs/InsertTransactionObjectAmount.md | 28 + clients/python/docs/ManualAccountObject.md | 42 + clients/python/docs/ManualAccountsApi.md | 446 ++++++ clients/python/docs/MeApi.md | 90 ++ clients/python/docs/PlaidAccountObject.md | 46 + clients/python/docs/PlaidAccountsApi.md | 272 ++++ clients/python/docs/RecurringApi.md | 192 +++ clients/python/docs/RecurringObject.md | 36 + clients/python/docs/RecurringObjectMatches.md | 33 + ...ringObjectMatchesFoundTransactionsInner.md | 28 + .../python/docs/RecurringObjectOverrides.md | 31 + .../RecurringObjectTransactionCriteria.md | 39 + .../docs/SplitTransactionObjectAmount.md | 28 + .../python/docs/SplitTransactionRequest.md | 27 + clients/python/docs/TagObject.md | 33 + clients/python/docs/TagsApi.md | 449 ++++++ clients/python/docs/TransactionObject.md | 52 + clients/python/docs/TransactionsApi.md | 182 +++ clients/python/docs/TransactionsBulkApi.md | 294 ++++ clients/python/docs/TransactionsGroupApi.md | 180 +++ clients/python/docs/TransactionsSplitApi.md | 182 +++ clients/python/docs/UserObject.md | 33 + clients/python/git_push.sh | 57 + clients/python/lunchable/__init__.py | 97 ++ clients/python/lunchable/api/__init__.py | 13 + .../python/lunchable/api/categories_api.py | 1427 +++++++++++++++++ .../lunchable/api/manual_accounts_api.py | 1354 ++++++++++++++++ clients/python/lunchable/api/me_api.py | 271 ++++ .../lunchable/api/plaid_accounts_api.py | 890 ++++++++++ clients/python/lunchable/api/recurring_api.py | 714 +++++++++ clients/python/lunchable/api/tags_api.py | 1365 ++++++++++++++++ .../python/lunchable/api/transactions_api.py | 583 +++++++ .../lunchable/api/transactions_bulk_api.py | 1233 ++++++++++++++ .../lunchable/api/transactions_group_api.py | 559 +++++++ .../lunchable/api/transactions_split_api.py | 577 +++++++ clients/python/lunchable/api_client.py | 747 +++++++++ clients/python/lunchable/api_response.py | 20 + clients/python/lunchable/configuration.py | 625 ++++++++ clients/python/lunchable/exceptions.py | 199 +++ clients/python/lunchable/models/__init__.py | 71 + .../lunchable/models/account_type_enum.py | 43 + .../lunchable/models/category_object.py | 190 +++ ..._category_request_object_children_inner.py | 159 ++ .../create_new_transactions201_response.py | 120 ++ .../models/create_new_transactions_request.py | 127 ++ .../python/lunchable/models/currency_enum.py | 195 +++ ...y_response_with_dependencies_dependents.py | 116 ++ ...g_response_with_dependencies_dependents.py | 90 ++ .../models/delete_transactions_request.py | 85 + .../lunchable/models/error_response_object.py | 86 + .../models/get_all_categories200_response.py | 99 ++ .../get_all_manual_accounts200_response.py | 100 ++ .../get_all_plaid_accounts200_response.py | 100 ++ .../models/get_all_recurring200_response.py | 99 ++ .../models/get_all_tags200_response.py | 97 ++ .../get_all_transactions200_response.py | 105 ++ .../models/group_transactions201_response.py | 99 ++ .../models/group_transactions_request.py | 147 ++ .../insert_transaction_object_amount.py | 170 ++ .../lunchable/models/manual_account_object.py | 221 +++ .../lunchable/models/plaid_account_object.py | 234 +++ .../lunchable/models/recurring_object.py | 180 +++ .../models/recurring_object_matches.py | 134 ++ ...object_matches_found_transactions_inner.py | 94 ++ .../models/recurring_object_overrides.py | 100 ++ .../recurring_object_transaction_criteria.py | 216 +++ .../models/split_transaction_object_amount.py | 170 ++ .../models/split_transaction_request.py | 101 ++ clients/python/lunchable/models/tag_object.py | 126 ++ .../lunchable/models/transaction_object.py | 328 ++++ .../python/lunchable/models/user_object.py | 121 ++ clients/python/lunchable/py.typed | 0 clients/python/lunchable/rest.py | 243 +++ clients/python/pyproject.toml | 70 + clients/python/requirements.txt | 4 + clients/python/setup.cfg | 2 + clients/python/setup.py | 50 + clients/python/test-requirements.txt | 6 + clients/python/test/__init__.py | 0 clients/python/test/test_account_type_enum.py | 33 + clients/python/test/test_categories_api.py | 66 + clients/python/test/test_category_object.py | 91 ++ ..._category_request_object_children_inner.py | 76 + ...est_create_new_transactions201_response.py | 137 ++ .../test_create_new_transactions_request.py | 93 ++ clients/python/test/test_currency_enum.py | 33 + ...y_response_with_dependencies_dependents.py | 68 + ...g_response_with_dependencies_dependents.py | 60 + .../test/test_delete_transactions_request.py | 58 + .../python/test/test_error_response_object.py | 60 + .../test_get_all_categories200_response.py | 81 + ...est_get_all_manual_accounts200_response.py | 71 + ...test_get_all_plaid_accounts200_response.py | 75 + .../test_get_all_recurring200_response.py | 92 ++ .../test/test_get_all_tags200_response.py | 62 + .../test_get_all_transactions200_response.py | 133 ++ .../test_group_transactions201_response.py | 90 ++ .../test/test_group_transactions_request.py | 68 + .../test_insert_transaction_object_amount.py | 54 + .../python/test/test_manual_account_object.py | 66 + .../python/test/test_manual_accounts_api.py | 66 + clients/python/test/test_me_api.py | 38 + .../python/test/test_plaid_account_object.py | 88 + .../python/test/test_plaid_accounts_api.py | 52 + clients/python/test/test_recurring_api.py | 45 + clients/python/test/test_recurring_object.py | 126 ++ .../test/test_recurring_object_matches.py | 65 + ...object_matches_found_transactions_inner.py | 58 + .../test/test_recurring_object_overrides.py | 55 + ...t_recurring_object_transaction_criteria.py | 65 + .../test_split_transaction_object_amount.py | 54 + .../test/test_split_transaction_request.py | 68 + clients/python/test/test_tag_object.py | 66 + clients/python/test/test_tags_api.py | 66 + .../python/test/test_transaction_object.py | 116 ++ clients/python/test/test_transactions_api.py | 45 + .../python/test/test_transactions_bulk_api.py | 52 + .../test/test_transactions_group_api.py | 45 + .../test/test_transactions_split_api.py | 45 + clients/python/test/test_user_object.py | 66 + clients/python/tox.ini | 9 + 148 files changed, 22837 insertions(+) create mode 100644 clients/python/.github/workflows/python.yml create mode 100644 clients/python/.gitignore create mode 100644 clients/python/.gitlab-ci.yml create mode 100644 clients/python/.openapi-generator-ignore create mode 100644 clients/python/.openapi-generator/FILES create mode 100644 clients/python/.openapi-generator/VERSION create mode 100644 clients/python/.travis.yml create mode 100644 clients/python/README.md create mode 100644 clients/python/docs/AccountTypeEnum.md create mode 100644 clients/python/docs/CategoriesApi.md create mode 100644 clients/python/docs/CategoryObject.md create mode 100644 clients/python/docs/CreateCategoryRequestObjectChildrenInner.md create mode 100644 clients/python/docs/CreateNewTransactions201Response.md create mode 100644 clients/python/docs/CreateNewTransactionsRequest.md create mode 100644 clients/python/docs/CurrencyEnum.md create mode 100644 clients/python/docs/DeleteCategoryResponseWithDependenciesDependents.md create mode 100644 clients/python/docs/DeleteTagResponseWithDependenciesDependents.md create mode 100644 clients/python/docs/DeleteTransactionsRequest.md create mode 100644 clients/python/docs/ErrorResponseObject.md create mode 100644 clients/python/docs/GetAllCategories200Response.md create mode 100644 clients/python/docs/GetAllManualAccounts200Response.md create mode 100644 clients/python/docs/GetAllPlaidAccounts200Response.md create mode 100644 clients/python/docs/GetAllRecurring200Response.md create mode 100644 clients/python/docs/GetAllTags200Response.md create mode 100644 clients/python/docs/GetAllTransactions200Response.md create mode 100644 clients/python/docs/GroupTransactions201Response.md create mode 100644 clients/python/docs/GroupTransactionsRequest.md create mode 100644 clients/python/docs/InsertTransactionObjectAmount.md create mode 100644 clients/python/docs/ManualAccountObject.md create mode 100644 clients/python/docs/ManualAccountsApi.md create mode 100644 clients/python/docs/MeApi.md create mode 100644 clients/python/docs/PlaidAccountObject.md create mode 100644 clients/python/docs/PlaidAccountsApi.md create mode 100644 clients/python/docs/RecurringApi.md create mode 100644 clients/python/docs/RecurringObject.md create mode 100644 clients/python/docs/RecurringObjectMatches.md create mode 100644 clients/python/docs/RecurringObjectMatchesFoundTransactionsInner.md create mode 100644 clients/python/docs/RecurringObjectOverrides.md create mode 100644 clients/python/docs/RecurringObjectTransactionCriteria.md create mode 100644 clients/python/docs/SplitTransactionObjectAmount.md create mode 100644 clients/python/docs/SplitTransactionRequest.md create mode 100644 clients/python/docs/TagObject.md create mode 100644 clients/python/docs/TagsApi.md create mode 100644 clients/python/docs/TransactionObject.md create mode 100644 clients/python/docs/TransactionsApi.md create mode 100644 clients/python/docs/TransactionsBulkApi.md create mode 100644 clients/python/docs/TransactionsGroupApi.md create mode 100644 clients/python/docs/TransactionsSplitApi.md create mode 100644 clients/python/docs/UserObject.md create mode 100644 clients/python/git_push.sh create mode 100644 clients/python/lunchable/__init__.py create mode 100644 clients/python/lunchable/api/__init__.py create mode 100644 clients/python/lunchable/api/categories_api.py create mode 100644 clients/python/lunchable/api/manual_accounts_api.py create mode 100644 clients/python/lunchable/api/me_api.py create mode 100644 clients/python/lunchable/api/plaid_accounts_api.py create mode 100644 clients/python/lunchable/api/recurring_api.py create mode 100644 clients/python/lunchable/api/tags_api.py create mode 100644 clients/python/lunchable/api/transactions_api.py create mode 100644 clients/python/lunchable/api/transactions_bulk_api.py create mode 100644 clients/python/lunchable/api/transactions_group_api.py create mode 100644 clients/python/lunchable/api/transactions_split_api.py create mode 100644 clients/python/lunchable/api_client.py create mode 100644 clients/python/lunchable/api_response.py create mode 100644 clients/python/lunchable/configuration.py create mode 100644 clients/python/lunchable/exceptions.py create mode 100644 clients/python/lunchable/models/__init__.py create mode 100644 clients/python/lunchable/models/account_type_enum.py create mode 100644 clients/python/lunchable/models/category_object.py create mode 100644 clients/python/lunchable/models/create_category_request_object_children_inner.py create mode 100644 clients/python/lunchable/models/create_new_transactions201_response.py create mode 100644 clients/python/lunchable/models/create_new_transactions_request.py create mode 100644 clients/python/lunchable/models/currency_enum.py create mode 100644 clients/python/lunchable/models/delete_category_response_with_dependencies_dependents.py create mode 100644 clients/python/lunchable/models/delete_tag_response_with_dependencies_dependents.py create mode 100644 clients/python/lunchable/models/delete_transactions_request.py create mode 100644 clients/python/lunchable/models/error_response_object.py create mode 100644 clients/python/lunchable/models/get_all_categories200_response.py create mode 100644 clients/python/lunchable/models/get_all_manual_accounts200_response.py create mode 100644 clients/python/lunchable/models/get_all_plaid_accounts200_response.py create mode 100644 clients/python/lunchable/models/get_all_recurring200_response.py create mode 100644 clients/python/lunchable/models/get_all_tags200_response.py create mode 100644 clients/python/lunchable/models/get_all_transactions200_response.py create mode 100644 clients/python/lunchable/models/group_transactions201_response.py create mode 100644 clients/python/lunchable/models/group_transactions_request.py create mode 100644 clients/python/lunchable/models/insert_transaction_object_amount.py create mode 100644 clients/python/lunchable/models/manual_account_object.py create mode 100644 clients/python/lunchable/models/plaid_account_object.py create mode 100644 clients/python/lunchable/models/recurring_object.py create mode 100644 clients/python/lunchable/models/recurring_object_matches.py create mode 100644 clients/python/lunchable/models/recurring_object_matches_found_transactions_inner.py create mode 100644 clients/python/lunchable/models/recurring_object_overrides.py create mode 100644 clients/python/lunchable/models/recurring_object_transaction_criteria.py create mode 100644 clients/python/lunchable/models/split_transaction_object_amount.py create mode 100644 clients/python/lunchable/models/split_transaction_request.py create mode 100644 clients/python/lunchable/models/tag_object.py create mode 100644 clients/python/lunchable/models/transaction_object.py create mode 100644 clients/python/lunchable/models/user_object.py create mode 100644 clients/python/lunchable/py.typed create mode 100644 clients/python/lunchable/rest.py create mode 100644 clients/python/pyproject.toml create mode 100644 clients/python/requirements.txt create mode 100644 clients/python/setup.cfg create mode 100644 clients/python/setup.py create mode 100644 clients/python/test-requirements.txt create mode 100644 clients/python/test/__init__.py create mode 100644 clients/python/test/test_account_type_enum.py create mode 100644 clients/python/test/test_categories_api.py create mode 100644 clients/python/test/test_category_object.py create mode 100644 clients/python/test/test_create_category_request_object_children_inner.py create mode 100644 clients/python/test/test_create_new_transactions201_response.py create mode 100644 clients/python/test/test_create_new_transactions_request.py create mode 100644 clients/python/test/test_currency_enum.py create mode 100644 clients/python/test/test_delete_category_response_with_dependencies_dependents.py create mode 100644 clients/python/test/test_delete_tag_response_with_dependencies_dependents.py create mode 100644 clients/python/test/test_delete_transactions_request.py create mode 100644 clients/python/test/test_error_response_object.py create mode 100644 clients/python/test/test_get_all_categories200_response.py create mode 100644 clients/python/test/test_get_all_manual_accounts200_response.py create mode 100644 clients/python/test/test_get_all_plaid_accounts200_response.py create mode 100644 clients/python/test/test_get_all_recurring200_response.py create mode 100644 clients/python/test/test_get_all_tags200_response.py create mode 100644 clients/python/test/test_get_all_transactions200_response.py create mode 100644 clients/python/test/test_group_transactions201_response.py create mode 100644 clients/python/test/test_group_transactions_request.py create mode 100644 clients/python/test/test_insert_transaction_object_amount.py create mode 100644 clients/python/test/test_manual_account_object.py create mode 100644 clients/python/test/test_manual_accounts_api.py create mode 100644 clients/python/test/test_me_api.py create mode 100644 clients/python/test/test_plaid_account_object.py create mode 100644 clients/python/test/test_plaid_accounts_api.py create mode 100644 clients/python/test/test_recurring_api.py create mode 100644 clients/python/test/test_recurring_object.py create mode 100644 clients/python/test/test_recurring_object_matches.py create mode 100644 clients/python/test/test_recurring_object_matches_found_transactions_inner.py create mode 100644 clients/python/test/test_recurring_object_overrides.py create mode 100644 clients/python/test/test_recurring_object_transaction_criteria.py create mode 100644 clients/python/test/test_split_transaction_object_amount.py create mode 100644 clients/python/test/test_split_transaction_request.py create mode 100644 clients/python/test/test_tag_object.py create mode 100644 clients/python/test/test_tags_api.py create mode 100644 clients/python/test/test_transaction_object.py create mode 100644 clients/python/test/test_transactions_api.py create mode 100644 clients/python/test/test_transactions_bulk_api.py create mode 100644 clients/python/test/test_transactions_group_api.py create mode 100644 clients/python/test/test_transactions_split_api.py create mode 100644 clients/python/test/test_user_object.py create mode 100644 clients/python/tox.ini diff --git a/clients/python/.github/workflows/python.yml b/clients/python/.github/workflows/python.yml new file mode 100644 index 00000000..25327653 --- /dev/null +++ b/clients/python/.github/workflows/python.yml @@ -0,0 +1,30 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: lunchable Python package + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov={{packageName}} diff --git a/clients/python/.gitignore b/clients/python/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/clients/python/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/clients/python/.gitlab-ci.yml b/clients/python/.gitlab-ci.yml new file mode 100644 index 00000000..adf999b1 --- /dev/null +++ b/clients/python/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=lunchable + +pytest-3.8: + extends: .pytest + image: python:3.8-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine diff --git a/clients/python/.openapi-generator-ignore b/clients/python/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/clients/python/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES new file mode 100644 index 00000000..746b5075 --- /dev/null +++ b/clients/python/.openapi-generator/FILES @@ -0,0 +1,146 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AccountTypeEnum.md +docs/CategoriesApi.md +docs/CategoryObject.md +docs/CreateCategoryRequestObjectChildrenInner.md +docs/CreateNewTransactions201Response.md +docs/CreateNewTransactionsRequest.md +docs/CurrencyEnum.md +docs/DeleteCategoryResponseWithDependenciesDependents.md +docs/DeleteTagResponseWithDependenciesDependents.md +docs/DeleteTransactionsRequest.md +docs/ErrorResponseObject.md +docs/GetAllCategories200Response.md +docs/GetAllManualAccounts200Response.md +docs/GetAllPlaidAccounts200Response.md +docs/GetAllRecurring200Response.md +docs/GetAllTags200Response.md +docs/GetAllTransactions200Response.md +docs/GroupTransactions201Response.md +docs/GroupTransactionsRequest.md +docs/InsertTransactionObjectAmount.md +docs/ManualAccountObject.md +docs/ManualAccountsApi.md +docs/MeApi.md +docs/PlaidAccountObject.md +docs/PlaidAccountsApi.md +docs/RecurringApi.md +docs/RecurringObject.md +docs/RecurringObjectMatches.md +docs/RecurringObjectMatchesFoundTransactionsInner.md +docs/RecurringObjectOverrides.md +docs/RecurringObjectTransactionCriteria.md +docs/SplitTransactionObjectAmount.md +docs/SplitTransactionRequest.md +docs/TagObject.md +docs/TagsApi.md +docs/TransactionObject.md +docs/TransactionsApi.md +docs/TransactionsBulkApi.md +docs/TransactionsGroupApi.md +docs/TransactionsSplitApi.md +docs/UserObject.md +git_push.sh +lunchable/__init__.py +lunchable/api/__init__.py +lunchable/api/categories_api.py +lunchable/api/manual_accounts_api.py +lunchable/api/me_api.py +lunchable/api/plaid_accounts_api.py +lunchable/api/recurring_api.py +lunchable/api/tags_api.py +lunchable/api/transactions_api.py +lunchable/api/transactions_bulk_api.py +lunchable/api/transactions_group_api.py +lunchable/api/transactions_split_api.py +lunchable/api_client.py +lunchable/api_response.py +lunchable/configuration.py +lunchable/exceptions.py +lunchable/models/__init__.py +lunchable/models/account_type_enum.py +lunchable/models/category_object.py +lunchable/models/create_category_request_object_children_inner.py +lunchable/models/create_new_transactions201_response.py +lunchable/models/create_new_transactions_request.py +lunchable/models/currency_enum.py +lunchable/models/delete_category_response_with_dependencies_dependents.py +lunchable/models/delete_tag_response_with_dependencies_dependents.py +lunchable/models/delete_transactions_request.py +lunchable/models/error_response_object.py +lunchable/models/get_all_categories200_response.py +lunchable/models/get_all_manual_accounts200_response.py +lunchable/models/get_all_plaid_accounts200_response.py +lunchable/models/get_all_recurring200_response.py +lunchable/models/get_all_tags200_response.py +lunchable/models/get_all_transactions200_response.py +lunchable/models/group_transactions201_response.py +lunchable/models/group_transactions_request.py +lunchable/models/insert_transaction_object_amount.py +lunchable/models/manual_account_object.py +lunchable/models/plaid_account_object.py +lunchable/models/recurring_object.py +lunchable/models/recurring_object_matches.py +lunchable/models/recurring_object_matches_found_transactions_inner.py +lunchable/models/recurring_object_overrides.py +lunchable/models/recurring_object_transaction_criteria.py +lunchable/models/split_transaction_object_amount.py +lunchable/models/split_transaction_request.py +lunchable/models/tag_object.py +lunchable/models/transaction_object.py +lunchable/models/user_object.py +lunchable/py.typed +lunchable/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_type_enum.py +test/test_categories_api.py +test/test_category_object.py +test/test_create_category_request_object_children_inner.py +test/test_create_new_transactions201_response.py +test/test_create_new_transactions_request.py +test/test_currency_enum.py +test/test_delete_category_response_with_dependencies_dependents.py +test/test_delete_tag_response_with_dependencies_dependents.py +test/test_delete_transactions_request.py +test/test_error_response_object.py +test/test_get_all_categories200_response.py +test/test_get_all_manual_accounts200_response.py +test/test_get_all_plaid_accounts200_response.py +test/test_get_all_recurring200_response.py +test/test_get_all_tags200_response.py +test/test_get_all_transactions200_response.py +test/test_group_transactions201_response.py +test/test_group_transactions_request.py +test/test_insert_transaction_object_amount.py +test/test_manual_account_object.py +test/test_manual_accounts_api.py +test/test_me_api.py +test/test_plaid_account_object.py +test/test_plaid_accounts_api.py +test/test_recurring_api.py +test/test_recurring_object.py +test/test_recurring_object_matches.py +test/test_recurring_object_matches_found_transactions_inner.py +test/test_recurring_object_overrides.py +test/test_recurring_object_transaction_criteria.py +test/test_split_transaction_object_amount.py +test/test_split_transaction_request.py +test/test_tag_object.py +test/test_tags_api.py +test/test_transaction_object.py +test/test_transactions_api.py +test/test_transactions_bulk_api.py +test/test_transactions_group_api.py +test/test_transactions_split_api.py +test/test_user_object.py +tox.ini diff --git a/clients/python/.openapi-generator/VERSION b/clients/python/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/clients/python/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/clients/python/.travis.yml b/clients/python/.travis.yml new file mode 100644 index 00000000..4f38588b --- /dev/null +++ b/clients/python/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + # uncomment the following if needed + #- "3.12-dev" # 3.12 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=lunchable diff --git a/clients/python/README.md b/clients/python/README.md new file mode 100644 index 00000000..150beb21 --- /dev/null +++ b/clients/python/README.md @@ -0,0 +1,211 @@ +# lunchable + +This is a version of the Lunch Money API described using the the OpenAPI 3.X +specification. + +The goal of this project is to validate an \"API Design First\" approach +for the Lunch Money API, which should allow us to gather developer feedback +prior to implementation in order to develop API endpoints more quickly. + +This version of the API will differ from the existing v1 beta version. For +more information on the changes please see the +[v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) + +Some useful links: + +- [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) +- [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) +- [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) +- [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 2.7.4 +- Package version: 1.0.0 +- Generator version: 7.10.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.8+ + +## Installation & Usage + +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` + +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: + +```python +import lunchable +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` + +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: + +```python +import lunchable +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + create_category_request_object = {"name":"API Created Category","description":"Test description of created category","is_income":false,"exclude_from_budget":true,"exclude_from_totals":false,"is_group":false} # CreateCategoryRequestObject | + + try: + # Create a new category or category group + api_response = api_instance.create_category(create_category_request_object) + print("The response of CategoriesApi->create_category:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling CategoriesApi->create_category: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Class | Method | HTTP request | Description | +| ---------------------- | --------------------------------------------------------------------------------------- | ----------------------------------- | --------------------------------------------- | +| _CategoriesApi_ | [**create_category**](docs/CategoriesApi.md#create_category) | **POST** /categories | Create a new category or category group | +| _CategoriesApi_ | [**delete_category**](docs/CategoriesApi.md#delete_category) | **DELETE** /categories/{id} | Delete a category or category group | +| _CategoriesApi_ | [**get_all_categories**](docs/CategoriesApi.md#get_all_categories) | **GET** /categories | Get all categories | +| _CategoriesApi_ | [**get_category_by_id**](docs/CategoriesApi.md#get_category_by_id) | **GET** /categories/{id} | Get a single category | +| _CategoriesApi_ | [**update_category**](docs/CategoriesApi.md#update_category) | **PUT** /categories/{id} | Update an existing category or category group | +| _ManualAccountsApi_ | [**create_manual_account**](docs/ManualAccountsApi.md#create_manual_account) | **POST** /manual_accounts | Create a manual account | +| _ManualAccountsApi_ | [**delete_manual_account**](docs/ManualAccountsApi.md#delete_manual_account) | **DELETE** /manual_accounts/{id} | Delete a manual account | +| _ManualAccountsApi_ | [**get_all_manual_accounts**](docs/ManualAccountsApi.md#get_all_manual_accounts) | **GET** /manual_accounts | Get all manual accounts | +| _ManualAccountsApi_ | [**get_manual_account_by_id**](docs/ManualAccountsApi.md#get_manual_account_by_id) | **GET** /manual_accounts/{id} | Get a single manual account | +| _ManualAccountsApi_ | [**update_manual_account**](docs/ManualAccountsApi.md#update_manual_account) | **PUT** /manual_accounts/{id} | Update an existing manual account | +| _MeApi_ | [**get_me**](docs/MeApi.md#get_me) | **GET** /me | Get current user | +| _PlaidAccountsApi_ | [**get_all_plaid_accounts**](docs/PlaidAccountsApi.md#get_all_plaid_accounts) | **GET** /plaid_accounts | Get all accounts synced via Plaid | +| _PlaidAccountsApi_ | [**get_plaid_account_by_id**](docs/PlaidAccountsApi.md#get_plaid_account_by_id) | **GET** /plaid_accounts/{id} | Get a single account that is synced via Plaid | +| _PlaidAccountsApi_ | [**trigger_plaid_account_fetch**](docs/PlaidAccountsApi.md#trigger_plaid_account_fetch) | **POST** /plaid_accounts/fetch | Trigger Fetch from Plaid | +| _RecurringApi_ | [**get_all_recurring**](docs/RecurringApi.md#get_all_recurring) | **GET** /recurring | Get a all recurring items | +| _RecurringApi_ | [**get_recurring_by_id**](docs/RecurringApi.md#get_recurring_by_id) | **GET** /recurring/{id} | Get a single recurring item | +| _TagsApi_ | [**create_tag**](docs/TagsApi.md#create_tag) | **POST** /tags | Create a new tag | +| _TagsApi_ | [**delete_tag**](docs/TagsApi.md#delete_tag) | **DELETE** /tags/{id} | Delete a tag | +| _TagsApi_ | [**get_all_tags**](docs/TagsApi.md#get_all_tags) | **GET** /tags | Get All Tags | +| _TagsApi_ | [**get_tag_by_id**](docs/TagsApi.md#get_tag_by_id) | **GET** /tags/{id} | Get a single tags | +| _TagsApi_ | [**update_tag**](docs/TagsApi.md#update_tag) | **PUT** /tags/{id} | Update an existing tag | +| _TransactionsApi_ | [**delete_transaction_by_id**](docs/TransactionsApi.md#delete_transaction_by_id) | **DELETE** /transactions/{id} | Delete a transaction | +| _TransactionsApi_ | [**get_transaction_by_id**](docs/TransactionsApi.md#get_transaction_by_id) | **GET** /transactions/{id} | Get a single transaction | +| _TransactionsBulkApi_ | [**create_new_transactions**](docs/TransactionsBulkApi.md#create_new_transactions) | **POST** /transactions | Insert one or more transactions. | +| _TransactionsBulkApi_ | [**delete_transactions**](docs/TransactionsBulkApi.md#delete_transactions) | **DELETE** /transactions | Bulk delete existing transactions | +| _TransactionsBulkApi_ | [**get_all_transactions**](docs/TransactionsBulkApi.md#get_all_transactions) | **GET** /transactions | Get all transactions | +| _TransactionsGroupApi_ | [**group_transactions**](docs/TransactionsGroupApi.md#group_transactions) | **POST** /transactions/group | Create a transaction group | +| _TransactionsGroupApi_ | [**ungroup_transactions**](docs/TransactionsGroupApi.md#ungroup_transactions) | **DELETE** /transactions/group/{id} | Delete a transaction group | +| _TransactionsSplitApi_ | [**split_transaction**](docs/TransactionsSplitApi.md#split_transaction) | **POST** /transactions/split/{id} | Split a transaction | +| _TransactionsSplitApi_ | [**unsplit_transaction**](docs/TransactionsSplitApi.md#unsplit_transaction) | **DELETE** /transactions/split/{id} | Unsplit a previously split transactions | + +## Documentation For Models + +- [AccountTypeEnum](docs/AccountTypeEnum.md) +- [CategoryObject](docs/CategoryObject.md) +- [CreateCategoryRequestObjectChildrenInner](docs/CreateCategoryRequestObjectChildrenInner.md) +- [CreateNewTransactions201Response](docs/CreateNewTransactions201Response.md) +- [CreateNewTransactionsRequest](docs/CreateNewTransactionsRequest.md) +- [CurrencyEnum](docs/CurrencyEnum.md) +- [DeleteCategoryResponseWithDependenciesDependents](docs/DeleteCategoryResponseWithDependenciesDependents.md) +- [DeleteTagResponseWithDependenciesDependents](docs/DeleteTagResponseWithDependenciesDependents.md) +- [DeleteTransactionsRequest](docs/DeleteTransactionsRequest.md) +- [ErrorResponseObject](docs/ErrorResponseObject.md) +- [GetAllCategories200Response](docs/GetAllCategories200Response.md) +- [GetAllManualAccounts200Response](docs/GetAllManualAccounts200Response.md) +- [GetAllPlaidAccounts200Response](docs/GetAllPlaidAccounts200Response.md) +- [GetAllRecurring200Response](docs/GetAllRecurring200Response.md) +- [GetAllTags200Response](docs/GetAllTags200Response.md) +- [GetAllTransactions200Response](docs/GetAllTransactions200Response.md) +- [GroupTransactions201Response](docs/GroupTransactions201Response.md) +- [GroupTransactionsRequest](docs/GroupTransactionsRequest.md) +- [InsertTransactionObjectAmount](docs/InsertTransactionObjectAmount.md) +- [ManualAccountObject](docs/ManualAccountObject.md) +- [PlaidAccountObject](docs/PlaidAccountObject.md) +- [RecurringObject](docs/RecurringObject.md) +- [RecurringObjectMatches](docs/RecurringObjectMatches.md) +- [RecurringObjectMatchesFoundTransactionsInner](docs/RecurringObjectMatchesFoundTransactionsInner.md) +- [RecurringObjectOverrides](docs/RecurringObjectOverrides.md) +- [RecurringObjectTransactionCriteria](docs/RecurringObjectTransactionCriteria.md) +- [SplitTransactionObjectAmount](docs/SplitTransactionObjectAmount.md) +- [SplitTransactionRequest](docs/SplitTransactionRequest.md) +- [TagObject](docs/TagObject.md) +- [TransactionObject](docs/TransactionObject.md) +- [UserObject](docs/UserObject.md) + + + +## Documentation For Authorization + +Authentication schemes defined for the API: + + +### bearerSecurity + +- **Type**: Bearer authentication (JWT) + + + +### cookieAuth + +- **Type**: API key +- **API key parameter name**: \_lm_access_token +- **Location**: + +## Author + +devsupport@lunchmoney.app diff --git a/clients/python/docs/AccountTypeEnum.md b/clients/python/docs/AccountTypeEnum.md new file mode 100644 index 00000000..dafdd575 --- /dev/null +++ b/clients/python/docs/AccountTypeEnum.md @@ -0,0 +1,25 @@ +# AccountTypeEnum + +## Enum + +- `CASH` (value: `'cash'`) + +- `CREDIT` (value: `'credit'`) + +- `CRYPTOCURRENCY` (value: `'cryptocurrency'`) + +- `EMPLOYEE_COMPENSATION` (value: `'employee compensation'`) + +- `INVESTMENT` (value: `'investment'`) + +- `LOAN` (value: `'loan'`) + +- `OTHER_LIABILITY` (value: `'other liability'`) + +- `OTHER_ASSET` (value: `'other asset'`) + +- `REAL_ESTATE` (value: `'real estate'`) + +- `VEHICLE` (value: `'vehicle'`) + +[[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/clients/python/docs/CategoriesApi.md b/clients/python/docs/CategoriesApi.md new file mode 100644 index 00000000..b2539ece --- /dev/null +++ b/clients/python/docs/CategoriesApi.md @@ -0,0 +1,454 @@ +# lunchable.CategoriesApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ------------------------------------------------------------- | --------------------------- | --------------------------------------------- | +| [**create_category**](CategoriesApi.md#create_category) | **POST** /categories | Create a new category or category group | +| [**delete_category**](CategoriesApi.md#delete_category) | **DELETE** /categories/{id} | Delete a category or category group | +| [**get_all_categories**](CategoriesApi.md#get_all_categories) | **GET** /categories | Get all categories | +| [**get_category_by_id**](CategoriesApi.md#get_category_by_id) | **GET** /categories/{id} | Get a single category | +| [**update_category**](CategoriesApi.md#update_category) | **PUT** /categories/{id} | Update an existing category or category group | + +# **create_category** + +> CategoryObject create_category(create_category_request_object) + +Create a new category or category group + +Creates a new category with the given name.
If the `is_group` attribute is set to true, a category group is created. In this case the `children` attribute may also be set to an array of existing category IDs to add to the newly created category group. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.category_object import CategoryObject +from lunchable.models.create_category_request_object import CreateCategoryRequestObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + create_category_request_object = {"name":"API Created Category","description":"Test description of created category","is_income":false,"exclude_from_budget":true,"exclude_from_totals":false,"is_group":false} # CreateCategoryRequestObject | + + try: + # Create a new category or category group + api_response = api_instance.create_category(create_category_request_object) + 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 | +| ---------------------------------- | ----------------------------------------------------------------- | ----------- | ----- | +| **create_category_request_object** | [**CreateCategoryRequestObject**](CreateCategoryRequestObject.md) | | + +### Return type + +[**CategoryObject**](CategoryObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | Category or Category Group Object with the successfully created category or category group. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_category** + +> delete_category(id, force=force) + +Delete a category or category group + +Attempts to delete the single category or category group specified on the path. By default his will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, children categories for a category group, categorized recurring items, etc. If there are dependents, this endpoint will return and object that describes each of the possible dependencies are and how many there are. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + id = 83 # int | ID of the category to delete + force = False # bool | Set to true to force deletion even if there are dependencies (optional) (default to False) + + try: + # Delete a category or category group + api_instance.delete_category(id, force=force) + except Exception as e: + print("Exception when calling CategoriesApi->delete_category: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------- | -------- | ------------------------------------------------------------ | ----------------------------- | +| **id** | **int** | ID of the category to delete | +| **force** | **bool** | Set to true to force deletion even if there are dependencies | [optional] [default to False] | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **422** | Unprocessable Entity | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_all_categories** + +> GetAllCategories200Response get_all_categories(format=format, is_group=is_group) + +Get all categories + +Retrieve a list of all categories associated with the user's account. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_categories200_response import GetAllCategories200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + format = nested # str | If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order. (optional) (default to nested) + is_group = False # bool | If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored. (optional) (default to False) + + try: + # Get all categories + api_response = api_instance.get_all_categories(format=format, is_group=is_group) + print("The response of CategoriesApi->get_all_categories:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->get_all_categories: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | +| **format** | **str** | If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.<br> Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order. | [optional] [default to nested] | +| **is_group** | **bool** | If set to `false`, just the list of assignable categories is returned.<br> If set to `true`, only category groups are returned.<br> When set the `format` parameter is ignored. | [optional] [default to False] | + +### Return type + +[**GetAllCategories200Response**](GetAllCategories200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | A list of Category Objects | - | +| **400** | Invalid request parameters | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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** + +> CategoryObject get_category_by_id(id) + +Get a single category + +Retrieve details of a specific category or category group by its ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.category_object import CategoryObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + id = 315174 # int | ID of the category to retrieve + + try: + # Get a single category + api_response = api_instance.get_category_by_id(id) + print("The response of CategoriesApi->get_category_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->get_category_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------------ | ----- | +| **id** | **int** | ID of the category to retrieve | + +### Return type + +[**CategoryObject**](CategoryObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | Category Object with the requested category or category group. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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** + +> CategoryObject update_category(id, update_category_request_object) + +Update an existing category or category group + +Updates an existing category or category group. You may submit the response from a `GET /categories/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `description`, `is_income`, `exclude_from_budget`, `exclude_from_totals`, `archived`, `group_id`, `order` and `children` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. It is not possible to use this API to convert a category to a category group, or a vice versa, so while submitting a request body with the `is_group` attribute is tolerated, it will result in an error response if the value is changed. It is possible to modify the children of an existing category group with this API by setting the `children` attribute. If this is set it will replace the existing children with the newly specified children, so if the intention is to add or remove a single category, it is more straightforward to update the child category by specifying the new `group_id` attribute. If the goal is to add multiple new children or remove multiple existing children, it is recommended to first call the `GET /categories/:id` endpoint to get the existing children and then modify the list as desired. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.category_object import CategoryObject +from lunchable.models.update_category_request_object import UpdateCategoryRequestObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.CategoriesApi(api_client) + id = 83 # int | ID of the category to update + update_category_request_object = {"name":"Updated Category Name","description":"Updated description of the category"} # UpdateCategoryRequestObject | + + try: + # Update an existing category or category group + api_response = api_instance.update_category(id, update_category_request_object) + print("The response of CategoriesApi->update_category:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CategoriesApi->update_category: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------------------------- | ----------------------------------------------------------------- | ---------------------------- | ----- | +| **id** | **int** | ID of the category to update | +| **update_category_request_object** | [**UpdateCategoryRequestObject**](UpdateCategoryRequestObject.md) | | + +### Return type + +[**CategoryObject**](CategoryObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Category or Category Group updated successfully | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/CategoryObject.md b/clients/python/docs/CategoryObject.md new file mode 100644 index 00000000..6cc5c7ec --- /dev/null +++ b/clients/python/docs/CategoryObject.md @@ -0,0 +1,40 @@ +# CategoryObject + +## Properties + +| Name | Type | Description | Notes | +| ----------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **id** | **int** | A system defined unique identifier for the category. | +| **name** | **str** | The name of the category. | +| **description** | **str** | The description of the category or `null` if not set. | +| **is_income** | **bool** | If true, the transactions in this category will be treated as income. | +| **exclude_from_budget** | **bool** | If true, the transactions in this category will be excluded from the budget. | +| **exclude_from_totals** | **bool** | If true, the transactions in this category will be excluded from totals. | +| **updated_at** | **datetime** | The date and time of when the category was last updated (in the ISO 8601 extended format). | +| **created_at** | **datetime** | The date and time of when the category was created (in the ISO 8601 extended format). | +| **group_id** | **int** | The ID of the category group this category belongs to or `null` if the category doesn't belong to a group, or is itself a category group. | +| **is_group** | **bool** | If true, the category is a group that can be a parent to other categories. | +| **children** | [**List[ChildCategoryObject]**](ChildCategoryObject.md) | For category groups, this will populate with details about the categories that belong to this group. The objects in this array are similar to Category Objects but do not include the `is_income`, `exclude_from_budget`, and `exclude_from_totals` properties as these are inherited from the Category Group. In addition the `is_group` property will always be `false``, and there will be no `children` attribute. | [optional] | +| **archived** | **bool** | If true, the category is archived and not displayed in relevant areas of the Lunch Money app. | +| **archived_at** | **datetime** | The date and time of when the category was last archived (in the ISO 8601 extended format). | +| **order** | **float** | An index specifying the position in which the category is displayed on the categories page in the Lunch Money GUI. For categories within a category group the order index is relative to the other categories within the group.<br> This value for this property will be `null` for categories created via the API until they are modified on the Categories page in the Lunch Money GUI. | + +## Example + +```python +from lunchable.models.category_object import CategoryObject + +# TODO update the JSON string below +json = "{}" +# create an instance of CategoryObject from a JSON string +category_object_instance = CategoryObject.from_json(json) +# print the JSON string representation of the object +print(CategoryObject.to_json()) + +# convert the object into a dict +category_object_dict = category_object_instance.to_dict() +# create an instance of CategoryObject from a dict +category_object_from_dict = CategoryObject.from_dict(category_object_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/clients/python/docs/CreateCategoryRequestObjectChildrenInner.md b/clients/python/docs/CreateCategoryRequestObjectChildrenInner.md new file mode 100644 index 00000000..f58b9eb9 --- /dev/null +++ b/clients/python/docs/CreateCategoryRequestObjectChildrenInner.md @@ -0,0 +1,36 @@ +# CreateCategoryRequestObjectChildrenInner + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| **id** | **int** | A system defined unique identifier for the category. | +| **name** | **str** | The name of the category. | +| **description** | **str** | The description of the category or `null` if not set. | +| **updated_at** | **datetime** | The date and time of when the category was last updated (in the ISO 8601 extended format). | +| **created_at** | **datetime** | The date and time of when the category was created (in the ISO 8601 extended format). | +| **group_id** | **int** | The ID of the category group this category belongs to or `null` if the category doesn't belong to a group, or is itself a category group. | +| **is_group** | **bool** | Will always be false for a category that is part of category group. | +| **archived** | **bool** | If true, the category is archived and not displayed in relevant areas of the Lunch Money app. | +| **archived_at** | **datetime** | The date and time of when the category was last archived (in the ISO 8601 extended format). | +| **order** | **float** | An index specifying the position in which the category is displayed on the categories page in the Lunch Money GUI. For categories within a category group the order index is relative to the other categories within the group. | + +## Example + +```python +from lunchable.models.create_category_request_object_children_inner import CreateCategoryRequestObjectChildrenInner + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCategoryRequestObjectChildrenInner from a JSON string +create_category_request_object_children_inner_instance = CreateCategoryRequestObjectChildrenInner.from_json(json) +# print the JSON string representation of the object +print(CreateCategoryRequestObjectChildrenInner.to_json()) + +# convert the object into a dict +create_category_request_object_children_inner_dict = create_category_request_object_children_inner_instance.to_dict() +# create an instance of CreateCategoryRequestObjectChildrenInner from a dict +create_category_request_object_children_inner_from_dict = CreateCategoryRequestObjectChildrenInner.from_dict(create_category_request_object_children_inner_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/clients/python/docs/CreateNewTransactions201Response.md b/clients/python/docs/CreateNewTransactions201Response.md new file mode 100644 index 00000000..871d1529 --- /dev/null +++ b/clients/python/docs/CreateNewTransactions201Response.md @@ -0,0 +1,28 @@ +# CreateNewTransactions201Response + +## Properties + +| Name | Type | Description | Notes | +| --------------------------------- | ------------------------------------------------------------------------------- | ----------- | ---------- | +| **transactions** | [**List[TransactionObject]**](TransactionObject.md) | | +| **skipped_existing_external_ids** | [**List[SkippedExistingExternalIdObject]**](SkippedExistingExternalIdObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.create_new_transactions201_response import CreateNewTransactions201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateNewTransactions201Response from a JSON string +create_new_transactions201_response_instance = CreateNewTransactions201Response.from_json(json) +# print the JSON string representation of the object +print(CreateNewTransactions201Response.to_json()) + +# convert the object into a dict +create_new_transactions201_response_dict = create_new_transactions201_response_instance.to_dict() +# create an instance of CreateNewTransactions201Response from a dict +create_new_transactions201_response_from_dict = CreateNewTransactions201Response.from_dict(create_new_transactions201_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/clients/python/docs/CreateNewTransactionsRequest.md b/clients/python/docs/CreateNewTransactionsRequest.md new file mode 100644 index 00000000..c98ca639 --- /dev/null +++ b/clients/python/docs/CreateNewTransactionsRequest.md @@ -0,0 +1,30 @@ +# CreateNewTransactionsRequest + +## Properties + +| Name | Type | Description | Notes | +| ----------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| **transactions** | [**List[InsertTransactionObject]**](InsertTransactionObject.md) | List of transactions to insert. | +| **apply_rules** | **bool** | If set to true, any rules associated with the account specified by the `manual_account_id` property for each transaction will be applied. | [optional] [default to False] | +| **skip_duplicates** | **bool** | If set to true, the system will flag new transactions that have the same `date`, `payee`, `amount`, and `manual_account_id`, as a duplicate. Not that deduplication based on `external_id` and `manual_account_id` will always occur regardless of how this property is set. | [optional] [default to False] | +| **skip_balance_update** | **bool** | If set to true, and new transactions include a `manual_account_id`, the balances of these accounts will not be updated, when the transactions are inserted. | [optional] [default to False] | + +## Example + +```python +from lunchable.models.create_new_transactions_request import CreateNewTransactionsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateNewTransactionsRequest from a JSON string +create_new_transactions_request_instance = CreateNewTransactionsRequest.from_json(json) +# print the JSON string representation of the object +print(CreateNewTransactionsRequest.to_json()) + +# convert the object into a dict +create_new_transactions_request_dict = create_new_transactions_request_instance.to_dict() +# create an instance of CreateNewTransactionsRequest from a dict +create_new_transactions_request_from_dict = CreateNewTransactionsRequest.from_dict(create_new_transactions_request_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/clients/python/docs/CurrencyEnum.md b/clients/python/docs/CurrencyEnum.md new file mode 100644 index 00000000..5e0bcfe0 --- /dev/null +++ b/clients/python/docs/CurrencyEnum.md @@ -0,0 +1,331 @@ +# CurrencyEnum + +Supported Currency codes: - `aed`: United Arab Emirates Dirham - `afn`: Afghan Afghani - `all`: Albanian Lek - `amd`: Armenian Dram - `ang`: Netherlands Antillean Guilder - `aoa`: Angolan Kwanza - `ars`: Argentine Peso - `aud`: Australian Dollar - `awg`: Aruban Florin - `azn`: Azerbaijani Manat - `bam`: Bosnia-Herzegovina Convertible Mark - `bbd`: Barbadian Dollar - `bdt`: Bangladeshi Taka - `bgn`: Bulgarian Lev - `bhd`: Bahraini Dinar - `bif`: Burundian Franc - `bmd`: Bermudian Dollar - `bnd`: Brunei Dollar - `bob`: Bolivian Boliviano - `brl`: Brazilian Real - `bsd`: Bahamian Dollar - `btc`: Bitcoin - `btn`: Bhutanese Ngultrum - `bwp`: Botswanan Pula - `byn`: Belarusian Ruble - `bzd`: Belize Dollar - `cad`: Canadian Dollar - `cdf`: Congolese Franc - `chf`: Swiss Franc - `clp`: Chilean Peso - `cny`: Chinese Yuan - `cop`: Colombian Peso - `crc`: Costa Rican Colón - `cuc`: Cuban Convertible Peso - `cup`: Cuban Peso - `cve`: Cape Verdean Escudo - `czk`: Czech Republic Koruna - `djf`: Djiboutian Franc - `dkk`: Danish Krone - `dop`: Dominican Peso - `dzd`: Algerian Dinar - `egp`: Egyptian Pound - `ern`: Eritrean Nakfa - `etb`: Ethiopian Birr - `eur`: Euro - `fjd`: Fijian Dollar - `fkp`: Falkland Islands Pound - `gbp`: British Pound Sterling - `gel`: Georgian Lari - `ggp`: Guernsey Pound - `ghs`: Ghanaian Cedi - `gip`: Gibraltar Pound - `gmd`: Gambian Dalasi - `gnf`: Guinean Franc - `gtq`: Guatemalan Quetzal - `gyd`: Guyanaese Dollar - `hkd`: Hong Kong Dollar - `hnl`: Honduran Lempira - `hrk`: Croatian Kuna - `htg`: Haitian Gourde - `huf`: Hungarian Forint - `idr`: Indonesian Rupiah - `ils`: Israeli New Sheqel - `imp`: Isle of Man Pound - `inr`: Indian Rupee - `iqd`: Iraqi Dinar - `irr`: Iranian Rial - `isk`: Icelandic Króna - `jep`: Jersey Pound - `jmd`: Jamaican Dollar - `jod`: Jordanian Dinar - `jpy`: Japanese Yen - `kes`: Kenyan Shilling - `kgs`: Kyrgystani Som - `khr`: Cambodian Riel - `kmf`: Comorian Franc - `kpw`: North Korean Won - `krw`: South Korean Won - `kwd`: Kuwaiti Dinar - `kyd`: Cayman Islands Dollar - `kzt`: Kazakhstani Tenge - `lak`: Laotian Kip - `lbp`: Lebanese Pound - `lkr`: Sri Lankan Rupee - `lrd`: Liberian Dollar - `lsl`: Lesotho Loti - `ltl`: Lithuanian Litas - `lvl`: Latvian Lats - `lyd`: Libyan Dinar - `mad`: Moroccan Dirham - `mdl`: Moldovan Leu - `mga`: Malagasy Ariary - `mkd`: Macedonian Denar - `mmk`: Myanma Kyat - `mnt`: Mongolian Tugrik - `mop`: Macanese Pataca - `mro`: Mauritanian Ouguiya - `mur`: Mauritian Rupee - `mvr`: Maldivian Rufiyaa - `mwk`: Malawian Kwacha - `mxn`: Mexican Peso - `myr`: Malaysian Ringgit - `mzn`: Mozambican Metical - `nad`: Namibian Dollar - `ngn`: Nigerian Naira - `nio`: Nicaraguan Córdoba - `nok`: Norwegian Krone - `npr`: Nepalese Rupee - `nzd`: New Zealand Dollar - `omr`: Omani Rial - `pab`: Panamanian Balboa - `pen`: Peruvian Nuevo Sol - `pgk`: Papua New Guinean Kina - `php`: Philippine Peso - `pkr`: Pakistani Rupee - `pln`: Polish Zloty - `pyg`: Paraguayan Guarani - `qar`: Qatari Rial - `ron`: Romanian Leu - `rsd`: Serbian Dinar - `rub`: Russian Ruble - `rwf`: Rwandan Franc - `sar`: Saudi Riyal - `sbd`: Solomon Islands Dollar - `scr`: Seychellois Rupee - `sdg`: Sudanese Pound - `sek`: Swedish Krona - `sgd`: Singapore Dollar - `shp`: Saint Helena Pound - `sll`: Sierra Leonean Leone - `sos`: Somali Shilling - `srd`: Surinamese Dollar - `std`: São Tomé and Príncipe Dobra - `svc`: Salvadoran Colón - `syp`: Syrian Pound - `szl`: Swazi Lilangeni - `thb`: Thai Baht - `tjs`: Tajikistani Somoni - `tmt`: Turkmenistani Manat - `tnd`: Tunisian Dinar - `top`: Tongan Paʻanga - `try`: Turkish Lira - `ttd`: Trinidad and Tobago Dollar - `twd`: New Taiwan Dollar - `tzs`: Tanzanian Shilling - `uah`: Ukrainian Hryvnia - `ugx`: Ugandan Shilling - `usd`: United States Dollar - `uyu`: Uruguayan Peso - `uzs`: Uzbekistan Som - `vef`: Venezuelan Bolívar - `vnd`: Vietnamese Dong - `vuv`: Vanuatu Vatu - `wst`: Samoan Tala - `xaf`: CFA Franc BEAC - `xcd`: East Caribbean Dollar - `xof`: CFA Franc BCEAO - `xpf`: CFP Franc - `yer`: Yemeni Rial - `zar`: South African Rand - `zmw`: Zambian Kwacha - `zwl`: Zimbabwean Dollar + +## Enum + +- `AED` (value: `'aed'`) + +- `AFN` (value: `'afn'`) + +- `ALL` (value: `'all'`) + +- `AMD` (value: `'amd'`) + +- `ANG` (value: `'ang'`) + +- `AOA` (value: `'aoa'`) + +- `ARS` (value: `'ars'`) + +- `AUD` (value: `'aud'`) + +- `AWG` (value: `'awg'`) + +- `AZN` (value: `'azn'`) + +- `BAM` (value: `'bam'`) + +- `BBD` (value: `'bbd'`) + +- `BDT` (value: `'bdt'`) + +- `BGN` (value: `'bgn'`) + +- `BHD` (value: `'bhd'`) + +- `BIF` (value: `'bif'`) + +- `BMD` (value: `'bmd'`) + +- `BND` (value: `'bnd'`) + +- `BOB` (value: `'bob'`) + +- `BRL` (value: `'brl'`) + +- `BSD` (value: `'bsd'`) + +- `BTC` (value: `'btc'`) + +- `BTN` (value: `'btn'`) + +- `BWP` (value: `'bwp'`) + +- `BYN` (value: `'byn'`) + +- `BZD` (value: `'bzd'`) + +- `CAD` (value: `'cad'`) + +- `CDF` (value: `'cdf'`) + +- `CHF` (value: `'chf'`) + +- `CLP` (value: `'clp'`) + +- `CNY` (value: `'cny'`) + +- `COP` (value: `'cop'`) + +- `CRC` (value: `'crc'`) + +- `CUC` (value: `'cuc'`) + +- `CUP` (value: `'cup'`) + +- `CVE` (value: `'cve'`) + +- `CZK` (value: `'czk'`) + +- `DJF` (value: `'djf'`) + +- `DKK` (value: `'dkk'`) + +- `DOP` (value: `'dop'`) + +- `DZD` (value: `'dzd'`) + +- `EGP` (value: `'egp'`) + +- `ERN` (value: `'ern'`) + +- `ETB` (value: `'etb'`) + +- `EUR` (value: `'eur'`) + +- `FJD` (value: `'fjd'`) + +- `FKP` (value: `'fkp'`) + +- `GBP` (value: `'gbp'`) + +- `GEL` (value: `'gel'`) + +- `GGP` (value: `'ggp'`) + +- `GHS` (value: `'ghs'`) + +- `GIP` (value: `'gip'`) + +- `GMD` (value: `'gmd'`) + +- `GNF` (value: `'gnf'`) + +- `GTQ` (value: `'gtq'`) + +- `GYD` (value: `'gyd'`) + +- `HKD` (value: `'hkd'`) + +- `HNL` (value: `'hnl'`) + +- `HRK` (value: `'hrk'`) + +- `HTG` (value: `'htg'`) + +- `HUF` (value: `'huf'`) + +- `IDR` (value: `'idr'`) + +- `ILS` (value: `'ils'`) + +- `IMP` (value: `'imp'`) + +- `INR` (value: `'inr'`) + +- `IQD` (value: `'iqd'`) + +- `IRR` (value: `'irr'`) + +- `ISK` (value: `'isk'`) + +- `JEP` (value: `'jep'`) + +- `JMD` (value: `'jmd'`) + +- `JOD` (value: `'jod'`) + +- `JPY` (value: `'jpy'`) + +- `KES` (value: `'kes'`) + +- `KGS` (value: `'kgs'`) + +- `KHR` (value: `'khr'`) + +- `KMF` (value: `'kmf'`) + +- `KPW` (value: `'kpw'`) + +- `KRW` (value: `'krw'`) + +- `KWD` (value: `'kwd'`) + +- `KYD` (value: `'kyd'`) + +- `KZT` (value: `'kzt'`) + +- `LAK` (value: `'lak'`) + +- `LBP` (value: `'lbp'`) + +- `LKR` (value: `'lkr'`) + +- `LRD` (value: `'lrd'`) + +- `LSL` (value: `'lsl'`) + +- `LTL` (value: `'ltl'`) + +- `LVL` (value: `'lvl'`) + +- `LYD` (value: `'lyd'`) + +- `MAD` (value: `'mad'`) + +- `MDL` (value: `'mdl'`) + +- `MGA` (value: `'mga'`) + +- `MKD` (value: `'mkd'`) + +- `MMK` (value: `'mmk'`) + +- `MNT` (value: `'mnt'`) + +- `MOP` (value: `'mop'`) + +- `MRO` (value: `'mro'`) + +- `MUR` (value: `'mur'`) + +- `MVR` (value: `'mvr'`) + +- `MWK` (value: `'mwk'`) + +- `MXN` (value: `'mxn'`) + +- `MYR` (value: `'myr'`) + +- `MZN` (value: `'mzn'`) + +- `NAD` (value: `'nad'`) + +- `NGN` (value: `'ngn'`) + +- `NIO` (value: `'nio'`) + +- `NOK` (value: `'nok'`) + +- `NPR` (value: `'npr'`) + +- `NZD` (value: `'nzd'`) + +- `OMR` (value: `'omr'`) + +- `PAB` (value: `'pab'`) + +- `PEN` (value: `'pen'`) + +- `PGK` (value: `'pgk'`) + +- `PHP` (value: `'php'`) + +- `PKR` (value: `'pkr'`) + +- `PLN` (value: `'pln'`) + +- `PYG` (value: `'pyg'`) + +- `QAR` (value: `'qar'`) + +- `RON` (value: `'ron'`) + +- `RSD` (value: `'rsd'`) + +- `RUB` (value: `'rub'`) + +- `RWF` (value: `'rwf'`) + +- `SAR` (value: `'sar'`) + +- `SBD` (value: `'sbd'`) + +- `SCR` (value: `'scr'`) + +- `SDG` (value: `'sdg'`) + +- `SEK` (value: `'sek'`) + +- `SGD` (value: `'sgd'`) + +- `SHP` (value: `'shp'`) + +- `SLL` (value: `'sll'`) + +- `SOS` (value: `'sos'`) + +- `SRD` (value: `'srd'`) + +- `STD` (value: `'std'`) + +- `SVC` (value: `'svc'`) + +- `SYP` (value: `'syp'`) + +- `SZL` (value: `'szl'`) + +- `THB` (value: `'thb'`) + +- `TJS` (value: `'tjs'`) + +- `TMT` (value: `'tmt'`) + +- `TND` (value: `'tnd'`) + +- `TOP` (value: `'top'`) + +- `TRY` (value: `'try'`) + +- `TTD` (value: `'ttd'`) + +- `TWD` (value: `'twd'`) + +- `TZS` (value: `'tzs'`) + +- `UAH` (value: `'uah'`) + +- `UGX` (value: `'ugx'`) + +- `USD` (value: `'usd'`) + +- `UYU` (value: `'uyu'`) + +- `UZS` (value: `'uzs'`) + +- `VEF` (value: `'vef'`) + +- `VND` (value: `'vnd'`) + +- `VUV` (value: `'vuv'`) + +- `WST` (value: `'wst'`) + +- `XAF` (value: `'xaf'`) + +- `XCD` (value: `'xcd'`) + +- `XOF` (value: `'xof'`) + +- `XPF` (value: `'xpf'`) + +- `YER` (value: `'yer'`) + +- `ZAR` (value: `'zar'`) + +- `ZMW` (value: `'zmw'`) + +- `ZWL` (value: `'zwl'`) + +[[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/clients/python/docs/DeleteCategoryResponseWithDependenciesDependents.md b/clients/python/docs/DeleteCategoryResponseWithDependenciesDependents.md new file mode 100644 index 00000000..3682d9c2 --- /dev/null +++ b/clients/python/docs/DeleteCategoryResponseWithDependenciesDependents.md @@ -0,0 +1,32 @@ +# DeleteCategoryResponseWithDependenciesDependents + +## Properties + +| Name | Type | Description | Notes | +| ------------------ | --------- | --------------------------------------------------------------- | ----- | +| **budget** | **float** | The number of budgets depending on the category | +| **category_rules** | **float** | The number of category rules depending on the category | +| **transactions** | **float** | The number of transactions depending on the category | +| **children** | **float** | The number of child categories in the category group | +| **recurring** | **float** | The number of recurring transactions depending on the category | +| **plaid_cats** | **float** | The number of auto created categories based on Plaid categories | + +## Example + +```python +from lunchable.models.delete_category_response_with_dependencies_dependents import DeleteCategoryResponseWithDependenciesDependents + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteCategoryResponseWithDependenciesDependents from a JSON string +delete_category_response_with_dependencies_dependents_instance = DeleteCategoryResponseWithDependenciesDependents.from_json(json) +# print the JSON string representation of the object +print(DeleteCategoryResponseWithDependenciesDependents.to_json()) + +# convert the object into a dict +delete_category_response_with_dependencies_dependents_dict = delete_category_response_with_dependencies_dependents_instance.to_dict() +# create an instance of DeleteCategoryResponseWithDependenciesDependents from a dict +delete_category_response_with_dependencies_dependents_from_dict = DeleteCategoryResponseWithDependenciesDependents.from_dict(delete_category_response_with_dependencies_dependents_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/clients/python/docs/DeleteTagResponseWithDependenciesDependents.md b/clients/python/docs/DeleteTagResponseWithDependenciesDependents.md new file mode 100644 index 00000000..a9c044de --- /dev/null +++ b/clients/python/docs/DeleteTagResponseWithDependenciesDependents.md @@ -0,0 +1,28 @@ +# DeleteTagResponseWithDependenciesDependents + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | --------- | ---------------------------------------- | ----- | +| **tag_rules** | **float** | The number of rules depending on the tag | +| **transactions** | **float** | The number of transactions with the tag | + +## Example + +```python +from lunchable.models.delete_tag_response_with_dependencies_dependents import DeleteTagResponseWithDependenciesDependents + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteTagResponseWithDependenciesDependents from a JSON string +delete_tag_response_with_dependencies_dependents_instance = DeleteTagResponseWithDependenciesDependents.from_json(json) +# print the JSON string representation of the object +print(DeleteTagResponseWithDependenciesDependents.to_json()) + +# convert the object into a dict +delete_tag_response_with_dependencies_dependents_dict = delete_tag_response_with_dependencies_dependents_instance.to_dict() +# create an instance of DeleteTagResponseWithDependenciesDependents from a dict +delete_tag_response_with_dependencies_dependents_from_dict = DeleteTagResponseWithDependenciesDependents.from_dict(delete_tag_response_with_dependencies_dependents_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/clients/python/docs/DeleteTransactionsRequest.md b/clients/python/docs/DeleteTransactionsRequest.md new file mode 100644 index 00000000..51800b54 --- /dev/null +++ b/clients/python/docs/DeleteTransactionsRequest.md @@ -0,0 +1,27 @@ +# DeleteTransactionsRequest + +## Properties + +| Name | Type | Description | Notes | +| ------- | --------------- | ------------------------------------------- | ----- | +| **ids** | **List[float]** | Array of existing Transaction IDs to delete | + +## Example + +```python +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteTransactionsRequest from a JSON string +delete_transactions_request_instance = DeleteTransactionsRequest.from_json(json) +# print the JSON string representation of the object +print(DeleteTransactionsRequest.to_json()) + +# convert the object into a dict +delete_transactions_request_dict = delete_transactions_request_instance.to_dict() +# create an instance of DeleteTransactionsRequest from a dict +delete_transactions_request_from_dict = DeleteTransactionsRequest.from_dict(delete_transactions_request_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/clients/python/docs/ErrorResponseObject.md b/clients/python/docs/ErrorResponseObject.md new file mode 100644 index 00000000..bc035cda --- /dev/null +++ b/clients/python/docs/ErrorResponseObject.md @@ -0,0 +1,28 @@ +# ErrorResponseObject + +## Properties + +| Name | Type | Description | Notes | +| ----------- | ---------------- | --------------------- | ----- | +| **message** | **str** | overall error message | +| **errors** | **List[object]** | | + +## Example + +```python +from lunchable.models.error_response_object import ErrorResponseObject + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponseObject from a JSON string +error_response_object_instance = ErrorResponseObject.from_json(json) +# print the JSON string representation of the object +print(ErrorResponseObject.to_json()) + +# convert the object into a dict +error_response_object_dict = error_response_object_instance.to_dict() +# create an instance of ErrorResponseObject from a dict +error_response_object_from_dict = ErrorResponseObject.from_dict(error_response_object_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/clients/python/docs/GetAllCategories200Response.md b/clients/python/docs/GetAllCategories200Response.md new file mode 100644 index 00000000..20a8735d --- /dev/null +++ b/clients/python/docs/GetAllCategories200Response.md @@ -0,0 +1,27 @@ +# GetAllCategories200Response + +## Properties + +| Name | Type | Description | Notes | +| -------------- | --------------------------------------------- | ----------- | ---------- | +| **categories** | [**List[CategoryObject]**](CategoryObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.get_all_categories200_response import GetAllCategories200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllCategories200Response from a JSON string +get_all_categories200_response_instance = GetAllCategories200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllCategories200Response.to_json()) + +# convert the object into a dict +get_all_categories200_response_dict = get_all_categories200_response_instance.to_dict() +# create an instance of GetAllCategories200Response from a dict +get_all_categories200_response_from_dict = GetAllCategories200Response.from_dict(get_all_categories200_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/clients/python/docs/GetAllManualAccounts200Response.md b/clients/python/docs/GetAllManualAccounts200Response.md new file mode 100644 index 00000000..6f75fc39 --- /dev/null +++ b/clients/python/docs/GetAllManualAccounts200Response.md @@ -0,0 +1,27 @@ +# GetAllManualAccounts200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------------- | ------------------------------------------------------- | ----------- | ---------- | +| **manual_accounts** | [**List[ManualAccountObject]**](ManualAccountObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.get_all_manual_accounts200_response import GetAllManualAccounts200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllManualAccounts200Response from a JSON string +get_all_manual_accounts200_response_instance = GetAllManualAccounts200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllManualAccounts200Response.to_json()) + +# convert the object into a dict +get_all_manual_accounts200_response_dict = get_all_manual_accounts200_response_instance.to_dict() +# create an instance of GetAllManualAccounts200Response from a dict +get_all_manual_accounts200_response_from_dict = GetAllManualAccounts200Response.from_dict(get_all_manual_accounts200_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/clients/python/docs/GetAllPlaidAccounts200Response.md b/clients/python/docs/GetAllPlaidAccounts200Response.md new file mode 100644 index 00000000..6fe89f51 --- /dev/null +++ b/clients/python/docs/GetAllPlaidAccounts200Response.md @@ -0,0 +1,27 @@ +# GetAllPlaidAccounts200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------------ | ----------------------------------------------------- | ----------- | ---------- | +| **plaid_accounts** | [**List[PlaidAccountObject]**](PlaidAccountObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.get_all_plaid_accounts200_response import GetAllPlaidAccounts200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllPlaidAccounts200Response from a JSON string +get_all_plaid_accounts200_response_instance = GetAllPlaidAccounts200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllPlaidAccounts200Response.to_json()) + +# convert the object into a dict +get_all_plaid_accounts200_response_dict = get_all_plaid_accounts200_response_instance.to_dict() +# create an instance of GetAllPlaidAccounts200Response from a dict +get_all_plaid_accounts200_response_from_dict = GetAllPlaidAccounts200Response.from_dict(get_all_plaid_accounts200_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/clients/python/docs/GetAllRecurring200Response.md b/clients/python/docs/GetAllRecurring200Response.md new file mode 100644 index 00000000..820eab51 --- /dev/null +++ b/clients/python/docs/GetAllRecurring200Response.md @@ -0,0 +1,27 @@ +# GetAllRecurring200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------------- | ----------------------------------------------- | ----------- | ---------- | +| **recurring_items** | [**List[RecurringObject]**](RecurringObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllRecurring200Response from a JSON string +get_all_recurring200_response_instance = GetAllRecurring200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllRecurring200Response.to_json()) + +# convert the object into a dict +get_all_recurring200_response_dict = get_all_recurring200_response_instance.to_dict() +# create an instance of GetAllRecurring200Response from a dict +get_all_recurring200_response_from_dict = GetAllRecurring200Response.from_dict(get_all_recurring200_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/clients/python/docs/GetAllTags200Response.md b/clients/python/docs/GetAllTags200Response.md new file mode 100644 index 00000000..87cae4aa --- /dev/null +++ b/clients/python/docs/GetAllTags200Response.md @@ -0,0 +1,27 @@ +# GetAllTags200Response + +## Properties + +| Name | Type | Description | Notes | +| -------- | ----------------------------------- | ----------- | ---------- | +| **tags** | [**List[TagObject]**](TagObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.get_all_tags200_response import GetAllTags200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllTags200Response from a JSON string +get_all_tags200_response_instance = GetAllTags200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllTags200Response.to_json()) + +# convert the object into a dict +get_all_tags200_response_dict = get_all_tags200_response_instance.to_dict() +# create an instance of GetAllTags200Response from a dict +get_all_tags200_response_from_dict = GetAllTags200Response.from_dict(get_all_tags200_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/clients/python/docs/GetAllTransactions200Response.md b/clients/python/docs/GetAllTransactions200Response.md new file mode 100644 index 00000000..a4809b92 --- /dev/null +++ b/clients/python/docs/GetAllTransactions200Response.md @@ -0,0 +1,29 @@ +# GetAllTransactions200Response + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | --------------------------------------------------- | ---------------------------------------------- | ---------- | +| **transactions** | [**List[TransactionObject]**](TransactionObject.md) | | +| **has_more** | **bool** | Set to true if more transactions are available | +| **error** | **str** | | [optional] | + +## Example + +```python +from lunchable.models.get_all_transactions200_response import GetAllTransactions200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAllTransactions200Response from a JSON string +get_all_transactions200_response_instance = GetAllTransactions200Response.from_json(json) +# print the JSON string representation of the object +print(GetAllTransactions200Response.to_json()) + +# convert the object into a dict +get_all_transactions200_response_dict = get_all_transactions200_response_instance.to_dict() +# create an instance of GetAllTransactions200Response from a dict +get_all_transactions200_response_from_dict = GetAllTransactions200Response.from_dict(get_all_transactions200_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/clients/python/docs/GroupTransactions201Response.md b/clients/python/docs/GroupTransactions201Response.md new file mode 100644 index 00000000..8481a660 --- /dev/null +++ b/clients/python/docs/GroupTransactions201Response.md @@ -0,0 +1,27 @@ +# GroupTransactions201Response + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | --------------------------------------------------- | ----------- | ---------- | +| **transactions** | [**List[TransactionObject]**](TransactionObject.md) | | [optional] | + +## Example + +```python +from lunchable.models.group_transactions201_response import GroupTransactions201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupTransactions201Response from a JSON string +group_transactions201_response_instance = GroupTransactions201Response.from_json(json) +# print the JSON string representation of the object +print(GroupTransactions201Response.to_json()) + +# convert the object into a dict +group_transactions201_response_dict = group_transactions201_response_instance.to_dict() +# create an instance of GroupTransactions201Response from a dict +group_transactions201_response_from_dict = GroupTransactions201Response.from_dict(group_transactions201_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/clients/python/docs/GroupTransactionsRequest.md b/clients/python/docs/GroupTransactionsRequest.md new file mode 100644 index 00000000..00dd38f2 --- /dev/null +++ b/clients/python/docs/GroupTransactionsRequest.md @@ -0,0 +1,33 @@ +# GroupTransactionsRequest + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | +| **ids** | **List[int]** | List of existing transaction IDs to group. Split and recurring transactions may not be grouped. Transactions that are already grouped must be ungrouped before being regrouped. | +| **var_date** | **date** | Date for the new grouped transaction in ISO 8601 format. | +| **payee** | **str** | The payee for the new grouped transaction. | +| **category_id** | **int** | The ID of an existing category to assign to the grouped transaction. If not set and all the grouped transactions have the same category, the grouped transaction will inherit the category, otherwise the new transaction will have no category. | [optional] | +| **notes** | **str** | Notes for the grouped transaction. | [optional] | +| **status** | **str** | If set must be either `reviewed` or `unreviewed`. If not set, defaults to `reviewed`. | [optional] | +| **tag_ids** | **List[int]** | A list of IDs for the tags associated with the grouped transaction. Each ID must match an existing tag associated with the user's account. If not set, no tags will be associated with the created transaction. | [optional] | + +## Example + +```python +from lunchable.models.group_transactions_request import GroupTransactionsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupTransactionsRequest from a JSON string +group_transactions_request_instance = GroupTransactionsRequest.from_json(json) +# print the JSON string representation of the object +print(GroupTransactionsRequest.to_json()) + +# convert the object into a dict +group_transactions_request_dict = group_transactions_request_instance.to_dict() +# create an instance of GroupTransactionsRequest from a dict +group_transactions_request_from_dict = GroupTransactionsRequest.from_dict(group_transactions_request_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/clients/python/docs/InsertTransactionObjectAmount.md b/clients/python/docs/InsertTransactionObjectAmount.md new file mode 100644 index 00000000..9681d01c --- /dev/null +++ b/clients/python/docs/InsertTransactionObjectAmount.md @@ -0,0 +1,28 @@ +# InsertTransactionObjectAmount + +Numeric value of amount. i.e. $4.25 should be denoted as 4.25. Can be a string or a number in double format. + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```python +from lunchable.models.insert_transaction_object_amount import InsertTransactionObjectAmount + +# TODO update the JSON string below +json = "{}" +# create an instance of InsertTransactionObjectAmount from a JSON string +insert_transaction_object_amount_instance = InsertTransactionObjectAmount.from_json(json) +# print the JSON string representation of the object +print(InsertTransactionObjectAmount.to_json()) + +# convert the object into a dict +insert_transaction_object_amount_dict = insert_transaction_object_amount_instance.to_dict() +# create an instance of InsertTransactionObjectAmount from a dict +insert_transaction_object_amount_from_dict = InsertTransactionObjectAmount.from_dict(insert_transaction_object_amount_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/clients/python/docs/ManualAccountObject.md b/clients/python/docs/ManualAccountObject.md new file mode 100644 index 00000000..288fe74b --- /dev/null +++ b/clients/python/docs/ManualAccountObject.md @@ -0,0 +1,42 @@ +# ManualAccountObject + +An object containing information about a manual account + +## Properties + +| Name | Type | Description | Notes | +| ----------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ---------- | +| **id** | **int** | The unique identifier of this account | [optional] | +| **name** | **str** | Name of the account | [optional] | +| **type** | [**AccountTypeEnum**](AccountTypeEnum.md) | Primary type of the account | [optional] | +| **subtype** | **str** | Optional account subtype. Examples include<br> - retirement - checking - savings - prepaid credit card | [optional] | +| **display_name** | **str** | Optional display name for the account set by the user | [optional] | +| **balance** | **str** | Current balance of the account in numeric format to 4 decimal places. | [optional] | +| **balance_as_of** | **datetime** | Date balance was last updated in ISO 8601 extended format | [optional] | +| **closed_on** | **date** | The date this account was closed. Will be null if the account has not been marked as closed | [optional] | +| **currency** | **str** | Three-letter lowercase currency code of the account balance | [optional] | +| **institution_name** | **str** | Name of institution holding the account | [optional] | +| **external_id** | **str** | An optional external_id that may be set or updated via the API | [optional] | +| **exclude_from_transactions** | **bool** | If true, this account will not show up as an option for assignment when creating transactions manually | [optional] | +| **created_at** | **datetime** | Date/time the account was created in ISO 8601 extended format | [optional] | +| **updated_at** | **datetime** | Date/time the account was created in ISO 8601 extended format | [optional] | + +## Example + +```python +from lunchable.models.manual_account_object import ManualAccountObject + +# TODO update the JSON string below +json = "{}" +# create an instance of ManualAccountObject from a JSON string +manual_account_object_instance = ManualAccountObject.from_json(json) +# print the JSON string representation of the object +print(ManualAccountObject.to_json()) + +# convert the object into a dict +manual_account_object_dict = manual_account_object_instance.to_dict() +# create an instance of ManualAccountObject from a dict +manual_account_object_from_dict = ManualAccountObject.from_dict(manual_account_object_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/clients/python/docs/ManualAccountsApi.md b/clients/python/docs/ManualAccountsApi.md new file mode 100644 index 00000000..5e2f191d --- /dev/null +++ b/clients/python/docs/ManualAccountsApi.md @@ -0,0 +1,446 @@ +# lunchable.ManualAccountsApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ----------------------------------------------------------------------------- | -------------------------------- | --------------------------------- | +| [**create_manual_account**](ManualAccountsApi.md#create_manual_account) | **POST** /manual_accounts | Create a manual account | +| [**delete_manual_account**](ManualAccountsApi.md#delete_manual_account) | **DELETE** /manual_accounts/{id} | Delete a manual account | +| [**get_all_manual_accounts**](ManualAccountsApi.md#get_all_manual_accounts) | **GET** /manual_accounts | Get all manual accounts | +| [**get_manual_account_by_id**](ManualAccountsApi.md#get_manual_account_by_id) | **GET** /manual_accounts/{id} | Get a single manual account | +| [**update_manual_account**](ManualAccountsApi.md#update_manual_account) | **PUT** /manual_accounts/{id} | Update an existing manual account | + +# **create_manual_account** + +> ManualAccountObject create_manual_account(create_manual_account_request_object) + +Create a manual account + +Create a new manually-managed account. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.create_manual_account_request_object import CreateManualAccountRequestObject +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.ManualAccountsApi(api_client) + create_manual_account_request_object = {"name":"API created Account","type":"cash","balance":"100"} # CreateManualAccountRequestObject | + + try: + # Create a manual account + api_response = api_instance.create_manual_account(create_manual_account_request_object) + print("The response of ManualAccountsApi->create_manual_account:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManualAccountsApi->create_manual_account: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------------------------------- | --------------------------------------------------------------------------- | ----------- | ----- | +| **create_manual_account_request_object** | [**CreateManualAccountRequestObject**](CreateManualAccountRequestObject.md) | | + +### Return type + +[**ManualAccountObject**](ManualAccountObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | Successfully created manual account | - | +| **400** | Invalid request body | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_manual_account** + +> delete_manual_account(id) + +Delete a manual account + +Deletes the single manual account with the ID specified on the path. If any transactions exist with the `manual_account_id` property set to this account's ID they will appear with a warning when displayed in the web view. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.ManualAccountsApi(api_client) + id = 119807 # int | ID of the manual account to delete + + try: + # Delete a manual account + api_instance.delete_manual_account(id) + except Exception as e: + print("Exception when calling ManualAccountsApi->delete_manual_account: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ---------------------------------- | ----- | +| **id** | **int** | ID of the manual account to delete | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_all_manual_accounts** + +> GetAllManualAccounts200Response get_all_manual_accounts() + +Get all manual accounts + +Retrieve a list of all manually-managed accounts associated with the user's account. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_manual_accounts200_response import GetAllManualAccounts200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.ManualAccountsApi(api_client) + + try: + # Get all manual accounts + api_response = api_instance.get_all_manual_accounts() + print("The response of ManualAccountsApi->get_all_manual_accounts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManualAccountsApi->get_all_manual_accounts: %s\n" % e) +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetAllManualAccounts200Response**](GetAllManualAccounts200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | A list of manual accounts | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_manual_account_by_id** + +> ManualAccountObject get_manual_account_by_id(id) + +Get a single manual account + +Retrieve the details of the manual account with the specified ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.ManualAccountsApi(api_client) + id = 119807 # int | ID of the manual account to retrieve + + try: + # Get a single manual account + api_response = api_instance.get_manual_account_by_id(id) + print("The response of ManualAccountsApi->get_manual_account_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManualAccountsApi->get_manual_account_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------------------ | ----- | +| **id** | **int** | ID of the manual account to retrieve | + +### Return type + +[**ManualAccountObject**](ManualAccountObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Manual Account Object with the requested account. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_manual_account** + +> ManualAccountObject update_manual_account(id, update_manual_account_request_object) + +Update an existing manual account + +Updates an existing manual account. You may submit the response from a `GET /manual_accounts/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `type`, `subtype`, `display_name`, `balance`, `balance_as_of`, `closed_on`, `currency`, `institution_name`, `external_id`, and `exclude_from_transactions` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.models.update_manual_account_request_object import UpdateManualAccountRequestObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.ManualAccountsApi(api_client) + id = 119807 # int | ID of the manual account to update + update_manual_account_request_object = {"type":"credit"} # UpdateManualAccountRequestObject | + + try: + # Update an existing manual account + api_response = api_instance.update_manual_account(id, update_manual_account_request_object) + print("The response of ManualAccountsApi->update_manual_account:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManualAccountsApi->update_manual_account: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------- | ----- | +| **id** | **int** | ID of the manual account to update | +| **update_manual_account_request_object** | [**UpdateManualAccountRequestObject**](UpdateManualAccountRequestObject.md) | | + +### Return type + +[**ManualAccountObject**](ManualAccountObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Manual Account updated successfully | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/MeApi.md b/clients/python/docs/MeApi.md new file mode 100644 index 00000000..76e6e9f0 --- /dev/null +++ b/clients/python/docs/MeApi.md @@ -0,0 +1,90 @@ +# lunchable.MeApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ----------------------------- | ------------ | ---------------- | +| [**get_me**](MeApi.md#get_me) | **GET** /me | Get current user | + +# **get_me** + +> UserObject get_me() + +Get current user + +Get details about the user associated with the supplied authorization token. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.user_object import UserObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.MeApi(api_client) + + try: + # Get current user + api_response = api_instance.get_me() + print("The response of MeApi->get_me:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MeApi->get_me: %s\n" % e) +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**UserObject**](UserObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | The User Object associated with the authorized token. | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/PlaidAccountObject.md b/clients/python/docs/PlaidAccountObject.md new file mode 100644 index 00000000..d786f643 --- /dev/null +++ b/clients/python/docs/PlaidAccountObject.md @@ -0,0 +1,46 @@ +# PlaidAccountObject + +An object containing information about an account synced via Plaid + +## Properties + +| Name | Type | Description | Notes | +| ----------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | +| **id** | **int** | The unique identifier of this account | +| **date_linked** | **date** | Date account was first linked in ISO 8601 format | +| **name** | **str** | Name of the account. This field is set by Plaid and cannot be altered. | +| **display_name** | **str** | Optional display name for the account set by the user. If not set it will return a concatenated string of institution and account name. | +| **type** | **str** | Primary type of the account, for example credit, depository, etc. This field is set by Plaid and cannot be altered. | +| **subtype** | **str** | Optional account subtype. This field is set by Plaid and cannot be altered. | +| **mask** | **str** | Mask (last 3 to 4 digits of account) of account. This field is set by Plaid and cannot be altered. | +| **institution_name** | **str** | Name of institution holding the account. This field is set by Plaid and cannot be altered. | +| **status** | **str** | Denotes the current status of the account within Lunch Money. Must be one of<br> - `active`: Account is active and in good state<br> - `inactive`: Account marked inactive from user. No transactions fetched or balance update for this account.<br> - `relink`: Account needs to be relinked with Plaid.<br> - `syncing`: Account is awaiting first import of transactions. <br> - `not found`: Account cannot be found with Plaid<br> - `not supported`: Account is not supported with Plaid<br> - `error`: Account is in error with Plaid.<br> | +| **allow_transaction_modifications** | **bool** | Is false if the \"Allow Modification To Transactions\" property for this account has been toggled off. Otherwise it is set to true. | +| **limit** | **float** | Optional credit limit of the account. This field is set by Plaid and cannot be altered | +| **balance** | **str** | Current balance of the account in numeric format to 4 decimal places. This field is set by Plaid and cannot be altered. | +| **currency** | **str** | Three-letter lowercase currency code of the account balance | +| **balance_last_update** | **datetime** | Date balance was last updated in ISO 8601 extended format. This field is set by Plaid and cannot be altered. | +| **import_start_date** | **date** | Date of earliest date allowed for importing transactions. Transactions earlier than this date are not imported. | +| **last_import** | **datetime** | Timestamp in ISO 8601 extended format of the last time Lunch Money imported new data from Plaid for this account. | +| **last_fetch** | **datetime** | Timestamp in ISO 8601 extended format of the last successful request from Lunch Money for updated data or timestamps from Plaid in ISO 8601 extended format (not necessarily date of last successful import) | +| **plaid_last_successful_update** | **datetime** | Timestamp in ISO 8601 extended format of the last time Plaid successfully connected with institution for new transaction updates, regardless of whether any new data was available in the update. | + +## Example + +```python +from lunchable.models.plaid_account_object import PlaidAccountObject + +# TODO update the JSON string below +json = "{}" +# create an instance of PlaidAccountObject from a JSON string +plaid_account_object_instance = PlaidAccountObject.from_json(json) +# print the JSON string representation of the object +print(PlaidAccountObject.to_json()) + +# convert the object into a dict +plaid_account_object_dict = plaid_account_object_instance.to_dict() +# create an instance of PlaidAccountObject from a dict +plaid_account_object_from_dict = PlaidAccountObject.from_dict(plaid_account_object_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/clients/python/docs/PlaidAccountsApi.md b/clients/python/docs/PlaidAccountsApi.md new file mode 100644 index 00000000..c20ac393 --- /dev/null +++ b/clients/python/docs/PlaidAccountsApi.md @@ -0,0 +1,272 @@ +# lunchable.PlaidAccountsApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ---------------------------------------------------------------------------------- | ------------------------------ | --------------------------------------------- | +| [**get_all_plaid_accounts**](PlaidAccountsApi.md#get_all_plaid_accounts) | **GET** /plaid_accounts | Get all accounts synced via Plaid | +| [**get_plaid_account_by_id**](PlaidAccountsApi.md#get_plaid_account_by_id) | **GET** /plaid_accounts/{id} | Get a single account that is synced via Plaid | +| [**trigger_plaid_account_fetch**](PlaidAccountsApi.md#trigger_plaid_account_fetch) | **POST** /plaid_accounts/fetch | Trigger Fetch from Plaid | + +# **get_all_plaid_accounts** + +> GetAllPlaidAccounts200Response get_all_plaid_accounts() + +Get all accounts synced via Plaid + +Retrieve a list of all synced accounts associated with the user's account. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_plaid_accounts200_response import GetAllPlaidAccounts200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.PlaidAccountsApi(api_client) + + try: + # Get all accounts synced via Plaid + api_response = api_instance.get_all_plaid_accounts() + print("The response of PlaidAccountsApi->get_all_plaid_accounts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PlaidAccountsApi->get_all_plaid_accounts: %s\n" % e) +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetAllPlaidAccounts200Response**](GetAllPlaidAccounts200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | A list of accounts synced via Plaid | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_plaid_account_by_id** + +> PlaidAccountObject get_plaid_account_by_id(id) + +Get a single account that is synced via Plaid + +Retrieve the details of the plaid account with the specified ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.plaid_account_object import PlaidAccountObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.PlaidAccountsApi(api_client) + id = 119805 # int | ID of the plaid account to retrieve + + try: + # Get a single account that is synced via Plaid + api_response = api_instance.get_plaid_account_by_id(id) + print("The response of PlaidAccountsApi->get_plaid_account_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PlaidAccountsApi->get_plaid_account_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ----------------------------------- | ----- | +| **id** | **int** | ID of the plaid account to retrieve | + +### Return type + +[**PlaidAccountObject**](PlaidAccountObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Plaid Account Object with the requested account. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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) + +# **trigger_plaid_account_fetch** + +> bool trigger_plaid_account_fetch(start_date=start_date, end_date=end_date, plaid_account_id=plaid_account_id) + +Trigger Fetch from Plaid + +Use this endpoint to trigger a fetch for latest data from Plaid. Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.PlaidAccountsApi(api_client) + start_date = '2013-10-20' # date | Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
(optional) + end_date = '2013-10-20' # date | Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. (optional) + plaid_account_id = 119807 # int | Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts. (optional) + + try: + # Trigger Fetch from Plaid + api_response = api_instance.trigger_plaid_account_fetch(start_date=start_date, end_date=end_date, plaid_account_id=plaid_account_id) + print("The response of PlaidAccountsApi->trigger_plaid_account_fetch:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PlaidAccountsApi->trigger_plaid_account_fetch: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **start_date** | **date** | Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br> | [optional] | +| **end_date** | **date** | Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. | [optional] | +| **plaid_account_id** | **int** | Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts. | [optional] | + +### Return type + +**bool** + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| **200** | A value of true is returned if Plaid acknowledged the fetch request. This indicates that it is possible that query the `GET /plaid_accounts` endpoint to determine if the request was successful (`plaid_last_successful_update` is more recent than `last_fetch), or if new transactions were synced (`last_import` is more recent than `last_fetch`).<br> If false is returned the request failed. This can occur if the requested account does not exist, if there are no Plaid accounts associated with the user, or if a request was already made within the last minute. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/RecurringApi.md b/clients/python/docs/RecurringApi.md new file mode 100644 index 00000000..bb713ee3 --- /dev/null +++ b/clients/python/docs/RecurringApi.md @@ -0,0 +1,192 @@ +# lunchable.RecurringApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| -------------------------------------------------------------- | ----------------------- | --------------------------- | +| [**get_all_recurring**](RecurringApi.md#get_all_recurring) | **GET** /recurring | Get a all recurring items | +| [**get_recurring_by_id**](RecurringApi.md#get_recurring_by_id) | **GET** /recurring/{id} | Get a single recurring item | + +# **get_all_recurring** + +> GetAllRecurring200Response get_all_recurring(start_date=start_date, end_date=end_date, include_suggested=include_suggested) + +Get a all recurring items + +Get info about the recurring items for a specified time frame + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.RecurringApi(api_client) + start_date = '2013-10-20' # date | Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. (optional) + end_date = '2013-10-20' # date | Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. (optional) + include_suggested = True # bool | (optional) + + try: + # Get a all recurring items + api_response = api_instance.get_all_recurring(start_date=start_date, end_date=end_date, include_suggested=include_suggested) + print("The response of RecurringApi->get_all_recurring:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RecurringApi->get_all_recurring: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **start_date** | **date** | Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists. | [optional] | +| **end_date** | **date** | Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. | [optional] | +| **include_suggested** | **bool** | | [optional] | + +### Return type + +[**GetAllRecurring200Response**](GetAllRecurring200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | A list of recurring items | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_recurring_by_id** + +> RecurringObject get_recurring_by_id(id, start_date=start_date, end_date=end_date) + +Get a single recurring item + +Retrieve the details of a specific recurring item with the specified ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.recurring_object import RecurringObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.RecurringApi(api_client) + id = 994069 # int | ID of the recurring item to retrieve + start_date = '2013-10-20' # date | Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. (optional) + end_date = '2013-10-20' # date | Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. (optional) + + try: + # Get a single recurring item + api_response = api_instance.get_recurring_by_id(id, start_date=start_date, end_date=end_date) + print("The response of RecurringApi->get_recurring_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RecurringApi->get_recurring_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **id** | **int** | ID of the recurring item to retrieve | +| **start_date** | **date** | Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists. | [optional] | +| **end_date** | **date** | Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. | [optional] | + +### Return type + +[**RecurringObject**](RecurringObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Tag Object with the requested Tag ID | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/RecurringObject.md b/clients/python/docs/RecurringObject.md new file mode 100644 index 00000000..2176ce77 --- /dev/null +++ b/clients/python/docs/RecurringObject.md @@ -0,0 +1,36 @@ +# RecurringObject + +## Properties + +| Name | Type | Description | Notes | +| ------------------------ | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| **id** | **int** | The unique identifier of this recurring item | +| **description** | **str** | An optional description of this recurring item. This is not written into the transactions. | +| **status** | **str** | The status of this recurring item. `suggested` recurring items are generated by Lunch Money, but only `reviewed` recurring items will be applied to matching transactions. | +| **transaction_criteria** | [**RecurringObjectTransactionCriteria**](RecurringObjectTransactionCriteria.md) | | +| **overrides** | [**RecurringObjectOverrides**](RecurringObjectOverrides.md) | | +| **matches** | [**RecurringObjectMatches**](RecurringObjectMatches.md) | | +| **created_by** | **int** | The ID of the user who created the recurring item. | +| **created_at** | **datetime** | Date/time the recurring item was created in ISO 8601 extended format. | +| **updated_at** | **datetime** | Date/time the recurring item was updated in ISO 8601 extended format. | +| **source** | **str** | This can be one of four values: - `manual`: User created this recurring item manually from the Recurring Items page - `transaction`: User created this by converting a transaction from the Transactions page - `system`: Recurring item was created by the system on transaction import - `null`: Some older recurring items may not have a source. | + +## Example + +```python +from lunchable.models.recurring_object import RecurringObject + +# TODO update the JSON string below +json = "{}" +# create an instance of RecurringObject from a JSON string +recurring_object_instance = RecurringObject.from_json(json) +# print the JSON string representation of the object +print(RecurringObject.to_json()) + +# convert the object into a dict +recurring_object_dict = recurring_object_instance.to_dict() +# create an instance of RecurringObject from a dict +recurring_object_from_dict = RecurringObject.from_dict(recurring_object_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/clients/python/docs/RecurringObjectMatches.md b/clients/python/docs/RecurringObjectMatches.md new file mode 100644 index 00000000..b25f6506 --- /dev/null +++ b/clients/python/docs/RecurringObjectMatches.md @@ -0,0 +1,33 @@ +# RecurringObjectMatches + +Details on expected, found and missing transactions for the specified range. This will be `null` for recurring items with a `status` of `suggested`. + +## Properties + +| Name | Type | Description | Notes | +| ----------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ---------- | +| **request_start_date** | **date** | The beginning of the date range that this request used to find matching transactions. | [optional] | +| **request_end_date** | **date** | The beginning of the date range that this request used to find matching transactions. | [optional] | +| **expected_occurrence_dates** | **List[date]** | A list of dates within the specified range where a recurring transactions is expected. | [optional] | +| **found_transactions** | [**List[RecurringObjectMatchesFoundTransactionsInner]**](RecurringObjectMatchesFoundTransactionsInner.md) | A list with the dates and IDs of matching transactions. | [optional] | +| **missing_transaction_dates** | **List[date]** | A list of dates within the range of where a recurring transaction was expected but none was found. | [optional] | + +## Example + +```python +from lunchable.models.recurring_object_matches import RecurringObjectMatches + +# TODO update the JSON string below +json = "{}" +# create an instance of RecurringObjectMatches from a JSON string +recurring_object_matches_instance = RecurringObjectMatches.from_json(json) +# print the JSON string representation of the object +print(RecurringObjectMatches.to_json()) + +# convert the object into a dict +recurring_object_matches_dict = recurring_object_matches_instance.to_dict() +# create an instance of RecurringObjectMatches from a dict +recurring_object_matches_from_dict = RecurringObjectMatches.from_dict(recurring_object_matches_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/clients/python/docs/RecurringObjectMatchesFoundTransactionsInner.md b/clients/python/docs/RecurringObjectMatchesFoundTransactionsInner.md new file mode 100644 index 00000000..f47c9ea3 --- /dev/null +++ b/clients/python/docs/RecurringObjectMatchesFoundTransactionsInner.md @@ -0,0 +1,28 @@ +# RecurringObjectMatchesFoundTransactionsInner + +## Properties + +| Name | Type | Description | Notes | +| ------------------ | -------- | --------------------------------------------------------------- | ---------- | +| **var_date** | **date** | The date for a matching transaction within the specified range. | [optional] | +| **transaction_id** | **int** | The ID of a matching transaction within the specified range. | [optional] | + +## Example + +```python +from lunchable.models.recurring_object_matches_found_transactions_inner import RecurringObjectMatchesFoundTransactionsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of RecurringObjectMatchesFoundTransactionsInner from a JSON string +recurring_object_matches_found_transactions_inner_instance = RecurringObjectMatchesFoundTransactionsInner.from_json(json) +# print the JSON string representation of the object +print(RecurringObjectMatchesFoundTransactionsInner.to_json()) + +# convert the object into a dict +recurring_object_matches_found_transactions_inner_dict = recurring_object_matches_found_transactions_inner_instance.to_dict() +# create an instance of RecurringObjectMatchesFoundTransactionsInner from a dict +recurring_object_matches_found_transactions_inner_from_dict = RecurringObjectMatchesFoundTransactionsInner.from_dict(recurring_object_matches_found_transactions_inner_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/clients/python/docs/RecurringObjectOverrides.md b/clients/python/docs/RecurringObjectOverrides.md new file mode 100644 index 00000000..d5e9208e --- /dev/null +++ b/clients/python/docs/RecurringObjectOverrides.md @@ -0,0 +1,31 @@ +# RecurringObjectOverrides + +The values that will be applied to matching transactions. + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------- | ---------------------------------------------------------------------------------- | ---------- | +| **payee** | **str** | If present, the payee name that will be displayed for any matching transactions. | [optional] | +| **notes** | **str** | If present, the notes that will be displayed for any matching transactions. | [optional] | +| **category_id** | **int** | If present, the id of the category that matching transactions will be assigned to. | [optional] | + +## Example + +```python +from lunchable.models.recurring_object_overrides import RecurringObjectOverrides + +# TODO update the JSON string below +json = "{}" +# create an instance of RecurringObjectOverrides from a JSON string +recurring_object_overrides_instance = RecurringObjectOverrides.from_json(json) +# print the JSON string representation of the object +print(RecurringObjectOverrides.to_json()) + +# convert the object into a dict +recurring_object_overrides_dict = recurring_object_overrides_instance.to_dict() +# create an instance of RecurringObjectOverrides from a dict +recurring_object_overrides_from_dict = RecurringObjectOverrides.from_dict(recurring_object_overrides_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/clients/python/docs/RecurringObjectTransactionCriteria.md b/clients/python/docs/RecurringObjectTransactionCriteria.md new file mode 100644 index 00000000..7c488a5e --- /dev/null +++ b/clients/python/docs/RecurringObjectTransactionCriteria.md @@ -0,0 +1,39 @@ +# RecurringObjectTransactionCriteria + +The set of properties used to identify matching transactions. + +## Properties + +| Name | Type | Description | Notes | +| --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | +| **start_date** | **date** | The beginning of the date range for matching transactions. If null, any transactions before end_date may be considered. | [optional] | +| **end_date** | **date** | The end of the date range for matching transactions. If null, any transactions after start_date may be considered. | [optional] | +| **granularity** | **str** | The unit of time used to define the cadence of the recurring item. | [optional] | +| **quantity** | **int** | The number of granularity units between each recurrence. | [optional] | +| **anchor_date** | **date** | The date used in conjunction with the `quantity` and `granularity` properties to calculate expected occurrences of recurring transactions. | [optional] | +| **payee** | **str** | If any, represents the original transaction payee name that triggered this recurring item's creation. | [optional] | +| **amount** | **str** | The expected amount for a transaction that will match this recurring item. For recurring items that have a flexible amount this is the average of the specified min and max amounts. | [optional] | +| **currency** | **str** | Three-letter lowercase currency code of the recurring item. | [optional] | +| **to_base** | **float** | The base amount of the recurring item. | [optional] | +| **plaid_account_id** | **int** | The Plaid account ID associated with the recurring item, if any. | [optional] | +| **manual_account_id** | **int** | The manual account ID associated with the recurring item, if any. | [optional] | + +## Example + +```python +from lunchable.models.recurring_object_transaction_criteria import RecurringObjectTransactionCriteria + +# TODO update the JSON string below +json = "{}" +# create an instance of RecurringObjectTransactionCriteria from a JSON string +recurring_object_transaction_criteria_instance = RecurringObjectTransactionCriteria.from_json(json) +# print the JSON string representation of the object +print(RecurringObjectTransactionCriteria.to_json()) + +# convert the object into a dict +recurring_object_transaction_criteria_dict = recurring_object_transaction_criteria_instance.to_dict() +# create an instance of RecurringObjectTransactionCriteria from a dict +recurring_object_transaction_criteria_from_dict = RecurringObjectTransactionCriteria.from_dict(recurring_object_transaction_criteria_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/clients/python/docs/SplitTransactionObjectAmount.md b/clients/python/docs/SplitTransactionObjectAmount.md new file mode 100644 index 00000000..f1096be8 --- /dev/null +++ b/clients/python/docs/SplitTransactionObjectAmount.md @@ -0,0 +1,28 @@ +# SplitTransactionObjectAmount + +Individual amount of split. Currency will inherit from parent transaction. All amounts must sum up to parent transaction amount. + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```python +from lunchable.models.split_transaction_object_amount import SplitTransactionObjectAmount + +# TODO update the JSON string below +json = "{}" +# create an instance of SplitTransactionObjectAmount from a JSON string +split_transaction_object_amount_instance = SplitTransactionObjectAmount.from_json(json) +# print the JSON string representation of the object +print(SplitTransactionObjectAmount.to_json()) + +# convert the object into a dict +split_transaction_object_amount_dict = split_transaction_object_amount_instance.to_dict() +# create an instance of SplitTransactionObjectAmount from a dict +split_transaction_object_amount_from_dict = SplitTransactionObjectAmount.from_dict(split_transaction_object_amount_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/clients/python/docs/SplitTransactionRequest.md b/clients/python/docs/SplitTransactionRequest.md new file mode 100644 index 00000000..6373818a --- /dev/null +++ b/clients/python/docs/SplitTransactionRequest.md @@ -0,0 +1,27 @@ +# SplitTransactionRequest + +## Properties + +| Name | Type | Description | Notes | +| ---------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----- | +| **child_transactions** | [**List[SplitTransactionObject]**](SplitTransactionObject.md) | List of child transactions to create. The sum of the `amounts` must match the split transaction amount. | + +## Example + +```python +from lunchable.models.split_transaction_request import SplitTransactionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SplitTransactionRequest from a JSON string +split_transaction_request_instance = SplitTransactionRequest.from_json(json) +# print the JSON string representation of the object +print(SplitTransactionRequest.to_json()) + +# convert the object into a dict +split_transaction_request_dict = split_transaction_request_instance.to_dict() +# create an instance of SplitTransactionRequest from a dict +split_transaction_request_from_dict = SplitTransactionRequest.from_dict(split_transaction_request_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/clients/python/docs/TagObject.md b/clients/python/docs/TagObject.md new file mode 100644 index 00000000..60b326c7 --- /dev/null +++ b/clients/python/docs/TagObject.md @@ -0,0 +1,33 @@ +# TagObject + +## Properties + +| Name | Type | Description | Notes | +| --------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ----- | +| **id** | **int** | Unique identifier for the tag. | +| **name** | **str** | Name of the tag. | +| **description** | **str** | Description of the tag. | +| **updated_at** | **datetime** | The date and time of when the tag was last updated (in the ISO 8601 extended format). | +| **created_at** | **datetime** | The date and time of when the tag was created (in the ISO 8601 extended format). | +| **archived** | **bool** | If true, the tag will not show up when creating or updating transactions in the Lunch Money app. **Can it be assigned via the API** | +| **archived_at** | **datetime** | The date and time of when the tag was last archived or null if not archived | + +## Example + +```python +from lunchable.models.tag_object import TagObject + +# TODO update the JSON string below +json = "{}" +# create an instance of TagObject from a JSON string +tag_object_instance = TagObject.from_json(json) +# print the JSON string representation of the object +print(TagObject.to_json()) + +# convert the object into a dict +tag_object_dict = tag_object_instance.to_dict() +# create an instance of TagObject from a dict +tag_object_from_dict = TagObject.from_dict(tag_object_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/clients/python/docs/TagsApi.md b/clients/python/docs/TagsApi.md new file mode 100644 index 00000000..f22e2ad1 --- /dev/null +++ b/clients/python/docs/TagsApi.md @@ -0,0 +1,449 @@ +# lunchable.TagsApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| --------------------------------------------- | --------------------- | ---------------------- | +| [**create_tag**](TagsApi.md#create_tag) | **POST** /tags | Create a new tag | +| [**delete_tag**](TagsApi.md#delete_tag) | **DELETE** /tags/{id} | Delete a tag | +| [**get_all_tags**](TagsApi.md#get_all_tags) | **GET** /tags | Get All Tags | +| [**get_tag_by_id**](TagsApi.md#get_tag_by_id) | **GET** /tags/{id} | Get a single tags | +| [**update_tag**](TagsApi.md#update_tag) | **PUT** /tags/{id} | Update an existing tag | + +# **create_tag** + +> TagObject create_tag(create_tag_request_object) + +Create a new tag + +Creates a new tag with the given name + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.create_tag_request_object import CreateTagRequestObject +from lunchable.models.tag_object import TagObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TagsApi(api_client) + create_tag_request_object = {"name":"API Created Tag with no description"} # CreateTagRequestObject | + + try: + # Create a new tag + api_response = api_instance.create_tag(create_tag_request_object) + print("The response of TagsApi->create_tag:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TagsApi->create_tag: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------------- | ------------------------------------------------------- | ----------- | ----- | +| **create_tag_request_object** | [**CreateTagRequestObject**](CreateTagRequestObject.md) | | + +### Return type + +[**TagObject**](TagObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | Tag Object with the successfully created tag | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_tag** + +> delete_tag(id, force=force) + +Delete a tag + +Deletes the tag with the ID specified on the path.
If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TagsApi(api_client) + id = 94319 # int | ID of the tag to delete + force = False # bool | Set to true to force deletion even if there are dependencies (optional) (default to False) + + try: + # Delete a tag + api_instance.delete_tag(id, force=force) + except Exception as e: + print("Exception when calling TagsApi->delete_tag: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------- | -------- | ------------------------------------------------------------ | ----------------------------- | +| **id** | **int** | ID of the tag to delete | +| **force** | **bool** | Set to true to force deletion even if there are dependencies | [optional] [default to False] | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **422** | Unprocessable Entity | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_all_tags** + +> GetAllTags200Response get_all_tags() + +Get All Tags + +Retrieve a list of all tags associated with the user's account. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_tags200_response import GetAllTags200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TagsApi(api_client) + + try: + # Get All Tags + api_response = api_instance.get_all_tags() + print("The response of TagsApi->get_all_tags:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TagsApi->get_all_tags: %s\n" % e) +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetAllTags200Response**](GetAllTags200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | A list of tags | - | +| **400** | Invalid request parameters | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_tag_by_id** + +> TagObject get_tag_by_id(id) + +Get a single tags + +Retrieve the details of a specific tag with the specified ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.tag_object import TagObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TagsApi(api_client) + id = 94319 # int | ID of the tag to retrieve + + try: + # Get a single tags + api_response = api_instance.get_tag_by_id(id) + print("The response of TagsApi->get_tag_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TagsApi->get_tag_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------- | ----- | +| **id** | **int** | ID of the tag to retrieve | + +### Return type + +[**TagObject**](TagObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Tag Object with the requested Tag ID | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_tag** + +> TagObject update_tag(id, update_tag_request_object) + +Update an existing tag + +Updates an existing tag. You may submit the response from a `GET /tags/{id}` as the request body which includes system created attributes such as `id`, however only the `name`, `description`, and `archived`, can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.tag_object import TagObject +from lunchable.models.update_tag_request_object import UpdateTagRequestObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TagsApi(api_client) + id = 94319 # int | ID of the tag to update + update_tag_request_object = {"name":"Updated Tag Name","description":"Updated description of the category"} # UpdateTagRequestObject | + + try: + # Update an existing tag + api_response = api_instance.update_tag(id, update_tag_request_object) + print("The response of TagsApi->update_tag:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TagsApi->update_tag: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------------- | ------------------------------------------------------- | ----------------------- | ----- | +| **id** | **int** | ID of the tag to update | +| **update_tag_request_object** | [**UpdateTagRequestObject**](UpdateTagRequestObject.md) | | + +### Return type + +[**TagObject**](TagObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Category or Category Group updated successfully | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/TransactionObject.md b/clients/python/docs/TransactionObject.md new file mode 100644 index 00000000..17706cc8 --- /dev/null +++ b/clients/python/docs/TransactionObject.md @@ -0,0 +1,52 @@ +# TransactionObject + +## Properties + +| Name | Type | Description | Notes | +| --------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **id** | **int** | System created unique identifier for transaction | +| **var_date** | **date** | Date of transaction in ISO 8601 format | +| **amount** | **str** | Amount of the transaction in numeric format to 4 decimal places | +| **currency** | [**CurrencyEnum**](CurrencyEnum.md) | Three-letter lowercase currency code of the transaction in ISO 4217 format | +| **to_base** | **float** | The amount converted to the user's primary currency. If the multi-currency feature is not being used, to_base and amount will be the same. | +| **recurring_id** | **int** | The unique identifier of the associated recurring item that this transaction matched. If the recurring item changed properties of this transaction, an `overrides` property with details on what was overridden will be include in the transaction object. If no `overrides` property exists when there is a `recurring_id` it means that the recurring_item is still in the suggested state, or that it does not contain any rules to override transaction properties. | +| **overrides** | [**TransactionOverridesObject**](TransactionOverridesObject.md) | | +| **payee** | **str** | Name of payee set by the user, the financial institution, or by a matched recurring item. This will match the value displayed in payee field on the transactions page in the GUI. | +| **category_id** | **int** | Unique identifier of associated category set by the user or by a matched recurring_item.<br> Category details can be obtained by passing the value of this property to the [Get A Single Category](../operations/getCategoryById) API | +| **notes** | **str** | Any transaction notes set by the user or by a matched recurring item. This will match the value displayed in notes field on the transactions page in the GUI. | +| **status** | **str** | Status of the transaction: - `reviewed`: User has reviewed the transaction, or it was automatically marked as reviewed due to reviewed recurring_item logic - `unreviewed`: User has not reviewed the transaction and it does not match any reviewed recurring_items. - `delete_pending`: The synced account deleted this transaction after it was updated by the user. Requires manual intervention. - `pending`: Transaction is still pending with the synced institution (not posted). | +| **is_pending** | **bool** | Denotes if the transaction is pending (not posted). Applies only to transactions in synced accounts and will always be false for transactions associated with manual accounts. | +| **created_at** | **datetime** | The date and time of when the transaction was created (in the ISO 8601 extended format). | +| **updated_at** | **datetime** | The date and time of when the transaction was last updated (in the ISO 8601 extended format). | +| **is_parent** | **bool** | If true this transaction has been split into two or more other transactions. By default parent transactions are not returned in call to `GET /transactions` but they can be queried directly by their ID. | [optional] | +| **children** | **List[str]** | Exists only for transactions which are the parent of a split transaction, and contains a list of the associated transactions that it was split into. By default parent transactions are not returned in a `GET /transactions` API call, but can be examined via a subsequent call to `GET /transactions{id}`, where the value of `parent_id` field of a split transaction is the requested transaction. | [optional] | +| **parent_id** | **List[float]** | A transaction ID if this is a split transaction. Denotes the transaction ID of the original, or parent, transaction. Is null if this is not a split transaction | +| **is_group** | **bool** | True if this transaction represents a group of transactions. If so, amount and currency represent the totalled amount of transactions bearing this transaction’s id as their group_id. Amount is calculated based on the user’s primary currency. | +| **group_id** | **int** | Is set if this transaction is part of a group. Denotes the ID of the grouped transaction this is now included in. By default the transactions that were grouped are not returned in a call to `GET /transactions` but they can be queried directly by calling the `GET /transactions/group/{id}`, where the id passed is associated with a transaction where the `is_group` attribute is true | +| **manual_account_id** | **int** | The unique identifier of the manual account associated with this transaction. This will always be null if this transaction is associated with a synced account or if this transaction has no associated account and appears as a \"Cash Transaction\" in the Lunch Money GUI. | +| **plaid_account_id** | **int** | The unique identifier of the plaid account associated with this transaction. This will always be null if this transaction is associated with a manual account or if this transaction has no associated account and appears as a \"Cash Transaction\" in the Lunch Money GUI. | +| **tag_ids** | **List[int]** | A list of tag_ids for the tags associated with this transaction. If the transaction has no tags this will be an empty list.<br> Tag details can be obtained by passing the value of this attribute as the `ids` query parameter to the [List Tags](../operations/getTags) API | +| **source** | **str** | Source of the transaction: - `api`: Transaction was added by a call to the [POST /transactions](../operations/createTransaction) API - `csv`: Transaction was added via a CSV Import - `manual`: Transaction was created via the \"Add to Cash\" button on the Transactions page - `merge`: Transactions were originally in an account that was merged into another account - `plaid`: Transaction came from a Financial Institution synced via Plaid - `recurring`: Transaction was created from the Recurring page - `rule`: Transaction was created by a rule to split a transaction - `split`: This is a transaction created by splitting another transaction - `user`: This is a legacy value and is replaced by either csv or manual | +| **external_id** | **str** | A user-defined external ID for any transaction that was added via csv import, `POST /transactions` API call, or manually added via the Lunch Money GUI. No external ID exists for transactions associated with synced accounts, and they cannot be added. For transactions associated with manual accounts, the external ID must be unique as attempts to add a subsequent transaction with the same external_id and manual_account_id will be flagged as duplicates and fail. | +| **plaid_metadata** | **object** | If requested, the transaction's plaid_metadata that came when this transaction was obtained. This will be a json object, but the schema is variable. This will only be present for transactions associated with a plaid account. | [optional] | +| **custom_metadata** | **object** | If requested, the transaction's custom_metadata that was included when the transaction was inserted via the API. This will be a json object, but the schema is variable. This will only be present for transactions associated with a manual account. | [optional] | + +## Example + +```python +from lunchable.models.transaction_object import TransactionObject + +# TODO update the JSON string below +json = "{}" +# create an instance of TransactionObject from a JSON string +transaction_object_instance = TransactionObject.from_json(json) +# print the JSON string representation of the object +print(TransactionObject.to_json()) + +# convert the object into a dict +transaction_object_dict = transaction_object_instance.to_dict() +# create an instance of TransactionObject from a dict +transaction_object_from_dict = TransactionObject.from_dict(transaction_object_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/clients/python/docs/TransactionsApi.md b/clients/python/docs/TransactionsApi.md new file mode 100644 index 00000000..870f1eec --- /dev/null +++ b/clients/python/docs/TransactionsApi.md @@ -0,0 +1,182 @@ +# lunchable.TransactionsApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| --------------------------------------------------------------------------- | ----------------------------- | ------------------------ | +| [**delete_transaction_by_id**](TransactionsApi.md#delete_transaction_by_id) | **DELETE** /transactions/{id} | Delete a transaction | +| [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /transactions/{id} | Get a single transaction | + +# **delete_transaction_by_id** + +> delete_transaction_by_id(id) + +Delete a transaction + +Deletes the transaction with the ID specified on the path.
If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted.
This action is not reversible! + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsApi(api_client) + id = 2112140361 # int | ID of the transaction to delete + + try: + # Delete a transaction + api_instance.delete_transaction_by_id(id) + except Exception as e: + print("Exception when calling TransactionsApi->delete_transaction_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------------- | ----- | +| **id** | **int** | ID of the transaction to delete | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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** + +> TransactionObject get_transaction_by_id(id, include_metadata=include_metadata) + +Get a single transaction + +Retrieve details of a specific transaction by its ID.

It the requested transaction is the parent of split transactions, the transaction returned in the response will include a `children` property which will contain a list of the split transactions.

Similarly, if the requested transaction is transaction group, the transaction returned in the response will include a `children` property which will contain a list of the original transactions that make up the transaction group. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.transaction_object import TransactionObject +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsApi(api_client) + id = 2112140359 # int | ID of the transaction to retrieve + include_metadata = False # bool | Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API. (optional) (default to False) + + try: + # Get a single transaction + api_response = api_instance.get_transaction_by_id(id, include_metadata=include_metadata) + print("The response of TransactionsApi->get_transaction_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionsApi->get_transaction_by_id: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| **id** | **int** | ID of the transaction to retrieve | +| **include_metadata** | **bool** | Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API. | [optional] [default to False] | + +### Return type + +[**TransactionObject**](TransactionObject.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **200** | Transaction Object with the requested transaction. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/TransactionsBulkApi.md b/clients/python/docs/TransactionsBulkApi.md new file mode 100644 index 00000000..26d8714d --- /dev/null +++ b/clients/python/docs/TransactionsBulkApi.md @@ -0,0 +1,294 @@ +# lunchable.TransactionsBulkApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ----------------------------------------------------------------------------- | ------------------------ | --------------------------------- | +| [**create_new_transactions**](TransactionsBulkApi.md#create_new_transactions) | **POST** /transactions | Insert one or more transactions. | +| [**delete_transactions**](TransactionsBulkApi.md#delete_transactions) | **DELETE** /transactions | Bulk delete existing transactions | +| [**get_all_transactions**](TransactionsBulkApi.md#get_all_transactions) | **GET** /transactions | Get all transactions | + +# **create_new_transactions** + +> CreateNewTransactions201Response create_new_transactions(create_new_transactions_request) + +Insert one or more transactions. + +Use this endpoint to add transactions to a budget. The request body for this endpoint must include a list of transactions with at least one transaction and not more than 500 transactions to insert. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.create_new_transactions201_response import CreateNewTransactions201Response +from lunchable.models.create_new_transactions_request import CreateNewTransactionsRequest +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsBulkApi(api_client) + create_new_transactions_request = {"transactions":[{"date":"2024-12-01","amount":"42.89","payee":"Food Town","category_id":315163,"status":"reviewed"}]} # CreateNewTransactionsRequest | + + try: + # Insert one or more transactions. + api_response = api_instance.create_new_transactions(create_new_transactions_request) + print("The response of TransactionsBulkApi->create_new_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionsBulkApi->create_new_transactions: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------------------- | ------------------------------------------------------------------- | ----------- | ----- | +| **create_new_transactions_request** | [**CreateNewTransactionsRequest**](CreateNewTransactionsRequest.md) | | + +### Return type + +[**CreateNewTransactions201Response**](CreateNewTransactions201Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | Transactions successfully inserted | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_transactions** + +> delete_transactions(delete_transactions_request) + +Bulk delete existing transactions + +Deletes the transaction with the IDs specified in the request body.
If any of the specified transactions are a split transaction or a split parent, or if any are a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. This will also fail if any of the specified transaction IDs do not exist.
Otherwise, the specified transactions are deleted. This action is not reversible! + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsBulkApi(api_client) + delete_transactions_request = {"ids":[2112150653,2112150654,2112150655]} # DeleteTransactionsRequest | + + try: + # Bulk delete existing transactions + api_instance.delete_transactions(delete_transactions_request) + except Exception as e: + print("Exception when calling TransactionsBulkApi->delete_transactions: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------------------------- | ------------------------------------------------------------- | ----------- | ----- | +| **delete_transactions_request** | [**DeleteTransactionsRequest**](DeleteTransactionsRequest.md) | | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **400** | Not Found | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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_all_transactions** + +> GetAllTransactions200Response get_all_transactions(start_date=start_date, end_date=end_date, manual_account_id=manual_account_id, plaid_account_id=plaid_account_id, recurring_id=recurring_id, category_id=category_id, is_group=is_group, status=status, tag_id=tag_id, include_pending=include_pending, include_custom_metadata=include_custom_metadata, limit=limit, offset=offset) + +Get all transactions + +Retrieve a list of all transactions associated with a user's account.
If called with no parameters this endpoint will return up to 100 of the most recent transactions. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.get_all_transactions200_response import GetAllTransactions200Response +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsBulkApi(api_client) + start_date = '2013-10-20' # date | Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
(optional) + end_date = '2013-10-20' # date | Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. (optional) + manual_account_id = 219909 # int | Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. (optional) + plaid_account_id = 119807 # int | Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. (optional) + recurring_id = 994069 # int | Filter transactions to those associated with specified Recurring Item ID (optional) + category_id = 83 # int | Filter transactions to those associated with the specified category ID. Will also match category groups. (optional) + is_group = True # bool | Filter by group (returns only grouped transactions if set to true) (optional) + status = 'unreviewed' # str | Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true. (optional) + tag_id = 56 # int | Filter transactions to those that have a tag with the specified Tag ID (optional) + include_pending = False # bool | Pass in true if you’d like to include imported transactions with a pending status. (optional) (default to False) + include_custom_metadata = False # bool | Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API. (optional) (default to False) + limit = 100 # int | Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo) (optional) (default to 100) + offset = 56 # int | Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo) (optional) + + try: + # Get all transactions + api_response = api_instance.get_all_transactions(start_date=start_date, end_date=end_date, manual_account_id=manual_account_id, plaid_account_id=plaid_account_id, recurring_id=recurring_id, category_id=category_id, is_group=is_group, status=status, tag_id=tag_id, include_pending=include_pending, include_custom_metadata=include_custom_metadata, limit=limit, offset=offset) + print("The response of TransactionsBulkApi->get_all_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionsBulkApi->get_all_transactions: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| **start_date** | **date** | Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists. <br> | [optional] | +| **end_date** | **date** | Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. | [optional] | +| **manual_account_id** | **int** | Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. | [optional] | +| **plaid_account_id** | **int** | Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. | [optional] | +| **recurring_id** | **int** | Filter transactions to those associated with specified Recurring Item ID | [optional] | +| **category_id** | **int** | Filter transactions to those associated with the specified category ID. Will also match category groups. | [optional] | +| **is_group** | **bool** | Filter by group (returns only grouped transactions if set to true) | [optional] | +| **status** | **str** | Filter transactions to those with the specified status:<br> - `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic<br> - `unreviewed`: Only transactions that need to be reviewed<br> - `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user. <br> - `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true. | [optional] | +| **tag_id** | **int** | Filter transactions to those that have a tag with the specified Tag ID | [optional] | +| **include_pending** | **bool** | Pass in true if you’d like to include imported transactions with a pending status. | [optional] [default to False] | +| **include_custom_metadata** | **bool** | Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API. | [optional] [default to False] | +| **limit** | **int** | Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo) | [optional] [default to 100] | +| **offset** | **int** | Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo) | [optional] | + +### Return type + +[**GetAllTransactions200Response**](GetAllTransactions200Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| **200** | Returns an array of transactions. <br><br>The `has_more` property is set to `true` if more transactions are available. See [Pagination](/foo) | - | +| **400** | Invalid request parameters | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/TransactionsGroupApi.md b/clients/python/docs/TransactionsGroupApi.md new file mode 100644 index 00000000..2d98f711 --- /dev/null +++ b/clients/python/docs/TransactionsGroupApi.md @@ -0,0 +1,180 @@ +# lunchable.TransactionsGroupApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ------------------------------------------------------------------------ | ----------------------------------- | -------------------------- | +| [**group_transactions**](TransactionsGroupApi.md#group_transactions) | **POST** /transactions/group | Create a transaction group | +| [**ungroup_transactions**](TransactionsGroupApi.md#ungroup_transactions) | **DELETE** /transactions/group/{id} | Delete a transaction group | + +# **group_transactions** + +> GroupTransactions201Response group_transactions(group_transactions_request) + +Create a transaction group + +Specify a set of existing transaction IDs to group together as a single grouped transaction. The new transaction will have an amount equal to the sum of the grouped transaction amounts. If the grouped transactions have different currencies, the new group transaction will be set in the user's default currency.

After a transaction has been grouped the original transactions are no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created grouped transaction is returned instead. To see the details of the original transactions that were used to create a transaction group, use the `GET /transactions/{id}` endpoint, passing the ID of the grouped transaction. The grouped transactions will be included in the `children` property of the transaction returned in the response + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.group_transactions_request import GroupTransactionsRequest +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsGroupApi(api_client) + group_transactions_request = {"ids":[2112140365,2112140361],"payee":"Home Entertainment Transactions","date":"2024-12-10"} # GroupTransactionsRequest | + + try: + # Create a transaction group + api_response = api_instance.group_transactions(group_transactions_request) + print("The response of TransactionsGroupApi->group_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionsGroupApi->group_transactions: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------------------------ | ----------------------------------------------------------- | ----------- | ----- | +| **group_transactions_request** | [**GroupTransactionsRequest**](GroupTransactionsRequest.md) | | + +### Return type + +[**GroupTransactions201Response**](GroupTransactions201Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | The new grouped parent transaction with populated children attribute | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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) + +# **ungroup_transactions** + +> ungroup_transactions(id) + +Delete a transaction group + +Deletes the transaction group with the ID specified on the path.
The transactions within the group are not removed and will subsequently be treated as \"normal\" ungrouped transactions. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsGroupApi(api_client) + id = 2112140959 # int | ID of the transaction group to delete + + try: + # Delete a transaction group + api_instance.ungroup_transactions(id) + except Exception as e: + print("Exception when calling TransactionsGroupApi->ungroup_transactions: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------------------- | ----- | +| **id** | **int** | ID of the transaction group to delete | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **404** | Not Found | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/TransactionsSplitApi.md b/clients/python/docs/TransactionsSplitApi.md new file mode 100644 index 00000000..5efcfa07 --- /dev/null +++ b/clients/python/docs/TransactionsSplitApi.md @@ -0,0 +1,182 @@ +# lunchable.TransactionsSplitApi + +All URIs are relative to *https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2* + +| Method | HTTP request | Description | +| ---------------------------------------------------------------------- | ----------------------------------- | --------------------------------------- | +| [**split_transaction**](TransactionsSplitApi.md#split_transaction) | **POST** /transactions/split/{id} | Split a transaction | +| [**unsplit_transaction**](TransactionsSplitApi.md#unsplit_transaction) | **DELETE** /transactions/split/{id} | Unsplit a previously split transactions | + +# **split_transaction** + +> GroupTransactions201Response split_transaction(id, split_transaction_request) + +Split a transaction + +Splits an existing transaction into a set of smaller child transactions.

After a transaction has been split the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split use the `GET /transactions/{id}` endpoint, passing the value of the `parent_id` of one of the children. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.split_transaction_request import SplitTransactionRequest +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsSplitApi(api_client) + id = 2112150650 # int | ID of the transaction to spit + split_transaction_request = {"child_transactions":[{"amount":44.23,"payee":"Food Town - Lenny"},{"amount":44.22,"payee":"Food Town - Penny"}]} # SplitTransactionRequest | + + try: + # Split a transaction + api_response = api_instance.split_transaction(id, split_transaction_request) + print("The response of TransactionsSplitApi->split_transaction:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionsSplitApi->split_transaction: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------------------------- | --------------------------------------------------------- | ----------------------------- | ----- | +| **id** | **int** | ID of the transaction to spit | +| **split_transaction_request** | [**SplitTransactionRequest**](SplitTransactionRequest.md) | | + +### Return type + +[**GroupTransactions201Response**](GroupTransactions201Response.md) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **201** | The new split parent transaction with populated children attribute | - | +| **400** | Bad Request | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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) + +# **unsplit_transaction** + +> unsplit_transaction(id) + +Unsplit a previously split transactions + +Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.

Use the value of the `parent_id`property of a split transaction to specify the parent ID. + +### Example + +- Api Key Authentication (cookieAuth): +- Bearer (JWT) Authentication (bearerSecurity): + +```python +import lunchable +from lunchable.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = lunchable.Configuration( + host = "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" +) + +# 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 API key authorization: cookieAuth +configuration.api_key['cookieAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookieAuth'] = 'Bearer' + +# Configure Bearer authorization (JWT): bearerSecurity +configuration = lunchable.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with lunchable.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lunchable.TransactionsSplitApi(api_client) + id = 2112140459 # int | ID of the previously split transaction to delete. + + try: + # Unsplit a previously split transactions + api_instance.unsplit_transaction(id) + except Exception as e: + print("Exception when calling TransactionsSplitApi->unsplit_transaction: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------ | ------- | ------------------------------------------------- | ----- | +| **id** | **int** | ID of the previously split transaction to delete. | + +### Return type + +void (empty response body) + +### Authorization + +[cookieAuth](../README.md#cookieAuth), [bearerSecurity](../README.md#bearerSecurity) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------- | +| **204** | No Content | - | +| **400** | Invalid request parameters | - | +| **401** | Unauthorized. This error occurs when an invalid API token is passed to the request. | - | +| **429** | Too Many Requests. Retry your request after the number of seconds specified in the retry-after header. | - | +| **500** | Internal Server Error. Contact support. | - | + +[[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/clients/python/docs/UserObject.md b/clients/python/docs/UserObject.md new file mode 100644 index 00000000..36c22280 --- /dev/null +++ b/clients/python/docs/UserObject.md @@ -0,0 +1,33 @@ +# UserObject + +## Properties + +| Name | Type | Description | Notes | +| -------------------- | ----------------------------------- | --------------------------------------------------------------------------------------- | ----- | +| **name** | **str** | User's name | +| **email** | **str** | User's email | +| **id** | **int** | Unique identifier for user | +| **account_id** | **int** | Unique identifier for the associated budgeting account | +| **budget_name** | **str** | Name of the associated budgeting account | +| **primary_currency** | [**CurrencyEnum**](CurrencyEnum.md) | Primary currency from user's settings | +| **api_key_label** | **str** | User-defined label of the developer API key used. Returns null if nothing has been set. | + +## Example + +```python +from lunchable.models.user_object import UserObject + +# TODO update the JSON string below +json = "{}" +# create an instance of UserObject from a JSON string +user_object_instance = UserObject.from_json(json) +# print the JSON string representation of the object +print(UserObject.to_json()) + +# convert the object into a dict +user_object_dict = user_object_instance.to_dict() +# create an instance of UserObject from a dict +user_object_from_dict = UserObject.from_dict(user_object_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/clients/python/git_push.sh b/clients/python/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/clients/python/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/python/lunchable/__init__.py b/clients/python/lunchable/__init__.py new file mode 100644 index 00000000..5b7f678d --- /dev/null +++ b/clients/python/lunchable/__init__.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +__version__ = "1.0.0" + +# import apis into sdk package +from lunchable.api.categories_api import CategoriesApi +from lunchable.api.manual_accounts_api import ManualAccountsApi +from lunchable.api.me_api import MeApi +from lunchable.api.plaid_accounts_api import PlaidAccountsApi +from lunchable.api.recurring_api import RecurringApi +from lunchable.api.tags_api import TagsApi +from lunchable.api.transactions_api import TransactionsApi +from lunchable.api.transactions_bulk_api import TransactionsBulkApi +from lunchable.api.transactions_group_api import TransactionsGroupApi +from lunchable.api.transactions_split_api import TransactionsSplitApi + +# import ApiClient +from lunchable.api_response import ApiResponse +from lunchable.api_client import ApiClient +from lunchable.configuration import Configuration +from lunchable.exceptions import OpenApiException +from lunchable.exceptions import ApiTypeError +from lunchable.exceptions import ApiValueError +from lunchable.exceptions import ApiKeyError +from lunchable.exceptions import ApiAttributeError +from lunchable.exceptions import ApiException + +# import models into sdk package +from lunchable.models.account_type_enum import AccountTypeEnum +from lunchable.models.category_object import CategoryObject +from lunchable.models.create_category_request_object_children_inner import ( + CreateCategoryRequestObjectChildrenInner, +) +from lunchable.models.create_new_transactions201_response import ( + CreateNewTransactions201Response, +) +from lunchable.models.create_new_transactions_request import ( + CreateNewTransactionsRequest, +) +from lunchable.models.currency_enum import CurrencyEnum +from lunchable.models.delete_category_response_with_dependencies_dependents import ( + DeleteCategoryResponseWithDependenciesDependents, +) +from lunchable.models.delete_tag_response_with_dependencies_dependents import ( + DeleteTagResponseWithDependenciesDependents, +) +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest +from lunchable.models.error_response_object import ErrorResponseObject +from lunchable.models.get_all_categories200_response import GetAllCategories200Response +from lunchable.models.get_all_manual_accounts200_response import ( + GetAllManualAccounts200Response, +) +from lunchable.models.get_all_plaid_accounts200_response import ( + GetAllPlaidAccounts200Response, +) +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response +from lunchable.models.get_all_tags200_response import GetAllTags200Response +from lunchable.models.get_all_transactions200_response import ( + GetAllTransactions200Response, +) +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.group_transactions_request import GroupTransactionsRequest +from lunchable.models.insert_transaction_object_amount import ( + InsertTransactionObjectAmount, +) +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.models.plaid_account_object import PlaidAccountObject +from lunchable.models.recurring_object import RecurringObject +from lunchable.models.recurring_object_matches import RecurringObjectMatches +from lunchable.models.recurring_object_matches_found_transactions_inner import ( + RecurringObjectMatchesFoundTransactionsInner, +) +from lunchable.models.recurring_object_overrides import RecurringObjectOverrides +from lunchable.models.recurring_object_transaction_criteria import ( + RecurringObjectTransactionCriteria, +) +from lunchable.models.split_transaction_object_amount import ( + SplitTransactionObjectAmount, +) +from lunchable.models.split_transaction_request import SplitTransactionRequest +from lunchable.models.tag_object import TagObject +from lunchable.models.transaction_object import TransactionObject +from lunchable.models.user_object import UserObject diff --git a/clients/python/lunchable/api/__init__.py b/clients/python/lunchable/api/__init__.py new file mode 100644 index 00000000..45d80620 --- /dev/null +++ b/clients/python/lunchable/api/__init__.py @@ -0,0 +1,13 @@ +# flake8: noqa + +# import apis into api package +from lunchable.api.categories_api import CategoriesApi +from lunchable.api.manual_accounts_api import ManualAccountsApi +from lunchable.api.me_api import MeApi +from lunchable.api.plaid_accounts_api import PlaidAccountsApi +from lunchable.api.recurring_api import RecurringApi +from lunchable.api.tags_api import TagsApi +from lunchable.api.transactions_api import TransactionsApi +from lunchable.api.transactions_bulk_api import TransactionsBulkApi +from lunchable.api.transactions_group_api import TransactionsGroupApi +from lunchable.api.transactions_split_api import TransactionsSplitApi diff --git a/clients/python/lunchable/api/categories_api.py b/clients/python/lunchable/api/categories_api.py new file mode 100644 index 00000000..145027f5 --- /dev/null +++ b/clients/python/lunchable/api/categories_api.py @@ -0,0 +1,1427 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictBool +from lunchable.models.category_object import CategoryObject +from lunchable.models.create_category_request_object import CreateCategoryRequestObject +from lunchable.models.get_all_categories200_response import GetAllCategories200Response +from lunchable.models.update_category_request_object import UpdateCategoryRequestObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class CategoriesApi: + """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 create_category( + self, + create_category_request_object: CreateCategoryRequestObject, + _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, + ) -> CategoryObject: + """Create a new category or category group + + Creates a new category with the given name.
If the `is_group` attribute is set to true, a category group is created. In this case the `children` attribute may also be set to an array of existing category IDs to add to the newly created category group. + + :param create_category_request_object: (required) + :type create_category_request_object: CreateCategoryRequestObject + :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( + create_category_request_object=create_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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, + create_category_request_object: CreateCategoryRequestObject, + _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[CategoryObject]: + """Create a new category or category group + + Creates a new category with the given name.
If the `is_group` attribute is set to true, a category group is created. In this case the `children` attribute may also be set to an array of existing category IDs to add to the newly created category group. + + :param create_category_request_object: (required) + :type create_category_request_object: CreateCategoryRequestObject + :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( + create_category_request_object=create_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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, + create_category_request_object: CreateCategoryRequestObject, + _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 new category or category group + + Creates a new category with the given name.
If the `is_group` attribute is set to true, a category group is created. In this case the `children` attribute may also be set to an array of existing category IDs to add to the newly created category group. + + :param create_category_request_object: (required) + :type create_category_request_object: CreateCategoryRequestObject + :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( + create_category_request_object=create_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_category_serialize( + self, + create_category_request_object, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_category_request_object is not None: + _body_params = create_category_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/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 delete_category( + self, + id: Annotated[StrictInt, Field(description="ID of the category to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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, + ) -> None: + """Delete a category or category group + + Attempts to delete the single category or category group specified on the path. By default his will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, children categories for a category group, categorized recurring items, etc. If there are dependents, this endpoint will return and object that describes each of the possible dependencies are and how many there are. + + :param id: ID of the category to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_category_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteCategoryResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_category_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the category to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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[None]: + """Delete a category or category group + + Attempts to delete the single category or category group specified on the path. By default his will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, children categories for a category group, categorized recurring items, etc. If there are dependents, this endpoint will return and object that describes each of the possible dependencies are and how many there are. + + :param id: ID of the category to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_category_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteCategoryResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_category_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the category to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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: + """Delete a category or category group + + Attempts to delete the single category or category group specified on the path. By default his will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, children categories for a category group, categorized recurring items, etc. If there are dependents, this endpoint will return and object that describes each of the possible dependencies are and how many there are. + + :param id: ID of the category to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_category_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteCategoryResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_category_serialize( + self, + id, + force, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + if force is not None: + _query_params.append(("force", force)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/categories/{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 get_all_categories( + self, + format: Annotated[ + Optional[StrictStr], + Field( + description="If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored." + ), + ] = None, + _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, + ) -> GetAllCategories200Response: + """Get all categories + + Retrieve a list of all categories associated with the user's account. + + :param format: If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order. + :type format: str + :param is_group: If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored. + :type is_group: bool + :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_all_categories_serialize( + format=format, + is_group=is_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllCategories200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_categories_with_http_info( + self, + format: Annotated[ + Optional[StrictStr], + Field( + description="If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored." + ), + ] = None, + _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[GetAllCategories200Response]: + """Get all categories + + Retrieve a list of all categories associated with the user's account. + + :param format: If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order. + :type format: str + :param is_group: If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored. + :type is_group: bool + :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_all_categories_serialize( + format=format, + is_group=is_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllCategories200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_categories_without_preload_content( + self, + format: Annotated[ + Optional[StrictStr], + Field( + description="If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored." + ), + ] = None, + _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 categories + + Retrieve a list of all categories associated with the user's account. + + :param format: If `nested`, returns top-level categories (either category groups or categories not part of a category group) in alphabetical order. Grouped categories are nested within the category group under the property `children`. A `flattened`, response is similar but it also includes grouped categories at the top level of this.
Categories are sorted by their `order`. When `order` is null, they are listed below other categories with an `order` in alphabetical order. + :type format: str + :param is_group: If set to `false`, just the list of assignable categories is returned.
If set to `true`, only category groups are returned.
When set the `format` parameter is ignored. + :type is_group: bool + :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_all_categories_serialize( + format=format, + is_group=is_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllCategories200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_categories_serialize( + self, + format, + is_group, + _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 + # process the query parameters + if format is not None: + _query_params.append(("format", format)) + + if is_group is not None: + _query_params.append(("is_group", is_group)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/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 get_category_by_id( + self, + id: Annotated[StrictInt, Field(description="ID of the category to retrieve")], + _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, + ) -> CategoryObject: + """Get a single category + + Retrieve details of a specific category or category group by its ID. + + :param id: ID of the category to retrieve (required) + :type id: int + :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_category_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_category_by_id_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the category to retrieve")], + _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[CategoryObject]: + """Get a single category + + Retrieve details of a specific category or category group by its ID. + + :param id: ID of the category to retrieve (required) + :type id: int + :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_category_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_category_by_id_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the category to retrieve")], + _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 a single category + + Retrieve details of a specific category or category group by its ID. + + :param id: ID of the category to retrieve (required) + :type id: int + :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_category_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_category_by_id_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/categories/{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( + self, + id: Annotated[StrictInt, Field(description="ID of the category to update")], + update_category_request_object: UpdateCategoryRequestObject, + _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, + ) -> CategoryObject: + """Update an existing category or category group + + Updates an existing category or category group. You may submit the response from a `GET /categories/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `description`, `is_income`, `exclude_from_budget`, `exclude_from_totals`, `archived`, `group_id`, `order` and `children` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. It is not possible to use this API to convert a category to a category group, or a vice versa, so while submitting a request body with the `is_group` attribute is tolerated, it will result in an error response if the value is changed. It is possible to modify the children of an existing category group with this API by setting the `children` attribute. If this is set it will replace the existing children with the newly specified children, so if the intention is to add or remove a single category, it is more straightforward to update the child category by specifying the new `group_id` attribute. If the goal is to add multiple new children or remove multiple existing children, it is recommended to first call the `GET /categories/:id` endpoint to get the existing children and then modify the list as desired. + + :param id: ID of the category to update (required) + :type id: int + :param update_category_request_object: (required) + :type update_category_request_object: UpdateCategoryRequestObject + :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_serialize( + id=id, + update_category_request_object=update_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the category to update")], + update_category_request_object: UpdateCategoryRequestObject, + _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[CategoryObject]: + """Update an existing category or category group + + Updates an existing category or category group. You may submit the response from a `GET /categories/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `description`, `is_income`, `exclude_from_budget`, `exclude_from_totals`, `archived`, `group_id`, `order` and `children` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. It is not possible to use this API to convert a category to a category group, or a vice versa, so while submitting a request body with the `is_group` attribute is tolerated, it will result in an error response if the value is changed. It is possible to modify the children of an existing category group with this API by setting the `children` attribute. If this is set it will replace the existing children with the newly specified children, so if the intention is to add or remove a single category, it is more straightforward to update the child category by specifying the new `group_id` attribute. If the goal is to add multiple new children or remove multiple existing children, it is recommended to first call the `GET /categories/:id` endpoint to get the existing children and then modify the list as desired. + + :param id: ID of the category to update (required) + :type id: int + :param update_category_request_object: (required) + :type update_category_request_object: UpdateCategoryRequestObject + :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_serialize( + id=id, + update_category_request_object=update_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the category to update")], + update_category_request_object: UpdateCategoryRequestObject, + _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 an existing category or category group + + Updates an existing category or category group. You may submit the response from a `GET /categories/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `description`, `is_income`, `exclude_from_budget`, `exclude_from_totals`, `archived`, `group_id`, `order` and `children` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. It is not possible to use this API to convert a category to a category group, or a vice versa, so while submitting a request body with the `is_group` attribute is tolerated, it will result in an error response if the value is changed. It is possible to modify the children of an existing category group with this API by setting the `children` attribute. If this is set it will replace the existing children with the newly specified children, so if the intention is to add or remove a single category, it is more straightforward to update the child category by specifying the new `group_id` attribute. If the goal is to add multiple new children or remove multiple existing children, it is recommended to first call the `GET /categories/:id` endpoint to get the existing children and then modify the list as desired. + + :param id: ID of the category to update (required) + :type id: int + :param update_category_request_object: (required) + :type update_category_request_object: UpdateCategoryRequestObject + :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_serialize( + id=id, + update_category_request_object=update_category_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CategoryObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_category_serialize( + self, + id, + update_category_request_object, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_category_request_object is not None: + _body_params = update_category_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/categories/{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, + ) diff --git a/clients/python/lunchable/api/manual_accounts_api.py b/clients/python/lunchable/api/manual_accounts_api.py new file mode 100644 index 00000000..76855db9 --- /dev/null +++ b/clients/python/lunchable/api/manual_accounts_api.py @@ -0,0 +1,1354 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from lunchable.models.create_manual_account_request_object import ( + CreateManualAccountRequestObject, +) +from lunchable.models.get_all_manual_accounts200_response import ( + GetAllManualAccounts200Response, +) +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.models.update_manual_account_request_object import ( + UpdateManualAccountRequestObject, +) + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class ManualAccountsApi: + """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 create_manual_account( + self, + create_manual_account_request_object: CreateManualAccountRequestObject, + _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, + ) -> ManualAccountObject: + """Create a manual account + + Create a new manually-managed account. + + :param create_manual_account_request_object: (required) + :type create_manual_account_request_object: CreateManualAccountRequestObject + :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_manual_account_serialize( + create_manual_account_request_object=create_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_with_http_info( + self, + create_manual_account_request_object: CreateManualAccountRequestObject, + _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[ManualAccountObject]: + """Create a manual account + + Create a new manually-managed account. + + :param create_manual_account_request_object: (required) + :type create_manual_account_request_object: CreateManualAccountRequestObject + :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_manual_account_serialize( + create_manual_account_request_object=create_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_without_preload_content( + self, + create_manual_account_request_object: CreateManualAccountRequestObject, + _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 manual account + + Create a new manually-managed account. + + :param create_manual_account_request_object: (required) + :type create_manual_account_request_object: CreateManualAccountRequestObject + :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_manual_account_serialize( + create_manual_account_request_object=create_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_manual_account_serialize( + self, + create_manual_account_request_object, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_manual_account_request_object is not None: + _body_params = create_manual_account_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/manual_accounts", + 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 delete_manual_account( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to delete") + ], + _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, + ) -> None: + """Delete a manual account + + Deletes the single manual account with the ID specified on the path. If any transactions exist with the `manual_account_id` property set to this account's ID they will appear with a warning when displayed in the web view. + + :param id: ID of the manual account to delete (required) + :type id: int + :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._delete_manual_account_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_manual_account_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to delete") + ], + _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[None]: + """Delete a manual account + + Deletes the single manual account with the ID specified on the path. If any transactions exist with the `manual_account_id` property set to this account's ID they will appear with a warning when displayed in the web view. + + :param id: ID of the manual account to delete (required) + :type id: int + :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._delete_manual_account_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_manual_account_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to delete") + ], + _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: + """Delete a manual account + + Deletes the single manual account with the ID specified on the path. If any transactions exist with the `manual_account_id` property set to this account's ID they will appear with a warning when displayed in the web view. + + :param id: ID of the manual account to delete (required) + :type id: int + :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._delete_manual_account_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_manual_account_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/manual_accounts/{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 get_all_manual_accounts( + self, + _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, + ) -> GetAllManualAccounts200Response: + """Get all manual accounts + + Retrieve a list of all manually-managed accounts associated with the user's account. + + :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_all_manual_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllManualAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_manual_accounts_with_http_info( + self, + _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[GetAllManualAccounts200Response]: + """Get all manual accounts + + Retrieve a list of all manually-managed accounts associated with the user's account. + + :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_all_manual_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllManualAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_manual_accounts_without_preload_content( + self, + _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 manual accounts + + Retrieve a list of all manually-managed accounts associated with the user's account. + + :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_all_manual_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllManualAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_manual_accounts_serialize( + self, + _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 + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/manual_accounts", + 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_manual_account_by_id( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to retrieve") + ], + _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, + ) -> ManualAccountObject: + """Get a single manual account + + Retrieve the details of the manual account with the specified ID. + + :param id: ID of the manual account to retrieve (required) + :type id: int + :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_manual_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_by_id_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to retrieve") + ], + _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[ManualAccountObject]: + """Get a single manual account + + Retrieve the details of the manual account with the specified ID. + + :param id: ID of the manual account to retrieve (required) + :type id: int + :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_manual_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_by_id_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to retrieve") + ], + _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 a single manual account + + Retrieve the details of the manual account with the specified ID. + + :param id: ID of the manual account to retrieve (required) + :type id: int + :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_manual_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_manual_account_by_id_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/manual_accounts/{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_manual_account( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to update") + ], + update_manual_account_request_object: UpdateManualAccountRequestObject, + _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, + ) -> ManualAccountObject: + """Update an existing manual account + + Updates an existing manual account. You may submit the response from a `GET /manual_accounts/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `type`, `subtype`, `display_name`, `balance`, `balance_as_of`, `closed_on`, `currency`, `institution_name`, `external_id`, and `exclude_from_transactions` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the manual account to update (required) + :type id: int + :param update_manual_account_request_object: (required) + :type update_manual_account_request_object: UpdateManualAccountRequestObject + :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_manual_account_serialize( + id=id, + update_manual_account_request_object=update_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to update") + ], + update_manual_account_request_object: UpdateManualAccountRequestObject, + _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[ManualAccountObject]: + """Update an existing manual account + + Updates an existing manual account. You may submit the response from a `GET /manual_accounts/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `type`, `subtype`, `display_name`, `balance`, `balance_as_of`, `closed_on`, `currency`, `institution_name`, `external_id`, and `exclude_from_transactions` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the manual account to update (required) + :type id: int + :param update_manual_account_request_object: (required) + :type update_manual_account_request_object: UpdateManualAccountRequestObject + :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_manual_account_serialize( + id=id, + update_manual_account_request_object=update_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_manual_account_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the manual account to update") + ], + update_manual_account_request_object: UpdateManualAccountRequestObject, + _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 an existing manual account + + Updates an existing manual account. You may submit the response from a `GET /manual_accounts/{id}` as the request body which includes system created attributes such as `id` or `created_at`, however only the `name`, `type`, `subtype`, `display_name`, `balance`, `balance_as_of`, `closed_on`, `currency`, `institution_name`, `external_id`, and `exclude_from_transactions` can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the manual account to update (required) + :type id: int + :param update_manual_account_request_object: (required) + :type update_manual_account_request_object: UpdateManualAccountRequestObject + :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_manual_account_serialize( + id=id, + update_manual_account_request_object=update_manual_account_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ManualAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_manual_account_serialize( + self, + id, + update_manual_account_request_object, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_manual_account_request_object is not None: + _body_params = update_manual_account_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/manual_accounts/{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, + ) diff --git a/clients/python/lunchable/api/me_api.py b/clients/python/lunchable/api/me_api.py new file mode 100644 index 00000000..e5e3595d --- /dev/null +++ b/clients/python/lunchable/api/me_api.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from lunchable.models.user_object import UserObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class MeApi: + """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_me( + self, + _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, + ) -> UserObject: + """Get current user + + Get details about the user associated with the supplied authorization token. + + :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_me_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UserObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_me_with_http_info( + self, + _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[UserObject]: + """Get current user + + Get details about the user associated with the supplied authorization token. + + :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_me_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UserObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_me_without_preload_content( + self, + _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 current user + + Get details about the user associated with the supplied authorization token. + + :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_me_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UserObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_me_serialize( + self, + _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 + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/me", + 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/clients/python/lunchable/api/plaid_accounts_api.py b/clients/python/lunchable/api/plaid_accounts_api.py new file mode 100644 index 00000000..3f36ec08 --- /dev/null +++ b/clients/python/lunchable/api/plaid_accounts_api.py @@ -0,0 +1,890 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +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 lunchable.models.get_all_plaid_accounts200_response import ( + GetAllPlaidAccounts200Response, +) +from lunchable.models.plaid_account_object import PlaidAccountObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class PlaidAccountsApi: + """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_all_plaid_accounts( + self, + _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, + ) -> GetAllPlaidAccounts200Response: + """Get all accounts synced via Plaid + + Retrieve a list of all synced accounts associated with the user's account. + + :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_all_plaid_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllPlaidAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_plaid_accounts_with_http_info( + self, + _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[GetAllPlaidAccounts200Response]: + """Get all accounts synced via Plaid + + Retrieve a list of all synced accounts associated with the user's account. + + :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_all_plaid_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllPlaidAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_plaid_accounts_without_preload_content( + self, + _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 accounts synced via Plaid + + Retrieve a list of all synced accounts associated with the user's account. + + :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_all_plaid_accounts_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllPlaidAccounts200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_plaid_accounts_serialize( + self, + _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 + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/plaid_accounts", + 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_plaid_account_by_id( + self, + id: Annotated[ + StrictInt, Field(description="ID of the plaid account to retrieve") + ], + _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, + ) -> PlaidAccountObject: + """Get a single account that is synced via Plaid + + Retrieve the details of the plaid account with the specified ID. + + :param id: ID of the plaid account to retrieve (required) + :type id: int + :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_plaid_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlaidAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_plaid_account_by_id_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the plaid account to retrieve") + ], + _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[PlaidAccountObject]: + """Get a single account that is synced via Plaid + + Retrieve the details of the plaid account with the specified ID. + + :param id: ID of the plaid account to retrieve (required) + :type id: int + :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_plaid_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlaidAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_plaid_account_by_id_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the plaid account to retrieve") + ], + _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 a single account that is synced via Plaid + + Retrieve the details of the plaid account with the specified ID. + + :param id: ID of the plaid account to retrieve (required) + :type id: int + :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_plaid_account_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlaidAccountObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_plaid_account_by_id_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/plaid_accounts/{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 trigger_plaid_account_fetch( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts." + ), + ] = None, + _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, + ) -> bool: + """Trigger Fetch from Plaid + + Use this endpoint to trigger a fetch for latest data from Plaid. Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param plaid_account_id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts. + :type plaid_account_id: int + :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._trigger_plaid_account_fetch_serialize( + start_date=start_date, + end_date=end_date, + plaid_account_id=plaid_account_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bool", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 trigger_plaid_account_fetch_with_http_info( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts." + ), + ] = None, + _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[bool]: + """Trigger Fetch from Plaid + + Use this endpoint to trigger a fetch for latest data from Plaid. Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param plaid_account_id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts. + :type plaid_account_id: int + :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._trigger_plaid_account_fetch_serialize( + start_date=start_date, + end_date=end_date, + plaid_account_id=plaid_account_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bool", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 trigger_plaid_account_fetch_without_preload_content( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts." + ), + ] = None, + _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: + """Trigger Fetch from Plaid + + Use this endpoint to trigger a fetch for latest data from Plaid. Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned.
Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param plaid_account_id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts. + :type plaid_account_id: int + :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._trigger_plaid_account_fetch_serialize( + start_date=start_date, + end_date=end_date, + plaid_account_id=plaid_account_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bool", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _trigger_plaid_account_fetch_serialize( + self, + start_date, + end_date, + plaid_account_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 + # process the query parameters + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + "start_date", + start_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("start_date", start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + "end_date", + end_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("end_date", end_date)) + + if plaid_account_id is not None: + _query_params.append(("plaid_account_id", plaid_account_id)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/plaid_accounts/fetch", + 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/clients/python/lunchable/api/recurring_api.py b/clients/python/lunchable/api/recurring_api.py new file mode 100644 index 00000000..f284c006 --- /dev/null +++ b/clients/python/lunchable/api/recurring_api.py @@ -0,0 +1,714 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +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 StrictBool +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response +from lunchable.models.recurring_object import RecurringObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class RecurringApi: + """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_all_recurring( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + include_suggested: Optional[StrictBool] = None, + _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, + ) -> GetAllRecurring200Response: + """Get a all recurring items + + Get info about the recurring items for a specified time frame + + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: date + :param include_suggested: + :type include_suggested: bool + :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_all_recurring_serialize( + start_date=start_date, + end_date=end_date, + include_suggested=include_suggested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllRecurring200Response", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_recurring_with_http_info( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + include_suggested: Optional[StrictBool] = None, + _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[GetAllRecurring200Response]: + """Get a all recurring items + + Get info about the recurring items for a specified time frame + + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: date + :param include_suggested: + :type include_suggested: bool + :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_all_recurring_serialize( + start_date=start_date, + end_date=end_date, + include_suggested=include_suggested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllRecurring200Response", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_recurring_without_preload_content( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + include_suggested: Optional[StrictBool] = None, + _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 a all recurring items + + Get info about the recurring items for a specified time frame + + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: date + :param include_suggested: + :type include_suggested: bool + :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_all_recurring_serialize( + start_date=start_date, + end_date=end_date, + include_suggested=include_suggested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllRecurring200Response", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_recurring_serialize( + self, + start_date, + end_date, + include_suggested, + _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 + # process the query parameters + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + "start_date", + start_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("start_date", start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + "end_date", + end_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("end_date", end_date)) + + if include_suggested is not None: + _query_params.append(("include_suggested", include_suggested)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/recurring", + 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_recurring_by_id( + self, + id: Annotated[ + StrictInt, Field(description="ID of the recurring item to retrieve") + ], + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + _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, + ) -> RecurringObject: + """Get a single recurring item + + Retrieve the details of a specific recurring item with the specified ID. + + :param id: ID of the recurring item to retrieve (required) + :type id: int + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: 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_recurring_by_id_serialize( + id=id, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RecurringObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_recurring_by_id_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the recurring item to retrieve") + ], + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + _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[RecurringObject]: + """Get a single recurring item + + Retrieve the details of a specific recurring item with the specified ID. + + :param id: ID of the recurring item to retrieve (required) + :type id: int + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: 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_recurring_by_id_serialize( + id=id, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RecurringObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_recurring_by_id_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the recurring item to retrieve") + ], + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists." + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists." + ), + ] = None, + _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 a single recurring item + + Retrieve the details of a specific recurring item with the specified ID. + + :param id: ID of the recurring item to retrieve (required) + :type id: int + :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.
Required if end_date exists. + :type start_date: date + :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. + :type end_date: 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_recurring_by_id_serialize( + id=id, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RecurringObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_recurring_by_id_serialize( + self, + id, + start_date, + end_date, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + "start_date", + start_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("start_date", start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + "end_date", + end_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("end_date", end_date)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/recurring/{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, + ) diff --git a/clients/python/lunchable/api/tags_api.py b/clients/python/lunchable/api/tags_api.py new file mode 100644 index 00000000..51322abb --- /dev/null +++ b/clients/python/lunchable/api/tags_api.py @@ -0,0 +1,1365 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictBool +from lunchable.models.create_tag_request_object import CreateTagRequestObject +from lunchable.models.get_all_tags200_response import GetAllTags200Response +from lunchable.models.tag_object import TagObject +from lunchable.models.update_tag_request_object import UpdateTagRequestObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class TagsApi: + """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 create_tag( + self, + create_tag_request_object: CreateTagRequestObject, + _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, + ) -> TagObject: + """Create a new tag + + Creates a new tag with the given name + + :param create_tag_request_object: (required) + :type create_tag_request_object: CreateTagRequestObject + :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_tag_serialize( + create_tag_request_object=create_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_with_http_info( + self, + create_tag_request_object: CreateTagRequestObject, + _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[TagObject]: + """Create a new tag + + Creates a new tag with the given name + + :param create_tag_request_object: (required) + :type create_tag_request_object: CreateTagRequestObject + :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_tag_serialize( + create_tag_request_object=create_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_without_preload_content( + self, + create_tag_request_object: CreateTagRequestObject, + _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 new tag + + Creates a new tag with the given name + + :param create_tag_request_object: (required) + :type create_tag_request_object: CreateTagRequestObject + :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_tag_serialize( + create_tag_request_object=create_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_tag_serialize( + self, + create_tag_request_object, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_tag_request_object is not None: + _body_params = create_tag_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/tags", + 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 delete_tag( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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, + ) -> None: + """Delete a tag + + Deletes the tag with the ID specified on the path.
If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`. + + :param id: ID of the tag to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_tag_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteTagResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_tag_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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[None]: + """Delete a tag + + Deletes the tag with the ID specified on the path.
If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`. + + :param id: ID of the tag to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_tag_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteTagResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_tag_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to delete")], + force: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to force deletion even if there are dependencies" + ), + ] = None, + _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: + """Delete a tag + + Deletes the tag with the ID specified on the path.
If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`. + + :param id: ID of the tag to delete (required) + :type id: int + :param force: Set to true to force deletion even if there are dependencies + :type force: bool + :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._delete_tag_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "422": "DeleteTagResponseWithDependencies", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_tag_serialize( + self, + id, + force, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + if force is not None: + _query_params.append(("force", force)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/tags/{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 get_all_tags( + self, + _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, + ) -> GetAllTags200Response: + """Get All Tags + + Retrieve a list of all tags associated with the user's account. + + :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_all_tags_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTags200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_tags_with_http_info( + self, + _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[GetAllTags200Response]: + """Get All Tags + + Retrieve a list of all tags associated with the user's account. + + :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_all_tags_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTags200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_tags_without_preload_content( + self, + _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 Tags + + Retrieve a list of all tags associated with the user's account. + + :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_all_tags_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTags200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_tags_serialize( + self, + _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 + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/tags", + 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_tag_by_id( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")], + _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, + ) -> TagObject: + """Get a single tags + + Retrieve the details of a specific tag with the specified ID. + + :param id: ID of the tag to retrieve (required) + :type id: int + :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_tag_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_by_id_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")], + _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[TagObject]: + """Get a single tags + + Retrieve the details of a specific tag with the specified ID. + + :param id: ID of the tag to retrieve (required) + :type id: int + :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_tag_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_by_id_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")], + _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 a single tags + + Retrieve the details of a specific tag with the specified ID. + + :param id: ID of the tag to retrieve (required) + :type id: int + :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_tag_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "404": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_tag_by_id_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/tags/{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_tag( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to update")], + update_tag_request_object: UpdateTagRequestObject, + _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, + ) -> TagObject: + """Update an existing tag + + Updates an existing tag. You may submit the response from a `GET /tags/{id}` as the request body which includes system created attributes such as `id`, however only the `name`, `description`, and `archived`, can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the tag to update (required) + :type id: int + :param update_tag_request_object: (required) + :type update_tag_request_object: UpdateTagRequestObject + :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_tag_serialize( + id=id, + update_tag_request_object=update_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to update")], + update_tag_request_object: UpdateTagRequestObject, + _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[TagObject]: + """Update an existing tag + + Updates an existing tag. You may submit the response from a `GET /tags/{id}` as the request body which includes system created attributes such as `id`, however only the `name`, `description`, and `archived`, can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the tag to update (required) + :type id: int + :param update_tag_request_object: (required) + :type update_tag_request_object: UpdateTagRequestObject + :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_tag_serialize( + id=id, + update_tag_request_object=update_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_tag_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the tag to update")], + update_tag_request_object: UpdateTagRequestObject, + _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 an existing tag + + Updates an existing tag. You may submit the response from a `GET /tags/{id}` as the request body which includes system created attributes such as `id`, however only the `name`, `description`, and `archived`, can be updated using this API. It is also possible to provide only the attribute(s) to be updated in the request body, as long as the request includes at least one of the attributes listed above. For example a request body that contains only a `name` attribute is valid. + + :param id: ID of the tag to update (required) + :type id: int + :param update_tag_request_object: (required) + :type update_tag_request_object: UpdateTagRequestObject + :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_tag_serialize( + id=id, + update_tag_request_object=update_tag_request_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TagObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _update_tag_serialize( + self, + id, + update_tag_request_object, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_tag_request_object is not None: + _body_params = update_tag_request_object + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/tags/{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, + ) diff --git a/clients/python/lunchable/api/transactions_api.py b/clients/python/lunchable/api/transactions_api.py new file mode 100644 index 00000000..7ed32221 --- /dev/null +++ b/clients/python/lunchable/api/transactions_api.py @@ -0,0 +1,583 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictBool +from lunchable.models.transaction_object import TransactionObject + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class TransactionsApi: + """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 delete_transaction_by_id( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to delete")], + _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, + ) -> None: + """Delete a transaction + + Deletes the transaction with the ID specified on the path.
If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted.
This action is not reversible! + + :param id: ID of the transaction to delete (required) + :type id: int + :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._delete_transaction_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_transaction_by_id_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to delete")], + _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[None]: + """Delete a transaction + + Deletes the transaction with the ID specified on the path.
If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted.
This action is not reversible! + + :param id: ID of the transaction to delete (required) + :type id: int + :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._delete_transaction_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_transaction_by_id_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to delete")], + _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: + """Delete a transaction + + Deletes the transaction with the ID specified on the path.
If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted.
This action is not reversible! + + :param id: ID of the transaction to delete (required) + :type id: int + :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._delete_transaction_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_transaction_by_id_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/transactions/{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 get_transaction_by_id( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction to retrieve") + ], + include_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API." + ), + ] = None, + _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, + ) -> TransactionObject: + """Get a single transaction + + Retrieve details of a specific transaction by its ID.

It the requested transaction is the parent of split transactions, the transaction returned in the response will include a `children` property which will contain a list of the split transactions.

Similarly, if the requested transaction is transaction group, the transaction returned in the response will include a `children` property which will contain a list of the original transactions that make up the transaction group. + + :param id: ID of the transaction to retrieve (required) + :type id: int + :param include_metadata: Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API. + :type include_metadata: bool + :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_transaction_by_id_serialize( + id=id, + include_metadata=include_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TransactionObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_transaction_by_id_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction to retrieve") + ], + include_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API." + ), + ] = None, + _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[TransactionObject]: + """Get a single transaction + + Retrieve details of a specific transaction by its ID.

It the requested transaction is the parent of split transactions, the transaction returned in the response will include a `children` property which will contain a list of the split transactions.

Similarly, if the requested transaction is transaction group, the transaction returned in the response will include a `children` property which will contain a list of the original transactions that make up the transaction group. + + :param id: ID of the transaction to retrieve (required) + :type id: int + :param include_metadata: Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API. + :type include_metadata: bool + :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_transaction_by_id_serialize( + id=id, + include_metadata=include_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TransactionObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_transaction_by_id_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction to retrieve") + ], + include_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API." + ), + ] = None, + _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 a single transaction + + Retrieve details of a specific transaction by its ID.

It the requested transaction is the parent of split transactions, the transaction returned in the response will include a `children` property which will contain a list of the split transactions.

Similarly, if the requested transaction is transaction group, the transaction returned in the response will include a `children` property which will contain a list of the original transactions that make up the transaction group. + + :param id: ID of the transaction to retrieve (required) + :type id: int + :param include_metadata: Set to true to have the metadata objects associated with this transaction returned as part of the result. A `plaid_metatdata` object will always exist for transactions associated with an account that is synced via plaid. A `custom_metadata` object may exist for transactions that were inserted or updated via the API. + :type include_metadata: bool + :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_transaction_by_id_serialize( + id=id, + include_metadata=include_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TransactionObject", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_transaction_by_id_serialize( + self, + id, + include_metadata, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + if include_metadata is not None: + _query_params.append(("include_metadata", include_metadata)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/transactions/{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, + ) diff --git a/clients/python/lunchable/api/transactions_bulk_api.py b/clients/python/lunchable/api/transactions_bulk_api.py new file mode 100644 index 00000000..4521629c --- /dev/null +++ b/clients/python/lunchable/api/transactions_bulk_api.py @@ -0,0 +1,1233 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +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 StrictBool +from lunchable.models.create_new_transactions201_response import ( + CreateNewTransactions201Response, +) +from lunchable.models.create_new_transactions_request import ( + CreateNewTransactionsRequest, +) +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest +from lunchable.models.get_all_transactions200_response import ( + GetAllTransactions200Response, +) + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class TransactionsBulkApi: + """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 create_new_transactions( + self, + create_new_transactions_request: CreateNewTransactionsRequest, + _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, + ) -> CreateNewTransactions201Response: + """Insert one or more transactions. + + Use this endpoint to add transactions to a budget. The request body for this endpoint must include a list of transactions with at least one transaction and not more than 500 transactions to insert. + + :param create_new_transactions_request: (required) + :type create_new_transactions_request: CreateNewTransactionsRequest + :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_new_transactions_serialize( + create_new_transactions_request=create_new_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateNewTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_new_transactions_with_http_info( + self, + create_new_transactions_request: CreateNewTransactionsRequest, + _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[CreateNewTransactions201Response]: + """Insert one or more transactions. + + Use this endpoint to add transactions to a budget. The request body for this endpoint must include a list of transactions with at least one transaction and not more than 500 transactions to insert. + + :param create_new_transactions_request: (required) + :type create_new_transactions_request: CreateNewTransactionsRequest + :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_new_transactions_serialize( + create_new_transactions_request=create_new_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateNewTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_new_transactions_without_preload_content( + self, + create_new_transactions_request: CreateNewTransactionsRequest, + _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: + """Insert one or more transactions. + + Use this endpoint to add transactions to a budget. The request body for this endpoint must include a list of transactions with at least one transaction and not more than 500 transactions to insert. + + :param create_new_transactions_request: (required) + :type create_new_transactions_request: CreateNewTransactionsRequest + :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_new_transactions_serialize( + create_new_transactions_request=create_new_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "CreateNewTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_new_transactions_serialize( + self, + create_new_transactions_request, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_new_transactions_request is not None: + _body_params = create_new_transactions_request + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/transactions", + 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 delete_transactions( + self, + delete_transactions_request: DeleteTransactionsRequest, + _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, + ) -> None: + """Bulk delete existing transactions + + Deletes the transaction with the IDs specified in the request body.
If any of the specified transactions are a split transaction or a split parent, or if any are a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. This will also fail if any of the specified transaction IDs do not exist.
Otherwise, the specified transactions are deleted. This action is not reversible! + + :param delete_transactions_request: (required) + :type delete_transactions_request: DeleteTransactionsRequest + :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._delete_transactions_serialize( + delete_transactions_request=delete_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_transactions_with_http_info( + self, + delete_transactions_request: DeleteTransactionsRequest, + _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[None]: + """Bulk delete existing transactions + + Deletes the transaction with the IDs specified in the request body.
If any of the specified transactions are a split transaction or a split parent, or if any are a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. This will also fail if any of the specified transaction IDs do not exist.
Otherwise, the specified transactions are deleted. This action is not reversible! + + :param delete_transactions_request: (required) + :type delete_transactions_request: DeleteTransactionsRequest + :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._delete_transactions_serialize( + delete_transactions_request=delete_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 delete_transactions_without_preload_content( + self, + delete_transactions_request: DeleteTransactionsRequest, + _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: + """Bulk delete existing transactions + + Deletes the transaction with the IDs specified in the request body.
If any of the specified transactions are a split transaction or a split parent, or if any are a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. This will also fail if any of the specified transaction IDs do not exist.
Otherwise, the specified transactions are deleted. This action is not reversible! + + :param delete_transactions_request: (required) + :type delete_transactions_request: DeleteTransactionsRequest + :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._delete_transactions_serialize( + delete_transactions_request=delete_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_transactions_serialize( + self, + delete_transactions_request, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if delete_transactions_request is not None: + _body_params = delete_transactions_request + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/transactions", + 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_all_transactions( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + manual_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + recurring_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with specified Recurring Item ID " + ), + ] = None, + category_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with the specified category ID. Will also match category groups." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="Filter by group (returns only grouped transactions if set to true)" + ), + ] = None, + status: Annotated[ + Optional[StrictStr], + Field( + description="Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true." + ), + ] = None, + tag_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those that have a tag with the specified Tag ID" + ), + ] = None, + include_pending: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like to include imported transactions with a pending status." + ), + ] = None, + include_custom_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API." + ), + ] = None, + limit: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field( + description="Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo)" + ), + ] = None, + offset: Annotated[ + Optional[StrictInt], + Field( + description="Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo)" + ), + ] = None, + _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, + ) -> GetAllTransactions200Response: + """Get all transactions + + Retrieve a list of all transactions associated with a user's account.
If called with no parameters this endpoint will return up to 100 of the most recent transactions. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param manual_account_id: Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type manual_account_id: int + :param plaid_account_id: Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type plaid_account_id: int + :param recurring_id: Filter transactions to those associated with specified Recurring Item ID + :type recurring_id: int + :param category_id: Filter transactions to those associated with the specified category ID. Will also match category groups. + :type category_id: int + :param is_group: Filter by group (returns only grouped transactions if set to true) + :type is_group: bool + :param status: Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true. + :type status: str + :param tag_id: Filter transactions to those that have a tag with the specified Tag ID + :type tag_id: int + :param include_pending: Pass in true if you’d like to include imported transactions with a pending status. + :type include_pending: bool + :param include_custom_metadata: Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API. + :type include_custom_metadata: bool + :param limit: Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo) + :type limit: int + :param offset: Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo) + :type offset: int + :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_all_transactions_serialize( + start_date=start_date, + end_date=end_date, + manual_account_id=manual_account_id, + plaid_account_id=plaid_account_id, + recurring_id=recurring_id, + category_id=category_id, + is_group=is_group, + status=status, + tag_id=tag_id, + include_pending=include_pending, + include_custom_metadata=include_custom_metadata, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTransactions200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_transactions_with_http_info( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + manual_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + recurring_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with specified Recurring Item ID " + ), + ] = None, + category_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with the specified category ID. Will also match category groups." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="Filter by group (returns only grouped transactions if set to true)" + ), + ] = None, + status: Annotated[ + Optional[StrictStr], + Field( + description="Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true." + ), + ] = None, + tag_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those that have a tag with the specified Tag ID" + ), + ] = None, + include_pending: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like to include imported transactions with a pending status." + ), + ] = None, + include_custom_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API." + ), + ] = None, + limit: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field( + description="Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo)" + ), + ] = None, + offset: Annotated[ + Optional[StrictInt], + Field( + description="Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo)" + ), + ] = None, + _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[GetAllTransactions200Response]: + """Get all transactions + + Retrieve a list of all transactions associated with a user's account.
If called with no parameters this endpoint will return up to 100 of the most recent transactions. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param manual_account_id: Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type manual_account_id: int + :param plaid_account_id: Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type plaid_account_id: int + :param recurring_id: Filter transactions to those associated with specified Recurring Item ID + :type recurring_id: int + :param category_id: Filter transactions to those associated with the specified category ID. Will also match category groups. + :type category_id: int + :param is_group: Filter by group (returns only grouped transactions if set to true) + :type is_group: bool + :param status: Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true. + :type status: str + :param tag_id: Filter transactions to those that have a tag with the specified Tag ID + :type tag_id: int + :param include_pending: Pass in true if you’d like to include imported transactions with a pending status. + :type include_pending: bool + :param include_custom_metadata: Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API. + :type include_custom_metadata: bool + :param limit: Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo) + :type limit: int + :param offset: Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo) + :type offset: int + :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_all_transactions_serialize( + start_date=start_date, + end_date=end_date, + manual_account_id=manual_account_id, + plaid_account_id=plaid_account_id, + recurring_id=recurring_id, + category_id=category_id, + is_group=is_group, + status=status, + tag_id=tag_id, + include_pending=include_pending, + include_custom_metadata=include_custom_metadata, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTransactions200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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_all_transactions_without_preload_content( + self, + start_date: Annotated[ + Optional[date], + Field( + description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
" + ), + ] = None, + end_date: Annotated[ + Optional[date], + Field( + description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists." + ), + ] = None, + manual_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + plaid_account_id: Annotated[ + Optional[StrictInt], + Field( + description='Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as "Cash Transactions" in the Lunch Money GUI.' + ), + ] = None, + recurring_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with specified Recurring Item ID " + ), + ] = None, + category_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those associated with the specified category ID. Will also match category groups." + ), + ] = None, + is_group: Annotated[ + Optional[StrictBool], + Field( + description="Filter by group (returns only grouped transactions if set to true)" + ), + ] = None, + status: Annotated[ + Optional[StrictStr], + Field( + description="Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true." + ), + ] = None, + tag_id: Annotated[ + Optional[StrictInt], + Field( + description="Filter transactions to those that have a tag with the specified Tag ID" + ), + ] = None, + include_pending: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like to include imported transactions with a pending status." + ), + ] = None, + include_custom_metadata: Annotated[ + Optional[StrictBool], + Field( + description="Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API." + ), + ] = None, + limit: Annotated[ + Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], + Field( + description="Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo)" + ), + ] = None, + offset: Annotated[ + Optional[StrictInt], + Field( + description="Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo)" + ), + ] = None, + _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 transactions + + Retrieve a list of all transactions associated with a user's account.
If called with no parameters this endpoint will return up to 100 of the most recent transactions. + + :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. See `limit`. Required if end_date exists.
+ :type start_date: date + :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. + :type end_date: date + :param manual_account_id: Filter transactions to those associated with specified manual account ID or set this to 0 to omit any transactions from manual accounts. Setting both this and `synched_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type manual_account_id: int + :param plaid_account_id: Filter transactions to those associated with specified plaid account ID or set this to 0 to omit any transactions from plaid accounts. Setting both this and `manual_account_id` to 0 will return transactions with no account. These are listed as \"Cash Transactions\" in the Lunch Money GUI. + :type plaid_account_id: int + :param recurring_id: Filter transactions to those associated with specified Recurring Item ID + :type recurring_id: int + :param category_id: Filter transactions to those associated with the specified category ID. Will also match category groups. + :type category_id: int + :param is_group: Filter by group (returns only grouped transactions if set to true) + :type is_group: bool + :param status: Filter transactions to those with the specified status:
- `reviewed`: Only user reviewed transactions or those that were automatically marked as reviewed due to reviewed recurring_item logic
- `unreviewed`: Only transactions that need to be reviewed
- `delete_pending`: Only transactions that require manual intervention because the plaid account deleted this transaction after it was updated by the user.
- `pending`: Only pending transactions from synced accounts. Must also set `include_pending` to true. + :type status: str + :param tag_id: Filter transactions to those that have a tag with the specified Tag ID + :type tag_id: int + :param include_pending: Pass in true if you’d like to include imported transactions with a pending status. + :type include_pending: bool + :param include_custom_metadata: Pass in true if you’d like the returned transactions objects to include any custom metadata that was previously added via the API. + :type include_custom_metadata: bool + :param limit: Sets the maximum number of transactions to return. If more match the filter criteria, the response will include a `has_more` attribute set to `true`. See [pagination](foo) + :type limit: int + :param offset: Sets the offset for the records returned. This is typically set automatically in the header. See [Pagination](/foo) + :type offset: int + :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_all_transactions_serialize( + start_date=start_date, + end_date=end_date, + manual_account_id=manual_account_id, + plaid_account_id=plaid_account_id, + recurring_id=recurring_id, + category_id=category_id, + is_group=is_group, + status=status, + tag_id=tag_id, + include_pending=include_pending, + include_custom_metadata=include_custom_metadata, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllTransactions200Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_all_transactions_serialize( + self, + start_date, + end_date, + manual_account_id, + plaid_account_id, + recurring_id, + category_id, + is_group, + status, + tag_id, + include_pending, + include_custom_metadata, + limit, + offset, + _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 + # process the query parameters + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + "start_date", + start_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("start_date", start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + "end_date", + end_date.strftime(self.api_client.configuration.date_format), + ) + ) + else: + _query_params.append(("end_date", end_date)) + + if manual_account_id is not None: + _query_params.append(("manual_account_id", manual_account_id)) + + if plaid_account_id is not None: + _query_params.append(("plaid_account_id", plaid_account_id)) + + if recurring_id is not None: + _query_params.append(("recurring_id", recurring_id)) + + if category_id is not None: + _query_params.append(("category_id", category_id)) + + if is_group is not None: + _query_params.append(("is_group", is_group)) + + if status is not None: + _query_params.append(("status", status)) + + if tag_id is not None: + _query_params.append(("tag_id", tag_id)) + + if include_pending is not None: + _query_params.append(("include_pending", include_pending)) + + if include_custom_metadata is not None: + _query_params.append(("include_custom_metadata", include_custom_metadata)) + + if limit is not None: + _query_params.append(("limit", limit)) + + if offset is not None: + _query_params.append(("offset", offset)) + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/transactions", + 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/clients/python/lunchable/api/transactions_group_api.py b/clients/python/lunchable/api/transactions_group_api.py new file mode 100644 index 00000000..4a75561c --- /dev/null +++ b/clients/python/lunchable/api/transactions_group_api.py @@ -0,0 +1,559 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.group_transactions_request import GroupTransactionsRequest + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class TransactionsGroupApi: + """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 group_transactions( + self, + group_transactions_request: GroupTransactionsRequest, + _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, + ) -> GroupTransactions201Response: + """Create a transaction group + + Specify a set of existing transaction IDs to group together as a single grouped transaction. The new transaction will have an amount equal to the sum of the grouped transaction amounts. If the grouped transactions have different currencies, the new group transaction will be set in the user's default currency.

After a transaction has been grouped the original transactions are no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created grouped transaction is returned instead. To see the details of the original transactions that were used to create a transaction group, use the `GET /transactions/{id}` endpoint, passing the ID of the grouped transaction. The grouped transactions will be included in the `children` property of the transaction returned in the response + + :param group_transactions_request: (required) + :type group_transactions_request: GroupTransactionsRequest + :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._group_transactions_serialize( + group_transactions_request=group_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 group_transactions_with_http_info( + self, + group_transactions_request: GroupTransactionsRequest, + _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[GroupTransactions201Response]: + """Create a transaction group + + Specify a set of existing transaction IDs to group together as a single grouped transaction. The new transaction will have an amount equal to the sum of the grouped transaction amounts. If the grouped transactions have different currencies, the new group transaction will be set in the user's default currency.

After a transaction has been grouped the original transactions are no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created grouped transaction is returned instead. To see the details of the original transactions that were used to create a transaction group, use the `GET /transactions/{id}` endpoint, passing the ID of the grouped transaction. The grouped transactions will be included in the `children` property of the transaction returned in the response + + :param group_transactions_request: (required) + :type group_transactions_request: GroupTransactionsRequest + :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._group_transactions_serialize( + group_transactions_request=group_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 group_transactions_without_preload_content( + self, + group_transactions_request: GroupTransactionsRequest, + _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 transaction group + + Specify a set of existing transaction IDs to group together as a single grouped transaction. The new transaction will have an amount equal to the sum of the grouped transaction amounts. If the grouped transactions have different currencies, the new group transaction will be set in the user's default currency.

After a transaction has been grouped the original transactions are no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created grouped transaction is returned instead. To see the details of the original transactions that were used to create a transaction group, use the `GET /transactions/{id}` endpoint, passing the ID of the grouped transaction. The grouped transactions will be included in the `children` property of the transaction returned in the response + + :param group_transactions_request: (required) + :type group_transactions_request: GroupTransactionsRequest + :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._group_transactions_serialize( + group_transactions_request=group_transactions_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _group_transactions_serialize( + self, + group_transactions_request, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if group_transactions_request is not None: + _body_params = group_transactions_request + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/transactions/group", + 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 ungroup_transactions( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction group to delete") + ], + _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, + ) -> None: + """Delete a transaction group + + Deletes the transaction group with the ID specified on the path.
The transactions within the group are not removed and will subsequently be treated as \"normal\" ungrouped transactions. + + :param id: ID of the transaction group to delete (required) + :type id: int + :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._ungroup_transactions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 ungroup_transactions_with_http_info( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction group to delete") + ], + _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[None]: + """Delete a transaction group + + Deletes the transaction group with the ID specified on the path.
The transactions within the group are not removed and will subsequently be treated as \"normal\" ungrouped transactions. + + :param id: ID of the transaction group to delete (required) + :type id: int + :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._ungroup_transactions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 ungroup_transactions_without_preload_content( + self, + id: Annotated[ + StrictInt, Field(description="ID of the transaction group to delete") + ], + _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: + """Delete a transaction group + + Deletes the transaction group with the ID specified on the path.
The transactions within the group are not removed and will subsequently be treated as \"normal\" ungrouped transactions. + + :param id: ID of the transaction group to delete (required) + :type id: int + :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._ungroup_transactions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "401": "ErrorResponseObject", + "404": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _ungroup_transactions_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/transactions/group/{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, + ) diff --git a/clients/python/lunchable/api/transactions_split_api.py b/clients/python/lunchable/api/transactions_split_api.py new file mode 100644 index 00000000..19d717ae --- /dev/null +++ b/clients/python/lunchable/api/transactions_split_api.py @@ -0,0 +1,577 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.split_transaction_request import SplitTransactionRequest + +from lunchable.api_client import ApiClient, RequestSerialized +from lunchable.api_response import ApiResponse +from lunchable.rest import RESTResponseType + + +class TransactionsSplitApi: + """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 split_transaction( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to spit")], + split_transaction_request: SplitTransactionRequest, + _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, + ) -> GroupTransactions201Response: + """Split a transaction + + Splits an existing transaction into a set of smaller child transactions.

After a transaction has been split the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split use the `GET /transactions/{id}` endpoint, passing the value of the `parent_id` of one of the children. + + :param id: ID of the transaction to spit (required) + :type id: int + :param split_transaction_request: (required) + :type split_transaction_request: SplitTransactionRequest + :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._split_transaction_serialize( + id=id, + split_transaction_request=split_transaction_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 split_transaction_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to spit")], + split_transaction_request: SplitTransactionRequest, + _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[GroupTransactions201Response]: + """Split a transaction + + Splits an existing transaction into a set of smaller child transactions.

After a transaction has been split the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split use the `GET /transactions/{id}` endpoint, passing the value of the `parent_id` of one of the children. + + :param id: ID of the transaction to spit (required) + :type id: int + :param split_transaction_request: (required) + :type split_transaction_request: SplitTransactionRequest + :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._split_transaction_serialize( + id=id, + split_transaction_request=split_transaction_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 split_transaction_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the transaction to spit")], + split_transaction_request: SplitTransactionRequest, + _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: + """Split a transaction + + Splits an existing transaction into a set of smaller child transactions.

After a transaction has been split the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split use the `GET /transactions/{id}` endpoint, passing the value of the `parent_id` of one of the children. + + :param id: ID of the transaction to spit (required) + :type id: int + :param split_transaction_request: (required) + :type split_transaction_request: SplitTransactionRequest + :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._split_transaction_serialize( + id=id, + split_transaction_request=split_transaction_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "GroupTransactions201Response", + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _split_transaction_serialize( + self, + id, + split_transaction_request, + _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 id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if split_transaction_request is not None: + _body_params = split_transaction_request + + # 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/transactions/split/{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 unsplit_transaction( + self, + id: Annotated[ + StrictInt, + Field(description="ID of the previously split transaction to delete."), + ], + _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, + ) -> None: + """Unsplit a previously split transactions + + Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.

Use the value of the `parent_id`property of a split transaction to specify the parent ID. + + :param id: ID of the previously split transaction to delete. (required) + :type id: int + :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._unsplit_transaction_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 unsplit_transaction_with_http_info( + self, + id: Annotated[ + StrictInt, + Field(description="ID of the previously split transaction to delete."), + ], + _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[None]: + """Unsplit a previously split transactions + + Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.

Use the value of the `parent_id`property of a split transaction to specify the parent ID. + + :param id: ID of the previously split transaction to delete. (required) + :type id: int + :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._unsplit_transaction_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + 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 unsplit_transaction_without_preload_content( + self, + id: Annotated[ + StrictInt, + Field(description="ID of the previously split transaction to delete."), + ], + _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: + """Unsplit a previously split transactions + + Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.

Use the value of the `parent_id`property of a split transaction to specify the parent ID. + + :param id: ID of the previously split transaction to delete. (required) + :type id: int + :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._unsplit_transaction_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "ErrorResponseObject", + "401": "ErrorResponseObject", + "429": "ErrorResponseObject", + "500": "ErrorResponseObject", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _unsplit_transaction_serialize( + self, + 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 id is not None: + _path_params["id"] = 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] = ["cookieAuth", "bearerSecurity"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/transactions/split/{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, + ) diff --git a/clients/python/lunchable/api_client.py b/clients/python/lunchable/api_client.py new file mode 100644 index 00000000..b88e6831 --- /dev/null +++ b/clients/python/lunchable/api_client.py @@ -0,0 +1,747 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from lunchable.configuration import Configuration +from lunchable.api_response import ApiResponse, T as ApiResponseT +import lunchable.models +from lunchable import rest +from lunchable.exceptions import ApiValueError, ApiException + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "decimal": decimal.Decimal, + "object": object, + } + _pool = None + + def __init__( + self, configuration=None, header_name=None, header_value=None, cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers["User-Agent"] + + @user_agent.setter + def user_agent(self, value): + self.default_headers["User-Agent"] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None, + ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params["Cookie"] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, collection_formats) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth, + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, collection_formats) + url += "?" + url_query + + return method, url, header_params, body, post_params + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None, + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout, + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]] = None, + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader("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" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize( + response_text, response_type, content_type + ) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() + } + + def deserialize( + self, response_text: str, response_type: str, content_type: Optional[str] + ): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match( + r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", + content_type, + re.IGNORECASE, + ): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(lunchable.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search("json", accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search("json", content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None, + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, queries, resource_path, method, body, request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting + ) + + def _apply_auth_params( + self, headers, queries, resource_path, method, body, auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) + else: + raise ApiValueError("Authentication token must be in `query` or `header`") + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("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) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=("Failed to parse `{0}` as datetime object".format(string)), + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/clients/python/lunchable/api_response.py b/clients/python/lunchable/api_response.py new file mode 100644 index 00000000..1ce13729 --- /dev/null +++ b/clients/python/lunchable/api_response.py @@ -0,0 +1,20 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = {"arbitrary_types_allowed": True} diff --git a/clients/python/lunchable/configuration.py b/clients/python/lunchable/configuration.py new file mode 100644 index 00000000..845e75c4 --- /dev/null +++ b/clients/python/lunchable/configuration.py @@ -0,0 +1,625 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 +from logging import FileHandler +import multiprocessing +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self + +import urllib3 + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "bearerSecurity": BearerFormatAuthSetting, + "cookieAuth": APIKeyAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = lunchable.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str] = None, + api_key: Optional[Dict[str, str]] = None, + api_key_prefix: Optional[Dict[str, str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + access_token: Optional[str] = None, + server_index: Optional[int] = None, + server_variables: Optional[ServerVariablesT] = None, + server_operation_index: Optional[Dict[int, int]] = None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None, + ignore_operation_servers: bool = False, + ssl_ca_cert: Optional[str] = None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor""" + self._base_path = ( + "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2" + if host is None + else host + ) + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("lunchable") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = "%(asctime)s %(levelname)s %(message)s" + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = "" + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ("logger", "logger_file_handler"): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix( + self, identifier: str, alias: Optional[str] = None + ) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) + + def auth_settings(self) -> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if self.access_token is not None: + auth["bearerSecurity"] = { + "type": "bearer", + "in": "header", + "format": "JWT", + "key": "Authorization", + "value": "Bearer " + self.access_token, + } + if "cookieAuth" in self.api_key: + auth["cookieAuth"] = { + "type": "api_key", + "in": "cookie", + "key": "_lm_access_token", + "value": self.get_api_key_with_prefix( + "cookieAuth", + ), + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: 2.7.4\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + "url": "https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2", + "description": "Static Mock v2 Lunch Money API Server", + }, + { + "url": "https://lm-v2-api-v1-proxy-08a8f2bf0c0c.herokuapp.com/v2", + "description": "v2 via v1 API Lunch Money API Server", + }, + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers)) + ) + + url = server["url"] + + # go through variables and replace placeholders + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) + + if "enum_values" in variable and used_value not in variable["enum_values"]: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], variable["enum_values"] + ) + ) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/clients/python/lunchable/exceptions.py b/clients/python/lunchable/exceptions.py new file mode 100644 index 00000000..68ef40c2 --- /dev/null +++ b/clients/python/lunchable/exceptions.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__( + self, msg, path_to_item=None, valid_classes=None, key_type=None + ) -> None: + """Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode("utf-8") + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + 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) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/clients/python/lunchable/models/__init__.py b/clients/python/lunchable/models/__init__.py new file mode 100644 index 00000000..18465339 --- /dev/null +++ b/clients/python/lunchable/models/__init__.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +# flake8: noqa +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from lunchable.models.account_type_enum import AccountTypeEnum +from lunchable.models.category_object import CategoryObject +from lunchable.models.create_category_request_object_children_inner import ( + CreateCategoryRequestObjectChildrenInner, +) +from lunchable.models.create_new_transactions201_response import ( + CreateNewTransactions201Response, +) +from lunchable.models.create_new_transactions_request import ( + CreateNewTransactionsRequest, +) +from lunchable.models.currency_enum import CurrencyEnum +from lunchable.models.delete_category_response_with_dependencies_dependents import ( + DeleteCategoryResponseWithDependenciesDependents, +) +from lunchable.models.delete_tag_response_with_dependencies_dependents import ( + DeleteTagResponseWithDependenciesDependents, +) +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest +from lunchable.models.error_response_object import ErrorResponseObject +from lunchable.models.get_all_categories200_response import GetAllCategories200Response +from lunchable.models.get_all_manual_accounts200_response import ( + GetAllManualAccounts200Response, +) +from lunchable.models.get_all_plaid_accounts200_response import ( + GetAllPlaidAccounts200Response, +) +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response +from lunchable.models.get_all_tags200_response import GetAllTags200Response +from lunchable.models.get_all_transactions200_response import ( + GetAllTransactions200Response, +) +from lunchable.models.group_transactions201_response import GroupTransactions201Response +from lunchable.models.group_transactions_request import GroupTransactionsRequest +from lunchable.models.insert_transaction_object_amount import ( + InsertTransactionObjectAmount, +) +from lunchable.models.manual_account_object import ManualAccountObject +from lunchable.models.plaid_account_object import PlaidAccountObject +from lunchable.models.recurring_object import RecurringObject +from lunchable.models.recurring_object_matches import RecurringObjectMatches +from lunchable.models.recurring_object_matches_found_transactions_inner import ( + RecurringObjectMatchesFoundTransactionsInner, +) +from lunchable.models.recurring_object_overrides import RecurringObjectOverrides +from lunchable.models.recurring_object_transaction_criteria import ( + RecurringObjectTransactionCriteria, +) +from lunchable.models.split_transaction_object_amount import ( + SplitTransactionObjectAmount, +) +from lunchable.models.split_transaction_request import SplitTransactionRequest +from lunchable.models.tag_object import TagObject +from lunchable.models.transaction_object import TransactionObject +from lunchable.models.user_object import UserObject diff --git a/clients/python/lunchable/models/account_type_enum.py b/clients/python/lunchable/models/account_type_enum.py new file mode 100644 index 00000000..db623bd4 --- /dev/null +++ b/clients/python/lunchable/models/account_type_enum.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AccountTypeEnum(str, Enum): + """ + AccountTypeEnum + """ + + """ + allowed enum values + """ + CASH = "cash" + CREDIT = "credit" + CRYPTOCURRENCY = "cryptocurrency" + EMPLOYEE_COMPENSATION = "employee compensation" + INVESTMENT = "investment" + LOAN = "loan" + OTHER_LIABILITY = "other liability" + OTHER_ASSET = "other asset" + REAL_ESTATE = "real estate" + VEHICLE = "vehicle" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountTypeEnum from a JSON string""" + return cls(json.loads(json_str)) diff --git a/clients/python/lunchable/models/category_object.py b/clients/python/lunchable/models/category_object.py new file mode 100644 index 00000000..83f93cfe --- /dev/null +++ b/clients/python/lunchable/models/category_object.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self + + +class CategoryObject(BaseModel): + """ + CategoryObject + """ # noqa: E501 + + id: StrictInt = Field( + description="A system defined unique identifier for the category." + ) + name: Annotated[str, Field(min_length=1, strict=True, max_length=100)] = Field( + description="The name of the category." + ) + description: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + description="The description of the category or `null` if not set." + ) + is_income: StrictBool = Field( + description="If true, the transactions in this category will be treated as income." + ) + exclude_from_budget: StrictBool = Field( + description="If true, the transactions in this category will be excluded from the budget." + ) + exclude_from_totals: StrictBool = Field( + description="If true, the transactions in this category will be excluded from totals." + ) + updated_at: datetime = Field( + description="The date and time of when the category was last updated (in the ISO 8601 extended format)." + ) + created_at: datetime = Field( + description="The date and time of when the category was created (in the ISO 8601 extended format)." + ) + group_id: Optional[StrictInt] = Field( + description="The ID of the category group this category belongs to or `null` if the category doesn't belong to a group, or is itself a category group." + ) + is_group: StrictBool = Field( + description="If true, the category is a group that can be a parent to other categories." + ) + children: Optional[List[ChildCategoryObject]] = Field( + default=None, + description="For category groups, this will populate with details about the categories that belong to this group. The objects in this array are similar to Category Objects but do not include the `is_income`, `exclude_from_budget`, and `exclude_from_totals` properties as these are inherited from the Category Group. In addition the `is_group` property will always be `false``, and there will be no `children` attribute.", + ) + archived: StrictBool = Field( + description="If true, the category is archived and not displayed in relevant areas of the Lunch Money app." + ) + archived_at: Optional[datetime] = Field( + description="The date and time of when the category was last archived (in the ISO 8601 extended format)." + ) + order: Optional[Union[StrictFloat, StrictInt]] = Field( + description="An index specifying the position in which the category is displayed on the categories page in the Lunch Money GUI. For categories within a category group the order index is relative to the other categories within the group.
This value for this property will be `null` for categories created via the API until they are modified on the Categories page in the Lunch Money GUI." + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "description", + "is_income", + "exclude_from_budget", + "exclude_from_totals", + "updated_at", + "created_at", + "group_id", + "is_group", + "children", + "archived", + "archived_at", + "order", + ] + + 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 CategoryObject 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 children (list) + _items = [] + if self.children: + for _item_children in self.children: + if _item_children: + _items.append(_item_children.to_dict()) + _dict["children"] = _items + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict["description"] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict["group_id"] = None + + # set to None if archived_at (nullable) is None + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: + _dict["archived_at"] = None + + # set to None if order (nullable) is None + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: + _dict["order"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CategoryObject 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"), + "description": obj.get("description"), + "is_income": obj.get("is_income"), + "exclude_from_budget": obj.get("exclude_from_budget"), + "exclude_from_totals": obj.get("exclude_from_totals"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "group_id": obj.get("group_id"), + "is_group": obj.get("is_group"), + "children": [ + ChildCategoryObject.from_dict(_item) for _item in obj["children"] + ] + if obj.get("children") is not None + else None, + "archived": obj.get("archived"), + "archived_at": obj.get("archived_at"), + "order": obj.get("order"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/create_category_request_object_children_inner.py b/clients/python/lunchable/models/create_category_request_object_children_inner.py new file mode 100644 index 00000000..9fcb361f --- /dev/null +++ b/clients/python/lunchable/models/create_category_request_object_children_inner.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, StrictInt, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Set, Dict +from typing_extensions import Self + +CREATECATEGORYREQUESTOBJECTCHILDRENINNER_ONE_OF_SCHEMAS = ["ChildCategoryObject", "int"] + + +class CreateCategoryRequestObjectChildrenInner(BaseModel): + """ + CreateCategoryRequestObjectChildrenInner + """ + + # data type: int + oneof_schema_1_validator: Optional[StrictInt] = None + # data type: ChildCategoryObject + oneof_schema_2_validator: Optional[ChildCategoryObject] = None + actual_instance: Optional[Union[ChildCategoryObject, int]] = None + one_of_schemas: Set[str] = {"ChildCategoryObject", "int"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = CreateCategoryRequestObjectChildrenInner.model_construct() + error_messages = [] + match = 0 + # validate data type: int + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: ChildCategoryObject + if not isinstance(v, ChildCategoryObject): + error_messages.append( + f"Error! Input type `{type(v)}` is not `ChildCategoryObject`" + ) + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in CreateCategoryRequestObjectChildrenInner with oneOf schemas: ChildCategoryObject, int. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in CreateCategoryRequestObjectChildrenInner with oneOf schemas: ChildCategoryObject, int. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into int + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ChildCategoryObject + try: + instance.actual_instance = ChildCategoryObject.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into CreateCategoryRequestObjectChildrenInner with oneOf schemas: ChildCategoryObject, int. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into CreateCategoryRequestObjectChildrenInner with oneOf schemas: ChildCategoryObject, int. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json + ): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ChildCategoryObject, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict + ): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/clients/python/lunchable/models/create_new_transactions201_response.py b/clients/python/lunchable/models/create_new_transactions201_response.py new file mode 100644 index 00000000..4957d826 --- /dev/null +++ b/clients/python/lunchable/models/create_new_transactions201_response.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.transaction_object import TransactionObject +from typing import Set +from typing_extensions import Self + + +class CreateNewTransactions201Response(BaseModel): + """ + CreateNewTransactions201Response + """ # noqa: E501 + + transactions: List[TransactionObject] + skipped_existing_external_ids: Optional[List[SkippedExistingExternalIdObject]] = ( + None + ) + __properties: ClassVar[List[str]] = [ + "transactions", + "skipped_existing_external_ids", + ] + + 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 CreateNewTransactions201Response 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 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 skipped_existing_external_ids (list) + _items = [] + if self.skipped_existing_external_ids: + for ( + _item_skipped_existing_external_ids + ) in self.skipped_existing_external_ids: + if _item_skipped_existing_external_ids: + _items.append(_item_skipped_existing_external_ids.to_dict()) + _dict["skipped_existing_external_ids"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNewTransactions201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "transactions": [ + TransactionObject.from_dict(_item) for _item in obj["transactions"] + ] + if obj.get("transactions") is not None + else None, + "skipped_existing_external_ids": [ + SkippedExistingExternalIdObject.from_dict(_item) + for _item in obj["skipped_existing_external_ids"] + ] + if obj.get("skipped_existing_external_ids") is not None + else None, + } + ) + return _obj diff --git a/clients/python/lunchable/models/create_new_transactions_request.py b/clients/python/lunchable/models/create_new_transactions_request.py new file mode 100644 index 00000000..8ee7b5cb --- /dev/null +++ b/clients/python/lunchable/models/create_new_transactions_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self + + +class CreateNewTransactionsRequest(BaseModel): + """ + CreateNewTransactionsRequest + """ # noqa: E501 + + transactions: List[InsertTransactionObject] = Field( + description="List of transactions to insert." + ) + apply_rules: Optional[StrictBool] = Field( + default=False, + description="If set to true, any rules associated with the account specified by the `manual_account_id` property for each transaction will be applied.", + ) + skip_duplicates: Optional[StrictBool] = Field( + default=False, + description="If set to true, the system will flag new transactions that have the same `date`, `payee`, `amount`, and `manual_account_id`, as a duplicate. Not that deduplication based on `external_id` and `manual_account_id` will always occur regardless of how this property is set.", + ) + skip_balance_update: Optional[StrictBool] = Field( + default=False, + description="If set to true, and new transactions include a `manual_account_id`, the balances of these accounts will not be updated, when the transactions are inserted.", + ) + __properties: ClassVar[List[str]] = [ + "transactions", + "apply_rules", + "skip_duplicates", + "skip_balance_update", + ] + + 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 CreateNewTransactionsRequest 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 transactions (list) + _items = [] + if self.transactions: + for _item_transactions in self.transactions: + if _item_transactions: + _items.append(_item_transactions.to_dict()) + _dict["transactions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNewTransactionsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "transactions": [ + InsertTransactionObject.from_dict(_item) + for _item in obj["transactions"] + ] + if obj.get("transactions") is not None + else None, + "apply_rules": obj.get("apply_rules") + if obj.get("apply_rules") is not None + else False, + "skip_duplicates": obj.get("skip_duplicates") + if obj.get("skip_duplicates") is not None + else False, + "skip_balance_update": obj.get("skip_balance_update") + if obj.get("skip_balance_update") is not None + else False, + } + ) + return _obj diff --git a/clients/python/lunchable/models/currency_enum.py b/clients/python/lunchable/models/currency_enum.py new file mode 100644 index 00000000..91480d8a --- /dev/null +++ b/clients/python/lunchable/models/currency_enum.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CurrencyEnum(str, Enum): + """ + Supported Currency codes: - `aed`: United Arab Emirates Dirham - `afn`: Afghan Afghani - `all`: Albanian Lek - `amd`: Armenian Dram - `ang`: Netherlands Antillean Guilder - `aoa`: Angolan Kwanza - `ars`: Argentine Peso - `aud`: Australian Dollar - `awg`: Aruban Florin - `azn`: Azerbaijani Manat - `bam`: Bosnia-Herzegovina Convertible Mark - `bbd`: Barbadian Dollar - `bdt`: Bangladeshi Taka - `bgn`: Bulgarian Lev - `bhd`: Bahraini Dinar - `bif`: Burundian Franc - `bmd`: Bermudian Dollar - `bnd`: Brunei Dollar - `bob`: Bolivian Boliviano - `brl`: Brazilian Real - `bsd`: Bahamian Dollar - `btc`: Bitcoin - `btn`: Bhutanese Ngultrum - `bwp`: Botswanan Pula - `byn`: Belarusian Ruble - `bzd`: Belize Dollar - `cad`: Canadian Dollar - `cdf`: Congolese Franc - `chf`: Swiss Franc - `clp`: Chilean Peso - `cny`: Chinese Yuan - `cop`: Colombian Peso - `crc`: Costa Rican Colón - `cuc`: Cuban Convertible Peso - `cup`: Cuban Peso - `cve`: Cape Verdean Escudo - `czk`: Czech Republic Koruna - `djf`: Djiboutian Franc - `dkk`: Danish Krone - `dop`: Dominican Peso - `dzd`: Algerian Dinar - `egp`: Egyptian Pound - `ern`: Eritrean Nakfa - `etb`: Ethiopian Birr - `eur`: Euro - `fjd`: Fijian Dollar - `fkp`: Falkland Islands Pound - `gbp`: British Pound Sterling - `gel`: Georgian Lari - `ggp`: Guernsey Pound - `ghs`: Ghanaian Cedi - `gip`: Gibraltar Pound - `gmd`: Gambian Dalasi - `gnf`: Guinean Franc - `gtq`: Guatemalan Quetzal - `gyd`: Guyanaese Dollar - `hkd`: Hong Kong Dollar - `hnl`: Honduran Lempira - `hrk`: Croatian Kuna - `htg`: Haitian Gourde - `huf`: Hungarian Forint - `idr`: Indonesian Rupiah - `ils`: Israeli New Sheqel - `imp`: Isle of Man Pound - `inr`: Indian Rupee - `iqd`: Iraqi Dinar - `irr`: Iranian Rial - `isk`: Icelandic Króna - `jep`: Jersey Pound - `jmd`: Jamaican Dollar - `jod`: Jordanian Dinar - `jpy`: Japanese Yen - `kes`: Kenyan Shilling - `kgs`: Kyrgystani Som - `khr`: Cambodian Riel - `kmf`: Comorian Franc - `kpw`: North Korean Won - `krw`: South Korean Won - `kwd`: Kuwaiti Dinar - `kyd`: Cayman Islands Dollar - `kzt`: Kazakhstani Tenge - `lak`: Laotian Kip - `lbp`: Lebanese Pound - `lkr`: Sri Lankan Rupee - `lrd`: Liberian Dollar - `lsl`: Lesotho Loti - `ltl`: Lithuanian Litas - `lvl`: Latvian Lats - `lyd`: Libyan Dinar - `mad`: Moroccan Dirham - `mdl`: Moldovan Leu - `mga`: Malagasy Ariary - `mkd`: Macedonian Denar - `mmk`: Myanma Kyat - `mnt`: Mongolian Tugrik - `mop`: Macanese Pataca - `mro`: Mauritanian Ouguiya - `mur`: Mauritian Rupee - `mvr`: Maldivian Rufiyaa - `mwk`: Malawian Kwacha - `mxn`: Mexican Peso - `myr`: Malaysian Ringgit - `mzn`: Mozambican Metical - `nad`: Namibian Dollar - `ngn`: Nigerian Naira - `nio`: Nicaraguan Córdoba - `nok`: Norwegian Krone - `npr`: Nepalese Rupee - `nzd`: New Zealand Dollar - `omr`: Omani Rial - `pab`: Panamanian Balboa - `pen`: Peruvian Nuevo Sol - `pgk`: Papua New Guinean Kina - `php`: Philippine Peso - `pkr`: Pakistani Rupee - `pln`: Polish Zloty - `pyg`: Paraguayan Guarani - `qar`: Qatari Rial - `ron`: Romanian Leu - `rsd`: Serbian Dinar - `rub`: Russian Ruble - `rwf`: Rwandan Franc - `sar`: Saudi Riyal - `sbd`: Solomon Islands Dollar - `scr`: Seychellois Rupee - `sdg`: Sudanese Pound - `sek`: Swedish Krona - `sgd`: Singapore Dollar - `shp`: Saint Helena Pound - `sll`: Sierra Leonean Leone - `sos`: Somali Shilling - `srd`: Surinamese Dollar - `std`: São Tomé and Príncipe Dobra - `svc`: Salvadoran Colón - `syp`: Syrian Pound - `szl`: Swazi Lilangeni - `thb`: Thai Baht - `tjs`: Tajikistani Somoni - `tmt`: Turkmenistani Manat - `tnd`: Tunisian Dinar - `top`: Tongan Paʻanga - `try`: Turkish Lira - `ttd`: Trinidad and Tobago Dollar - `twd`: New Taiwan Dollar - `tzs`: Tanzanian Shilling - `uah`: Ukrainian Hryvnia - `ugx`: Ugandan Shilling - `usd`: United States Dollar - `uyu`: Uruguayan Peso - `uzs`: Uzbekistan Som - `vef`: Venezuelan Bolívar - `vnd`: Vietnamese Dong - `vuv`: Vanuatu Vatu - `wst`: Samoan Tala - `xaf`: CFA Franc BEAC - `xcd`: East Caribbean Dollar - `xof`: CFA Franc BCEAO - `xpf`: CFP Franc - `yer`: Yemeni Rial - `zar`: South African Rand - `zmw`: Zambian Kwacha - `zwl`: Zimbabwean Dollar + """ + + """ + allowed enum values + """ + AED = "aed" + AFN = "afn" + ALL = "all" + AMD = "amd" + ANG = "ang" + AOA = "aoa" + ARS = "ars" + AUD = "aud" + AWG = "awg" + AZN = "azn" + BAM = "bam" + BBD = "bbd" + BDT = "bdt" + BGN = "bgn" + BHD = "bhd" + BIF = "bif" + BMD = "bmd" + BND = "bnd" + BOB = "bob" + BRL = "brl" + BSD = "bsd" + BTC = "btc" + BTN = "btn" + BWP = "bwp" + BYN = "byn" + BZD = "bzd" + CAD = "cad" + CDF = "cdf" + CHF = "chf" + CLP = "clp" + CNY = "cny" + COP = "cop" + CRC = "crc" + CUC = "cuc" + CUP = "cup" + CVE = "cve" + CZK = "czk" + DJF = "djf" + DKK = "dkk" + DOP = "dop" + DZD = "dzd" + EGP = "egp" + ERN = "ern" + ETB = "etb" + EUR = "eur" + FJD = "fjd" + FKP = "fkp" + GBP = "gbp" + GEL = "gel" + GGP = "ggp" + GHS = "ghs" + GIP = "gip" + GMD = "gmd" + GNF = "gnf" + GTQ = "gtq" + GYD = "gyd" + HKD = "hkd" + HNL = "hnl" + HRK = "hrk" + HTG = "htg" + HUF = "huf" + IDR = "idr" + ILS = "ils" + IMP = "imp" + INR = "inr" + IQD = "iqd" + IRR = "irr" + ISK = "isk" + JEP = "jep" + JMD = "jmd" + JOD = "jod" + JPY = "jpy" + KES = "kes" + KGS = "kgs" + KHR = "khr" + KMF = "kmf" + KPW = "kpw" + KRW = "krw" + KWD = "kwd" + KYD = "kyd" + KZT = "kzt" + LAK = "lak" + LBP = "lbp" + LKR = "lkr" + LRD = "lrd" + LSL = "lsl" + LTL = "ltl" + LVL = "lvl" + LYD = "lyd" + MAD = "mad" + MDL = "mdl" + MGA = "mga" + MKD = "mkd" + MMK = "mmk" + MNT = "mnt" + MOP = "mop" + MRO = "mro" + MUR = "mur" + MVR = "mvr" + MWK = "mwk" + MXN = "mxn" + MYR = "myr" + MZN = "mzn" + NAD = "nad" + NGN = "ngn" + NIO = "nio" + NOK = "nok" + NPR = "npr" + NZD = "nzd" + OMR = "omr" + PAB = "pab" + PEN = "pen" + PGK = "pgk" + PHP = "php" + PKR = "pkr" + PLN = "pln" + PYG = "pyg" + QAR = "qar" + RON = "ron" + RSD = "rsd" + RUB = "rub" + RWF = "rwf" + SAR = "sar" + SBD = "sbd" + SCR = "scr" + SDG = "sdg" + SEK = "sek" + SGD = "sgd" + SHP = "shp" + SLL = "sll" + SOS = "sos" + SRD = "srd" + STD = "std" + SVC = "svc" + SYP = "syp" + SZL = "szl" + THB = "thb" + TJS = "tjs" + TMT = "tmt" + TND = "tnd" + TOP = "top" + TRY = "try" + TTD = "ttd" + TWD = "twd" + TZS = "tzs" + UAH = "uah" + UGX = "ugx" + USD = "usd" + UYU = "uyu" + UZS = "uzs" + VEF = "vef" + VND = "vnd" + VUV = "vuv" + WST = "wst" + XAF = "xaf" + XCD = "xcd" + XOF = "xof" + XPF = "xpf" + YER = "yer" + ZAR = "zar" + ZMW = "zmw" + ZWL = "zwl" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CurrencyEnum from a JSON string""" + return cls(json.loads(json_str)) diff --git a/clients/python/lunchable/models/delete_category_response_with_dependencies_dependents.py b/clients/python/lunchable/models/delete_category_response_with_dependencies_dependents.py new file mode 100644 index 00000000..c4f2d7ac --- /dev/null +++ b/clients/python/lunchable/models/delete_category_response_with_dependencies_dependents.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + + +class DeleteCategoryResponseWithDependenciesDependents(BaseModel): + """ + DeleteCategoryResponseWithDependenciesDependents + """ # noqa: E501 + + budget: Union[StrictFloat, StrictInt] = Field( + description="The number of budgets depending on the category" + ) + category_rules: Union[StrictFloat, StrictInt] = Field( + description="The number of category rules depending on the category" + ) + transactions: Union[StrictFloat, StrictInt] = Field( + description="The number of transactions depending on the category" + ) + children: Union[StrictFloat, StrictInt] = Field( + description="The number of child categories in the category group" + ) + recurring: Union[StrictFloat, StrictInt] = Field( + description="The number of recurring transactions depending on the category" + ) + plaid_cats: Union[StrictFloat, StrictInt] = Field( + description="The number of auto created categories based on Plaid categories" + ) + __properties: ClassVar[List[str]] = [ + "budget", + "category_rules", + "transactions", + "children", + "recurring", + "plaid_cats", + ] + + 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 DeleteCategoryResponseWithDependenciesDependents 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 DeleteCategoryResponseWithDependenciesDependents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "budget": obj.get("budget"), + "category_rules": obj.get("category_rules"), + "transactions": obj.get("transactions"), + "children": obj.get("children"), + "recurring": obj.get("recurring"), + "plaid_cats": obj.get("plaid_cats"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/delete_tag_response_with_dependencies_dependents.py b/clients/python/lunchable/models/delete_tag_response_with_dependencies_dependents.py new file mode 100644 index 00000000..d59d6098 --- /dev/null +++ b/clients/python/lunchable/models/delete_tag_response_with_dependencies_dependents.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + + +class DeleteTagResponseWithDependenciesDependents(BaseModel): + """ + DeleteTagResponseWithDependenciesDependents + """ # noqa: E501 + + tag_rules: Union[StrictFloat, StrictInt] = Field( + description="The number of rules depending on the tag" + ) + transactions: Union[StrictFloat, StrictInt] = Field( + description="The number of transactions with the tag" + ) + __properties: ClassVar[List[str]] = ["tag_rules", "transactions"] + + 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 DeleteTagResponseWithDependenciesDependents 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 DeleteTagResponseWithDependenciesDependents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"tag_rules": obj.get("tag_rules"), "transactions": obj.get("transactions")} + ) + return _obj diff --git a/clients/python/lunchable/models/delete_transactions_request.py b/clients/python/lunchable/models/delete_transactions_request.py new file mode 100644 index 00000000..adfff07e --- /dev/null +++ b/clients/python/lunchable/models/delete_transactions_request.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + + +class DeleteTransactionsRequest(BaseModel): + """ + DeleteTransactionsRequest + """ # noqa: E501 + + ids: List[Union[StrictFloat, StrictInt]] = Field( + description="Array of existing Transaction IDs to delete" + ) + __properties: ClassVar[List[str]] = ["ids"] + + 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 DeleteTransactionsRequest 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 DeleteTransactionsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"ids": obj.get("ids")}) + return _obj diff --git a/clients/python/lunchable/models/error_response_object.py b/clients/python/lunchable/models/error_response_object.py new file mode 100644 index 00000000..6f9f06b7 --- /dev/null +++ b/clients/python/lunchable/models/error_response_object.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ErrorResponseObject(BaseModel): + """ + ErrorResponseObject + """ # noqa: E501 + + message: StrictStr = Field(description="overall error message") + errors: List[Dict[str, Any]] + __properties: ClassVar[List[str]] = ["message", "errors"] + + 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 ErrorResponseObject 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 ErrorResponseObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"message": obj.get("message"), "errors": obj.get("errors")} + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_categories200_response.py b/clients/python/lunchable/models/get_all_categories200_response.py new file mode 100644 index 00000000..ccf18e4d --- /dev/null +++ b/clients/python/lunchable/models/get_all_categories200_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.category_object import CategoryObject +from typing import Set +from typing_extensions import Self + + +class GetAllCategories200Response(BaseModel): + """ + GetAllCategories200Response + """ # noqa: E501 + + categories: Optional[List[CategoryObject]] = None + __properties: ClassVar[List[str]] = ["categories"] + + 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 GetAllCategories200Response 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 categories (list) + _items = [] + if self.categories: + for _item_categories in self.categories: + if _item_categories: + _items.append(_item_categories.to_dict()) + _dict["categories"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllCategories200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "categories": [ + CategoryObject.from_dict(_item) for _item in obj["categories"] + ] + if obj.get("categories") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_manual_accounts200_response.py b/clients/python/lunchable/models/get_all_manual_accounts200_response.py new file mode 100644 index 00000000..99731787 --- /dev/null +++ b/clients/python/lunchable/models/get_all_manual_accounts200_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.manual_account_object import ManualAccountObject +from typing import Set +from typing_extensions import Self + + +class GetAllManualAccounts200Response(BaseModel): + """ + GetAllManualAccounts200Response + """ # noqa: E501 + + manual_accounts: Optional[List[ManualAccountObject]] = None + __properties: ClassVar[List[str]] = ["manual_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 GetAllManualAccounts200Response 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 manual_accounts (list) + _items = [] + if self.manual_accounts: + for _item_manual_accounts in self.manual_accounts: + if _item_manual_accounts: + _items.append(_item_manual_accounts.to_dict()) + _dict["manual_accounts"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllManualAccounts200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "manual_accounts": [ + ManualAccountObject.from_dict(_item) + for _item in obj["manual_accounts"] + ] + if obj.get("manual_accounts") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_plaid_accounts200_response.py b/clients/python/lunchable/models/get_all_plaid_accounts200_response.py new file mode 100644 index 00000000..eb837d83 --- /dev/null +++ b/clients/python/lunchable/models/get_all_plaid_accounts200_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.plaid_account_object import PlaidAccountObject +from typing import Set +from typing_extensions import Self + + +class GetAllPlaidAccounts200Response(BaseModel): + """ + GetAllPlaidAccounts200Response + """ # noqa: E501 + + plaid_accounts: Optional[List[PlaidAccountObject]] = None + __properties: ClassVar[List[str]] = ["plaid_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 GetAllPlaidAccounts200Response 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 plaid_accounts (list) + _items = [] + if self.plaid_accounts: + for _item_plaid_accounts in self.plaid_accounts: + if _item_plaid_accounts: + _items.append(_item_plaid_accounts.to_dict()) + _dict["plaid_accounts"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllPlaidAccounts200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "plaid_accounts": [ + PlaidAccountObject.from_dict(_item) + for _item in obj["plaid_accounts"] + ] + if obj.get("plaid_accounts") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_recurring200_response.py b/clients/python/lunchable/models/get_all_recurring200_response.py new file mode 100644 index 00000000..5439248c --- /dev/null +++ b/clients/python/lunchable/models/get_all_recurring200_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.recurring_object import RecurringObject +from typing import Set +from typing_extensions import Self + + +class GetAllRecurring200Response(BaseModel): + """ + GetAllRecurring200Response + """ # noqa: E501 + + recurring_items: Optional[List[RecurringObject]] = None + __properties: ClassVar[List[str]] = ["recurring_items"] + + 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 GetAllRecurring200Response 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 recurring_items (list) + _items = [] + if self.recurring_items: + for _item_recurring_items in self.recurring_items: + if _item_recurring_items: + _items.append(_item_recurring_items.to_dict()) + _dict["recurring_items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllRecurring200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "recurring_items": [ + RecurringObject.from_dict(_item) for _item in obj["recurring_items"] + ] + if obj.get("recurring_items") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_tags200_response.py b/clients/python/lunchable/models/get_all_tags200_response.py new file mode 100644 index 00000000..7dab3fcb --- /dev/null +++ b/clients/python/lunchable/models/get_all_tags200_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.tag_object import TagObject +from typing import Set +from typing_extensions import Self + + +class GetAllTags200Response(BaseModel): + """ + GetAllTags200Response + """ # noqa: E501 + + tags: Optional[List[TagObject]] = None + __properties: ClassVar[List[str]] = ["tags"] + + 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 GetAllTags200Response 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 tags (list) + _items = [] + if self.tags: + for _item_tags in self.tags: + if _item_tags: + _items.append(_item_tags.to_dict()) + _dict["tags"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllTags200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "tags": [TagObject.from_dict(_item) for _item in obj["tags"]] + if obj.get("tags") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/get_all_transactions200_response.py b/clients/python/lunchable/models/get_all_transactions200_response.py new file mode 100644 index 00000000..5c162d29 --- /dev/null +++ b/clients/python/lunchable/models/get_all_transactions200_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lunchable.models.transaction_object import TransactionObject +from typing import Set +from typing_extensions import Self + + +class GetAllTransactions200Response(BaseModel): + """ + GetAllTransactions200Response + """ # noqa: E501 + + transactions: List[TransactionObject] + has_more: StrictBool = Field( + description="Set to true if more transactions are available" + ) + error: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["transactions", "has_more", "error"] + + 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 GetAllTransactions200Response 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 transactions (list) + _items = [] + if self.transactions: + for _item_transactions in self.transactions: + if _item_transactions: + _items.append(_item_transactions.to_dict()) + _dict["transactions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAllTransactions200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "transactions": [ + TransactionObject.from_dict(_item) for _item in obj["transactions"] + ] + if obj.get("transactions") is not None + else None, + "has_more": obj.get("has_more"), + "error": obj.get("error"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/group_transactions201_response.py b/clients/python/lunchable/models/group_transactions201_response.py new file mode 100644 index 00000000..532c631f --- /dev/null +++ b/clients/python/lunchable/models/group_transactions201_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 lunchable.models.transaction_object import TransactionObject +from typing import Set +from typing_extensions import Self + + +class GroupTransactions201Response(BaseModel): + """ + GroupTransactions201Response + """ # noqa: E501 + + transactions: Optional[List[TransactionObject]] = None + __properties: ClassVar[List[str]] = ["transactions"] + + 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 GroupTransactions201Response 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 transactions (list) + _items = [] + if self.transactions: + for _item_transactions in self.transactions: + if _item_transactions: + _items.append(_item_transactions.to_dict()) + _dict["transactions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupTransactions201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "transactions": [ + TransactionObject.from_dict(_item) for _item in obj["transactions"] + ] + if obj.get("transactions") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/group_transactions_request.py b/clients/python/lunchable/models/group_transactions_request.py new file mode 100644 index 00000000..d444360d --- /dev/null +++ b/clients/python/lunchable/models/group_transactions_request.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self + + +class GroupTransactionsRequest(BaseModel): + """ + GroupTransactionsRequest + """ # noqa: E501 + + ids: List[StrictInt] = Field( + description="List of existing transaction IDs to group. Split and recurring transactions may not be grouped. Transactions that are already grouped must be ungrouped before being regrouped." + ) + var_date: date = Field( + description="Date for the new grouped transaction in ISO 8601 format.", + alias="date", + ) + payee: Annotated[str, Field(min_length=0, strict=True, max_length=140)] = Field( + description="The payee for the new grouped transaction. " + ) + category_id: Optional[StrictInt] = Field( + default=None, + description="The ID of an existing category to assign to the grouped transaction. If not set and all the grouped transactions have the same category, the grouped transaction will inherit the category, otherwise the new transaction will have no category.", + ) + notes: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=350)] + ] = Field(default=None, description="Notes for the grouped transaction. ") + status: Optional[StrictStr] = Field( + default=None, + description="If set must be either `reviewed` or `unreviewed`. If not set, defaults to `reviewed`.", + ) + tag_ids: Optional[List[StrictInt]] = Field( + default=None, + description="A list of IDs for the tags associated with the grouped transaction. Each ID must match an existing tag associated with the user's account. If not set, no tags will be associated with the created transaction.", + ) + __properties: ClassVar[List[str]] = [ + "ids", + "date", + "payee", + "category_id", + "notes", + "status", + "tag_ids", + ] + + @field_validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["reviewed", "unreviewed"]): + raise ValueError("must be one of enum values ('reviewed', 'unreviewed')") + return value + + 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 GroupTransactionsRequest 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 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 notes (nullable) is None + # and model_fields_set contains the field + if self.notes is None and "notes" in self.model_fields_set: + _dict["notes"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupTransactionsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "ids": obj.get("ids"), + "date": obj.get("date"), + "payee": obj.get("payee"), + "category_id": obj.get("category_id"), + "notes": obj.get("notes"), + "status": obj.get("status"), + "tag_ids": obj.get("tag_ids"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/insert_transaction_object_amount.py b/clients/python/lunchable/models/insert_transaction_object_amount.py new file mode 100644 index 00000000..6e183b80 --- /dev/null +++ b/clients/python/lunchable/models/insert_transaction_object_amount.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +import pprint +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictFloat, + StrictInt, + ValidationError, + field_validator, +) +from typing import Any, Optional, Union +from typing_extensions import Annotated +from typing import Set, Dict +from typing_extensions import Self + +INSERTTRANSACTIONOBJECTAMOUNT_ONE_OF_SCHEMAS = ["float", "str"] + + +class InsertTransactionObjectAmount(BaseModel): + """ + Numeric value of amount. i.e. $4.25 should be denoted as 4.25. Can be a string or a number in double format. + """ + + # data type: float + oneof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: str + oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None + actual_instance: Optional[Union[float, str]] = None + one_of_schemas: Set[str] = {"float", "str"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = InsertTransactionObjectAmount.model_construct() + error_messages = [] + match = 0 + # validate data type: float + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in InsertTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in InsertTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into float + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into InsertTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into InsertTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json + ): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict + ): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/clients/python/lunchable/models/manual_account_object.py b/clients/python/lunchable/models/manual_account_object.py new file mode 100644 index 00000000..eee424bf --- /dev/null +++ b/clients/python/lunchable/models/manual_account_object.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from lunchable.models.account_type_enum import AccountTypeEnum +from typing import Set +from typing_extensions import Self + + +class ManualAccountObject(BaseModel): + """ + An object containing information about a manual account + """ # noqa: E501 + + id: Optional[StrictInt] = Field( + default=None, description="The unique identifier of this account" + ) + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=45)]] = ( + Field(default=None, description="Name of the account") + ) + type: Optional[AccountTypeEnum] = Field( + default=None, description="Primary type of the account" + ) + subtype: Optional[StrictStr] = Field( + default=None, + description="Optional account subtype. Examples include
- retirement - checking - savings - prepaid credit card", + ) + display_name: Optional[StrictStr] = Field( + default=None, + description="Optional display name for the account set by the user", + ) + balance: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="Current balance of the account in numeric format to 4 decimal places.", + ) + balance_as_of: Optional[datetime] = Field( + default=None, + description="Date balance was last updated in ISO 8601 extended format", + ) + closed_on: Optional[date] = Field( + default=None, + description="The date this account was closed. Will be null if the account has not been marked as closed", + ) + currency: Optional[ + Annotated[str, Field(min_length=3, strict=True, max_length=3)] + ] = Field( + default=None, + description="Three-letter lowercase currency code of the account balance", + ) + institution_name: Optional[ + Annotated[str, Field(min_length=1, strict=True, max_length=50)] + ] = Field(default=None, description="Name of institution holding the account") + external_id: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=75)] + ] = Field( + default=None, + description="An optional external_id that may be set or updated via the API", + ) + exclude_from_transactions: Optional[StrictBool] = Field( + default=None, + description="If true, this account will not show up as an option for assignment when creating transactions manually", + ) + created_at: Optional[datetime] = Field( + default=None, + description="Date/time the account was created in ISO 8601 extended format", + ) + updated_at: Optional[datetime] = Field( + default=None, + description="Date/time the account was created in ISO 8601 extended format", + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "type", + "subtype", + "display_name", + "balance", + "balance_as_of", + "closed_on", + "currency", + "institution_name", + "external_id", + "exclude_from_transactions", + "created_at", + "updated_at", + ] + + @field_validator("balance") + def balance_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^-?\d+(\.\d{0,4})?$", value): + raise ValueError( + r"must validate the regular expression /^-?\d+(\.\d{0,4})?$/" + ) + return value + + 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 ManualAccountObject 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 subtype (nullable) is None + # and model_fields_set contains the field + if self.subtype is None and "subtype" in self.model_fields_set: + _dict["subtype"] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict["display_name"] = None + + # set to None if closed_on (nullable) is None + # and model_fields_set contains the field + if self.closed_on is None and "closed_on" in self.model_fields_set: + _dict["closed_on"] = None + + # set to None if institution_name (nullable) is None + # and model_fields_set contains the field + if ( + self.institution_name is None + and "institution_name" in self.model_fields_set + ): + _dict["institution_name"] = None + + # set to None if external_id (nullable) is None + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: + _dict["external_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManualAccountObject 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"), + "type": obj.get("type"), + "subtype": obj.get("subtype"), + "display_name": obj.get("display_name"), + "balance": obj.get("balance"), + "balance_as_of": obj.get("balance_as_of"), + "closed_on": obj.get("closed_on"), + "currency": obj.get("currency"), + "institution_name": obj.get("institution_name"), + "external_id": obj.get("external_id"), + "exclude_from_transactions": obj.get("exclude_from_transactions"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/plaid_account_object.py b/clients/python/lunchable/models/plaid_account_object.py new file mode 100644 index 00000000..015289a7 --- /dev/null +++ b/clients/python/lunchable/models/plaid_account_object.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self + + +class PlaidAccountObject(BaseModel): + """ + An object containing information about an account synced via Plaid + """ # noqa: E501 + + id: StrictInt = Field(description="The unique identifier of this account") + date_linked: date = Field( + description="Date account was first linked in ISO 8601 format" + ) + name: StrictStr = Field( + description="Name of the account. This field is set by Plaid and cannot be altered." + ) + display_name: Optional[StrictStr] = Field( + description="Optional display name for the account set by the user. If not set it will return a concatenated string of institution and account name." + ) + type: StrictStr = Field( + description="Primary type of the account, for example credit, depository, etc. This field is set by Plaid and cannot be altered." + ) + subtype: StrictStr = Field( + description="Optional account subtype. This field is set by Plaid and cannot be altered." + ) + mask: StrictStr = Field( + description="Mask (last 3 to 4 digits of account) of account. This field is set by Plaid and cannot be altered." + ) + institution_name: StrictStr = Field( + description="Name of institution holding the account. This field is set by Plaid and cannot be altered." + ) + status: StrictStr = Field( + description="Denotes the current status of the account within Lunch Money. Must be one of
- `active`: Account is active and in good state
- `inactive`: Account marked inactive from user. No transactions fetched or balance update for this account.
- `relink`: Account needs to be relinked with Plaid.
- `syncing`: Account is awaiting first import of transactions.
- `not found`: Account cannot be found with Plaid
- `not supported`: Account is not supported with Plaid
- `error`: Account is in error with Plaid.
" + ) + allow_transaction_modifications: StrictBool = Field( + description='Is false if the "Allow Modification To Transactions" property for this account has been toggled off. Otherwise it is set to true.' + ) + limit: Optional[Union[StrictFloat, StrictInt]] = Field( + description="Optional credit limit of the account. This field is set by Plaid and cannot be altered" + ) + balance: StrictStr = Field( + description="Current balance of the account in numeric format to 4 decimal places. This field is set by Plaid and cannot be altered." + ) + currency: Annotated[str, Field(min_length=3, strict=True, max_length=3)] = Field( + description="Three-letter lowercase currency code of the account balance" + ) + balance_last_update: datetime = Field( + description="Date balance was last updated in ISO 8601 extended format. This field is set by Plaid and cannot be altered." + ) + import_start_date: Optional[date] = Field( + description="Date of earliest date allowed for importing transactions. Transactions earlier than this date are not imported." + ) + last_import: Optional[datetime] = Field( + description="Timestamp in ISO 8601 extended format of the last time Lunch Money imported new data from Plaid for this account." + ) + last_fetch: Optional[datetime] = Field( + description="Timestamp in ISO 8601 extended format of the last successful request from Lunch Money for updated data or timestamps from Plaid in ISO 8601 extended format (not necessarily date of last successful import)" + ) + plaid_last_successful_update: datetime = Field( + description="Timestamp in ISO 8601 extended format of the last time Plaid successfully connected with institution for new transaction updates, regardless of whether any new data was available in the update." + ) + __properties: ClassVar[List[str]] = [ + "id", + "date_linked", + "name", + "display_name", + "type", + "subtype", + "mask", + "institution_name", + "status", + "allow_transaction_modifications", + "limit", + "balance", + "currency", + "balance_last_update", + "import_start_date", + "last_import", + "last_fetch", + "plaid_last_successful_update", + ] + + @field_validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set( + [ + "active", + "inactive", + "relink", + "syncing", + "not found", + "not supported", + "error", + ] + ): + raise ValueError( + "must be one of enum values ('active', 'inactive', 'relink', 'syncing', 'not found', 'not supported', 'error')" + ) + return value + + 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 PlaidAccountObject 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 display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict["display_name"] = None + + # set to None if limit (nullable) is None + # and model_fields_set contains the field + if self.limit is None and "limit" in self.model_fields_set: + _dict["limit"] = None + + # set to None if import_start_date (nullable) is None + # and model_fields_set contains the field + if ( + self.import_start_date is None + and "import_start_date" in self.model_fields_set + ): + _dict["import_start_date"] = None + + # set to None if last_import (nullable) is None + # and model_fields_set contains the field + if self.last_import is None and "last_import" in self.model_fields_set: + _dict["last_import"] = None + + # set to None if last_fetch (nullable) is None + # and model_fields_set contains the field + if self.last_fetch is None and "last_fetch" in self.model_fields_set: + _dict["last_fetch"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlaidAccountObject 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"), + "date_linked": obj.get("date_linked"), + "name": obj.get("name"), + "display_name": obj.get("display_name"), + "type": obj.get("type"), + "subtype": obj.get("subtype"), + "mask": obj.get("mask"), + "institution_name": obj.get("institution_name"), + "status": obj.get("status"), + "allow_transaction_modifications": obj.get( + "allow_transaction_modifications" + ), + "limit": obj.get("limit"), + "balance": obj.get("balance"), + "currency": obj.get("currency"), + "balance_last_update": obj.get("balance_last_update"), + "import_start_date": obj.get("import_start_date"), + "last_import": obj.get("last_import"), + "last_fetch": obj.get("last_fetch"), + "plaid_last_successful_update": obj.get("plaid_last_successful_update"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/recurring_object.py b/clients/python/lunchable/models/recurring_object.py new file mode 100644 index 00000000..785d6cbf --- /dev/null +++ b/clients/python/lunchable/models/recurring_object.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from lunchable.models.recurring_object_matches import RecurringObjectMatches +from lunchable.models.recurring_object_overrides import RecurringObjectOverrides +from lunchable.models.recurring_object_transaction_criteria import ( + RecurringObjectTransactionCriteria, +) +from typing import Set +from typing_extensions import Self + + +class RecurringObject(BaseModel): + """ + RecurringObject + """ # noqa: E501 + + id: StrictInt = Field(description="The unique identifier of this recurring item") + description: StrictStr = Field( + description="An optional description of this recurring item. This is not written into the transactions." + ) + status: StrictStr = Field( + description="The status of this recurring item. `suggested` recurring items are generated by Lunch Money, but only `reviewed` recurring items will be applied to matching transactions." + ) + transaction_criteria: RecurringObjectTransactionCriteria + overrides: RecurringObjectOverrides + matches: Optional[RecurringObjectMatches] + created_by: StrictInt = Field( + description="The ID of the user who created the recurring item." + ) + created_at: datetime = Field( + description="Date/time the recurring item was created in ISO 8601 extended format." + ) + updated_at: datetime = Field( + description="Date/time the recurring item was updated in ISO 8601 extended format." + ) + source: Optional[StrictStr] = Field( + description="This can be one of four values: - `manual`: User created this recurring item manually from the Recurring Items page - `transaction`: User created this by converting a transaction from the Transactions page - `system`: Recurring item was created by the system on transaction import - `null`: Some older recurring items may not have a source. " + ) + __properties: ClassVar[List[str]] = [ + "id", + "description", + "status", + "transaction_criteria", + "overrides", + "matches", + "created_by", + "created_at", + "updated_at", + "source", + ] + + @field_validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["suggested", "reviewed"]): + raise ValueError("must be one of enum values ('suggested', 'reviewed')") + return value + + @field_validator("source") + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["manual", "transaction", "system"]): + raise ValueError( + "must be one of enum values ('manual', 'transaction', 'system')" + ) + return value + + 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 RecurringObject 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 transaction_criteria + if self.transaction_criteria: + _dict["transaction_criteria"] = self.transaction_criteria.to_dict() + # override the default output from pydantic by calling `to_dict()` of overrides + if self.overrides: + _dict["overrides"] = self.overrides.to_dict() + # override the default output from pydantic by calling `to_dict()` of matches + if self.matches: + _dict["matches"] = self.matches.to_dict() + # set to None if matches (nullable) is None + # and model_fields_set contains the field + if self.matches is None and "matches" in self.model_fields_set: + _dict["matches"] = None + + # set to None if source (nullable) is None + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: + _dict["source"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecurringObject 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"), + "description": obj.get("description"), + "status": obj.get("status"), + "transaction_criteria": RecurringObjectTransactionCriteria.from_dict( + obj["transaction_criteria"] + ) + if obj.get("transaction_criteria") is not None + else None, + "overrides": RecurringObjectOverrides.from_dict(obj["overrides"]) + if obj.get("overrides") is not None + else None, + "matches": RecurringObjectMatches.from_dict(obj["matches"]) + if obj.get("matches") is not None + else None, + "created_by": obj.get("created_by"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "source": obj.get("source"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/recurring_object_matches.py b/clients/python/lunchable/models/recurring_object_matches.py new file mode 100644 index 00000000..21cae2e3 --- /dev/null +++ b/clients/python/lunchable/models/recurring_object_matches.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 +from typing import Any, ClassVar, Dict, List, Optional +from lunchable.models.recurring_object_matches_found_transactions_inner import ( + RecurringObjectMatchesFoundTransactionsInner, +) +from typing import Set +from typing_extensions import Self + + +class RecurringObjectMatches(BaseModel): + """ + Details on expected, found and missing transactions for the specified range. This will be `null` for recurring items with a `status` of `suggested`. + """ # noqa: E501 + + request_start_date: Optional[date] = Field( + default=None, + description="The beginning of the date range that this request used to find matching transactions.", + ) + request_end_date: Optional[date] = Field( + default=None, + description="The beginning of the date range that this request used to find matching transactions.", + ) + expected_occurrence_dates: Optional[List[date]] = Field( + default=None, + description="A list of dates within the specified range where a recurring transactions is expected.", + ) + found_transactions: Optional[List[RecurringObjectMatchesFoundTransactionsInner]] = ( + Field( + default=None, + description="A list with the dates and IDs of matching transactions.", + ) + ) + missing_transaction_dates: Optional[List[date]] = Field( + default=None, + description="A list of dates within the range of where a recurring transaction was expected but none was found.", + ) + __properties: ClassVar[List[str]] = [ + "request_start_date", + "request_end_date", + "expected_occurrence_dates", + "found_transactions", + "missing_transaction_dates", + ] + + 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 RecurringObjectMatches 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 found_transactions (list) + _items = [] + if self.found_transactions: + for _item_found_transactions in self.found_transactions: + if _item_found_transactions: + _items.append(_item_found_transactions.to_dict()) + _dict["found_transactions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecurringObjectMatches from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "request_start_date": obj.get("request_start_date"), + "request_end_date": obj.get("request_end_date"), + "expected_occurrence_dates": obj.get("expected_occurrence_dates"), + "found_transactions": [ + RecurringObjectMatchesFoundTransactionsInner.from_dict(_item) + for _item in obj["found_transactions"] + ] + if obj.get("found_transactions") is not None + else None, + "missing_transaction_dates": obj.get("missing_transaction_dates"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/recurring_object_matches_found_transactions_inner.py b/clients/python/lunchable/models/recurring_object_matches_found_transactions_inner.py new file mode 100644 index 00000000..9b60b215 --- /dev/null +++ b/clients/python/lunchable/models/recurring_object_matches_found_transactions_inner.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self + + +class RecurringObjectMatchesFoundTransactionsInner(BaseModel): + """ + RecurringObjectMatchesFoundTransactionsInner + """ # noqa: E501 + + var_date: Optional[date] = Field( + default=None, + description="The date for a matching transaction within the specified range.", + alias="date", + ) + transaction_id: Optional[StrictInt] = Field( + default=None, + description="The ID of a matching transaction within the specified range.", + ) + __properties: ClassVar[List[str]] = ["date", "transaction_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 RecurringObjectMatchesFoundTransactionsInner 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 RecurringObjectMatchesFoundTransactionsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"date": obj.get("date"), "transaction_id": obj.get("transaction_id")} + ) + return _obj diff --git a/clients/python/lunchable/models/recurring_object_overrides.py b/clients/python/lunchable/models/recurring_object_overrides.py new file mode 100644 index 00000000..80040ce6 --- /dev/null +++ b/clients/python/lunchable/models/recurring_object_overrides.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self + + +class RecurringObjectOverrides(BaseModel): + """ + The values that will be applied to matching transactions. + """ # noqa: E501 + + payee: Optional[StrictStr] = Field( + default=None, + description="If present, the payee name that will be displayed for any matching transactions.", + ) + notes: Optional[StrictStr] = Field( + default=None, + description="If present, the notes that will be displayed for any matching transactions.", + ) + category_id: Optional[StrictInt] = Field( + default=None, + description="If present, the id of the category that matching transactions will be assigned to.", + ) + __properties: ClassVar[List[str]] = ["payee", "notes", "category_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 RecurringObjectOverrides 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 RecurringObjectOverrides from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "payee": obj.get("payee"), + "notes": obj.get("notes"), + "category_id": obj.get("category_id"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/recurring_object_transaction_criteria.py b/clients/python/lunchable/models/recurring_object_transaction_criteria.py new file mode 100644 index 00000000..aae8664d --- /dev/null +++ b/clients/python/lunchable/models/recurring_object_transaction_criteria.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self + + +class RecurringObjectTransactionCriteria(BaseModel): + """ + The set of properties used to identify matching transactions. + """ # noqa: E501 + + start_date: Optional[date] = Field( + default=None, + description="The beginning of the date range for matching transactions. If null, any transactions before end_date may be considered.", + ) + end_date: Optional[date] = Field( + default=None, + description="The end of the date range for matching transactions. If null, any transactions after start_date may be considered.", + ) + granularity: Optional[StrictStr] = Field( + default=None, + description="The unit of time used to define the cadence of the recurring item.", + ) + quantity: Optional[StrictInt] = Field( + default=None, + description="The number of granularity units between each recurrence.", + ) + anchor_date: Optional[date] = Field( + default=None, + description="The date used in conjunction with the `quantity` and `granularity` properties to calculate expected occurrences of recurring transactions.", + ) + payee: Optional[StrictStr] = Field( + default=None, + description="If any, represents the original transaction payee name that triggered this recurring item's creation.", + ) + amount: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The expected amount for a transaction that will match this recurring item. For recurring items that have a flexible amount this is the average of the specified min and max amounts.", + ) + currency: Optional[StrictStr] = Field( + default=None, + description="Three-letter lowercase currency code of the recurring item.", + ) + to_base: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="The base amount of the recurring item." + ) + plaid_account_id: Optional[StrictInt] = Field( + default=None, + description="The Plaid account ID associated with the recurring item, if any.", + ) + manual_account_id: Optional[StrictInt] = Field( + default=None, + description="The manual account ID associated with the recurring item, if any.", + ) + __properties: ClassVar[List[str]] = [ + "start_date", + "end_date", + "granularity", + "quantity", + "anchor_date", + "payee", + "amount", + "currency", + "to_base", + "plaid_account_id", + "manual_account_id", + ] + + @field_validator("granularity") + def granularity_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["day", "week", "month", "year"]): + raise ValueError( + "must be one of enum values ('day', 'week', 'month', 'year')" + ) + return value + + @field_validator("amount") + def amount_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^-?\d+(\.\d{1,4})?$", value): + raise ValueError( + r"must validate the regular expression /^-?\d+(\.\d{1,4})?$/" + ) + return value + + 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 RecurringObjectTransactionCriteria 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 start_date (nullable) is None + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: + _dict["start_date"] = None + + # set to None if end_date (nullable) is None + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: + _dict["end_date"] = None + + # set to None if payee (nullable) is None + # and model_fields_set contains the field + if self.payee is None and "payee" in self.model_fields_set: + _dict["payee"] = None + + # set to None if plaid_account_id (nullable) is None + # and model_fields_set contains the field + if ( + self.plaid_account_id is None + and "plaid_account_id" in self.model_fields_set + ): + _dict["plaid_account_id"] = None + + # set to None if manual_account_id (nullable) is None + # and model_fields_set contains the field + if ( + self.manual_account_id is None + and "manual_account_id" in self.model_fields_set + ): + _dict["manual_account_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecurringObjectTransactionCriteria from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "start_date": obj.get("start_date"), + "end_date": obj.get("end_date"), + "granularity": obj.get("granularity"), + "quantity": obj.get("quantity"), + "anchor_date": obj.get("anchor_date"), + "payee": obj.get("payee"), + "amount": obj.get("amount"), + "currency": obj.get("currency"), + "to_base": obj.get("to_base"), + "plaid_account_id": obj.get("plaid_account_id"), + "manual_account_id": obj.get("manual_account_id"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/split_transaction_object_amount.py b/clients/python/lunchable/models/split_transaction_object_amount.py new file mode 100644 index 00000000..7f295db7 --- /dev/null +++ b/clients/python/lunchable/models/split_transaction_object_amount.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +import pprint +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictFloat, + StrictInt, + ValidationError, + field_validator, +) +from typing import Any, Optional, Union +from typing_extensions import Annotated +from typing import Set, Dict +from typing_extensions import Self + +SPLITTRANSACTIONOBJECTAMOUNT_ONE_OF_SCHEMAS = ["float", "str"] + + +class SplitTransactionObjectAmount(BaseModel): + """ + Individual amount of split. Currency will inherit from parent transaction. All amounts must sum up to parent transaction amount. + """ + + # data type: float + oneof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: str + oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None + actual_instance: Optional[Union[float, str]] = None + one_of_schemas: Set[str] = {"float", "str"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = SplitTransactionObjectAmount.model_construct() + error_messages = [] + match = 0 + # validate data type: float + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in SplitTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in SplitTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into float + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into SplitTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into SplitTransactionObjectAmount with oneOf schemas: float, str. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json + ): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict + ): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/clients/python/lunchable/models/split_transaction_request.py b/clients/python/lunchable/models/split_transaction_request.py new file mode 100644 index 00000000..15b51aac --- /dev/null +++ b/clients/python/lunchable/models/split_transaction_request.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 import Optional, Set +from typing_extensions import Self + + +class SplitTransactionRequest(BaseModel): + """ + SplitTransactionRequest + """ # noqa: E501 + + child_transactions: List[SplitTransactionObject] = Field( + description="List of child transactions to create. The sum of the `amounts` must match the split transaction amount." + ) + __properties: ClassVar[List[str]] = ["child_transactions"] + + 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 SplitTransactionRequest 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 child_transactions (list) + _items = [] + if self.child_transactions: + for _item_child_transactions in self.child_transactions: + if _item_child_transactions: + _items.append(_item_child_transactions.to_dict()) + _dict["child_transactions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SplitTransactionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "child_transactions": [ + SplitTransactionObject.from_dict(_item) + for _item in obj["child_transactions"] + ] + if obj.get("child_transactions") is not None + else None + } + ) + return _obj diff --git a/clients/python/lunchable/models/tag_object.py b/clients/python/lunchable/models/tag_object.py new file mode 100644 index 00000000..a3a163a7 --- /dev/null +++ b/clients/python/lunchable/models/tag_object.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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 datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self + + +class TagObject(BaseModel): + """ + TagObject + """ # noqa: E501 + + id: StrictInt = Field(description="Unique identifier for the tag.") + name: StrictStr = Field(description="Name of the tag.") + description: Optional[StrictStr] = Field(description="Description of the tag.") + updated_at: datetime = Field( + description="The date and time of when the tag was last updated (in the ISO 8601 extended format)." + ) + created_at: datetime = Field( + description="The date and time of when the tag was created (in the ISO 8601 extended format)." + ) + archived: StrictBool = Field( + description="If true, the tag will not show up when creating or updating transactions in the Lunch Money app. **Can it be assigned via the API**" + ) + archived_at: Optional[datetime] = Field( + description="The date and time of when the tag was last archived or null if not archived" + ) + __properties: ClassVar[List[str]] = [ + "id", + "name", + "description", + "updated_at", + "created_at", + "archived", + "archived_at", + ] + + 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 TagObject 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 description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict["description"] = None + + # set to None if archived_at (nullable) is None + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: + _dict["archived_at"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TagObject 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"), + "description": obj.get("description"), + "updated_at": obj.get("updated_at"), + "created_at": obj.get("created_at"), + "archived": obj.get("archived"), + "archived_at": obj.get("archived_at"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/transaction_object.py b/clients/python/lunchable/models/transaction_object.py new file mode 100644 index 00000000..ff4d5d4b --- /dev/null +++ b/clients/python/lunchable/models/transaction_object.py @@ -0,0 +1,328 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from lunchable.models.currency_enum import CurrencyEnum +from typing import Set +from typing_extensions import Self + + +class TransactionObject(BaseModel): + """ + TransactionObject + """ # noqa: E501 + + id: StrictInt = Field( + description="System created unique identifier for transaction" + ) + var_date: date = Field( + description="Date of transaction in ISO 8601 format", alias="date" + ) + amount: StrictStr = Field( + description="Amount of the transaction in numeric format to 4 decimal places" + ) + currency: CurrencyEnum = Field( + description="Three-letter lowercase currency code of the transaction in ISO 4217 format" + ) + to_base: Union[StrictFloat, StrictInt] = Field( + description="The amount converted to the user's primary currency. If the multi-currency feature is not being used, to_base and amount will be the same." + ) + recurring_id: Optional[StrictInt] = Field( + description="The unique identifier of the associated recurring item that this transaction matched. If the recurring item changed properties of this transaction, an `overrides` property with details on what was overridden will be include in the transaction object. If no `overrides` property exists when there is a `recurring_id` it means that the recurring_item is still in the suggested state, or that it does not contain any rules to override transaction properties." + ) + overrides: Optional[TransactionOverridesObject] + payee: Annotated[str, Field(min_length=0, strict=True, max_length=140)] = Field( + description="Name of payee set by the user, the financial institution, or by a matched recurring item. This will match the value displayed in payee field on the transactions page in the GUI. " + ) + category_id: Optional[StrictInt] = Field( + description="Unique identifier of associated category set by the user or by a matched recurring_item.
Category details can be obtained by passing the value of this property to the [Get A Single Category](../operations/getCategoryById) API" + ) + notes: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=350)] + ] = Field( + description="Any transaction notes set by the user or by a matched recurring item. This will match the value displayed in notes field on the transactions page in the GUI. " + ) + status: StrictStr = Field( + description="Status of the transaction: - `reviewed`: User has reviewed the transaction, or it was automatically marked as reviewed due to reviewed recurring_item logic - `unreviewed`: User has not reviewed the transaction and it does not match any reviewed recurring_items. - `delete_pending`: The synced account deleted this transaction after it was updated by the user. Requires manual intervention. - `pending`: Transaction is still pending with the synced institution (not posted). " + ) + is_pending: StrictBool = Field( + description="Denotes if the transaction is pending (not posted). Applies only to transactions in synced accounts and will always be false for transactions associated with manual accounts." + ) + created_at: datetime = Field( + description="The date and time of when the transaction was created (in the ISO 8601 extended format)." + ) + updated_at: datetime = Field( + description="The date and time of when the transaction was last updated (in the ISO 8601 extended format)." + ) + is_parent: Optional[StrictBool] = Field( + default=None, + description="If true this transaction has been split into two or more other transactions. By default parent transactions are not returned in call to `GET /transactions` but they can be queried directly by their ID.", + ) + children: Optional[List[StrictStr]] = Field( + default=None, + description="Exists only for transactions which are the parent of a split transaction, and contains a list of the associated transactions that it was split into. By default parent transactions are not returned in a `GET /transactions` API call, but can be examined via a subsequent call to `GET /transactions{id}`, where the value of `parent_id` field of a split transaction is the requested transaction.", + ) + parent_id: Optional[List[Union[StrictFloat, StrictInt]]] = Field( + description="A transaction ID if this is a split transaction. Denotes the transaction ID of the original, or parent, transaction. Is null if this is not a split transaction" + ) + is_group: StrictBool = Field( + description="True if this transaction represents a group of transactions. If so, amount and currency represent the totalled amount of transactions bearing this transaction’s id as their group_id. Amount is calculated based on the user’s primary currency." + ) + group_id: Optional[StrictInt] = Field( + description="Is set if this transaction is part of a group. Denotes the ID of the grouped transaction this is now included in. By default the transactions that were grouped are not returned in a call to `GET /transactions` but they can be queried directly by calling the `GET /transactions/group/{id}`, where the id passed is associated with a transaction where the `is_group` attribute is true" + ) + manual_account_id: Optional[StrictInt] = Field( + description='The unique identifier of the manual account associated with this transaction. This will always be null if this transaction is associated with a synced account or if this transaction has no associated account and appears as a "Cash Transaction" in the Lunch Money GUI.' + ) + plaid_account_id: Optional[StrictInt] = Field( + description='The unique identifier of the plaid account associated with this transaction. This will always be null if this transaction is associated with a manual account or if this transaction has no associated account and appears as a "Cash Transaction" in the Lunch Money GUI.' + ) + tag_ids: List[StrictInt] = Field( + description="A list of tag_ids for the tags associated with this transaction. If the transaction has no tags this will be an empty list.
Tag details can be obtained by passing the value of this attribute as the `ids` query parameter to the [List Tags](../operations/getTags) API" + ) + source: Optional[StrictStr] = Field( + description='Source of the transaction: - `api`: Transaction was added by a call to the [POST /transactions](../operations/createTransaction) API - `csv`: Transaction was added via a CSV Import - `manual`: Transaction was created via the "Add to Cash" button on the Transactions page - `merge`: Transactions were originally in an account that was merged into another account - `plaid`: Transaction came from a Financial Institution synced via Plaid - `recurring`: Transaction was created from the Recurring page - `rule`: Transaction was created by a rule to split a transaction - `split`: This is a transaction created by splitting another transaction - `user`: This is a legacy value and is replaced by either csv or manual ' + ) + external_id: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=75)] + ] = Field( + description="A user-defined external ID for any transaction that was added via csv import, `POST /transactions` API call, or manually added via the Lunch Money GUI. No external ID exists for transactions associated with synced accounts, and they cannot be added. For transactions associated with manual accounts, the external ID must be unique as attempts to add a subsequent transaction with the same external_id and manual_account_id will be flagged as duplicates and fail." + ) + plaid_metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="If requested, the transaction's plaid_metadata that came when this transaction was obtained. This will be a json object, but the schema is variable. This will only be present for transactions associated with a plaid account.", + ) + custom_metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="If requested, the transaction's custom_metadata that was included when the transaction was inserted via the API. This will be a json object, but the schema is variable. This will only be present for transactions associated with a manual account.", + ) + __properties: ClassVar[List[str]] = [ + "id", + "date", + "amount", + "currency", + "to_base", + "recurring_id", + "overrides", + "payee", + "category_id", + "notes", + "status", + "is_pending", + "created_at", + "updated_at", + "is_parent", + "children", + "parent_id", + "is_group", + "group_id", + "manual_account_id", + "plaid_account_id", + "tag_ids", + "source", + "external_id", + "plaid_metadata", + "custom_metadata", + ] + + @field_validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["reviewed", "unreviewed", "delete_pending", "pending"]): + raise ValueError( + "must be one of enum values ('reviewed', 'unreviewed', 'delete_pending', 'pending')" + ) + return value + + @field_validator("source") + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set( + [ + "api", + "csv", + "manual", + "merge", + "plaid", + "recurring", + "rule", + "split", + "user", + ] + ): + raise ValueError( + "must be one of enum values ('api', 'csv', 'manual', 'merge', 'plaid', 'recurring', 'rule', 'split', 'user')" + ) + return value + + 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 TransactionObject 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 overrides + if self.overrides: + _dict["overrides"] = self.overrides.to_dict() + # set to None if recurring_id (nullable) is None + # and model_fields_set contains the field + if self.recurring_id is None and "recurring_id" in self.model_fields_set: + _dict["recurring_id"] = None + + # set to None if overrides (nullable) is None + # and model_fields_set contains the field + if self.overrides is None and "overrides" in self.model_fields_set: + _dict["overrides"] = 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 notes (nullable) is None + # and model_fields_set contains the field + if self.notes is None and "notes" in self.model_fields_set: + _dict["notes"] = None + + # set to None if parent_id (nullable) is None + # and model_fields_set contains the field + if self.parent_id is None and "parent_id" in self.model_fields_set: + _dict["parent_id"] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict["group_id"] = None + + # set to None if manual_account_id (nullable) is None + # and model_fields_set contains the field + if ( + self.manual_account_id is None + and "manual_account_id" in self.model_fields_set + ): + _dict["manual_account_id"] = None + + # set to None if plaid_account_id (nullable) is None + # and model_fields_set contains the field + if ( + self.plaid_account_id is None + and "plaid_account_id" in self.model_fields_set + ): + _dict["plaid_account_id"] = None + + # set to None if source (nullable) is None + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: + _dict["source"] = None + + # set to None if external_id (nullable) is None + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: + _dict["external_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransactionObject 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"), + "date": obj.get("date"), + "amount": obj.get("amount"), + "currency": obj.get("currency"), + "to_base": obj.get("to_base"), + "recurring_id": obj.get("recurring_id"), + "overrides": TransactionOverridesObject.from_dict(obj["overrides"]) + if obj.get("overrides") is not None + else None, + "payee": obj.get("payee"), + "category_id": obj.get("category_id"), + "notes": obj.get("notes"), + "status": obj.get("status"), + "is_pending": obj.get("is_pending"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "is_parent": obj.get("is_parent"), + "children": obj.get("children"), + "parent_id": obj.get("parent_id"), + "is_group": obj.get("is_group"), + "group_id": obj.get("group_id"), + "manual_account_id": obj.get("manual_account_id"), + "plaid_account_id": obj.get("plaid_account_id"), + "tag_ids": obj.get("tag_ids"), + "source": obj.get("source"), + "external_id": obj.get("external_id"), + "plaid_metadata": obj.get("plaid_metadata"), + "custom_metadata": obj.get("custom_metadata"), + } + ) + return _obj diff --git a/clients/python/lunchable/models/user_object.py b/clients/python/lunchable/models/user_object.py new file mode 100644 index 00000000..f99bc798 --- /dev/null +++ b/clients/python/lunchable/models/user_object.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lunchable.models.currency_enum import CurrencyEnum +from typing import Set +from typing_extensions import Self + + +class UserObject(BaseModel): + """ + UserObject + """ # noqa: E501 + + name: StrictStr = Field(description="User's name") + email: StrictStr = Field(description="User's email") + id: StrictInt = Field(description="Unique identifier for user") + account_id: StrictInt = Field( + description="Unique identifier for the associated budgeting account" + ) + budget_name: StrictStr = Field( + description="Name of the associated budgeting account" + ) + primary_currency: CurrencyEnum = Field( + description="Primary currency from user's settings" + ) + api_key_label: Optional[StrictStr] = Field( + description="User-defined label of the developer API key used. Returns null if nothing has been set." + ) + __properties: ClassVar[List[str]] = [ + "name", + "email", + "id", + "account_id", + "budget_name", + "primary_currency", + "api_key_label", + ] + + 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 UserObject 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 api_key_label (nullable) is None + # and model_fields_set contains the field + if self.api_key_label is None and "api_key_label" in self.model_fields_set: + _dict["api_key_label"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserObject 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"), + "email": obj.get("email"), + "id": obj.get("id"), + "account_id": obj.get("account_id"), + "budget_name": obj.get("budget_name"), + "primary_currency": obj.get("primary_currency"), + "api_key_label": obj.get("api_key_label"), + } + ) + return _obj diff --git a/clients/python/lunchable/py.typed b/clients/python/lunchable/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/clients/python/lunchable/rest.py b/clients/python/lunchable/rest.py new file mode 100644 index 00000000..3edb33f3 --- /dev/null +++ b/clients/python/lunchable/rest.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import io +import json +import re +import ssl + +import urllib3 + +from lunchable.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args["assert_hostname"] = configuration.assert_hostname + + if configuration.retries is not None: + pool_args["retries"] = configuration.retries + + if configuration.tls_server_name: + pool_args["server_hostname"] = configuration.tls_server_name + + if configuration.socket_options is not None: + pool_args["socket_options"] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args["maxsize"] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None, + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :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. + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + # no content type provided or payload is json + content_type = headers.get("Content-Type") + if not content_type or re.search("json", content_type, re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif content_type == "application/x-www-form-urlencoded": + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif content_type == "multipart/form-data": + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers["Content-Type"] + # Ensures that dict objects are serialized + post_params = [ + (a, json.dumps(b)) if isinstance(b, dict) else (a, b) + for a, b in post_params + ] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False, + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif headers["Content-Type"].startswith("text/") and isinstance( + body, bool + ): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers, + ) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False, + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml new file mode 100644 index 00000000..a98ce8bc --- /dev/null +++ b/clients/python/pyproject.toml @@ -0,0 +1,70 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools"] + +[tool.mypy] +# # Strongly recommend enabling this one as soon as you can +check_untyped_defs = true +disallow_any_generics = true +# # These shouldn't be too much additional work, but may be tricky to +# # get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +extra_checks = true +files = [ + "lunchable", + # "test", # auto-generated tests + "tests" # hand-written tests +] +# # Getting these passing should be easy +strict_equality = true +warn_redundant_casts = true +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_unused_ignores = true + +[[tool.mypy.overrides]] +check_untyped_defs = true +disallow_any_generics = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +extra_checks = true +module = [ + "lunchable.configuration" +] +no_implicit_reexport = true +strict_equality = true +warn_return_any = true +warn_unused_ignores = true + +[tool.poetry] +authors = ["OpenAPI Generator Community "] +description = "Lunch Money API - v2" +include = ["lunchable/py.typed"] +keywords = ["OpenAPI", "OpenAPI-Generator", "Lunch Money API - v2"] +license = "Apache 2.0" +name = "lunchable" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +version = "1.0.0" + +[tool.poetry.dependencies] +pydantic = ">= 2" +python = "^3.8" +python-dateutil = ">= 2.8.2" +typing-extensions = ">= 4.7.1" +urllib3 = ">= 1.25.3 < 3.0.0" + +[tool.poetry.dev-dependencies] +flake8 = ">= 4.0.0" +mypy = ">= 1.5" +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +types-python-dateutil = ">= 2.8.19.14" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/clients/python/requirements.txt b/clients/python/requirements.txt new file mode 100644 index 00000000..67f7f68d --- /dev/null +++ b/clients/python/requirements.txt @@ -0,0 +1,4 @@ +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/clients/python/setup.cfg b/clients/python/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/clients/python/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/clients/python/setup.py b/clients/python/setup.py new file mode 100644 index 00000000..745ad11d --- /dev/null +++ b/clients/python/setup.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "lunchable" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.8" +REQUIRES = [ + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Lunch Money API - v2", + author="OpenAPI Generator community", + author_email="devsupport@lunchmoney.app", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "Lunch Money API - v2"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache 2.0", + long_description_content_type="text/markdown", + long_description="""\ + This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + """, # noqa: E501 + package_data={"lunchable": ["py.typed"]}, +) diff --git a/clients/python/test-requirements.txt b/clients/python/test-requirements.txt new file mode 100644 index 00000000..e98555c1 --- /dev/null +++ b/clients/python/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/clients/python/test/__init__.py b/clients/python/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/clients/python/test/test_account_type_enum.py b/clients/python/test/test_account_type_enum.py new file mode 100644 index 00000000..a208d24d --- /dev/null +++ b/clients/python/test/test_account_type_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestAccountTypeEnum(unittest.TestCase): + """AccountTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAccountTypeEnum(self): + """Test AccountTypeEnum""" + # inst = AccountTypeEnum() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_categories_api.py b/clients/python/test/test_categories_api.py new file mode 100644 index 00000000..7c66a417 --- /dev/null +++ b/clients/python/test/test_categories_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.categories_api import CategoriesApi + + +class TestCategoriesApi(unittest.TestCase): + """CategoriesApi unit test stubs""" + + def setUp(self) -> None: + self.api = CategoriesApi() + + def tearDown(self) -> None: + pass + + def test_create_category(self) -> None: + """Test case for create_category + + Create a new category or category group + """ + pass + + def test_delete_category(self) -> None: + """Test case for delete_category + + Delete a category or category group + """ + pass + + def test_get_all_categories(self) -> None: + """Test case for get_all_categories + + Get all categories + """ + pass + + def test_get_category_by_id(self) -> None: + """Test case for get_category_by_id + + Get a single category + """ + pass + + def test_update_category(self) -> None: + """Test case for update_category + + Update an existing category or category group + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_category_object.py b/clients/python/test/test_category_object.py new file mode 100644 index 00000000..dc8cb393 --- /dev/null +++ b/clients/python/test/test_category_object.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.category_object import CategoryObject + + +class TestCategoryObject(unittest.TestCase): + """CategoryObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CategoryObject: + """Test CategoryObject + 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 `CategoryObject` + """ + model = CategoryObject() + if include_optional: + return CategoryObject( + id = 56, + name = '0', + description = '', + is_income = True, + exclude_from_budget = True, + exclude_from_totals = True, + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + children = [ + lunchable.models.child_category_object.childCategoryObject( + id = 56, + name = '0', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337, ) + ], + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337 + ) + else: + return CategoryObject( + id = 56, + name = '0', + description = '', + is_income = True, + exclude_from_budget = True, + exclude_from_totals = True, + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337, + ) + """ + + def testCategoryObject(self): + """Test CategoryObject""" + # 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/clients/python/test/test_create_category_request_object_children_inner.py b/clients/python/test/test_create_category_request_object_children_inner.py new file mode 100644 index 00000000..ae8479f2 --- /dev/null +++ b/clients/python/test/test_create_category_request_object_children_inner.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.create_category_request_object_children_inner import ( + CreateCategoryRequestObjectChildrenInner, +) + + +class TestCreateCategoryRequestObjectChildrenInner(unittest.TestCase): + """CreateCategoryRequestObjectChildrenInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> CreateCategoryRequestObjectChildrenInner: + """Test CreateCategoryRequestObjectChildrenInner + 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 `CreateCategoryRequestObjectChildrenInner` + """ + model = CreateCategoryRequestObjectChildrenInner() + if include_optional: + return CreateCategoryRequestObjectChildrenInner( + id = 56, + name = '0', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337 + ) + else: + return CreateCategoryRequestObjectChildrenInner( + id = 56, + name = '0', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337, + ) + """ + + def testCreateCategoryRequestObjectChildrenInner(self): + """Test CreateCategoryRequestObjectChildrenInner""" + # 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/clients/python/test/test_create_new_transactions201_response.py b/clients/python/test/test_create_new_transactions201_response.py new file mode 100644 index 00000000..a1d08e8a --- /dev/null +++ b/clients/python/test/test_create_new_transactions201_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.create_new_transactions201_response import ( + CreateNewTransactions201Response, +) + + +class TestCreateNewTransactions201Response(unittest.TestCase): + """CreateNewTransactions201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateNewTransactions201Response: + """Test CreateNewTransactions201Response + 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 `CreateNewTransactions201Response` + """ + model = CreateNewTransactions201Response() + if include_optional: + return CreateNewTransactions201Response( + transactions = [ + lunchable.models.transaction_object.transactionObject( + id = 56, + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = null, + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = lunchable.models.plaid_metadata.plaid_metadata(), + custom_metadata = lunchable.models.custom_metadata.custom_metadata(), ) + ], + skipped_existing_external_ids = [ + lunchable.models.skipped_existing_external_id_object.skippedExistingExternalIdObject( + request_transaction_index = 1.337, + external_id = '', + manual_account_id = 1.337, + existing_transaction_id = 1.337, ) + ] + ) + else: + return CreateNewTransactions201Response( + transactions = [ + lunchable.models.transaction_object.transactionObject( + id = 56, + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = null, + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = lunchable.models.plaid_metadata.plaid_metadata(), + custom_metadata = lunchable.models.custom_metadata.custom_metadata(), ) + ], + ) + """ + + def testCreateNewTransactions201Response(self): + """Test CreateNewTransactions201Response""" + # 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/clients/python/test/test_create_new_transactions_request.py b/clients/python/test/test_create_new_transactions_request.py new file mode 100644 index 00000000..4cfa5d72 --- /dev/null +++ b/clients/python/test/test_create_new_transactions_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.create_new_transactions_request import ( + CreateNewTransactionsRequest, +) + + +class TestCreateNewTransactionsRequest(unittest.TestCase): + """CreateNewTransactionsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateNewTransactionsRequest: + """Test CreateNewTransactionsRequest + 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 `CreateNewTransactionsRequest` + """ + model = CreateNewTransactionsRequest() + if include_optional: + return CreateNewTransactionsRequest( + transactions = [ + lunchable.models.insert_transaction_object.insertTransactionObject( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = null, + currency = null, + payee = '', + category_id = 56, + notes = '', + manual_account_id = 56, + plaid_account_id = 56, + recurring_id = 56, + status = 'reviewed', + tag_ids = [ + 56 + ], + external_id = '', + custom_metadata = { }, ) + ], + apply_rules = True, + skip_duplicates = True, + skip_balance_update = True + ) + else: + return CreateNewTransactionsRequest( + transactions = [ + lunchable.models.insert_transaction_object.insertTransactionObject( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = null, + currency = null, + payee = '', + category_id = 56, + notes = '', + manual_account_id = 56, + plaid_account_id = 56, + recurring_id = 56, + status = 'reviewed', + tag_ids = [ + 56 + ], + external_id = '', + custom_metadata = { }, ) + ], + ) + """ + + def testCreateNewTransactionsRequest(self): + """Test CreateNewTransactionsRequest""" + # 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/clients/python/test/test_currency_enum.py b/clients/python/test/test_currency_enum.py new file mode 100644 index 00000000..af5462e1 --- /dev/null +++ b/clients/python/test/test_currency_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestCurrencyEnum(unittest.TestCase): + """CurrencyEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCurrencyEnum(self): + """Test CurrencyEnum""" + # inst = CurrencyEnum() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_delete_category_response_with_dependencies_dependents.py b/clients/python/test/test_delete_category_response_with_dependencies_dependents.py new file mode 100644 index 00000000..2e235c79 --- /dev/null +++ b/clients/python/test/test_delete_category_response_with_dependencies_dependents.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.delete_category_response_with_dependencies_dependents import ( + DeleteCategoryResponseWithDependenciesDependents, +) + + +class TestDeleteCategoryResponseWithDependenciesDependents(unittest.TestCase): + """DeleteCategoryResponseWithDependenciesDependents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> DeleteCategoryResponseWithDependenciesDependents: + """Test DeleteCategoryResponseWithDependenciesDependents + 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 `DeleteCategoryResponseWithDependenciesDependents` + """ + model = DeleteCategoryResponseWithDependenciesDependents() + if include_optional: + return DeleteCategoryResponseWithDependenciesDependents( + budget = 1.337, + category_rules = 1.337, + transactions = 1.337, + children = 1.337, + recurring = 1.337, + plaid_cats = 1.337 + ) + else: + return DeleteCategoryResponseWithDependenciesDependents( + budget = 1.337, + category_rules = 1.337, + transactions = 1.337, + children = 1.337, + recurring = 1.337, + plaid_cats = 1.337, + ) + """ + + def testDeleteCategoryResponseWithDependenciesDependents(self): + """Test DeleteCategoryResponseWithDependenciesDependents""" + # 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/clients/python/test/test_delete_tag_response_with_dependencies_dependents.py b/clients/python/test/test_delete_tag_response_with_dependencies_dependents.py new file mode 100644 index 00000000..a6d7b380 --- /dev/null +++ b/clients/python/test/test_delete_tag_response_with_dependencies_dependents.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.delete_tag_response_with_dependencies_dependents import ( + DeleteTagResponseWithDependenciesDependents, +) + + +class TestDeleteTagResponseWithDependenciesDependents(unittest.TestCase): + """DeleteTagResponseWithDependenciesDependents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> DeleteTagResponseWithDependenciesDependents: + """Test DeleteTagResponseWithDependenciesDependents + 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 `DeleteTagResponseWithDependenciesDependents` + """ + model = DeleteTagResponseWithDependenciesDependents() + if include_optional: + return DeleteTagResponseWithDependenciesDependents( + tag_rules = 1.337, + transactions = 1.337 + ) + else: + return DeleteTagResponseWithDependenciesDependents( + tag_rules = 1.337, + transactions = 1.337, + ) + """ + + def testDeleteTagResponseWithDependenciesDependents(self): + """Test DeleteTagResponseWithDependenciesDependents""" + # 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/clients/python/test/test_delete_transactions_request.py b/clients/python/test/test_delete_transactions_request.py new file mode 100644 index 00000000..84d96017 --- /dev/null +++ b/clients/python/test/test_delete_transactions_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.delete_transactions_request import DeleteTransactionsRequest + + +class TestDeleteTransactionsRequest(unittest.TestCase): + """DeleteTransactionsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeleteTransactionsRequest: + """Test DeleteTransactionsRequest + 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 `DeleteTransactionsRequest` + """ + model = DeleteTransactionsRequest() + if include_optional: + return DeleteTransactionsRequest( + ids = [ + 1.337 + ] + ) + else: + return DeleteTransactionsRequest( + ids = [ + 1.337 + ], + ) + """ + + def testDeleteTransactionsRequest(self): + """Test DeleteTransactionsRequest""" + # 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/clients/python/test/test_error_response_object.py b/clients/python/test/test_error_response_object.py new file mode 100644 index 00000000..7d235e9b --- /dev/null +++ b/clients/python/test/test_error_response_object.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.error_response_object import ErrorResponseObject + + +class TestErrorResponseObject(unittest.TestCase): + """ErrorResponseObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorResponseObject: + """Test ErrorResponseObject + 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 `ErrorResponseObject` + """ + model = ErrorResponseObject() + if include_optional: + return ErrorResponseObject( + message = '', + errors = [ + None + ] + ) + else: + return ErrorResponseObject( + message = '', + errors = [ + None + ], + ) + """ + + def testErrorResponseObject(self): + """Test ErrorResponseObject""" + # 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/clients/python/test/test_get_all_categories200_response.py b/clients/python/test/test_get_all_categories200_response.py new file mode 100644 index 00000000..6d8fd62f --- /dev/null +++ b/clients/python/test/test_get_all_categories200_response.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_categories200_response import GetAllCategories200Response + + +class TestGetAllCategories200Response(unittest.TestCase): + """GetAllCategories200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllCategories200Response: + """Test GetAllCategories200Response + 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 `GetAllCategories200Response` + """ + model = GetAllCategories200Response() + if include_optional: + return GetAllCategories200Response( + categories = [ + lunchable.models.category_object.categoryObject( + id = 56, + name = '0', + description = '', + is_income = True, + exclude_from_budget = True, + exclude_from_totals = True, + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + children = [ + lunchable.models.child_category_object.childCategoryObject( + id = 56, + name = '0', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + group_id = 56, + is_group = True, + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337, ) + ], + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + order = 1.337, ) + ] + ) + else: + return GetAllCategories200Response( + ) + """ + + def testGetAllCategories200Response(self): + """Test GetAllCategories200Response""" + # 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/clients/python/test/test_get_all_manual_accounts200_response.py b/clients/python/test/test_get_all_manual_accounts200_response.py new file mode 100644 index 00000000..16da4f8e --- /dev/null +++ b/clients/python/test/test_get_all_manual_accounts200_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_manual_accounts200_response import ( + GetAllManualAccounts200Response, +) + + +class TestGetAllManualAccounts200Response(unittest.TestCase): + """GetAllManualAccounts200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllManualAccounts200Response: + """Test GetAllManualAccounts200Response + 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 `GetAllManualAccounts200Response` + """ + model = GetAllManualAccounts200Response() + if include_optional: + return GetAllManualAccounts200Response( + manual_accounts = [ + lunchable.models.manual_account_object.manualAccountObject( + id = 56, + name = '0', + type = null, + subtype = '', + display_name = '', + balance = '-80728', + balance_as_of = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + closed_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + currency = '012', + institution_name = '0', + external_id = '', + exclude_from_transactions = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return GetAllManualAccounts200Response( + ) + """ + + def testGetAllManualAccounts200Response(self): + """Test GetAllManualAccounts200Response""" + # 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/clients/python/test/test_get_all_plaid_accounts200_response.py b/clients/python/test/test_get_all_plaid_accounts200_response.py new file mode 100644 index 00000000..41717c86 --- /dev/null +++ b/clients/python/test/test_get_all_plaid_accounts200_response.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_plaid_accounts200_response import ( + GetAllPlaidAccounts200Response, +) + + +class TestGetAllPlaidAccounts200Response(unittest.TestCase): + """GetAllPlaidAccounts200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllPlaidAccounts200Response: + """Test GetAllPlaidAccounts200Response + 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 `GetAllPlaidAccounts200Response` + """ + model = GetAllPlaidAccounts200Response() + if include_optional: + return GetAllPlaidAccounts200Response( + plaid_accounts = [ + lunchable.models.plaid_account_object.plaidAccountObject( + id = 56, + date_linked = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + name = '', + display_name = '', + type = '', + subtype = '', + mask = '', + institution_name = '', + status = 'active', + allow_transaction_modifications = True, + limit = 1.337, + balance = '', + currency = '012', + balance_last_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + import_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + last_import = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_fetch = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + plaid_last_successful_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return GetAllPlaidAccounts200Response( + ) + """ + + def testGetAllPlaidAccounts200Response(self): + """Test GetAllPlaidAccounts200Response""" + # 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/clients/python/test/test_get_all_recurring200_response.py b/clients/python/test/test_get_all_recurring200_response.py new file mode 100644 index 00000000..77aa7c65 --- /dev/null +++ b/clients/python/test/test_get_all_recurring200_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_recurring200_response import GetAllRecurring200Response + + +class TestGetAllRecurring200Response(unittest.TestCase): + """GetAllRecurring200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllRecurring200Response: + """Test GetAllRecurring200Response + 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 `GetAllRecurring200Response` + """ + model = GetAllRecurring200Response() + if include_optional: + return GetAllRecurring200Response( + recurring_items = [ + lunchable.models.recurring_object.recurringObject( + id = 56, + description = '', + status = 'suggested', + transaction_criteria = lunchable.models.recurring_object_transaction_criteria.recurringObject_transaction_criteria( + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + granularity = 'day', + quantity = 56, + anchor_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + amount = '-80728', + currency = '', + to_base = 1.337, + plaid_account_id = 56, + manual_account_id = 56, ), + overrides = lunchable.models.recurring_object_overrides.recurringObject_overrides( + payee = '', + notes = '', + category_id = 56, ), + matches = lunchable.models.recurring_object_matches.recurringObject_matches( + request_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + request_end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + expected_occurrence_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], + found_transactions = [ + lunchable.models.recurring_object_matches_found_transactions_inner.recurringObject_matches_found_transactions_inner( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + transaction_id = 56, ) + ], + missing_transaction_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], ), + created_by = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + source = 'manual', ) + ] + ) + else: + return GetAllRecurring200Response( + ) + """ + + def testGetAllRecurring200Response(self): + """Test GetAllRecurring200Response""" + # 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/clients/python/test/test_get_all_tags200_response.py b/clients/python/test/test_get_all_tags200_response.py new file mode 100644 index 00000000..d2e006df --- /dev/null +++ b/clients/python/test/test_get_all_tags200_response.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_tags200_response import GetAllTags200Response + + +class TestGetAllTags200Response(unittest.TestCase): + """GetAllTags200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllTags200Response: + """Test GetAllTags200Response + 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 `GetAllTags200Response` + """ + model = GetAllTags200Response() + if include_optional: + return GetAllTags200Response( + tags = [ + lunchable.models.tag_object.tagObject( + id = 56, + name = '', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return GetAllTags200Response( + ) + """ + + def testGetAllTags200Response(self): + """Test GetAllTags200Response""" + # 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/clients/python/test/test_get_all_transactions200_response.py b/clients/python/test/test_get_all_transactions200_response.py new file mode 100644 index 00000000..ad75a09a --- /dev/null +++ b/clients/python/test/test_get_all_transactions200_response.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.get_all_transactions200_response import ( + GetAllTransactions200Response, +) + + +class TestGetAllTransactions200Response(unittest.TestCase): + """GetAllTransactions200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAllTransactions200Response: + """Test GetAllTransactions200Response + 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 `GetAllTransactions200Response` + """ + model = GetAllTransactions200Response() + if include_optional: + return GetAllTransactions200Response( + transactions = [ + lunchable.models.transaction_object.transactionObject( + id = 56, + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = null, + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = lunchable.models.plaid_metadata.plaid_metadata(), + custom_metadata = lunchable.models.custom_metadata.custom_metadata(), ) + ], + has_more = True, + error = '' + ) + else: + return GetAllTransactions200Response( + transactions = [ + lunchable.models.transaction_object.transactionObject( + id = 56, + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = null, + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = lunchable.models.plaid_metadata.plaid_metadata(), + custom_metadata = lunchable.models.custom_metadata.custom_metadata(), ) + ], + has_more = True, + ) + """ + + def testGetAllTransactions200Response(self): + """Test GetAllTransactions200Response""" + # 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/clients/python/test/test_group_transactions201_response.py b/clients/python/test/test_group_transactions201_response.py new file mode 100644 index 00000000..0f35c221 --- /dev/null +++ b/clients/python/test/test_group_transactions201_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.group_transactions201_response import GroupTransactions201Response + + +class TestGroupTransactions201Response(unittest.TestCase): + """GroupTransactions201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupTransactions201Response: + """Test GroupTransactions201Response + 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 `GroupTransactions201Response` + """ + model = GroupTransactions201Response() + if include_optional: + return GroupTransactions201Response( + transactions = [ + lunchable.models.transaction_object.transactionObject( + id = 56, + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = null, + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = lunchable.models.plaid_metadata.plaid_metadata(), + custom_metadata = lunchable.models.custom_metadata.custom_metadata(), ) + ] + ) + else: + return GroupTransactions201Response( + ) + """ + + def testGroupTransactions201Response(self): + """Test GroupTransactions201Response""" + # 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/clients/python/test/test_group_transactions_request.py b/clients/python/test/test_group_transactions_request.py new file mode 100644 index 00000000..c04cc34a --- /dev/null +++ b/clients/python/test/test_group_transactions_request.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.group_transactions_request import GroupTransactionsRequest + + +class TestGroupTransactionsRequest(unittest.TestCase): + """GroupTransactionsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupTransactionsRequest: + """Test GroupTransactionsRequest + 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 `GroupTransactionsRequest` + """ + model = GroupTransactionsRequest() + if include_optional: + return GroupTransactionsRequest( + ids = [ + 56 + ], + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + tag_ids = [ + 56 + ] + ) + else: + return GroupTransactionsRequest( + ids = [ + 56 + ], + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + ) + """ + + def testGroupTransactionsRequest(self): + """Test GroupTransactionsRequest""" + # 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/clients/python/test/test_insert_transaction_object_amount.py b/clients/python/test/test_insert_transaction_object_amount.py new file mode 100644 index 00000000..beb9d72f --- /dev/null +++ b/clients/python/test/test_insert_transaction_object_amount.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.insert_transaction_object_amount import ( + InsertTransactionObjectAmount, +) + + +class TestInsertTransactionObjectAmount(unittest.TestCase): + """InsertTransactionObjectAmount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InsertTransactionObjectAmount: + """Test InsertTransactionObjectAmount + 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 `InsertTransactionObjectAmount` + """ + model = InsertTransactionObjectAmount() + if include_optional: + return InsertTransactionObjectAmount( + ) + else: + return InsertTransactionObjectAmount( + ) + """ + + def testInsertTransactionObjectAmount(self): + """Test InsertTransactionObjectAmount""" + # 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/clients/python/test/test_manual_account_object.py b/clients/python/test/test_manual_account_object.py new file mode 100644 index 00000000..1db2f365 --- /dev/null +++ b/clients/python/test/test_manual_account_object.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.manual_account_object import ManualAccountObject + + +class TestManualAccountObject(unittest.TestCase): + """ManualAccountObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ManualAccountObject: + """Test ManualAccountObject + 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 `ManualAccountObject` + """ + model = ManualAccountObject() + if include_optional: + return ManualAccountObject( + id = 56, + name = '0', + type = 'cash', + subtype = '', + display_name = '', + balance = '-80728', + balance_as_of = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + closed_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + currency = '012', + institution_name = '0', + external_id = '', + exclude_from_transactions = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return ManualAccountObject( + ) + """ + + def testManualAccountObject(self): + """Test ManualAccountObject""" + # 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/clients/python/test/test_manual_accounts_api.py b/clients/python/test/test_manual_accounts_api.py new file mode 100644 index 00000000..4fceb6a1 --- /dev/null +++ b/clients/python/test/test_manual_accounts_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.manual_accounts_api import ManualAccountsApi + + +class TestManualAccountsApi(unittest.TestCase): + """ManualAccountsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ManualAccountsApi() + + def tearDown(self) -> None: + pass + + def test_create_manual_account(self) -> None: + """Test case for create_manual_account + + Create a manual account + """ + pass + + def test_delete_manual_account(self) -> None: + """Test case for delete_manual_account + + Delete a manual account + """ + pass + + def test_get_all_manual_accounts(self) -> None: + """Test case for get_all_manual_accounts + + Get all manual accounts + """ + pass + + def test_get_manual_account_by_id(self) -> None: + """Test case for get_manual_account_by_id + + Get a single manual account + """ + pass + + def test_update_manual_account(self) -> None: + """Test case for update_manual_account + + Update an existing manual account + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_me_api.py b/clients/python/test/test_me_api.py new file mode 100644 index 00000000..aa2b66b9 --- /dev/null +++ b/clients/python/test/test_me_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.me_api import MeApi + + +class TestMeApi(unittest.TestCase): + """MeApi unit test stubs""" + + def setUp(self) -> None: + self.api = MeApi() + + def tearDown(self) -> None: + pass + + def test_get_me(self) -> None: + """Test case for get_me + + Get current user + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_plaid_account_object.py b/clients/python/test/test_plaid_account_object.py new file mode 100644 index 00000000..ed315310 --- /dev/null +++ b/clients/python/test/test_plaid_account_object.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.plaid_account_object import PlaidAccountObject + + +class TestPlaidAccountObject(unittest.TestCase): + """PlaidAccountObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlaidAccountObject: + """Test PlaidAccountObject + 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 `PlaidAccountObject` + """ + model = PlaidAccountObject() + if include_optional: + return PlaidAccountObject( + id = 56, + date_linked = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + name = '', + display_name = '', + type = '', + subtype = '', + mask = '', + institution_name = '', + status = 'active', + allow_transaction_modifications = True, + limit = 1.337, + balance = '', + currency = '012', + balance_last_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + import_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + last_import = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_fetch = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + plaid_last_successful_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return PlaidAccountObject( + id = 56, + date_linked = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + name = '', + display_name = '', + type = '', + subtype = '', + mask = '', + institution_name = '', + status = 'active', + allow_transaction_modifications = True, + limit = 1.337, + balance = '', + currency = '012', + balance_last_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + import_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + last_import = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_fetch = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + plaid_last_successful_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testPlaidAccountObject(self): + """Test PlaidAccountObject""" + # 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/clients/python/test/test_plaid_accounts_api.py b/clients/python/test/test_plaid_accounts_api.py new file mode 100644 index 00000000..33558814 --- /dev/null +++ b/clients/python/test/test_plaid_accounts_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.plaid_accounts_api import PlaidAccountsApi + + +class TestPlaidAccountsApi(unittest.TestCase): + """PlaidAccountsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PlaidAccountsApi() + + def tearDown(self) -> None: + pass + + def test_get_all_plaid_accounts(self) -> None: + """Test case for get_all_plaid_accounts + + Get all accounts synced via Plaid + """ + pass + + def test_get_plaid_account_by_id(self) -> None: + """Test case for get_plaid_account_by_id + + Get a single account that is synced via Plaid + """ + pass + + def test_trigger_plaid_account_fetch(self) -> None: + """Test case for trigger_plaid_account_fetch + + Trigger Fetch from Plaid + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_recurring_api.py b/clients/python/test/test_recurring_api.py new file mode 100644 index 00000000..bf35e949 --- /dev/null +++ b/clients/python/test/test_recurring_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.recurring_api import RecurringApi + + +class TestRecurringApi(unittest.TestCase): + """RecurringApi unit test stubs""" + + def setUp(self) -> None: + self.api = RecurringApi() + + def tearDown(self) -> None: + pass + + def test_get_all_recurring(self) -> None: + """Test case for get_all_recurring + + Get a all recurring items + """ + pass + + def test_get_recurring_by_id(self) -> None: + """Test case for get_recurring_by_id + + Get a single recurring item + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_recurring_object.py b/clients/python/test/test_recurring_object.py new file mode 100644 index 00000000..859b2d47 --- /dev/null +++ b/clients/python/test/test_recurring_object.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.recurring_object import RecurringObject + + +class TestRecurringObject(unittest.TestCase): + """RecurringObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecurringObject: + """Test RecurringObject + 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 `RecurringObject` + """ + model = RecurringObject() + if include_optional: + return RecurringObject( + id = 56, + description = '', + status = 'suggested', + transaction_criteria = lunchable.models.recurring_object_transaction_criteria.recurringObject_transaction_criteria( + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + granularity = 'day', + quantity = 56, + anchor_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + amount = '-80728', + currency = '', + to_base = 1.337, + plaid_account_id = 56, + manual_account_id = 56, ), + overrides = lunchable.models.recurring_object_overrides.recurringObject_overrides( + payee = '', + notes = '', + category_id = 56, ), + matches = lunchable.models.recurring_object_matches.recurringObject_matches( + request_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + request_end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + expected_occurrence_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], + found_transactions = [ + lunchable.models.recurring_object_matches_found_transactions_inner.recurringObject_matches_found_transactions_inner( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + transaction_id = 56, ) + ], + missing_transaction_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], ), + created_by = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + source = 'manual' + ) + else: + return RecurringObject( + id = 56, + description = '', + status = 'suggested', + transaction_criteria = lunchable.models.recurring_object_transaction_criteria.recurringObject_transaction_criteria( + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + granularity = 'day', + quantity = 56, + anchor_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + amount = '-80728', + currency = '', + to_base = 1.337, + plaid_account_id = 56, + manual_account_id = 56, ), + overrides = lunchable.models.recurring_object_overrides.recurringObject_overrides( + payee = '', + notes = '', + category_id = 56, ), + matches = lunchable.models.recurring_object_matches.recurringObject_matches( + request_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + request_end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + expected_occurrence_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], + found_transactions = [ + lunchable.models.recurring_object_matches_found_transactions_inner.recurringObject_matches_found_transactions_inner( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + transaction_id = 56, ) + ], + missing_transaction_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], ), + created_by = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + source = 'manual', + ) + """ + + def testRecurringObject(self): + """Test RecurringObject""" + # 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/clients/python/test/test_recurring_object_matches.py b/clients/python/test/test_recurring_object_matches.py new file mode 100644 index 00000000..9dd78c57 --- /dev/null +++ b/clients/python/test/test_recurring_object_matches.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.recurring_object_matches import RecurringObjectMatches + + +class TestRecurringObjectMatches(unittest.TestCase): + """RecurringObjectMatches unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecurringObjectMatches: + """Test RecurringObjectMatches + 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 `RecurringObjectMatches` + """ + model = RecurringObjectMatches() + if include_optional: + return RecurringObjectMatches( + request_start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + request_end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + expected_occurrence_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ], + found_transactions = [ + lunchable.models.recurring_object_matches_found_transactions_inner.recurringObject_matches_found_transactions_inner( + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + transaction_id = 56, ) + ], + missing_transaction_dates = [ + datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ] + ) + else: + return RecurringObjectMatches( + ) + """ + + def testRecurringObjectMatches(self): + """Test RecurringObjectMatches""" + # 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/clients/python/test/test_recurring_object_matches_found_transactions_inner.py b/clients/python/test/test_recurring_object_matches_found_transactions_inner.py new file mode 100644 index 00000000..428bdc70 --- /dev/null +++ b/clients/python/test/test_recurring_object_matches_found_transactions_inner.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.recurring_object_matches_found_transactions_inner import ( + RecurringObjectMatchesFoundTransactionsInner, +) + + +class TestRecurringObjectMatchesFoundTransactionsInner(unittest.TestCase): + """RecurringObjectMatchesFoundTransactionsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance( + self, include_optional + ) -> RecurringObjectMatchesFoundTransactionsInner: + """Test RecurringObjectMatchesFoundTransactionsInner + 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 `RecurringObjectMatchesFoundTransactionsInner` + """ + model = RecurringObjectMatchesFoundTransactionsInner() + if include_optional: + return RecurringObjectMatchesFoundTransactionsInner( + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + transaction_id = 56 + ) + else: + return RecurringObjectMatchesFoundTransactionsInner( + ) + """ + + def testRecurringObjectMatchesFoundTransactionsInner(self): + """Test RecurringObjectMatchesFoundTransactionsInner""" + # 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/clients/python/test/test_recurring_object_overrides.py b/clients/python/test/test_recurring_object_overrides.py new file mode 100644 index 00000000..e2429fe1 --- /dev/null +++ b/clients/python/test/test_recurring_object_overrides.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.recurring_object_overrides import RecurringObjectOverrides + + +class TestRecurringObjectOverrides(unittest.TestCase): + """RecurringObjectOverrides unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecurringObjectOverrides: + """Test RecurringObjectOverrides + 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 `RecurringObjectOverrides` + """ + model = RecurringObjectOverrides() + if include_optional: + return RecurringObjectOverrides( + payee = '', + notes = '', + category_id = 56 + ) + else: + return RecurringObjectOverrides( + ) + """ + + def testRecurringObjectOverrides(self): + """Test RecurringObjectOverrides""" + # 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/clients/python/test/test_recurring_object_transaction_criteria.py b/clients/python/test/test_recurring_object_transaction_criteria.py new file mode 100644 index 00000000..c5ea60f8 --- /dev/null +++ b/clients/python/test/test_recurring_object_transaction_criteria.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.recurring_object_transaction_criteria import ( + RecurringObjectTransactionCriteria, +) + + +class TestRecurringObjectTransactionCriteria(unittest.TestCase): + """RecurringObjectTransactionCriteria unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecurringObjectTransactionCriteria: + """Test RecurringObjectTransactionCriteria + 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 `RecurringObjectTransactionCriteria` + """ + model = RecurringObjectTransactionCriteria() + if include_optional: + return RecurringObjectTransactionCriteria( + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + granularity = 'day', + quantity = 56, + anchor_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + payee = '', + amount = '-80728', + currency = '', + to_base = 1.337, + plaid_account_id = 56, + manual_account_id = 56 + ) + else: + return RecurringObjectTransactionCriteria( + ) + """ + + def testRecurringObjectTransactionCriteria(self): + """Test RecurringObjectTransactionCriteria""" + # 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/clients/python/test/test_split_transaction_object_amount.py b/clients/python/test/test_split_transaction_object_amount.py new file mode 100644 index 00000000..bbd97d28 --- /dev/null +++ b/clients/python/test/test_split_transaction_object_amount.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.split_transaction_object_amount import ( + SplitTransactionObjectAmount, +) + + +class TestSplitTransactionObjectAmount(unittest.TestCase): + """SplitTransactionObjectAmount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SplitTransactionObjectAmount: + """Test SplitTransactionObjectAmount + 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 `SplitTransactionObjectAmount` + """ + model = SplitTransactionObjectAmount() + if include_optional: + return SplitTransactionObjectAmount( + ) + else: + return SplitTransactionObjectAmount( + ) + """ + + def testSplitTransactionObjectAmount(self): + """Test SplitTransactionObjectAmount""" + # 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/clients/python/test/test_split_transaction_request.py b/clients/python/test/test_split_transaction_request.py new file mode 100644 index 00000000..db333355 --- /dev/null +++ b/clients/python/test/test_split_transaction_request.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.split_transaction_request import SplitTransactionRequest + + +class TestSplitTransactionRequest(unittest.TestCase): + """SplitTransactionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SplitTransactionRequest: + """Test SplitTransactionRequest + 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 `SplitTransactionRequest` + """ + model = SplitTransactionRequest() + if include_optional: + return SplitTransactionRequest( + child_transactions = [ + lunchable.models.split_transaction_object.splitTransactionObject( + amount = null, + payee = '', + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + category_id = 1.337, + notes = '', ) + ] + ) + else: + return SplitTransactionRequest( + child_transactions = [ + lunchable.models.split_transaction_object.splitTransactionObject( + amount = null, + payee = '', + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + category_id = 1.337, + notes = '', ) + ], + ) + """ + + def testSplitTransactionRequest(self): + """Test SplitTransactionRequest""" + # 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/clients/python/test/test_tag_object.py b/clients/python/test/test_tag_object.py new file mode 100644 index 00000000..8fa60231 --- /dev/null +++ b/clients/python/test/test_tag_object.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.tag_object import TagObject + + +class TestTagObject(unittest.TestCase): + """TagObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TagObject: + """Test TagObject + 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 `TagObject` + """ + model = TagObject() + if include_optional: + return TagObject( + id = 56, + name = '', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return TagObject( + id = 56, + name = '', + description = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + archived = True, + archived_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testTagObject(self): + """Test TagObject""" + # 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/clients/python/test/test_tags_api.py b/clients/python/test/test_tags_api.py new file mode 100644 index 00000000..a6197a5e --- /dev/null +++ b/clients/python/test/test_tags_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.tags_api import TagsApi + + +class TestTagsApi(unittest.TestCase): + """TagsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TagsApi() + + def tearDown(self) -> None: + pass + + def test_create_tag(self) -> None: + """Test case for create_tag + + Create a new tag + """ + pass + + def test_delete_tag(self) -> None: + """Test case for delete_tag + + Delete a tag + """ + pass + + def test_get_all_tags(self) -> None: + """Test case for get_all_tags + + Get All Tags + """ + pass + + def test_get_tag_by_id(self) -> None: + """Test case for get_tag_by_id + + Get a single tags + """ + pass + + def test_update_tag(self) -> None: + """Test case for update_tag + + Update an existing tag + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_transaction_object.py b/clients/python/test/test_transaction_object.py new file mode 100644 index 00000000..6a1380fa --- /dev/null +++ b/clients/python/test/test_transaction_object.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.transaction_object import TransactionObject + + +class TestTransactionObject(unittest.TestCase): + """TransactionObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransactionObject: + """Test TransactionObject + 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 `TransactionObject` + """ + model = TransactionObject() + if include_optional: + return TransactionObject( + id = 56, + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = 'aed', + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + is_parent = True, + children = [ + '' + ], + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + plaid_metadata = None, + custom_metadata = None + ) + else: + return TransactionObject( + id = 56, + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + amount = '', + currency = 'aed', + to_base = 1.337, + recurring_id = 56, + overrides = lunchable.models.transaction_overrides_object.transactionOverridesObject( + original_payee = '', + original_category_id = 56, + original_notes = '', ), + payee = '', + category_id = 56, + notes = '', + status = 'reviewed', + is_pending = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + parent_id = [ + 1.337 + ], + is_group = True, + group_id = 56, + manual_account_id = 56, + plaid_account_id = 56, + tag_ids = [ + 56 + ], + source = 'api', + external_id = '', + ) + """ + + def testTransactionObject(self): + """Test TransactionObject""" + # 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/clients/python/test/test_transactions_api.py b/clients/python/test/test_transactions_api.py new file mode 100644 index 00000000..075796b4 --- /dev/null +++ b/clients/python/test/test_transactions_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.transactions_api import TransactionsApi + + +class TestTransactionsApi(unittest.TestCase): + """TransactionsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransactionsApi() + + def tearDown(self) -> None: + pass + + def test_delete_transaction_by_id(self) -> None: + """Test case for delete_transaction_by_id + + Delete a transaction + """ + pass + + def test_get_transaction_by_id(self) -> None: + """Test case for get_transaction_by_id + + Get a single transaction + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_transactions_bulk_api.py b/clients/python/test/test_transactions_bulk_api.py new file mode 100644 index 00000000..ae17919c --- /dev/null +++ b/clients/python/test/test_transactions_bulk_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.transactions_bulk_api import TransactionsBulkApi + + +class TestTransactionsBulkApi(unittest.TestCase): + """TransactionsBulkApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransactionsBulkApi() + + def tearDown(self) -> None: + pass + + def test_create_new_transactions(self) -> None: + """Test case for create_new_transactions + + Insert one or more transactions. + """ + pass + + def test_delete_transactions(self) -> None: + """Test case for delete_transactions + + Bulk delete existing transactions + """ + pass + + def test_get_all_transactions(self) -> None: + """Test case for get_all_transactions + + Get all transactions + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_transactions_group_api.py b/clients/python/test/test_transactions_group_api.py new file mode 100644 index 00000000..92e52dd3 --- /dev/null +++ b/clients/python/test/test_transactions_group_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.transactions_group_api import TransactionsGroupApi + + +class TestTransactionsGroupApi(unittest.TestCase): + """TransactionsGroupApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransactionsGroupApi() + + def tearDown(self) -> None: + pass + + def test_group_transactions(self) -> None: + """Test case for group_transactions + + Create a transaction group + """ + pass + + def test_ungroup_transactions(self) -> None: + """Test case for ungroup_transactions + + Delete a transaction group + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_transactions_split_api.py b/clients/python/test/test_transactions_split_api.py new file mode 100644 index 00000000..ae1b9b1c --- /dev/null +++ b/clients/python/test/test_transactions_split_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.api.transactions_split_api import TransactionsSplitApi + + +class TestTransactionsSplitApi(unittest.TestCase): + """TransactionsSplitApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransactionsSplitApi() + + def tearDown(self) -> None: + pass + + def test_split_transaction(self) -> None: + """Test case for split_transaction + + Split a transaction + """ + pass + + def test_unsplit_transaction(self) -> None: + """Test case for unsplit_transaction + + Unsplit a previously split transactions + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/test/test_user_object.py b/clients/python/test/test_user_object.py new file mode 100644 index 00000000..b7774b3e --- /dev/null +++ b/clients/python/test/test_user_object.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" +Lunch Money API - v2 + +This is a version of the Lunch Money API described using the the OpenAPI 3.X specification. The goal of this project is to validate an \"API Design First\" approach for the Lunch Money API, which should allow us to gather developer feedback prior to implementation in order to develop API endpoints more quickly. This version of the API will differ from the existing v1 beta version. For more information on the changes please see the [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) Some useful links: - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [v2 API Changelog](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/changelog) - [OpenAPI API YAML Specification](https://lm-v2-api-mock-data-f24357049a1b.herokuapp.com/v2/openapi/) - [Awesome Lunch Money Projects](https://lunchmoney.dev/#awesome-projects) + +The version of the OpenAPI document: 2.7.4 +Contact: devsupport@lunchmoney.app +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from lunchable.models.user_object import UserObject + + +class TestUserObject(unittest.TestCase): + """UserObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserObject: + """Test UserObject + 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 `UserObject` + """ + model = UserObject() + if include_optional: + return UserObject( + name = '', + email = '', + id = 56, + account_id = 56, + budget_name = '', + primary_currency = 'aed', + api_key_label = '' + ) + else: + return UserObject( + name = '', + email = '', + id = 56, + account_id = 56, + budget_name = '', + primary_currency = 'aed', + api_key_label = '', + ) + """ + + def testUserObject(self): + """Test UserObject""" + # 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/clients/python/tox.ini b/clients/python/tox.ini new file mode 100644 index 00000000..e05984c7 --- /dev/null +++ b/clients/python/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=lunchable