-
Notifications
You must be signed in to change notification settings - Fork 5
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
Remove *asana.Client function argument from model's methods #3
base: develop
Are you sure you want to change the base?
Conversation
now there is no need to pass asana.Client to every method of object, now it's stored and when new model is creating it inherits client from creator
embed client
This is really interesting: the embedded client was actually in my original design for this library and removed in bbe591e. My reasoning was as follows:
I'm prepared to be convinced this way is better, but it's a breaking change to the API of the library which will necessitate a new major version to avoid breaking existing code. Do the points above affect your use case, or are you purely using the API client in a fetch-then-modify style which won't require construction of requests from previously stored IDs or serialised records? Very interested to hear your thoughts on the pros and cons! Thanks, |
Thanks for the quick response @kothar. Interesting to see your previous commit. I've been using Trello's SDK lately and they have embedded client inside models. see creation of Boards list I just thought this approach is too verbose, but after seeing your point it seems reasonable. I think there is a way to solve those problems, by decoupling input and output types of API. So what about instead of I'll think about the design like this and reply here. Thanks for your time. |
feat: tasks.go added custom fields for update task request Approved-by: Mike Houston
Before this PR every method of asana's model needed to pass
*asana.Client
. Now it's embedded inside structs and there is no need for that.When new models are creating they inherit the embedded
client
field from the creator.