Skip to content

Commit f1c7f35

Browse files
authored
Merge pull request #1 from rikvermeer/rikvermeer-patch-1
Update bunq_model.py
2 parents 8cb9f77 + e4fecd8 commit f1c7f35

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bunq/sdk/model/core/bunq_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ def _from_json_list(cls,
101101

102102
for item in array:
103103
item_unwrapped = item if wrapper is None else item[wrapper]
104+
# item_unwrapped needs to be deserialized to NotificationFilterUrl (wrapper)
105+
# when cls is NotificationFilterUrlUser or NotificationFilterUrlMonetaryAccount
106+
if wrapper=='NotificationFilterUrl':
107+
from bunq.sdk.model.generated.endpoint import NotificationFilterUrlUser, NotificationFilterUrlMonetaryAccount
108+
from bunq.sdk.model.generated.object_ import NotificationFilterUrl
109+
if cls == NotificationFilterUrlUser or cls == NotificationFilterUrlMonetaryAccount:
110+
cls_orig = cls
111+
cls = NotificationFilterUrl
112+
#print(f'NotificationFilterUrlUser deserialization, changing cls from: {cls_orig} to: {cls}')
113+
#TODO: Test deserialize for NotificationFilterUrlUser and NotificationFilterUrlMonetaryAccount
104114
item_deserialized = converter.deserialize(cls, item_unwrapped)
105115
array_deserialized.append(item_deserialized)
106116

0 commit comments

Comments
 (0)