trello

package module
v0.0.0-...-84d7016 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2019 License: MIT Imports: 11 Imported by: 2

README

Go Trello API

Trello Logo

GoDoc Build Status Coverage Status

A #golang package to access the Trello API. Nearly 100% of the read-only surface area of the API is covered, as is creation and modification of Cards. Low-level infrastructure for features to modify Lists and Boards are easy to add... just not done yet.

Pull requests are welcome for missing features.

My current development focus is documentation, especially enhancing this README.md with more example use cases.

Installation

The Go Trello API has been Tested compatible with Go 1.1 on up. Its only dependency is the github.com/pkg/errors package. It otherwise relies only on the Go standard library.

go get github.com/adlio/trello

Basic Usage

All interaction starts with a trello.Client. Create one with your appKey and token:

client := trello.NewClient(appKey, token)

All API requests accept a trello.Arguments object. This object is a simple map[string]string, converted to query string arguments in the API call. Trello has sane defaults on API calls. We have a trello.Defaults() utility function which can be used when you desire the default Trello arguments. Internally, trello.Defaults() is an empty map, which translates to an empty query string.

board, err := client.GetBoard("bOaRdID", trello.Defaults())
if err != nil {
  // Handle error
}

Client Longevity

When getting Lists from Boards or Cards from Lists, the original trello.Client pointer is carried along in returned child objects. It's important to realize that this enables you to make additional API calls via functions invoked on the objects you receive:

client := trello.NewClient(appKey, token)
board, err := client.GetBoard("ID", trello.Defaults())

// GetLists makes an API call to /boards/:id/lists using credentials from `client`
lists, err := board.GetLists(trello.Defaults())

for _, list := range lists {
  // GetCards makes an API call to /lists/:id/cards using credentials from `client`
  cards, err := list.GetCards(trello.Defaults())
}

Get Trello Boards for a User

Boards can be retrieved directly by their ID (see example above), or by asking for all boards for a member:

member, err := client.GetMember("usernameOrId", trello.Defaults())
if err != nil {
  // Handle error
}

boards, err := member.GetBoards(trello.Defaults())
if err != nil {
  // Handle error
}

Get Trello Lists on a Board

board, err := client.GetBoard("bOaRdID", trello.Defaults())
if err != nil {
  // Handle error
}

lists, err := board.GetLists(trello.Defaults())
if err != nil {
  // Handle error
}

Get Trello Cards on a Board

board, err := client.GetBoard("bOaRdID", trello.Defaults())
if err != nil {
  // Handle error
}

cards, err := board.GetCards(trello.Defaults())
if err != nil {
  // Handle error
}

Get Trello Cards on a List

list, err := client.GetList("lIsTID", trello.Defaults())
if err != nil {
  // Handle error
}

cards, err := list.GetCards(trello.Defaults())
if err != nil {
  // Handle error
}

Creating a Card

The API provides several mechanisms for creating new cards.

Creating Cards from Scratch on the Client

This approach requires the most input data on the card:

