Documentation ¶
Index ¶
- Constants
- func IDToTime(id string) (t time.Time, err error)
- func IsNotFound(err error) bool
- func IsPermissionDenied(err error) bool
- func IsRateLimit(err error) bool
- type Action
- type ActionCollection
- func (c ActionCollection) ContainsCardCreation() bool
- func (c ActionCollection) FilterToCardCreationActions() ActionCollection
- func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection
- func (c ActionCollection) FilterToListChangeActions() ActionCollection
- func (c ActionCollection) FirstCardCreateAction() *Action
- func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error)
- func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error)
- func (c ActionCollection) LastCommentAction() *Action
- func (c ActionCollection) Len() int
- func (c ActionCollection) Less(i, j int) bool
- func (c ActionCollection) Swap(i, j int)
- type ActionData
- type ActionDataCard
- type AddedMembersResponse
- type Arguments
- type Attachment
- type AttachmentPreview
- type BackgroundImage
- type Board
- func (b *Board) AddMember(member *Member, extraArgs ...Arguments) (response *AddedMembersResponse, err error)
- func (b *Board) ContainsCopyOfCard(cardID string, extraArgs ...Arguments) (bool, error)
- func (b *Board) CreateLabel(label *Label, extraArgs ...Arguments) error
- func (b *Board) CreateList(name string, extraArgs ...Arguments) (list *List, err error)
- func (b *Board) CreatedAt() time.Time
- func (b *Board) Delete(extraArgs ...Arguments) error
- func (b *Board) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
- func (b *Board) GetCards(extraArgs ...Arguments) (cards []*Card, err error)
- func (b *Board) GetCustomFields(extraArgs ...Arguments) (customFields []*CustomField, err error)
- func (b *Board) GetLabels(extraArgs ...Arguments) (labels []*Label, err error)
- func (b *Board) GetLists(extraArgs ...Arguments) (lists []*List, err error)
- func (b *Board) GetMembers(extraArgs ...Arguments) (members []*Member, err error)
- func (b *Board) SetClient(newClient *Client)
- func (b *Board) Update(extraArgs ...Arguments) error
- type BoardLabelNames
- type BoardPrefs
- type BoardWebhookRequest
- type ByFirstEntered
- type ByLongestDuration
- type Card
- func (c *Card) AddComment(comment string, extraArgs ...Arguments) (*Action, error)
- func (c *Card) AddFileAttachment(attachment *Attachment, filename string, file io.Reader, ...) error
- func (c *Card) AddIDLabel(labelID string) error
- func (c *Card) AddMemberID(memberID string) (member []*Member, err error)
- func (c *Card) AddURLAttachment(attachment *Attachment, extraArgs ...Arguments) error
- func (c *Card) Archive() error
- func (c *Card) CopyToList(listID string, extraArgs ...Arguments) (*Card, error)
- func (c *Card) CreatedAt() time.Time
- func (c *Card) CreatorMember() (*Member, error)
- func (c *Card) CreatorMemberID() (string, error)
- func (c *Card) CustomFields(boardCustomFields []*CustomField) map[string]interface{}
- func (c *Card) Delete() error
- func (c *Card) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
- func (c *Card) GetAncestorCards(extraArgs ...Arguments) (ancestors []*Card, err error)
- func (c *Card) GetAttachments(args Arguments) (attachments []*Attachment, err error)
- func (c *Card) GetCommentActions() (actions ActionCollection, err error)
- func (c *Card) GetLastCommentAction() (*Action, error)
- func (c *Card) GetListChangeActions() (actions ActionCollection, err error)
- func (c *Card) GetListDurations() (durations []*ListDuration, err error)
- func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error)
- func (c *Card) GetMembers(extraArgs ...Arguments) (members []*Member, err error)
- func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error)
- func (c *Card) GetOriginatingCard(extraArgs ...Arguments) (*Card, error)
- func (c *Card) GetParentCard(extraArgs ...Arguments) (*Card, error)
- func (c *Card) MoveToBottomOfList() error
- func (c *Card) MoveToList(listID string, extraArgs ...Arguments) error
- func (c *Card) MoveToTopOfList() error
- func (c *Card) RemoveIDLabel(labelID string, label *Label) error
- func (c *Card) RemoveMember(memberID string) error
- func (c *Card) SetClient(newClient *Client)
- func (c *Card) SetPos(newPos float64) error
- func (c *Card) Unarchive() error
- func (c *Card) Update(extraArgs ...Arguments) error
- type CardBadges
- type CardCover
- type CardCoverScaledVariant
- type CardWebhookRequest
- type CheckItem
- type CheckItemState
- type Checklist
- type Client
- func (c *Client) CreateBoard(board *Board, extraArgs ...Arguments) error
- func (c *Client) CreateCard(card *Card, extraArgs ...Arguments) error
- func (c *Client) CreateCheckItem(checklist *Checklist, name string, extraArgs ...Arguments) (item *CheckItem, err error)
- func (c *Client) CreateChecklist(card *Card, name string, extraArgs ...Arguments) (checklist *Checklist, err error)
- func (c *Client) CreateList(onBoard *Board, name string, extraArgs ...Arguments) (list *List, err error)
- func (c *Client) CreateWebhook(webhook *Webhook) error
- func (c *Client) Delete(path string, args Arguments, target interface{}) error
- func (c *Client) Get(path string, args Arguments, target interface{}) error
- func (c *Client) GetBoard(boardID string, extraArgs ...Arguments) (board *Board, err error)
- func (c *Client) GetBoardsInOrganization(orgID string, extraArgs ...Arguments) (boards []*Board, err error)
- func (c *Client) GetCard(cardID string, extraArgs ...Arguments) (card *Card, err error)
- func (c *Client) GetChecklist(checklistID string, args Arguments) (checklist *Checklist, err error)
- func (c *Client) GetCustomField(fieldID string, extraArgs ...Arguments) (customField *CustomField, err error)
- func (c *Client) GetLabel(labelID string, extraArgs ...Arguments) (label *Label, err error)
- func (c *Client) GetList(listID string, extraArgs ...Arguments) (list *List, err error)
- func (c *Client) GetMember(memberID string, extraArgs ...Arguments) (member *Member, err error)
- func (c *Client) GetMyBoards(extraArgs ...Arguments) (boards []*Board, err error)
- func (c *Client) GetMyMember(args Arguments) (member *Member, err error)
- func (c *Client) GetMyNotifications(extraArgs ...Arguments) (notifications []*Notification, err error)
- func (c *Client) GetOrganization(orgID string, extraArgs ...Arguments) (organization *Organization, err error)
- func (c *Client) GetToken(tokenID string, extraArgs ...Arguments) (token *Token, err error)
- func (c *Client) GetWebhook(webhookID string, extraArgs ...Arguments) (webhook *Webhook, err error)
- func (c *Client) Post(path string, args Arguments, target interface{}) error
- func (c *Client) PostWithBody(path string, args Arguments, target interface{}, filename string, ...) error
- func (c *Client) Put(path string, args Arguments, target interface{}) error
- func (c *Client) PutBoard(board *Board, extraArgs ...Arguments) error
- func (c *Client) SearchBoards(query string, extraArgs ...Arguments) (boards []*Board, err error)
- func (c *Client) SearchCards(query string, extraArgs ...Arguments) (cards []*Card, err error)
- func (c *Client) SearchMembers(query string, extraArgs ...Arguments) (members []*Member, err error)
- func (c *Client) Throttle()
- func (c *Client) WithContext(ctx context.Context) *Client
- type CustomField
- type CustomFieldItem
- type CustomFieldOption
- type CustomFieldValue
- type Label
- type List
- func (l *List) AddCard(card *Card, extraArgs ...Arguments) error
- func (l *List) Archive() error
- func (l *List) CreatedAt() time.Time
- func (l *List) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
- func (l *List) GetCards(extraArgs ...Arguments) (cards []*Card, err error)
- func (l *List) SetClient(newClient *Client)
- func (l *List) Unarchive() error
- func (l *List) Update(extraArgs ...Arguments) error
- type ListDuration
- type ListWebhookRequest
- type Member
- type MemberDuration
- type Membership
- type Notification
- type NotificationData
- type NotificationDataBoard
- type NotificationDataCard
- type Organization
- type Permission
- type SearchModifier
- type SearchOptions
- type SearchResult
- type SearchTerm
- type Token
- type Webhook
Constants ¶
const DefaultBaseURL = "https://api.trello.com/1"
DefaultBaseURL is the default API base url used by Client to send requests to Trello.
Variables ¶
This section is empty.
Functions ¶
func IDToTime ¶
IDToTime is a convenience function. It takes a Trello ID string and extracts the encoded create time as time.Time or an error.
func IsNotFound ¶
IsNotFound takes an error and returns true exactly if the error is a not-found error.
func IsPermissionDenied ¶
IsPermissionDenied takes an error and returns true exactly if the error is a permission-denied error.
func IsRateLimit ¶
IsRateLimit takes an error and returns true exactly if the error is a rate-limit error.
Types ¶
type Action ¶
type Action struct { ID string `json:"id"` IDMemberCreator string `json:"idMemberCreator"` Type string `json:"type"` Date time.Time `json:"date"` Data *ActionData `json:"data,omitempty"` MemberCreator *Member `json:"memberCreator,omitempty"` Member *Member `json:"member,omitempty"` // contains filtered or unexported fields }
Action represents Trello API actions Actions are immutable event traces generated whenever an action occurs in Trello. See https://developers.trello.com/reference/#actions.
func (*Action) DidArchiveCard ¶
DidArchiveCard returns true if the card was updated
func (*Action) DidChangeCardMembership ¶
DidChangeCardMembership returns true if card's membership was changed
func (*Action) DidChangeListForCard ¶
DidChangeListForCard returns true if this action created the card (in which case it caused it to enter its first list), archived the card (in which case it caused it to leave its last List), or was an updateCard action involving a change to the list. This is supporting functionality for ListDuration.
func (*Action) DidCommentCard ¶
DidCommentCard returns true if card was commented
func (*Action) DidCreateCard ¶
DidCreateCard returns true if this action created a card, false otherwise.
func (*Action) DidUnarchiveCard ¶
DidUnarchiveCard returns true if the card was unarchived
type ActionCollection ¶
type ActionCollection []*Action
ActionCollection is an alias of []*Action, which sorts by the Action's ID. Which is the same as sorting by the Action's time of occurrence
func (ActionCollection) ContainsCardCreation ¶
func (c ActionCollection) ContainsCardCreation() bool
ContainsCardCreation returns true if collection contains a card-create action
func (ActionCollection) FilterToCardCreationActions ¶
func (c ActionCollection) FilterToCardCreationActions() ActionCollection
FilterToCardCreationActions returns this collection's card-create actions
func (ActionCollection) FilterToCardMembershipChangeActions ¶
func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection
FilterToCardMembershipChangeActions returns the collection's card-change, archive and unarchive actions
func (ActionCollection) FilterToListChangeActions ¶
func (c ActionCollection) FilterToListChangeActions() ActionCollection
FilterToListChangeActions returns card-change-list actions
func (ActionCollection) FirstCardCreateAction ¶
func (c ActionCollection) FirstCardCreateAction() *Action
FirstCardCreateAction returns first card-create action
func (ActionCollection) GetListDurations ¶
func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error)
GetListDurations returns a slice of ListDurations based on the receiver Actions.
func (ActionCollection) GetMemberDurations ¶
func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error)
GetMemberDurations is similar to GetListDurations. It returns a slice of MemberDuration objects, which describes the length of time each member was attached to this card. Durations are calculated such that being added to a card starts a timer for that member, and being removed starts it again (so that if a person is added and removed multiple times, the duration captures only the times which they were attached). Archiving the card also stops the timer.
func (ActionCollection) LastCommentAction ¶
func (c ActionCollection) LastCommentAction() *Action
LastCommentAction returns last comment action
func (ActionCollection) Len ¶
func (c ActionCollection) Len() int
func (ActionCollection) Less ¶
func (c ActionCollection) Less(i, j int) bool
func (ActionCollection) Swap ¶
func (c ActionCollection) Swap(i, j int)
type ActionData ¶
type ActionData struct { Text string `json:"text,omitempty"` List *List `json:"list,omitempty"` Card *ActionDataCard `json:"card,omitempty"` CardSource *ActionDataCard `json:"cardSource,omitempty"` Board *Board `json:"board,omitempty"` Old *ActionDataCard `json:"old,omitempty"` ListBefore *List `json:"listBefore,omitempty"` ListAfter *List `json:"listAfter,omitempty"` DateLastEdited time.Time `json:"dateLastEdited"` CheckItem *CheckItem `json:"checkItem"` Checklist *Checklist `json:"checklist"` }
ActionData represent the nested data of actions
type ActionDataCard ¶
type ActionDataCard struct { ID string `json:"id"` Name string `json:"name"` IDShort int `json:"idShort"` ShortLink string `json:"shortLink"` Pos float64 `json:"pos"` Closed bool `json:"closed"` }
ActionDataCard represent the nested 'card' data attribute of actions
type AddedMembersResponse ¶
type AddedMembersResponse struct { ID string `json:"id"` Members []*Member `json:"members"` Memberships []*Membership `json:"memberships"` }
AddedMembersResponse represents a response after adding a new member.
type Arguments ¶
Arguments are used for passing URL parameters to the client for making API calls.
func (Arguments) ToURLValues ¶
ToURLValues returns the argument's URL value representation.
type Attachment ¶
type Attachment struct { ID string `json:"id"` Card *Card `json:"-"` Name string `json:"name"` Pos float32 `json:"pos"` Bytes int `json:"int"` Date string `json:"date"` EdgeColor string `json:"edgeColor"` IDMember string `json:"idMember"` IsUpload bool `json:"isUpload"` MimeType string `json:"mimeType"` Previews []AttachmentPreview `json:"previews"` URL string `json:"url"` // contains filtered or unexported fields }
Attachment represent the attachments of cards. This is a nested resource of Card. https://developers.trello.com/reference/#attachments
func (*Attachment) SetClient ¶
func (a *Attachment) SetClient(newClient *Client)
SetClient can be used to override this Attachment's internal connection to the Trello API. Normally, this is set automatically after API calls.
type AttachmentPreview ¶
type AttachmentPreview struct { ID string `json:"_id"` URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` Bytes int `json:"bytes"` Scaled bool `json:"scaled"` }
AttachmentPreview is a nested attribute of Attachment.
type BackgroundImage ¶
type BackgroundImage struct { Width int `json:"width"` Height int `json:"height"` URL string `json:"url"` }
BackgroundImage is a nested resource of Board.
type Board ¶
type Board struct { ID string `json:"id"` Name string `json:"name"` Desc string `json:"desc"` Closed bool `json:"closed"` IDOrganization string `json:"idOrganization"` Pinned bool `json:"pinned"` Starred bool `json:"starred"` URL string `json:"url"` ShortURL string `json:"shortUrl"` Prefs BoardPrefs `json:"prefs"` Subscribed bool `json:"subscribed"` LabelNames BoardLabelNames `json:"labelNames"` Lists []*List `json:"lists"` Actions []*Action `json:"actions"` Organization Organization `json:"organization"` // contains filtered or unexported fields }
Board represents a Trello Board. https://developers.trello.com/reference/#boardsid
func NewBoard ¶
NewBoard is a constructor that sets the default values for Prefs.SelfJoin and Prefs.CardCovers also set by the API.
func (*Board) AddMember ¶
func (b *Board) AddMember(member *Member, extraArgs ...Arguments) (response *AddedMembersResponse, err error)
AddMember adds a new member to the board. https://developers.trello.com/reference#boardsidlabelnamesmembers
func (*Board) ContainsCopyOfCard ¶
ContainsCopyOfCard accepts a card id and Arguments and returns true if the receiver Board contains a Card with the id.
func (*Board) CreateLabel ¶
CreateLabel takes a Label and Arguments and POSTs the label to the Board API. Returns an error if the operation fails.
func (*Board) CreateList ¶
CreateList creates a list. Attribute currently supported as extra argument: pos. Attributes currently known to be unsupported: idListSource.
func (*Board) GetActions ¶
func (b *Board) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
GetActions make a GET call for a board's actions
func (*Board) GetCards ¶
GetCards takes Arguments and retrieves all Cards on a Board as slice or returns error.
func (*Board) GetCustomFields ¶
func (b *Board) GetCustomFields(extraArgs ...Arguments) (customFields []*CustomField, err error)
GetCustomFields returns a slice of all receiver board's custom fields.
func (*Board) GetLabels ¶
GetLabels takes Arguments and returns a slice containing all labels of the receiver board or an error.
func (*Board) GetMembers ¶
GetMembers takes Arguments and returns a slice of all members of the Board or an error.
func (*Board) SetClient ¶
SetClient can be used to override this Board's internal connection to the Trello API. Normally, this is set automatically after calls to GetBoard() from the Client. This method exists for special cases where functions which need a Client need to be called on Board structs which weren't created from a Client in the first place.
type BoardLabelNames ¶
type BoardLabelNames struct { Black string `json:"black,omitempty"` Blue string `json:"blue,omitempty"` Green string `json:"green,omitempty"` Lime string `json:"lime,omitempty"` Orange string `json:"orange,omitempty"` Pink string `json:"pink,omitempty"` Purple string `json:"purple,omitempty"` Red string `json:"red,omitempty"` Sky string `json:"sky,omitempty"` Yellow string `json:"yellow,omitempty"` }
type BoardPrefs ¶
type BoardPrefs struct { PermissionLevel string `json:"permissionLevel"` Voting string `json:"voting"` Comments string `json:"comments"` Invitations string `json:"invitations"` SelfJoin bool `json:"selfjoin"` CardCovers bool `json:"cardCovers"` CardAging string `json:"cardAging"` CalendarFeedEnabled bool `json:"calendarFeedEnabled"` Background string `json:"background"` BackgroundColor string `json:"backgroundColor"` BackgroundImage string `json:"backgroundImage"` BackgroundImageScaled []BackgroundImage `json:"backgroundImageScaled"` BackgroundTile bool `json:"backgroundTile"` BackgroundBrightness string `json:"backgroundBrightness"` CanBePublic bool `json:"canBePublic"` CanBeOrg bool `json:"canBeOrg"` CanBePrivate bool `json:"canBePrivate"` CanInvite bool `json:"canInvite"` }
type BoardWebhookRequest ¶
BoardWebhookRequest is the object sent by Trello to a Webhook for Board-triggered webhooks.
func GetBoardWebhookRequest ¶
func GetBoardWebhookRequest(r *http.Request) (whr *BoardWebhookRequest, err error)
GetBoardWebhookRequest takes a http.Request and returns the decoded body as BoardWebhookRequest or an error.
type ByFirstEntered ¶
type ByFirstEntered []*ListDuration
ByFirstEntered is a slice of ListDurations
func (ByFirstEntered) Len ¶
func (durs ByFirstEntered) Len() int
ByFirstEntered returns the length of the receiver.
func (ByFirstEntered) Less ¶
func (durs ByFirstEntered) Less(i, j int) bool
Less takes two indexes i and j and returns true exactly if the ListDuration at i was entered before j.
func (ByFirstEntered) Swap ¶
func (durs ByFirstEntered) Swap(i, j int)
Swap takes two indexes i and j and swaps the ListDurations at the indexes.
type ByLongestDuration ¶
type ByLongestDuration []*MemberDuration
ByLongestDuration is a slice of *MemberDuration
func (ByLongestDuration) Len ¶
func (d ByLongestDuration) Len() int
Len returns the length of the ByLongestDuration slice.
func (ByLongestDuration) Less ¶
func (d ByLongestDuration) Less(i, j int) bool
Less takes two indexes i and j and returns true exactly if the Duration at i is larger than the Duration at j.
func (ByLongestDuration) Swap ¶
func (d ByLongestDuration) Swap(i, j int)
type Card ¶
type Card struct { // Key metadata ID string `json:"id"` IDShort int `json:"idShort"` Name string `json:"name"` Pos float64 `json:"pos"` Email string `json:"email"` ShortLink string `json:"shortLink"` ShortURL string `json:"shortUrl"` URL string `json:"url"` Desc string `json:"desc"` Start *time.Time `json:"start"` Due *time.Time `json:"due"` DueComplete bool `json:"dueComplete"` Closed bool `json:"closed"` Subscribed bool `json:"subscribed"` DateLastActivity *time.Time `json:"dateLastActivity"` // Board Board *Board IDBoard string `json:"idBoard"` // List List *List IDList string `json:"idList"` // Badges Badges CardBadges `json:"badges"` // Actions Actions ActionCollection `json:"actions,omitempty"` // Checklists IDCheckLists []string `json:"idCheckLists"` Checklists []*Checklist `json:"checklists,omitempty"` CheckItemStates []*CheckItemState `json:"checkItemStates,omitempty"` // Members IDMembers []string `json:"idMembers,omitempty"` IDMembersVoted []string `json:"idMembersVoted,omitempty"` Members []*Member `json:"members,omitempty"` // Attachments IDAttachmentCover string `json:"idAttachmentCover"` ManualCoverAttachment bool `json:"manualCoverAttachment"` Attachments []*Attachment `json:"attachments,omitempty"` Cover *CardCover `json:"cover"` // Labels IDLabels []string `json:"idLabels,omitempty"` Labels []*Label `json:"labels,omitempty"` // Custom Fields CustomFieldItems []*CustomFieldItem `json:"customFieldItems,omitempty"` // contains filtered or unexported fields }
Card represents the card resource. https://developers.trello.com/reference/#card-object
func (*Card) AddComment ¶
AddComment takes a comment string and Arguments and adds the comment to the card.
func (*Card) AddFileAttachment ¶
func (c *Card) AddFileAttachment(attachment *Attachment, filename string, file io.Reader, extraArgs ...Arguments) error
AddFileAttachment takes an Attachment, filename with io.Reader and adds it to the card.
func (*Card) AddIDLabel ¶
AddIDLabel receives a label id and adds the corresponding label or returns an error.
func (*Card) AddMemberID ¶
AddMemberID receives a member id and adds the corresponding member to the card. Returns a list of the card's members or an error.
func (*Card) AddURLAttachment ¶
func (c *Card) AddURLAttachment(attachment *Attachment, extraArgs ...Arguments) error
AddURLAttachment takes an Attachment and adds it to the card.
func (*Card) CopyToList ¶
CopyToList takes a list id and Arguments and returns the matching Card. The following Arguments are supported.
Arguments["keepFromSource"] = "all" Arguments["keepFromSource"] = "none" Arguments["keepFromSource"] = "attachments,checklists,comments"
func (*Card) CreatorMember ¶
CreatorMember returns the member of the card who created it or and error. The creator is the member who is associated with the card's first action.
func (*Card) CreatorMemberID ¶
CreatorMemberID returns as string the id of the member who created the card or an error. The creator is the member who is associated with the card's first action.
func (*Card) CustomFields ¶
func (c *Card) CustomFields(boardCustomFields []*CustomField) map[string]interface{}
CustomFields returns the card's custom fields.
func (*Card) GetActions ¶
func (c *Card) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
GetActions makes a GET for a card's actions
func (*Card) GetAncestorCards ¶
GetAncestorCards takes Arguments, GETs the card's ancestors and returns them as a slice.
func (*Card) GetAttachments ¶
func (c *Card) GetAttachments(args Arguments) (attachments []*Attachment, err error)
GetAttachments returns all attachments for a card
func (*Card) GetCommentActions ¶
func (c *Card) GetCommentActions() (actions ActionCollection, err error)
GetCommentActions return only comment actions
func (*Card) GetLastCommentAction ¶
GetLastCommentAction return only last comment action
func (*Card) GetListChangeActions ¶
func (c *Card) GetListChangeActions() (actions ActionCollection, err error)
GetListChangeActions retrieves a slice of Actions which resulted in changes to the card's active List. This includes the createCard and copyCard action (which place the card in its first list), and the updateCard:closed action (which remove it from its last list).
This function is just an alias for:
card.GetActions(Arguments{"filter": "createCard,copyCard,updateCard:idList,updateCard:closed", "limit": "1000"})
func (*Card) GetListDurations ¶
func (c *Card) GetListDurations() (durations []*ListDuration, err error)
GetListDurations analyses a Card's actions to figure out how long it was in each List. It returns a slice of the ListDurations, one Duration per list, or an error.
func (*Card) GetMemberDurations ¶
func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error)
GetMemberDurations returns a slice containing all durations of a card.
func (*Card) GetMembers ¶
GetMembers takes Arguments and returns a slice of all members of the Card or an error.
func (*Card) GetMembershipChangeActions ¶
func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error)
GetMembershipChangeActions makes a GET call for a card's membership-change actions
func (*Card) GetOriginatingCard ¶
GetOriginatingCard takes Arguments, GETs ancestors and returns most recent ancestor card of the Card.
func (*Card) GetParentCard ¶
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 non-existence of a parent is not treated as an error.
func (*Card) MoveToBottomOfList ¶
MoveToBottomOfList moves the card to the bottom of its list.
func (*Card) MoveToList ¶
MoveToList moves a card to a list given by listID.
func (*Card) MoveToTopOfList ¶
MoveToTopOfList moves the card to the top of it's list.
func (*Card) RemoveIDLabel ¶
RemoveIDLabel removes a label id from the card.
func (*Card) RemoveMember ¶
RemoveMember receives the id of a member and removes the corresponding member from the card.
func (*Card) SetClient ¶
SetClient can be used to override this Card's internal connection to the Trello API. Normally, this is set automatically after calls to GetCard() from the Client or a List. This method is public to allow for situations where a Card which wasn't created from an API call to be used as the basis for other API calls. All nested structs (Actions, Attachments, Checklists, etc) also have their client properties updated.
type CardBadges ¶
type CardBadges struct { Votes int `json:"votes"` ViewingMemberVoted bool `json:"viewingMemberVoted"` Subscribed bool `json:"subscribed"` Fogbugz string `json:"fogbugz,omitempty"` CheckItems int `json:"checkItems"` CheckItemsChecked int `json:"checkItemsChecked"` Comments int `json:"comments"` Attachments int `json:"attachments"` Description bool `json:"description"` Due *time.Time `json:"due,omitempty"` }
type CardCover ¶
type CardCover struct { IDAttachment string `json:"idAttachment"` Color string `json:"color"` IDUploadedBackground string `json:"idUploadedBackground"` Size string `json:"size"` Brightness string `json:"brightness"` Scaled []*CardCoverScaledVariant `json:"scaled"` EdgeColor string `json:"edgeColor"` }
type CardCoverScaledVariant ¶
type CardWebhookRequest ¶
CardWebhookRequest is the object sent by Trello to a Webhook for Card-triggered webhooks.
func GetCardWebhookRequest ¶
func GetCardWebhookRequest(r *http.Request) (whr *CardWebhookRequest, err error)
GetCardWebhookRequest takes a http.Request and returns the decoded Body as CardWebhookRequest or an error.
type CheckItem ¶
type CheckItem struct { ID string `json:"id"` Name string `json:"name"` State string `json:"state"` IDChecklist string `json:"idChecklist,omitempty"` Checklist *Checklist `json:"-"` Pos float64 `json:"pos,omitempty"` // contains filtered or unexported fields }
CheckItem is a nested resource representing an item in Checklist.
type CheckItemState ¶
CheckItemState represents a CheckItem when it appears in CheckItemStates on a Card.
type Checklist ¶
type Checklist struct { ID string `json:"id"` Name string `json:"name"` IDBoard string `json:"idBoard,omitempty"` IDCard string `json:"idCard,omitempty"` Card *Card `json:"-"` Pos float64 `json:"pos,omitempty"` CheckItems []CheckItem `json:"checkItems,omitempty"` // contains filtered or unexported fields }
Checklist represents Trello card's checklists. A card can have one zero or more checklists. https://developers.trello.com/reference/#checklist-object
func (*Checklist) CreateCheckItem ¶
func (cl *Checklist) CreateCheckItem(name string, extraArgs ...Arguments) (item *CheckItem, err error)
CreateCheckItem creates a checkitem inside the checklist. Attribute currently supported as extra argument: pos. Attributes currently known to be unsupported: checked.
API Docs: https://developers.trello.com/reference#checklistsidcheckitems
type Client ¶
type Client struct { Client *http.Client Logger logger BaseURL string Key string Token string // contains filtered or unexported fields }
Client is the central object for making API calls. It wraps a http client, context, logger and identity configuration (Key and Token) of the Trello member.
func NewClient ¶
NewClient is a constructor for the Client. It takes the key and token credentials of a Trello member to authenticate and authorise requests with.
func (*Client) CreateBoard ¶
CreateBoard creates a board remote. Attribute currently supported as extra argument: defaultLists, powerUps. Attributes currently known to be unsupported: idBoardSource, keepFromSource.
func (*Client) CreateCard ¶
CreateCard takes a Card and Arguments and POSTs the card.
func (*Client) CreateCheckItem ¶
func (c *Client) CreateCheckItem(checklist *Checklist, name string, extraArgs ...Arguments) (item *CheckItem, err error)
CreateCheckItem creates a checkitem inside the given checklist. Attribute currently supported as extra argument: pos. Attributes currently known to be unsupported: checked.
API Docs: https://developers.trello.com/reference#checklistsidcheckitems
func (*Client) CreateChecklist ¶
func (c *Client) CreateChecklist(card *Card, name string, extraArgs ...Arguments) (checklist *Checklist, err error)
CreateChecklist creates a checklist. Attribute currently supported as extra argument: pos. Attributes currently known to be unsupported: idChecklistSource.
API Docs: https://developers.trello.com/reference#cardsidchecklists-1
func (*Client) CreateList ¶
func (c *Client) CreateList(onBoard *Board, name string, extraArgs ...Arguments) (list *List, err error)
CreateList creates a list. Attribute currently supported as extra argument: pos. Attributes currently known to be unsupported: idListSource.
func (*Client) CreateWebhook ¶
CreateWebhook takes a Webhook, POSTs it and returns an error object.
func (*Client) Delete ¶
Delete takes a path, Arguments, and a target interface (e.g. Board or Card). It runs a DELETE request on the Trello API endpoint with the path and uses the Arguments as URL parameters. Then it returns either the target interface updated from the response or an error.
func (*Client) Get ¶
Get takes a path, Arguments, and a target interface (e.g. Board or Card). It runs a GET request on the Trello API endpoint and the path and uses the Arguments as URL parameters. Then it returns either the target interface updated from the response or an error.
func (*Client) GetBoardsInOrganization ¶
func (c *Client) GetBoardsInOrganization(orgID string, extraArgs ...Arguments) (boards []*Board, err error)
GetBoardsInOrganization takes an organization id and Arguments and either GET returns a slice of boards within that organization, or an error.
func (*Client) GetCard ¶
GetCard receives a card id and Arguments and returns the card if found with the credentials given for the receiver Client. Returns an error otherwise.
func (*Client) GetChecklist ¶
GetChecklist receives a checklist id and Arguments and returns the checklist if found with the credentials given for the receiver Client. Returns an error otherwise.
func (*Client) GetCustomField ¶
func (c *Client) GetCustomField(fieldID string, extraArgs ...Arguments) (customField *CustomField, err error)
GetCustomField takes a field id string and Arguments and returns the matching custom Field.
func (*Client) GetLabel ¶
GetLabel takes a label id and Arguments and returns the matching label (per Trello member) or an error.
func (*Client) GetMember ¶
GetMember takes a member id and Arguments and returns a Member or an error.
func (*Client) GetMyBoards ¶
GetMyBoards returns a slice of all boards associated with the credentials set on the client.
func (*Client) GetMyMember ¶
GetMyMember returns Member for the user authenticating the API call
func (*Client) GetMyNotifications ¶
func (c *Client) GetMyNotifications(extraArgs ...Arguments) (notifications []*Notification, err error)
GetMyNotifications returns the notifications of the authenticated user
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(orgID string, extraArgs ...Arguments) (organization *Organization, err error)
GetOrganization takes an organization id and Arguments and either GETs returns an Organization, or an error.
func (*Client) GetToken ¶
GetToken takes a token id and Arguments and GETs and returns the Token or an error.
func (*Client) GetWebhook ¶
GetWebhook takes a webhook id and Arguments, GETs the matching Webhook and returns it or an error.
func (*Client) Post ¶
Post takes a path, Arguments, and a target interface (e.g. Board or Card). It runs a POST request on the Trello API endpoint with the path and uses the Arguments as URL parameters. Then it returns either the target interface updated from the response or an error.
func (*Client) PostWithBody ¶
func (c *Client) PostWithBody(path string, args Arguments, target interface{}, filename string, file io.Reader) error
PostWithBody takes a path, Arguments, and a target interface (e.g. Board or Card). It runs a POST request on the Trello API endpoint with the path and uses the Arguments as URL parameters, takes file io.Reader and put to multipart body. Then it returns either the target interface updated from the response or an error.
func (*Client) Put ¶
Put takes a path, Arguments, and a target interface (e.g. Board or Card). It runs a PUT request on the Trello API endpoint with the path and uses the Arguments as URL parameters. Then it returns either the target interface updated from the response or an error.
func (*Client) SearchBoards ¶
SearchBoards takes a query string and Arguments and returns a slice of Boards or an error.
func (*Client) SearchCards ¶
SearchCards takes a query string and Arguments and returns a slice of Cards or an error.
func (*Client) SearchMembers ¶
SearchMembers takes a query string and Arguments and returns a slice of Members or an error.
type CustomField ¶
type CustomField struct { ID string `json:"id"` IDModel string `json:"idModel"` IDModelType string `json:"modelType,omitempty"` FieldGroup string `json:"fieldGroup"` Name string `json:"name"` Pos int `json:"pos"` Display struct { CardFront bool `json:"cardfront"` } `json:"display"` Type string `json:"type"` Options []*CustomFieldOption `json:"options"` }
CustomField represents Trello's custom fields: "extra bits of structured data attached to cards when our users need a bit more than what Trello provides." https://developers.trello.com/reference/#custom-fields
type CustomFieldItem ¶
type CustomFieldItem struct { ID string `json:"id,omitempty"` Value CustomFieldValue `json:"value,omitempty"` IDValue string `json:"idValue,omitempty"` IDCustomField string `json:"idCustomField,omitempty"` IDModel string `json:"idModel,omitempty"` IDModelType string `json:"modelType,omitempty"` }
CustomFieldItem represents the custom field items of Trello a trello card.
type CustomFieldOption ¶
type CustomFieldOption struct { ID string `json:"id"` IDCustomField string `json:"idCustomField"` Value struct { Text string `json:"text"` } `json:"value"` Color string `json:"color,omitempty"` Pos int `json:"pos"` }
CustomFieldOption are nested resources of CustomFields
type CustomFieldValue ¶
type CustomFieldValue struct {
// contains filtered or unexported fields
}
CustomFieldValue represents the custom field value struct
func NewCustomFieldValue ¶
func NewCustomFieldValue(val interface{}) CustomFieldValue
NewCustomFieldValue the custom field constructor
func (CustomFieldValue) Get ¶
func (v CustomFieldValue) Get() interface{}
Get the custom field value getter
func (CustomFieldValue) MarshalJSON ¶
func (v CustomFieldValue) MarshalJSON() ([]byte, error)
MarshalJSON the custom field marchaller
func (CustomFieldValue) String ¶
func (v CustomFieldValue) String() string
String the custom field String method
func (*CustomFieldValue) UnmarshalJSON ¶
func (v *CustomFieldValue) UnmarshalJSON(b []byte) error
UnmarshalJSON the custom field umarshaller
type Label ¶
type Label struct { ID string `json:"id"` IDBoard string `json:"idBoard"` Name string `json:"name"` Color string `json:"color"` Uses int `json:"uses"` // contains filtered or unexported fields }
Label represents a Trello label. Labels are defined per board, and can be applied to the cards on that board. https://developers.trello.com/reference/#label-object
type List ¶
type List struct { ID string `json:"id"` Name string `json:"name"` IDBoard string `json:"idBoard,omitempty"` Closed bool `json:"closed"` Pos float32 `json:"pos,omitempty"` Subscribed bool `json:"subscribed"` Board *Board `json:"board,omitempty"` Cards []*Card `json:"cards,omitempty"` // contains filtered or unexported fields }
List represents Trello lists. https://developers.trello.com/reference/#list-object
func ListAfterAction ¶
ListAfterAction calculates which List the card ended up in after this action completed. Returns nil when the action resulted in the card being archived (in which case we consider it to not be in a list anymore), or when the action isn't related to a list at all (in which case this is a nonsensical question to ask).
func (*List) GetActions ¶
func (l *List) GetActions(extraArgs ...Arguments) (actions ActionCollection, err error)
GetActions makes a GET call for a list's actions
func (*List) SetClient ¶
SetClient can be used to override this List's internal connection to the Trello API. Normally, this is set automatically after calls to GetList() from the Client. This method exists for special cases where functions which need a Client need to be called on List structs which weren't created from a Client in the first place.
type ListDuration ¶
type ListDuration struct { ListID string ListName string Duration time.Duration FirstEntered time.Time TimesInList int }
ListDuration represents the time a Card has been or was in list.
func (*ListDuration) AddDuration ¶
func (l *ListDuration) AddDuration(d time.Duration)
AddDuration takes a duration and adds it to the ListDuration's Duration. Also increments TimesInList.
type ListWebhookRequest ¶
ListWebhookRequest is the object sent by Trello to a Webhook for List-triggered webhooks.
func GetListWebhookRequest ¶
func GetListWebhookRequest(r *http.Request) (whr *ListWebhookRequest, err error)
GetListWebhookRequest takes a http.Request and returns the decoded Body as ListWebhookRequest or an error.
type Member ¶
type Member struct { ID string `json:"id"` Username string `json:"username,omitempty"` FullName string `json:"fullName,omitempty"` Initials string `json:"initials,omitempty"` AvatarHash string `json:"avatarHash,omitempty"` AvatarURL string `json:"avatarUrl,omitempty"` Email string `json:"email,omitempty"` IDBoards []string `json:"idBoards,omitempty"` IDOrganizations []string `json:"idOrganizations,omitempty"` // contains filtered or unexported fields }
Member represents a Trello member. https://developers.trello.com/reference/#member-object
type MemberDuration ¶
type MemberDuration struct { MemberID string MemberName string FirstAdded time.Time Duration time.Duration // contains filtered or unexported fields }
MemberDuration is used to track the periods of time which a user (member) is attached to a card.
type Membership ¶
type Membership struct { ID string `json:"id"` MemberID string `json:"idMember"` Type string `json:"memberType"` Unconfirmed bool `json:"unconfirmed"` Deactivated bool `json:"deactivated"` }
Membership represents a Trello membership. https://developers.trello.com/reference#memberships-nested-resource
type Notification ¶
type Notification struct { ID string `json:"id"` IDAction string `json:"idAction"` Unread bool `json:"unread"` Type string `json:"type"` IDMemberCreator string `json:"idMemberCreator"` Date time.Time `json:"date"` DateRead time.Time `json:"dataRead"` Data NotificationData `json:"data,omitempty"` MemberCreator *Member `json:"memberCreator,omitempty"` // contains filtered or unexported fields }
Notification represents a Trello Notification. https://developers.trello.com/reference/#notifications
func (*Notification) SetClient ¶
func (n *Notification) SetClient(newClient *Client)
SetClient can be used to override this Notification's internal connection to the Trello API. Normally, this is set automatically after API calls.
type NotificationData ¶
type NotificationData struct { Text string `json:"text"` Card *NotificationDataCard `json:"card,omitempty"` Board *NotificationDataBoard `json:"board,omitempty"` }
NotificationData represents the 'notificaiton.data'
type NotificationDataBoard ¶
type NotificationDataBoard struct { ID string `json:"id"` ShortLink string `json:"shortLink"` Name string `json:"name"` }
NotificationDataBoard represents the 'notification.data.board'
type NotificationDataCard ¶
type NotificationDataCard struct { ID string `json:"id"` IDShort int `json:"idShort"` Name string `json:"name"` ShortLink string `json:"shortLink"` }
NotificationDataCard represents the 'notification.data.card'
type Organization ¶
type Organization struct { ID string `json:"id"` Name string `json:"name"` DisplayName string `json:"displayName"` Desc string `json:"desc"` URL string `json:"url"` Website string `json:"website"` Products []int `json:"products"` PowerUps []int `json:"powerUps"` // contains filtered or unexported fields }
Organization represents a Trello organization or team, i.e. a collection of members and boards. https://developers.trello.com/reference/#organizations
func (*Organization) GetMembers ¶
func (o *Organization) GetMembers(extraArgs ...Arguments) (members []*Member, err error)
GetMembers takes Arguments and returns a slice of all members of the organization or an error.
func (*Organization) SetClient ¶
func (o *Organization) SetClient(newClient *Client)
SetClient can be used to override this Organization's internal connection to the Trello API. Normally, this is set automatically after API calls.
type Permission ¶
type Permission struct { IDModel string `json:"idModel"` ModelType string `json:"modelType"` Read bool `json:"read"` Write bool `json:"write"` }
Permission represent a Token's permissions.
type SearchModifier ¶
type SearchModifier struct {
Text string `json:"text"`
}
SearchModifier is wrapper for a search string.
type SearchOptions ¶
type SearchOptions struct { Terms []SearchTerm `json:"terms"` Modifiers []SearchModifier `json:"modifiers,omitempty"` ModelTypes []string `json:"modelTypes,omitempty"` Partial bool `json:"partial"` }
SearchOptions contains options for search requests.
type SearchResult ¶
type SearchResult struct { Options SearchOptions `json:"options"` Actions []*Action `json:"actions,omitempty"` Cards []*Card `json:"cards,omitempty"` Boards []*Board `json:"boards,omitempty"` Members []*Member `json:"members,omitempty"` }
SearchResult represents a search result as collections of various types returned by a search, e.g. Cards or Boards.
type SearchTerm ¶
SearchTerm is a string that may be negated in a search query.
type Token ¶
type Token struct { ID string `json:"id"` DateCreated time.Time `json:"dateCreated"` DateExpires *time.Time `json:"dateExpires"` IDMember string `json:"idMember"` Identifier string `json:"identifier"` Permissions []Permission `json:"permissions"` // contains filtered or unexported fields }
Token represents Trello tokens. Tokens can be used for setting up Webhooks among other things. https://developers.trello.com/reference/#tokens
func (*Token) GetWebhooks ¶
GetWebhooks takes Arguments and returns a list of all Webhooks for the receiver Token or an error.
type Webhook ¶
type Webhook struct { ID string `json:"id,omitempty"` IDModel string `json:"idModel"` Description string `json:"description"` CallbackURL string `json:"callbackURL"` Active bool `json:"active"` // contains filtered or unexported fields }
Webhook is the Go representation of a webhook registered in Trello's systems. Used when creating, modifying or deleting webhooks. https://developers.trello.com/reference/#webhook-object