-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix supperfouls fields error bunq/sdk_python#77 #91
Fix supperfouls fields error bunq/sdk_python#77 #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly magic values and formatting.
bunq/sdk/json/adapters.py
Outdated
@@ -31,16 +30,11 @@ def deserialize(cls, cls_target, obj_raw): | |||
|
|||
model_ = super()._deserialize_default(cls_target, obj_raw) | |||
|
|||
if isinstance(model_, core.AnchoredObjectInterface) and model_.is_all_field_none(): | |||
if isinstance(model_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny formatting.
bunq/sdk/json/adapters.py
Outdated
@@ -62,6 +56,11 @@ def _get_object_class(cls, class_name): | |||
:rtype: core.BunqModel | |||
""" | |||
|
|||
class_name = class_name.lstrip('_') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic.
bunq/sdk/model/core.py
Outdated
@@ -166,6 +166,10 @@ def _determine_monetary_account_id(cls, monetary_account_id=None): | |||
|
|||
return monetary_account_id | |||
|
|||
@classmethod | |||
def _remove_field_for_request(cls, json_str: str): | |||
return json_str.replace('__field_for_request', '').replace('_field_for_request', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic.
from bunq.sdk.model.generated.endpoint import Payment | ||
from bunq.sdk.model.generated.endpoint import PaymentChat | ||
from bunq.sdk.model.generated.object_ import Amount | ||
from bunq.sdk.model.generated.object_ import Amount, Pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split.
from bunq.sdk.model.generated.endpoint import ChatMessageText | ||
from typing import List | ||
|
||
from bunq.sdk.model.generated.endpoint import ChatMessageText, PaymentBatch, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split
|
||
all_payment: List[Payment] = [] | ||
|
||
while len(all_payment) < 10: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic
while len(all_payment) < 10: | ||
all_payment.append( | ||
Payment( | ||
Amount('0.01', 'EUR'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic values.
all_payment.append( | ||
Payment( | ||
Amount('0.01', 'EUR'), | ||
Pointer('EMAIL', 'bravo@bunq.com'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic ❇️
Payment( | ||
Amount('0.01', 'EUR'), | ||
Pointer('EMAIL', 'bravo@bunq.com'), | ||
'Python sdk payment batch test.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
@JordyHeemskerk please 👀 |
References #77