adlio / trello

Trello API wrapper for Go
MIT License
219 stars 71 forks source link

Cards lack GetList() method #67

Open fdcds opened 4 years ago

fdcds commented 4 years ago

Card has a List field, but no Card.GetList() method to fill it.

The information does not appear to be returned by the Trello API for calls to List.GetCards(), and cannot be optionally requested through it, since https://developer.atlassian.com/cloud/trello/rest/#api-lists-id-cards-get does not describe a fields argument (and it is not respected by the API).

TJM commented 3 years ago

Card shouldn't have "getList()" as that is a method on Board (and Client). However, finding the parent object can probably be useful, so I added it in that PR #77 when it was available. There was also a method or two where list was not available. I am not sure why you would want Board.GetCards, but in that case, we may need to come up with a way to get a map of lists map[string]*List (lists[IDList] = *List), cause if you are retrieving all the cards on a board (not sure why that would be useful), we don't want to "getList(IDList)" for every card. Feel free to test out my PR and let me know if that fills your need.

~tommy