From 255f8c64e97c806a32c3eb770751c6ca4ac18304 Mon Sep 17 00:00:00 2001 From: "fiatjaf@spooner" Date: Sat, 20 Feb 2016 21:52:46 -0500 Subject: [PATCH 1/2] Allow repositioning a card --- card.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/card.go b/card.go index c827a95..d326376 100644 --- a/card.go +++ b/card.go @@ -197,3 +197,12 @@ func (c *Card) MoveToList(listId string) ([]byte, error) { return c.client.Put("/cards/"+c.Id+"/idList", payload) } + +// MoveToPos will move card to the specified position +// https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-pos +func (c *Card) MoveToPos(pos string) ([]byte, error) { + payload := url.Values{} + payload.Set("value", pos) + + return c.client.Put("/cards/"+c.Id+"/pos", payload) +} From 9b5ea97799745ea32ccadb6cad2c43612da18192 Mon Sep 17 00:00:00 2001 From: "fiatjaf@spooner" Date: Sat, 20 Feb 2016 21:58:00 -0500 Subject: [PATCH 2/2] Allow cards to be unclosed (dearchived, sent to board) --- card.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/card.go b/card.go index d326376..3960b49 100644 --- a/card.go +++ b/card.go @@ -189,6 +189,15 @@ func (c *Card) Archive() ([]byte, error) { return c.client.Put("/cards/"+c.Id+"/closed", payload) } +// SendToBoard will dearchive the card, or send the card to the board back from archive +// https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-closed +func (c *Card) SendToBoard() ([]byte, error) { + payload := url.Values{} + payload.Set("value", "false") + + return c.client.Put("/cards/"+c.Id+"/closed", payload) +} + // MoveToList will move the card to another list // https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-idlist func (c *Card) MoveToList(listId string) ([]byte, error) {