card := trello.Card{
  Name: "Card Name",
  Desc: "Card description",
  Pos: 12345.678,
  IDList: "iDOfaLiSt",
}
err := client.CreateCard(card, trello.Defaults())
Creating Cards On a List
list, err := client.GetList("lIsTID", trello.Defaults())
list.AddCard(trello.Card{ Name: "Card Name", Description: "Card description" }, trello.Defaults())
Creating a Card by Copying Another Card
err := card.CopyToList("listIdNUmber", trello.Defaults()

Get Actions on a Board

board, err := client.GetBoard("bOaRdID", trello.Defaults())
if err != nil {
  // Handle error
}

actions, err := board.GetActions(trello.Defaults())
if err != nil {
  // Handle error
}

Get Actions on a Card

card, err := client.GetCard("cArDID", trello.Defaults())
if err != nil {
  // Handle error
}

actions, err := card.GetActions(trello.Defaults())
if err != nil {
  // Handle error
}

Rearrange Cards Within a List

err := card.MoveToTopOfList()
err = card.MoveToBottomOfList()
err = card.SetPos(12345.6789)

Moving a Card to Another List

err := card.MoveToList("listIdNUmber", trello.Defaults())

Card Ancestry

Trello provides ancestry tracking when cards are created as copies of other cards. This package provides functions for working with this data:


// ancestors will hold a slice of *trello.Cards, with the first
// being the card's parent, and the last being parent's parent's parent...
ancestors, err := card.GetAncestorCards(trello.Defaults())

// GetOriginatingCard() is an alias for the last element in the slice
// of ancestor cards.
ultimateParentCard, err := card.GetOriginatingCard(trello.Defaults())

Debug Logging

If you'd like to see all API calls logged, you can attach a .Logger (implementing Debugf(string, ...interface{})) to your client. The interface for the logger mimics logrus. Example usage:

logger := logrus.New()
logger.SetLevel(logrus.DebugLevel)
client := trello.NewClient(appKey, token)
client.Logger = logger

Documentation

Index

Constants

View Source
const DEFAULT_BASEURL = "https://api.trello.com/1"

Variables

This section is empty.

Functions

func EarliestCardID

func EarliestCardID(cards []*Card) string

func IDToTime

func IDToTime(id string) (t time.Time, err error)

func IsNotFound

func IsNotFound(err error) bool

func IsPermissionDenied

func IsPermissionDenied(err error) bool

func IsRateLimit

func IsRateLimit(err error) bool

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"`
}

func (*Action) DidArchiveCard

func (a *Action) DidArchiveCard() bool

func (*Action) DidChangeCardMembership

func (a *Action) DidChangeCardMembership() bool

func (*Action) DidChangeListForCard

func (a *Action) DidChangeListForCard() bool

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) DidCreateCard

func (a *Action) DidCreateCard() bool

DidCreateCard() returns true if this action created a card, false otherwise.

func (*Action) DidUnarchiveCard

func (a *Action) DidUnarchiveCard() bool

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 (actions ActionCollection) ContainsCardCreation() bool

func (ActionCollection) FilterToCardCreationActions

func (c ActionCollection) FilterToCardCreationActions() ActionCollection

func (ActionCollection) FilterToCardMembershipChangeActions

func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection

func (ActionCollection) FilterToListChangeActions

func (c ActionCollection) FilterToListChangeActions() ActionCollection

func (ActionCollection) FirstCardCreateAction

func (actions ActionCollection) FirstCardCreateAction() *Action

func (ActionCollection) GetListDurations

func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error)

func (ActionCollection) GetMemberDurations

func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error)

Similar to GetListDurations(), this function 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) 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           *Card     `json:"card,omitempty"`
	CardSource     *Card     `json:"cardSource,omitempty"`
	Board          *Board    `json:"board,omitempty"`
	Old            *Card     `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"`
}

type Arguments

type Arguments map[string]string

func Defaults

func Defaults() Arguments

func (Arguments) ToURLValues

func (args Arguments) ToURLValues() url.Values

type Attachment

type Attachment struct {
	ID        string              `json:"id"`
	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"`
}

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"`
}

type BackgroundImage

type BackgroundImage struct {
	Width  int    `json:"width"`
	Height int    `json:"height"`
	URL    string `json:"url"`
}

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"`
	Url            string `json:"url"`
	ShortUrl       string `json:"shortUrl"`
	Prefs          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"`
	} `json:"prefs"`
	LabelNames 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"`
	} `json:"labelNames"`
	// contains filtered or unexported fields
}

func (*Board) ContainsCopyOfCard

func (b *Board) ContainsCopyOfCard(cardID string, args Arguments) (bool, error)

func (*Board) CreateList

func (b *Board) CreateList(name string, args Arguments) (list *List, err error)

func (*Board) CreatedAt

func (b *Board) CreatedAt() time.Time

func (*Board) GetActions

func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error)

func (*Board) GetCards

func (b *Board) GetCards(args Arguments) (cards []*Card, err error)

*

  • Retrieves all Cards on a Board *
  • If before

func (*Board) GetLists

func (b *Board) GetLists(args Arguments) (lists []*List, err error)

func (*Board) GetMembers

func (b *Board) GetMembers(args Arguments) (members []*Member, err error)

type BoardWebhookRequest

type BoardWebhookRequest struct {
	Model  *Board
	Action *Action
}

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)

