From 5c4ef79b531e399887b498837caf48fbec5957c4 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 17 Dec 2020 00:43:12 +0100 Subject: [PATCH] Add method to get all card attachments --- card.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/card.go b/card.go index a61b298..e8a4efd 100644 --- a/card.go +++ b/card.go @@ -320,6 +320,13 @@ func (c *Card) AddURLAttachment(attachment *Attachment, extraArgs ...Arguments) } +// GetAttachments returns all attachments a card has +func (c *Card) GetAttachments(args Arguments) (attachments []*Attachment, err error) { + path := fmt.Sprintf("cards/%s/attachments", c.ID) + c.client.Get(path, args, &attachments) + return +} + // GetParentCard retrieves the originating Card if the Card was created // from a copy of another Card. Returns an error only when a low-level failure occurred. // If this Card has no parent, a nil card and nil error are returned. In other words, the