Added mechanism to pass arguments to client.#14
Added mechanism to pass arguments to client.#14VojtechVitek merged 2 commits intoVojtechVitek:masterfrom
Conversation
The first endpoint to use is board. If approved, will add to other endpoints that accept arguments.
|
|
||
| import "net/url" | ||
|
|
||
| type Argument struct { |
|
This is really good addition, @gedex. What would you think about the following API? type Args []Arg
args := trello.Args{{"filter", "updateCard:idList"}, {"before", "2016-02-05"}}
actions, err := board.Actions(args...)
actions, err := board.Actions(trello.Arg{"filter": "updateCard:idList"}) |
|
This is great, and something I was just thinking of adding. I merged this into my own fork and am using it. I fully support merging this or something like it. |
|
@gedex any input on my last comment? |
|
Why |
|
Accepting a list of argument keypairs is a good idea that it can be of the form of variadic arguments, instead of requiring a |
The only benefit would be the possibility of defining methods on Args without breaking the API. For example, we could add validation/normalization methods on Args etc. It's
Yes, it will be variadic and optional for sure. |
|
I'm gonna merge and rename to Arg. Thank you for this contribution! |
Added mechanism to pass arguments to client.
|
Apologies for late reply, been busy with works. Thanks for the merge @VojtechVitek. |
The first endpoint to use is boards, specifically
actionsresource that accept various arguments. If approved, will add other endpoints that accept arguments.Example
Resolves #15