The lack of an update to the YNAB OpenAPI wrapper library since YNAB added loanaccounts causes an exception to be thrown when the otherDebt
account type is returned from the YNAB API.
2022-01-29T15:33:20.126260+00:00 app[web.1]: Traceback (most recent call last):
2022-01-29T15:33:20.126261+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
2022-01-29T15:33:20.126261+00:00 app[web.1]: response = self.full_dispatch_request()
2022-01-29T15:33:20.126262+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
2022-01-29T15:33:20.126263+00:00 app[web.1]: rv = self.handle_user_exception(e)
2022-01-29T15:33:20.126263+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
2022-01-29T15:33:20.126263+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2022-01-29T15:33:20.126264+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
2022-01-29T15:33:20.126265+00:00 app[web.1]: raise value
2022-01-29T15:33:20.126265+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
2022-01-29T15:33:20.126265+00:00 app[web.1]: rv = self.dispatch_request()
2022-01-29T15:33:20.126265+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
2022-01-29T15:33:20.126266+00:00 app[web.1]: return self.view_functions[rule.endpoint](**req.view_args)
2022-01-29T15:33:20.126266+00:00 app[web.1]: File "/app/pynab_monzo/app.py", line 24, in monzo_hook
2022-01-29T15:33:20.126267+00:00 app[web.1]: status_code = webhook.handle_incoming_transaction(request.json)
2022-01-29T15:33:20.126267+00:00 app[web.1]: File "/app/pynab_monzo/controllers/webhook.py", line 59, in handle_incoming_transaction
2022-01-29T15:33:20.126267+00:00 app[web.1]: outgoing_json = translate_monzo_to_ynab(json)
2022-01-29T15:33:20.126267+00:00 app[web.1]: File "/app/pynab_monzo/controllers/webhook.py", line 13, in translate_monzo_to_ynab
2022-01-29T15:33:20.126268+00:00 app[web.1]: account_id = client.find_monzo_id()
2022-01-29T15:33:20.126268+00:00 app[web.1]: File "/app/pynab_monzo/ynab.py", line 31, in find_monzo_id
2022-01-29T15:33:20.126268+00:00 app[web.1]: res = accounts.get_accounts(self._LAST_USED)
2022-01-29T15:33:20.126268+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api/accounts_api.py", line 179, in get_accounts
2022-01-29T15:33:20.126268+00:00 app[web.1]: return self.get_accounts_with_http_info(budget_id, **kwargs) # noqa: E501
2022-01-29T15:33:20.126269+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api/accounts_api.py", line 251, in get_accounts_with_http_info
2022-01-29T15:33:20.126270+00:00 app[web.1]: return self.api_client.call_api(
2022-01-29T15:33:20.126270+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 348, in call_api
2022-01-29T15:33:20.126270+00:00 app[web.1]: return self.__call_api(resource_path, method,
2022-01-29T15:33:20.126270+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 192, in __call_api
2022-01-29T15:33:20.126270+00:00 app[web.1]: return_data = self.deserialize(response_data, response_type)
2022-01-29T15:33:20.126271+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 264, in deserialize
2022-01-29T15:33:20.126271+00:00 app[web.1]: return self.__deserialize(data, response_type)
2022-01-29T15:33:20.126271+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126271+00:00 app[web.1]: return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126271+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 639, in __deserialize_model
2022-01-29T15:33:20.126271+00:00 app[web.1]: kwargs[attr] = self.__deserialize(value, attr_type)
2022-01-29T15:33:20.126272+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126272+00:00 app[web.1]: return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126272+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 639, in __deserialize_model
2022-01-29T15:33:20.126272+00:00 app[web.1]: kwargs[attr] = self.__deserialize(value, attr_type)
2022-01-29T15:33:20.126272+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 280, in __deserialize
2022-01-29T15:33:20.126272+00:00 app[web.1]: return [self.__deserialize(sub_data, sub_kls)
2022-01-29T15:33:20.126272+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 280, in <listcomp>
2022-01-29T15:33:20.126272+00:00 app[web.1]: return [self.__deserialize(sub_data, sub_kls)
2022-01-29T15:33:20.126273+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 303, in __deserialize
2022-01-29T15:33:20.126273+00:00 app[web.1]: return self.__deserialize_model(data, klass)
2022-01-29T15:33:20.126273+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/api_client.py", line 641, in __deserialize_model
2022-01-29T15:33:20.126273+00:00 app[web.1]: instance = klass(**kwargs)
2022-01-29T15:33:20.126274+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/models/account.py", line 84, in __init__
2022-01-29T15:33:20.126274+00:00 app[web.1]: self.type = type
2022-01-29T15:33:20.126274+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ynab/models/account.py", line 165, in type
2022-01-29T15:33:20.126274+00:00 app[web.1]: raise ValueError(
2022-01-29T15:33:20.126275+00:00 app[web.1]: ValueError: Invalid value for `type` (otherDebt), must be one of ['checking', 'savings', 'cash', 'creditCard', 'lineOfCredit', 'otherAsset', 'otherLiability', 'payPal', 'merchantAccount', 'investmentAccount', 'mortgage']```