-
Notifications
You must be signed in to change notification settings - Fork 208
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
An optional 'id' argument for Manager.save method. #215
An optional 'id' argument for Manager.save method. #215
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.
Thanks for the suggestion; but I'm not convinced this is the right approach to this API. If the use case is deletion, then we should add a delete
entry point on objects (or, at least, on objects that support it)
I've changed the solution based on your feedback. I added a PaymentManager with a custom delete method. |
I guess a better alternative could be to pass a delete_strategy callable to the BaseManager constructor, in this case there will be no need to define a manager class for every entity that has non-standard API. |
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.
Apologies for the delay in reviewing this; the PR appears to have drifted out of sync with main. Could I ask you to merge it with main?
Not a problem @freakboy3742. I've merged it with the latest main. |
Looks like I have some additional housekeeping to do (dropping Python 3.6 support); I'll add that to my todo list, then review this for you. |
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.
Looks good; apologies again for the late review, and thanks for the contribution!
The new argument should enable Xero API methods utilizing Resource ID URI parameter in POST requests. Such as deletion of payments and bank transactions:
https://developer.xero.com/documentation/api/payments#POST
https://developer.xero.com/documentation/api/banktransactions#POST