java-asana
java-asana copied to clipboard
Introduction of a TaskDataBuilder
Using the data-method providing names as strings may lead to typo-problems and errors that can be hard to find. So we built a TaskDataBuilder where you can set properties via specific methods like notes(String notes) or completed(boolean completed) and then let the builder generate a map to hand over to the apis data-method. It would be great if such a builder would be part of the client-api maybe also for the other entities. We could provide our implementation if you like.
Thanks, Christian
┆Issue is synchronized with this Asana task
Hi! We'll discuss this internally to figure out what to do. I think it would definitely be nice to have a typed way to interact with the Api, but we are concerned with making drastic changes at this moment.
Hi. Happy to hear that.
Such a TaskDataBuilder is on simple class that could reside in the api-project. The usage can be as non-intrusive as this (in case i did not make myself clear in the first description): TaskDataBuilder dataBuilder = TaskDataBuilder.create().name("The name").notes("The notes") ...tasks.createInWorkspace(workspaceId).data(dataBuilder.build()).execute());
I attached the class we built. Thanks again, Christian