Skip to content

Update bunq_model.py (bunq/sdk_python#145) #157

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bunq/sdk/model/core/bunq_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ def _from_json_list(cls,

for item in array:
item_unwrapped = item if wrapper is None else item[wrapper]
# item_unwrapped needs to be deserialized to NotificationFilterUrl (wrapper)
# when cls is NotificationFilterUrlUser or NotificationFilterUrlMonetaryAccount
if wrapper=='NotificationFilterUrl':
from bunq.sdk.model.generated.endpoint import NotificationFilterUrlUser, NotificationFilterUrlMonetaryAccount
from bunq.sdk.model.generated.object_ import NotificationFilterUrl
if cls == NotificationFilterUrlUser or cls == NotificationFilterUrlMonetaryAccount:
cls_orig = cls
cls = NotificationFilterUrl
#print(f'NotificationFilterUrlUser deserialization, changing cls from: {cls_orig} to: {cls}')
#TODO: Test deserialize for NotificationFilterUrlUser and NotificationFilterUrlMonetaryAccount
item_deserialized = converter.deserialize(cls, item_unwrapped)
array_deserialized.append(item_deserialized)

Expand Down