type ByFirstEntered

type ByFirstEntered []*ListDuration

func (ByFirstEntered) Len

func (durs ByFirstEntered) Len() int

func (ByFirstEntered) Less

func (durs ByFirstEntered) Less(i, j int) bool

func (ByFirstEntered) Swap

func (durs ByFirstEntered) Swap(i, j int)

type ByLongestDuration

type ByLongestDuration []*MemberDuration

func (ByLongestDuration) Len

func (d ByLongestDuration) Len() int

func (ByLongestDuration) Less

func (d ByLongestDuration) Less(i, j int) bool

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"`
	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 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"`
	} `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"`

	// Labels
	Labels []*Label `json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*Card) AddChecklist

func (c *Card) AddChecklist(name string) error

func (*Card) AddComment

func (c *Card) AddComment(comment string, args Arguments) (*Action, error)

func (*Card) AddLabel

func (c *Card) AddLabel(labelID string) error

func (*Card) CopyToList

func (c *Card) CopyToList(listID string, args Arguments) (*Card, error)

Try these Arguments

	Arguments["keepFromSource"] = "all"
 Arguments["keepFromSource"] = "none"
	Arguments["keepFromSource"] = "attachments,checklists,comments"

func (*Card) CreatedAt

func (c *Card) CreatedAt() time.Time

func (*Card) CreatorMember

func (c *Card) CreatorMember() (*Member, error)

func (*Card) CreatorMemberID

func (c *Card) CreatorMemberID() (string, error)

func (*Card) GetActions

func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error)

func (*Card) GetAncestorCards

func (c *Card) GetAncestorCards(args Arguments) (ancestors []*Card, err error)

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)

Analytzes a Cards actions to figure out how long it was in each List

func (*Card) GetMemberDurations

func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error)

func (*Card) GetMembers

func (c *Card) GetMembers(args Arguments) (members []*Member, err error)

func (*Card) GetMembershipChangeActions

func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error)

func (*Card) GetOriginatingCard

func (c *Card) GetOriginatingCard(args Arguments) (*Card, error)

func (*Card) GetParentCard

func (c *Card) GetParentCard(args Arguments) (*Card, error)

If this Card was created from a copy of another Card, this func retrieves the originating 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

func (c *Card) MoveToBottomOfList() error

func (*Card) MoveToList

func (c *Card) MoveToList(listID string, args Arguments) error

func (*Card) MoveToListOnBoard

func (c *Card) MoveToListOnBoard(listID string, boardID string, args Arguments) error

func (*Card) MoveToTopOfList

func (c *Card) MoveToTopOfList() error

func (*Card) RemoveLabel

func (c *Card) RemoveLabel(labelID string) error

func (*Card) RemoveMember

func (c *Card) RemoveMember(memberID string) error

func (*Card) SetPos

func (c *Card) SetPos(newPos float64) error

func (*Card) Update

func (c *Card) Update(args Arguments) error

type CardWebhookRequest

type CardWebhookRequest struct {
	Model  *Card
	Action *Action
}

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)

type CheckItem

type CheckItem struct {
	IDCard      string
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	State       string  `json:"state"`
	IDChecklist string  `json:"idChecklist,omitempty"`
	Pos         float64 `json:"pos,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckItem) SetNameAndState

func (c *CheckItem) SetNameAndState(name string, state string) error

func (*CheckItem) SetPos

func (c *CheckItem) SetPos(newPos int) error

type CheckItemState

type CheckItemState struct {
	IDCheckItem string `json:"idCheckItem"`
	State       string `json:"state"`
}

Manifestation of 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"`
	Pos        float64     `json:"pos,omitempty"`
	CheckItems []CheckItem `json:"checkItems,omitempty"`
	// contains filtered or unexported fields
}

func (*Checklist) AddCheckItem

func (c *Checklist) AddCheckItem(name string) error

type Client

type Client struct {
	Logger  logger
	BaseURL string
	Key     string
	Token   string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key, token string) *Client

func (*Client) CreateCard

func (c *Client) CreateCard(card *Card, extraArgs Arguments) error

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(webhook *Webhook) error

func (*Client) Delete

