trello

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

README

Golang Trello API client

go-trello is a Go client package for accessing the Trello API.

Go package

PkgGoDev Travis Coverage Status

Example

Prerequisites:

  • Retrieve your appKey: https://trello.com/app-key (NOTE: This identifies "you" as the developer of the application)
  • Retrieve your (temporary) token: (put the space there to prevent the link) https ://trello.com/1/connect?key=${MYKEYFROMABOVE}>&name=${MYAPPNAME}&response_type=token&scope=read,write&expiration=1day
package main

import (
  "fmt"
  "log"

  "github.com/TJM/go-trello"
)

func main() {
  // New Trello Client
  appKey := "application-key"
  token := "token"
  trello, err := trello.NewAuthClient(appKey, &token)
  if err != nil {
    log.Fatal(err)
  }

  // User @trello
  user, err := trello.Member("trello")
  if err != nil {
    log.Fatal(err)
  }
  fmt.Println(user.FullName)

  // @trello Boards
  boards, err := user.Boards()
  if err != nil {
    log.Fatal(err)
  }

  if len(boards) > 0 {
    board := boards[0]
    fmt.Printf("* %v (%v)\n", board.Name, board.ShortURL)

    // @trello Board Lists
    lists, err := board.Lists()
    if err != nil {
      log.Fatal(err)
    }

    for _, list := range lists {
      fmt.Println("   - ", list.Name)

      // @trello Board List Cards
      cards, _ := list.Cards()
      for _, card := range cards {
        fmt.Println("      + ", card.Name)
      }
    }
  }
}

prints

Trello
* Bucket List (https://trello.com/b/Nl2oG77n)
   -  Goals
      +  How To Use This Board
      +  Do volunteer work
   -  Up Next
      +  Solve a Rubik’s Cube!
      +  Visit Japan
   -  Underway
      +  Improve writing skills
   -  Done!
      +  Learn to sail

Acknowledgements

Forked From:

(previously) Influenced by:

License

Licensed under the Apache License, Version 2.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeArgs

func EncodeArgs(args []*Argument) string

EncodeArgs URL encodes a list of arguments

Types

type Action

type Action struct {
	ID              string `json:"id"`
	IDMemberCreator string `json:"idMemberCreator"`
	Data            struct {
		DateLastEdited string `json:"dateLastEdited"`
		ListBefore     struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"listBefore"`
		ListAfter struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"listAfter"`
		CheckItem struct {
			ID    string `json:"id"`
			State string `json:"state"`
			Name  string `json:"name"`
		} `json:"checkItem"`
		CheckList struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"checklist"`
		List struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"list"`
		TextData struct {
			Emoji struct{} `json:"emoji"`
		} `json:"textData"`
		Board struct {
			ID        string `json:"id"`
			Name      string `json:"name"`
			ShortLink string `json:"shortLink"`
		} `json:"board"`
		Card struct {
			ID        string `json:"id"`
			Name      string `json:"name"`
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
		} `json:"card"`
		Text string `json:"text"`
	} `json:"data"`
	Type          ActionType `json:"type"`
	Date          string     `json:"date"`
	MemberCreator struct {
		ID         string `json:"id"`
		AvatarHash string `json:"avatarHash"`
		FullName   string `json:"fullName"`
		Initials   string `json:"initials"`
		Username   string `json:"username"`
	} `json:"memberCreator"`
	// contains filtered or unexported fields
}

Action struct

type ActionType

type ActionType string

ActionType Action String

const (
	AddAdminToBoard                   ActionType = "addAdminToBoard"
	AddAdminToOrganization            ActionType = "addAdminToOrganization"
	AddAttachmentToCard               ActionType = "addAttachmentToCard"
	AddBoardsPinnedToMember           ActionType = "addBoardsPinnedToMember"
	AddChecklistToCard                ActionType = "addChecklistToCard"
	AddLabelToCard                    ActionType = "addLabelToCard"
	AddMemberToBoard                  ActionType = "addMemberToBoard"
	AddMemberToCard                   ActionType = "addMemberToCard"
	AddMemberToOrganization           ActionType = "addMemberToOrganization"
	AddToOrganizationBoard            ActionType = "addToOrganizationBoard"
	CommentCard                       ActionType = "commentCard"
	ConvertToCardFromCheckItem        ActionType = "convertToCardFromCheckItem"
	CopyBoard                         ActionType = "copyBoard"
	CopyCard                          ActionType = "copyCard"
	CopyChecklist                     ActionType = "copyChecklist"
	CreateLabel                       ActionType = "createLabel"
	CopyCommentCard                   ActionType = "copyCommentCard"
	CreateBoard                       ActionType = "createBoard"
	CreateBoardInvitation             ActionType = "createBoardInvitation"
	CreateBoardPreference             ActionType = "createBoardPreference"
	CreateCard                        ActionType = "createCard"
	CreateChecklist                   ActionType = "createChecklist"
	CreateList                        ActionType = "createList"
	CreateOrganization                ActionType = "createOrganization"
	CreateOrganizationInvitation      ActionType = "createOrganizationInvitation"
	DeleteAttachmentFromCard          ActionType = "deleteAttachmentFromCard"
	DeleteBoardInvitation             ActionType = "deleteBoardInvitation"
	DeleteCard                        ActionType = "deleteCard"
	DeleteCheckItem                   ActionType = "deleteCheckItem"
	DeleteLabel                       ActionType = "deleteLabel"
	DeleteOrganizationInvitation      ActionType = "deleteOrganizationInvitation"
	DisablePlugin                     ActionType = "disablePlugin"
	DisablePowerUp                    ActionType = "disablePowerUp"
	EmailCard                         ActionType = "emailCard"
	EnablePlugin                      ActionType = "enablePlugin"
	EnablePowerUp                     ActionType = "enablePowerUp"
	MakeAdminOfBoard                  ActionType = "makeAdminOfBoard"
	MakeAdminOfOrganization           ActionType = "makeAdminOfOrganization"
	MakeNormalMemberOfBoard           ActionType = "makeNormalMemberOfBoard"
	MakeNormalMemberOfOrganization    ActionType = "makeNormalMemberOfOrganization"
	MakeObserverOfBoard               ActionType = "makeObserverOfBoard"
	MemberJoinedTrello                ActionType = "memberJoinedTrello"
	MoveCardFromBoard                 ActionType = "moveCardFromBoard"
	MoveCardToBoard                   ActionType = "moveCardToBoard"
	MoveListFromBoard                 ActionType = "moveListFromBoard"
	MoveListToBoard                   ActionType = "moveListToBoard"
	RemoveAdminFromBoard              ActionType = "removeAdminFromBoard"
	RemoveAdminFromOrganization       ActionType = "removeAdminFromOrganization"
	RemoveBoardsPinnedFromMember      ActionType = "removeBoardsPinnedFromMember"
	RemoveChecklistFromCard           ActionType = "removeChecklistFromCard"
	RemoveFromOrganizationBoard       ActionType = "removeFromOrganizationBoard"
	RemoveLabelFromCard               ActionType = "removeLabelFromCard"
	RemoveMemberFromBoard             ActionType = "removeMemberFromBoard"
	RemoveMemberFromCard              ActionType = "removeMemberFromCard"
	RemoveMemberFromOrganization      ActionType = "removeMemberFromOrganization"
	UnconfirmedBoardInvitation        ActionType = "unconfirmedBoardInvitation"
	UnconfirmedOrganizationInvitation ActionType = "unconfirmedOrganizationInvitation"
	UpdateBoard                       ActionType = "updateBoard"
	UpdateCard                        ActionType = "updateCard"
	UpdateCheckItem                   ActionType = "updateCheckItem"
	UpdateCheckItemStateOnCard        ActionType = "updateCheckItemStateOnCard"
	UpdateChecklist                   ActionType = "updateChecklist"
	UpdateLabel                       ActionType = "updateLabel"
	UpdateList                        ActionType = "updateList"
	UpdateMember                      ActionType = "updateMember"
	UpdateOrganization                ActionType = "updateOrganization"
	VoteOnCard                        ActionType = "voteOnCard"
)

Actions

type Argument

type Argument struct {
	Name  string
	Value string
}

Argument struct

func NewArgument

func NewArgument(name, value string) *Argument

NewArgument creates a new argument type from name and value strings

type Attachment

type Attachment struct {
	ID        string `json:"id"`
	Bytes     int    `json:"bytes"`
	Date      string `json:"date"`
	EdgeColor string `json:"edgeColor"`
	IDMember  string `json:"idMember"`
	IsUpload  bool   `json:"isUpload"`
	MimeType  string `json:"mimeType"`
	Name      string `json:"name"`
	Previews  []struct {
		Width  int    `json:"width"`
		Height int    `json:"height"`
		URL    string `json:"url"`
		Bytes  int    `json:"bytes"`
		ID     string `json:"_id"`
		Scaled bool   `json:"scaled"`
	} `json:"previews"`
	URL string `json:"url"`
	// contains filtered or unexported fields
}

Attachment - Type

type Board

type Board struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Desc     string `json:"desc"`
	DescData struct {
		Emoji struct{} `json:"emoji"`
	} `json:"descData"`
	Closed          bool          `json:"closed"`
	IDMemberCreator string        `json:"idMemberCreator"`
	IDOrganization  string        `json:"idOrganization"`
	Members         []*Member     `json:"members"`
	Memberships     []*Membership `json:"memberships"`
	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 []BoardBackground `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 {
		Red    string `json:"red"`
		Orange string `json:"orange"`
		Yellow string `json:"yellow"`
		Green  string `json:"green"`
		Blue   string `json:"blue"`
		Purple string `json:"purple"`
	} `json:"labelNames"`
	// contains filtered or unexported fields
}

Board Type for Trello Board

func (*Board) Actions

func (b *Board) Actions(arg ...*Argument) (actions []Action, err error)

Actions - Get Actions for a Board - URL LINK?

func (*Board) AddLabel

func (b *Board) AddLabel(name, color string) (label *Label, err error)

AddLabel - Create a Label on a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-post NOTE: Color can be an empty string

func (*Board) AddList

func (b *Board) AddList(opts List) (list *List, err error)

AddList - Add a List to a Board

func (*Board) AddMember added in v0.4.0

func (b *Board) AddMember(member *Member, memberType string) (err error)

AddMember - Add a Member to a board memberType can be admin, normal or observer (if left blank will default to normal) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-idmember-put

func (*Board) Card

func (b *Board) Card(IDCard string) (card *Card, err error)

Card - Get a card on a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-idcard-get

func (*Board) Cards

func (b *Board) Cards() (cards []Card, err error)

Cards - Get cards on a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-get

func (*Board) Checklists

func (b *Board) Checklists() (checklists []Checklist, err error)

Checklists - Get checklists on a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-checklists-get

func (*Board) Delete added in v0.3.0

func (b *Board) Delete() (err error)

Delete - Update a Board (path and value, see API docs for details)

*WARNING* - No Confirmation Dialog!

- https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-delete

func (*Board) Duplicate added in v0.3.0

func (b *Board) Duplicate(name string, keepCards bool) (board *Board, err error)

Duplicate - Duplicate (Copy) Board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post

func (*Board) GetMembers added in v0.4.0

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

GetMembers - Get the members of a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-get

func (*Board) GetMembership added in v0.4.0

func (b *Board) GetMembership(id string) (membership *Membership, err error)

GetMembership - Get a Membership of a board by ID Get information about the memberships users have to the board. filter: Valid Values: admins, all, none, normal (default: all) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-memberships-get

func (*Board) GetMembershipForMember added in v0.4.0

func (b *Board) GetMembershipForMember(member *Member) (membership *Membership, err error)

GetMembershipForMember - Return a Membership that matches a specific Member

func (*Board) GetMemberships added in v0.4.0

func (b *Board) GetMemberships() (memberships []*Membership, err error)

GetMemberships - Get Memberships of a board Get information about the memberships users have to the board. filter: Valid Values: admins, all, none, normal (default: all) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-memberships-get

func (*Board) IsAdmin added in v0.4.0

func (b *Board) IsAdmin(member *Member) (isAdmin bool)

IsAdmin - Check to see if a member is an admin

func (*Board) Labels

func (b *Board) Labels() (labels []Label, err error)

Labels - Get Labels on a Board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get

func (*Board) Lists

func (b *Board) Lists() (lists []List, err error)

Lists - Get lists on a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-lists-get

func (*Board) MemberCards

func (b *Board) MemberCards(IDMember string) (cards []Card, err error)

MemberCards - Get cards for a member ID (string) on a board? - URL Link?

func (*Board) RemoveMember added in v0.4.0

func (b *Board) RemoveMember(member *Member) (err error)

RemoveMember - Remove a Member from a board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-idmember-put

func (*Board) SetBackground added in v0.3.0

func (b *Board) SetBackground(background string) (err error)

SetBackground - Sets background on board background can be a color or a background id

func (*Board) SetDescription added in v0.3.0

func (b *Board) SetDescription(description string) (err error)

SetDescription - Sets background on board

func (*Board) Update added in v0.3.0

func (b *Board) Update(path, value string) (err error)

Update - Update a Board (path and value, see API docs for details) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put

type BoardBackground

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

BoardBackground Type

type Card

type Card struct {
	ID                    string   `json:"id"`
	Name                  string   `json:"name"`
	Email                 string   `json:"email"`
	IDShort               int      `json:"idShort"`
	IDAttachmentCover     string   `json:"idAttachmentCover"`
	IDCheckLists          []string `json:"idCheckLists"`
	IDBoard               string   `json:"idBoard"`
	IDList                string   `json:"idList"`
	IDMembers             []string `json:"idMembers"`
	IDMembersVoted        []string `json:"idMembersVoted"`
	ManualCoverAttachment bool     `json:"manualCoverAttachment"`
	Closed                bool     `json:"closed"`
	Pos                   float64  `json:"pos"`
	ShortLink             string   `json:"shortLink"`
	DateLastActivity      string   `json:"dateLastActivity"`
	ShortURL              string   `json:"shortUrl"`
	Subscribed            bool     `json:"subscribed"`
	URL                   string   `json:"url"`
	Due                   string   `json:"due"`
	Desc                  string   `json:"desc"`
	DescData              struct {
		Emoji struct{} `json:"emoji"`
	} `json:"descData"`
	CheckItemStates []struct {
		IDCheckItem string `json:"idCheckItem"`
		State       string `json:"state"`
	} `json:"checkItemStates"`
	Badges struct {
		Votes              int    `json:"votes"`
		ViewingMemberVoted bool   `json:"viewingMemberVoted"`
		Subscribed         bool   `json:"subscribed"`
		Fogbugz            string `json:"fogbugz"`
		CheckItems         int    `json:"checkItems"`
		CheckItemsChecked  int    `json:"checkItemsChecked"`
		Comments           int    `json:"comments"`
		Attachments        int    `json:"attachments"`
		Description        bool   `json:"description"`
		Due                string `json:"due"`
	} `json:"badges"`
	Labels []Label `json:"labels"`
	// contains filtered or unexported fields
}

Card - Trello Card Type

func (*Card) Actions

func (c *Card) Actions() (actions []Action, err error)

Actions - Get Actions on a card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-get

func (*Card) AddChecklist

func (c *Card) AddChecklist(name string) (checklist *Checklist, err error)

AddChecklist - Create a Checklist on a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-checklists-post

func (*Card) AddComment

func (c *Card) AddComment(text string) (action *Action, err error)

AddComment will add a new comment to the card https://developers.trello.com/advanced-reference/card#post-1-cards-card-id-or-shortlink-actions-comments

func (*Card) AddLabel

func (c *Card) AddLabel(id string) (ids []string, err error)

AddLabel - Add Label to a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post Returns an array of cards labels ids

func (*Card) AddMember

func (c *Card) AddMember(member *Member) (members []*Member, err error)

AddMember - Add a member to a card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post The AddMember function requires a member (pointer) to add It returns the resulting member-list https://developers.trello.com/v1.0/reference#cardsididmembers

func (*Card) AddNewLabel

func (c *Card) AddNewLabel(name, color string) (label *Label, err error)

AddNewLabel - Add a Label to a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post

func (*Card) Archive

func (c *Card) Archive(mode bool) error

Archive - Archive (close) a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put If mode is true, card is archived, otherwise it's unarchived (returns to the board)

func (*Card) Attachments

func (c *Card) Attachments() (attachments []Attachment, err error)

Attachments - Get Attachments on a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-attachments-get

func (*Card) Checklists

func (c *Card) Checklists() (checklists []Checklist, err error)

Checklists - Get Checklists on a Card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-checklists-get

func (*Card) Members

func (c *Card) Members() (members []*Member, err error)

Members - Get the Members of a card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-members-get

func (*Card) Move

func (c *Card) Move(pos string) (err error)

Move - Move Card Position (Update a Card) - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put pos can be "bottom", "top" or a positive number

func (*Card) MoveToList

func (c *Card) MoveToList(dstList List) (err error)

MoveToList - Move a card to a list

func (*Card) RemoveMember

func (c *Card) RemoveMember(member *Member) (members []*Member, err error)

RemoveMember - Remove a member from a card - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-idmember-delete The RemoveMember function requires a member (pointer) to delete It returns the resulting member-list

func (*Card) SetDescription

func (c *Card) SetDescription(desc string) (err error)

SetDescription - Set Description on Card (Update a Card) - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put

func (*Card) SetName

func (c *Card) SetName(name string) (err error)

SetName - Set Name on Card (Update a Card) - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put

type Checklist

type Checklist struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	IDBoard    string          `json:"idBoard"`
	IDCard     string          `json:"idCard"`
	Pos        float32         `json:"pos"`
	CheckItems []ChecklistItem `json:"checkItems"`
	// contains filtered or unexported fields
}

Checklist is a representation of a checklist on a trello card https://developers.trello.com/advanced-reference/checklist

func (*Checklist) AddItem

func (c *Checklist) AddItem(name string, pos string, checked bool) (checklistItem *ChecklistItem, err error)

AddItem will add a new item to the given checklist. The position will default to 'bottom' if nil and the item will default to 'unchecked'.

name must have a length 1 <= length <= 16384
pos can take the values 'top', 'bottom', or a positive integer

https://developers.trello.com/advanced-reference/checklist#post-1-checklists-idchecklist-checkitems

func (*Checklist) Delete

func (c *Checklist) Delete() error

Delete will delete the checklist https://developers.trello.com/advanced-reference/checklist#delete-1-checklists-idchecklist

type ChecklistItem

type ChecklistItem struct {
	State    string `json:"state"`
	ID       string `json:"id"`
	Name     string `json:"name"`
	NameData struct {
		Emoji struct{} `json:"emoji"`
	} `json:"nameData"`
	Pos int `json:"pos"`
	// contains filtered or unexported fields
}

ChecklistItem - Trello Checklist Item (member of Checklist)

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client - Trello Client Type

func NewAuthClient

func NewAuthClient(applicationKey string, token *string) (*Client, error)

NewAuthClient will create a trello client which allows authentication. It uses NewBearerTokenTransport to create an http.Client which can be used as a trello client.

func NewClient

func NewClient() (*Client, error)

NewClient returns a client needed to make trello API calls. If transport is nil all API calls will be unauthenticated. If you have a bearer token, NewBearerTokenTransport() may be helpful in making calls authenticated.

func NewCustomClient

func NewCustomClient(client *http.Client) (*Client, error)

NewCustomClient can be used to implement your own client

func (*Client) Board

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

Board - Get board by boardID - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-get

func (*Client) Card

func (c *Client) Card(CardID string) (card *Card, err error)

Card - Retrieve card by card ID - https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-get

func (*Client) CreateBoard added in v0.3.0

func (c *Client) CreateBoard(name string) (board *Board, err error)

CreateBoard - Create Board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(hook Webhook) (webhook *Webhook, err error)

CreateWebhook - Create a Webhook - https://developer.atlassian.com/cloud/trello/rest/api-group-webhooks/#api-webhooks-post

func (*Client) Delete

func (c *Client) Delete(resource string) ([]byte, error)

Delete - HTTP DELETE

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(webhookID string) (err error)

DeleteWebhook - Delete a Webhook by id (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-webhooks/#api-webhooks-id-delete

func (*Client) Get

func (c *Client) Get(resource string) ([]byte, error)

Get - HTTP GET

func (*Client) List

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

List - Get List by listID (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-get

func (*Client) Member

func (c *Client) Member(nick string) (member *Member, err error)

Member returns a member (NOTE: "me" defaults to yourself) - https://developer.atlassian.com/cloud/trello/rest/api-group-members/#api-members-id-get

func (*Client) Notification

func (c *Client) Notification(notificationID string) (notification *Notification, err error)

Notification - Get Notification by notificationId (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-notifications/#api-notifications-id-get

func (*Client) Organization

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

Organization - Get Organization by orgId (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-organizations/#api-organizations-id-get

func (*Client) Post

func (c *Client) Post(resource string, data url.Values) ([]byte, error)

Post - HTTP POST

func (*Client) Put

func (c *Client) Put(resource string, data url.Values) ([]byte, error)

Put - HTTP PUT

func (*Client) Version

func (c *Client) Version() string

Version - Trello API Version

func (*Client) Webhook

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

Webhook - Get Webhook by id (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-webhooks/#api-webhooks-id-get

func (*Client) Webhooks

func (c *Client) Webhooks(token string) (webhooks []Webhook, err error)

Webhooks - Get Webhooks for a token (string) https://developer.atlassian.com/cloud/trello/rest/api-group-tokens/#api-tokens-token-webhooks-get

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 - Label Type

func (*Label) Delete added in v0.3.0

func (l *Label) Delete() error

Delete - Delete a Label - https://developer.atlassian.com/cloud/trello/rest/api-group-labels/#api-labels-id-delete

func (*Label) SetColor added in v0.3.0

func (l *Label) SetColor(color string) (err error)

SetColor - Set Color for Label (Update a Label) - https://developer.atlassian.com/cloud/trello/rest/api-group-labels/#api-labels-id-put Color can be null

func (*Label) SetName added in v0.3.0

func (l *Label) SetName(name string) (err error)

SetName - Set Name on a Label (Update a Label) - https://developer.atlassian.com/cloud/trello/rest/api-group-labels/#api-labels-id-put

func (*Label) Update added in v0.3.0

func (l *Label) Update(path, value string) (err error)

Update - Update a Label (path and value, see API docs for details) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put

type List

type List struct {
	ID      string  `json:"id"`
	Name    string  `json:"name"`
	Closed  bool    `json:"closed"`
	IDBoard string  `json:"idBoard"`
	Pos     float32 `json:"pos"`
	// contains filtered or unexported fields
}

List - Trello List Type

func (*List) Actions

func (l *List) Actions() (actions []Action, err error)

Actions - Get Actions for a List - https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-actions-get

func (*List) AddCard

func (l *List) AddCard(opts Card) (card *Card, err error)

AddCard creates with the attributes of the supplied Card struct https://developers.trello.com/advanced-reference/card#post-1-cards

func (*List) Archive

func (l *List) Archive(mode bool) (err error)

Archive - Archive List If mode is true, list is archived, otherwise it's unarchived (returns to the board)

func (*List) Cards

func (l *List) Cards() (cards []Card, err error)

Cards - Get Cards in a List - https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-cards-get

func (*List) Move

func (l *List) Move(pos string) (err error)

Move - Move a List (Update a List) - https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-put pos can be "bottom", "top" or a positive number

type Member

type Member struct {
	ID         string `json:"id"`
	AvatarHash string `json:"avatarHash"`
	Bio        string `json:"bio"`
	BioData    struct {
		Emoji interface{} `json:"emoji,omitempty"`
	} `json:"bioData"`
	Confirmed                bool     `json:"confirmed"`
	FullName                 string   `json:"fullName"`
	IDPremOrgsAdmin          []string `json:"idPremOrgsAdmin"`
	Initials                 string   `json:"initials"`
	MemberType               string   `json:"memberType"`
	Products                 []int    `json:"products"`
	Status                   string   `json:"status"`
	URL                      string   `json:"url"`
	Username                 string   `json:"username"`
	AvatarSource             string   `json:"avatarSource"`
	Email                    string   `json:"email"`
	GravatarHash             string   `json:"gravatarHash"`
	IDBoards                 []string `json:"idBoards"`
	IDBoardsPinned           []string `json:"idBoardsPinned"`
	IDOrganizations          []string `json:"idOrganizations"`
	LoginTypes               []string `json:"loginTypes"`
	NewEmail                 string   `json:"newEmail"`
	OneTimeMessagesDismissed []string `json:"oneTimeMessagesDismissed"`
	Prefs                    struct {
		SendSummaries                 bool   `json:"sendSummaries"`
		MinutesBetweenSummaries       int    `json:"minutesBetweenSummaries"`
		MinutesBeforeDeadlineToNotify int    `json:"minutesBeforeDeadlineToNotify"`
		ColorBlind                    bool   `json:"colorBlind"`
		Locale                        string `json:"locale"`
	} `json:"prefs"`
	Trophies           []string `json:"trophies"`
	UploadedAvatarHash string   `json:"uploadedAvatarHash"`
	PremiumFeatures    []string `json:"premiumFeatures"`
	// contains filtered or unexported fields
}

Member tello member struct

func (*Member) AddBoard

func (m *Member) AddBoard(name string) (*Board, error)

AddBoard creates a new Board - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post

func (*Member) AvatarURL

func (m *Member) AvatarURL() string

AvatarURL returns avatar URL for member TODO: Avatar sizes [170, 30]

func (*Member) Boards

func (m *Member) Boards(field ...string) (boards []*Board, err error)

Boards returns members boards - https://developer.atlassian.com/cloud/trello/rest/api-group-members/#api-members-id-boards-get

type Membership added in v0.4.0

type Membership struct {
	Board       *Board
	ID          string `json:"id" pattern:"^[0-9a-fA-F]{32}$"` // Pattern: ^[0-9a-fA-F]{32}$
	IDMember    string `json:"idMember"`
	MemberType  string `json:"memberType"`
	Unconfirmed bool   `json:"unconfirmed"`
	Deactivated bool   `json:"deactivated"`
	// contains filtered or unexported fields
}

Membership tello membership struct - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-memberships-get

func (*Membership) Update added in v0.4.0

func (m *Membership) Update(memberType, memberFields string) (err error)

Update - Update Membership of Member on a Board memberType can be admin, normal or observer (if left blank will default to normal) - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-memberships-idmembership-put

type Notification

type Notification struct {
	ID     string `json:"id"`
	Unread bool   `json:"unread"`
	Type   string `json:"type"`
	Date   string `json:"date"`
	Data   struct {
		ListBefore struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"listBefore"`
		ListAfter struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"listAfter"`
		Board struct {
			ID        string `json:"id"`
			Name      string `json:"name"`
			ShortLink string `json:"shortLink"`
		} `json:"board"`
		Card struct {
			ID        string `json:"id"`
			Name      string `json:"name"`
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
		} `json:"card"`
		Old struct {
			IDList string `json:"idList"`
		} `json:"old"`
	} `json:"data"`
	IDMemberCreator string `json:"idMemberCreator"`
	MemberCreator   struct {
		ID         string `json:"id"`
		AvatarHash string `json:"avatarHash"`
		FullName   string `json:"fullName"`
		Initials   string `json:"initials"`
		Username   string `json:"username"`
	} `json:"memberCreator"`
	// contains filtered or unexported fields
}

Notification - Trello Notification Type

type Organization

type Organization struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Desc        string `json:"desc"`
	DescData    struct {
		Emoji struct{} `json:"emoji"`
	} `json:"descData"`
	URL      string   `json:"url"`
	Website  string   `json:"website"`
	LogoHash string   `json:"logoHash"`
	Products []string `json:"products"`
	PowerUps []string `json:"powerUps"`
	// contains filtered or unexported fields
}

Organization - Trello Organization Type

func (*Organization) AddBoard

func (o *Organization) AddBoard(name string) (board *Board, err error)

AddBoard - Create a new Board in the organization - https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post

func (*Organization) Boards

func (o *Organization) Boards() (boards []*Board, err error)

Boards - Get Boards in an Organization - https://developer.atlassian.com/cloud/trello/rest/api-group-organizations/#api-organizations-id-boards-get

func (*Organization) Members

func (o *Organization) Members() (members []*Member, err error)

Members - Get the Members of an Organization - https://developer.atlassian.com/cloud/trello/rest/api-group-organizations/#api-organizations-id-members-get

type Webhook

type Webhook struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	IDModel     string `json:"idModel"`
	CallbackURL string `json:"callbackURL"`
	Active      bool   `json:"active"`
	// contains filtered or unexported fields
}

Webhook - Trello Webhook Type

func (*Webhook) Delete added in v0.3.0

func (w *Webhook) Delete() (err error)

Delete - Delete a Webhook (string) - https://developer.atlassian.com/cloud/trello/rest/api-group-webhooks/#api-webhooks-id-delete

func (*Webhook) SetActive added in v0.3.0

func (w *Webhook) SetActive(active bool) (err error)

SetActive - Set Active for WebHook true - active, false - inactive

func (*Webhook) SetCallbackURL added in v0.3.0

func (w *Webhook) SetCallbackURL(callbackURL string) (err error)

SetCallbackURL - Set SetCallbackURL for WebHook

func (*Webhook) SetDescription added in v0.3.0

func (w *Webhook) SetDescription(description string) (err error)

SetDescription - Set Description for WebHook

func (*Webhook) SetIDModel added in v0.3.0

func (w *Webhook) SetIDModel(model string) (err error)

SetIDModel - Set IDModel for WebHook

Jump to

Keyboard shortcuts

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