func (c *Client) Delete(path string, args Arguments, target interface{}) error

func (*Client) Get

func (c *Client) Get(path string, args Arguments, target interface{}) error

func (*Client) GetBoard

func (c *Client) GetBoard(boardID string, args Arguments) (board *Board, err error)

*

  • Board retrieves a Trello board by its ID.

func (*Client) GetCard

func (c *Client) GetCard(cardID string, args Arguments) (card *Card, err error)

func (*Client) GetList

func (c *Client) GetList(listID string, args Arguments) (list *List, err error)

func (*Client) GetMember

func (c *Client) GetMember(memberID string, args Arguments) (member *Member, err error)

func (*Client) GetOrganization

func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error)

func (*Client) GetToken

func (c *Client) GetToken(tokenID string, args Arguments) (token *Token, err error)

func (*Client) GetWebhook

func (c *Client) GetWebhook(webhookID string, args Arguments) (webhook *Webhook, err error)

func (*Client) Post

func (c *Client) Post(path string, args Arguments, target interface{}) error

func (*Client) Put

func (c *Client) Put(path string, args Arguments, target interface{}) error

func (*Client) SearchBoards

func (c *Client) SearchBoards(query string, args Arguments) (boards []*Board, err error)

func (*Client) SearchCards

func (c *Client) SearchCards(query string, args Arguments) (cards []*Card, err error)

func (*Client) SearchMembers

func (c *Client) SearchMembers(query string, args Arguments) (members []*Member, err error)

func (*Client) Throttle

func (c *Client) Throttle()

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"`
}

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"`
	Board   *Board  `json:"board,omitempty"`
	Cards   []*Card `json:"cards,omitempty"`
	// contains filtered or unexported fields
}

func ListAfterAction

func ListAfterAction(a *Action) *List

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) AddCard

func (l *List) AddCard(card *Card, extraArgs Arguments) error

func (*List) CreatedAt

func (l *List) CreatedAt() time.Time

func (*List) GetActions

func (l *List) GetActions(args Arguments) (actions ActionCollection, err error)

func (*List) GetCards

func (l *List) GetCards(args Arguments) (cards []*Card, err error)

*

  • Retrieves all Cards in a List

type ListDuration

type ListDuration struct {
	ListID       string
	ListName     string
	Duration     time.Duration
	FirstEntered time.Time
	TimesInList  int
}

func (*ListDuration) AddDuration

func (l *ListDuration) AddDuration(d time.Duration)

type ListWebhookRequest

type ListWebhookRequest struct {
	Model  *List
	Action *Action
}

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)

type Member

type Member struct {
	ID         string `json:"id"`
	Username   string `json:"username"`
	FullName   string `json:"fullName"`
	Initials   string `json:"initials"`
	AvatarHash string `json:"avatarHash"`
	Email      string `json:"email"`
	// contains filtered or unexported fields
}

func (*Member) GetBoards

func (m *Member) GetBoards(args Arguments) (boards []*Board, err error)

type MemberDuration

type MemberDuration struct {
	MemberID   string
	MemberName string
	FirstAdded time.Time
	Duration   time.Duration
	// contains filtered or unexported fields
}

Used to track the periods of time which a user (member) is attached to a 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    []string `json:"products"`
	PowerUps    []string `json:"powerUps"`
	// contains filtered or unexported fields
}

func (*Organization) GetMembers

func (o *Organization) GetMembers(args Arguments) (members []*Member, err error)

type Permission

type Permission struct {
	IDModel   string `json:"idModel"`
	ModelType string `json:"modelType"`
	Read      bool   `json:"read"`
	Write     bool   `json:"write"`
}

type SearchOptions

type SearchOptions struct {
	Terms      []SearchTerm `json:"terms"`
	Modifiers  []string     `json:"modifiers,omitempty"`
	ModelTypes []string     `json:"modelTypes,omitempty"`
	Partial    bool         `json:"partial"`
}

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"`
}

type SearchTerm

type SearchTerm struct {
	Text    string `json:"text"`
	Negated bool   `json:"negated,omitempty"`
}

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
}

func (*Token) GetWebhooks

func (t *Token) GetWebhooks(args Arguments) (webhooks []*Webhook, err 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL