miro

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointBoards = "boards"

	// QueryParamCopyFrom Unique identifier (ID) of the board that you want to copy (required).
	QueryParamCopyFrom = "copy_from"

	// SortDefault If team_id is present, last_created. Otherwise, last_opened
	SortDefault = "default"
	// SortLastModified sort by the date and time when the board was last modified
	SortLastModified = "last_modified"
	// SortLastOpened sort by the date and time when the board was last opened
	SortLastOpened = "last_opened"
	// SortLastCreated sort by the date and time when the board was created
	SortLastCreated = "last_created"
	// SortAlphabetically sort by the board name (alphabetically)
	SortAlphabetically = "alphabetically"

	CopyAccessAnyone      = "anyone"
	CopyAccessTeamMembers = "team_members"
	CopyAccessTeamEditors = "team_editors"
	CopyAccessBoardOwner  = "board_owner"

	AccessTeamMemberWithEditingRights = "team_members_with_editing_rights"
	AccessBoardOwnersAndCoOwners      = "board_owners_and_coowners"

	CollabToolsStartAccessAllEditors = "all_editors"

	AccessPrivate = "private"
	AccessView    = "view"
	AccessComment = "comment"
	AccessEdit    = "edit"

	InviteAccessViewer    = "viewer"
	InviteAccessCommenter = "commenter"
	InviteAccessEditor    = "editor"
	InviteAccessNoAccess  = "no_access"
)

Variables

This section is empty.

Functions

func EncodeQueryParams

func EncodeQueryParams(queryParams []Parameter) string

Types

type BasicTeamInfo

type BasicTeamInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type BasicUserInfo

type BasicUserInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type Board

type Board struct {
	ID                    string                `json:"id"`
	Name                  string                `json:"name"`
	Description           string                `json:"description"`
	Team                  BasicTeamInfo         `json:"team"`
	Picture               Picture               `json:"picture"`
	Policy                Policy                `json:"policy"`
	ViewLink              string                `json:"viewLink"`
	Owner                 BasicUserInfo         `json:"owner"`
	CurrentUserMembership CurrentUserMembership `json:"currentUserMembership"`
	CreatedAt             time.Time             `json:"createdAt"`
	CreatedBy             BasicUserInfo         `json:"createdBy"`
	ModifiedAt            time.Time             `json:"modifiedAt"`
	ModifiedBy            BasicUserInfo         `json:"modifiedBy"`
	Links                 BoardLinks            `json:"links"`
	Type                  string                `json:"type"`
	Project               Project               `json:"project,omitempty"`
}

type BoardData

type BoardData struct {
	ID                    string                `json:"id"`
	Type                  string                `json:"type"`
	Name                  string                `json:"name"`
	Description           string                `json:"description"`
	Links                 BoardLinks            `json:"links"`
	CreatedAt             time.Time             `json:"createdAt"`
	CreatedBy             BasicUserInfo         `json:"createdBy"`
	CurrentUserMembership CurrentUserMembership `json:"currentUserMembership,omitempty"`
	ModifiedAt            time.Time             `json:"modifiedAt"`
	ModifiedBy            BasicUserInfo         `json:"modifiedBy"`
	Owner                 BasicUserInfo         `json:"owner"`
	PermissionsPolicy     PermissionsPolicy     `json:"permissionsPolicy"`
	Policy                Policy                `json:"policy"`
	Project               Project               `json:"project,omitempty"`
	SharingPolicy         SharingPolicy         `json:"sharingPolicy"`
	Team                  BasicTeamInfo         `json:"team"`
	ViewLink              string                `json:"viewLink"`
}
type BoardLinks struct {
	Related string `json:"related"`
	Self    string `json:"self"`
}

type BoardMembersService

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

type BoardQueryParams

type BoardQueryParams struct {
	// TeamID The team_id for which you want to retrieve the list of boards. If this parameter is sent in the request,
	// the query and owner parameters are ignored.
	TeamID string `query:"team_id,omitempty"`
	// Query Retrieves a list of boards that contain the query string provided in the board content or board name.
	// For example, if you want to retrieve a list of boards that contain the word beta within the board itself (board content),
	// add beta as the query parameter value. You can use the query parameter with the owner parameter to narrow down the board search results.
	Query string `query:"query,omitempty"`
	// Owner Retrieves a list of boards that belong to a specific owner ID. You must pass the owner ID (for example,
	//3074457353169356300), not the owner name. You can use the 'owner' parameter with the query parameter to narrow
	//down the board search results. Note that if you pass the team_id in the same request, the owner parameter is ignored.
	Owner string `query:"owner,omitempty"`
	// Limit The maximum number of boards to retrieve.
	// Default: 20
	Limit string `query:"limit,omitempty"`
	// The (zero-based) offset of the first item in the collection to return.
	// Default: 0.
	Offset string `query:"offset,omitempty"`
	// Sort The order in which you want to view the result set.
	// Options last_created and alphabetically are applicable only when you search for boards by team.
	Sort string `query:"sort,omitempty"`
}

type BoardsService

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

func (*BoardsService) Copy

func (b *BoardsService) Copy(body CreateBoard, copyFrom string) (*Board, error)

Copy Creates a copy of an existing board. You can also update the name, description, sharing policy, and permissions policy for the new board in the request body. Required scope: boards:write | Rate limiting: Level 4

func (*BoardsService) Create

func (b *BoardsService) Create(body CreateBoard) (*Board, error)

Create a board with the specified name and sharing policies. Required scope: boards:write | Rate limiting: Level 3

func (*BoardsService) Get

func (b *BoardsService) Get(id string) (*Board, error)

Get Retrieves information about a board. Required scope: boards:read | Rate limiting: Level 1

func (*BoardsService) GetAll

func (b *BoardsService) GetAll(queryParams ...BoardQueryParams) (*ListBoards, error)

GetAll Retrieves a list of boards that match the search criteria provided in the request. Required scope: boards:read | Rate limiting: Level 1 Search query params: BoardQueryParams{}

type Client

type Client struct {
	BaseURL string

	Boards *BoardsService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) Get

func (c *Client) Get(url string, response interface{}, queryParams ...Parameter) error

Get takes a client, API endpoint and a pointer to a struct then writes the API response data to that struct

func (*Client) Post

func (c *Client) Post(url string, body, response interface{}) error

func (*Client) Put

func (c *Client) Put(url string, body, response interface{}, queryParams ...Parameter) error

type CreateBoard

type CreateBoard struct {
	// Description of the board.
	Description string `json:"description"`
	// Name for the board.
	Name string `json:"name"`
	// Policy Defines the permissions policies and sharing policies for the board.
	Policy Policy `json:"policy"`
	// TeamID Unique identifier (ID) of the team where the board must be placed.
	TeamID string `json:"teamId"`
}

type CurrentUserMembership

type CurrentUserMembership struct {
	BasicUserInfo
	Role string `json:"role"`
}

type ListBoards

type ListBoards struct {
	Data   []*BoardData     `json:"data"`
	Links  *ListBoardsLinks `json:"links"`
	Type   string           `json:"type"`
	Total  int              `json:"total"`
	Size   int              `json:"size"`
	Offset int              `json:"offset"`
	Limit  int              `json:"limit"`
}
type ListBoardsLinks struct {
	First string `json:"first,omitempty"`
	Last  string `json:"last,omitempty"`
	Next  string `json:"next,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Self  string `json:"self,omitempty"`
}

type Parameter

type Parameter map[string]string

func ParseQueryTags

func ParseQueryTags(v interface{}) []Parameter

type PermissionsPolicy

type PermissionsPolicy struct {
	// CollaborationToolsStartAccess Defines who can start or stop timer, voting, video chat, screen sharing, attention management.
	// Others will only be able to join. To change the value for the collaborationToolsStartAccess parameter, contact Miro Customer Support.
	// Valid options: all_editors | board_owners_and_coowners
	CollaborationToolsStartAccess string `json:"collaborationToolsStartAccess"`
	// CopyAccess Defines who can copy the board, copy objects, download images, and save the board as a template or PDF.
	// Valid options: anyone | team_members | team_editors | board_owner
	CopyAccess string `json:"copyAccess"`
	// CopyAccessLevel ...
	CopyAccessLevel string `json:"copyAccessLevel"`
	// SharingAccess Defines who can change access and invite users to this board. To change the value for the sharingAccess
	// parameter, contact Miro Customer Support.
	// Valid options: team_members_with_editing_rights | board_owners_and_coowners
	SharingAccess string `json:"sharingAccess"`
}

PermissionsPolicy Defines the permissions policies for the board.

type Picture

type Picture struct {
	ID       string `json:"id"`
	ImageURL string `json:"imageURL"`
}

type Policy

type Policy struct {
	// PermissionsPolicy Defines the permissions policies for the board.
	PermissionsPolicy `json:"permissionsPolicy"`
	// SharingPolicy Defines the public-level, organization-level, and team-level access for the board. The access level
	// that a user gets depends on the highest level of access that results from considering the public-level, team-level,
	// organization-level, and direct sharing access.
	SharingPolicy `json:"sharingPolicy"`
}

type Project

type Project struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
}

type ResponseError

type ResponseError struct {
	// Status code of the error
	Status int `json:"status"`
	// Code of the error
	Code string `json:"code"`
	// Description of the error
	Message string `json:"message"`
	// Type of the error
	Type string `json:"type"`
}

type ShareBoardRequest

type ShareBoardRequest struct {
	Emails []string `json:"emails"`
}

type SharingPolicy

type SharingPolicy struct {
	// Access Defines the public-level access to the board.
	// Valid options: private | view | edit | comment
	Access string `json:"access"`
	// InviteToAccountAndBoardLinkAccess Defines the user role when inviting a user via the invite to team and board link.
	// For Enterprise users, this parameter is always set to no_access regardless of the value that you assign for this parameter.
	// Valid options: viewer | commenter | editor | no_access
	InviteToAccountAndBoardLinkAccess string `json:"inviteToAccountAndBoardLinkAccess"`
	// OrganizationAccess Defines the organization-level access to the board. If the board is created for a team that does
	// not belong to an organization, the organizationAccess parameter is always set to the default value.
	// Valid options: private | view | edit | comment
	OrganizationAccess string `json:"organizationAccess"`
	// TeamAccess Defines the team-level access to the board.
	// Valid options: private | view | edit | comment
	TeamAccess string `json:"teamAccess"`
}

type Team

type Team struct {
	BasicTeamInfo
	CreatedAt  time.Time      `json:"createdAt"`
	ModifiedAt time.Time      `json:"modifiedAt"`
	CreatedBy  *BasicUserInfo `json:"createdBy"`
	ModifiedBy *BasicUserInfo `json:"modifiedBy"`
	Picture    *Picture       `json:"picture"`
}

type User

type User struct {
	BasicUserInfo
	Company   string    `json:"company"`
	Role      string    `json:"role"`
	Industry  string    `json:"industry"`
	Email     string    `json:"email"`
	State     string    `json:"state"`
	CreatedAt time.Time `json:"createdAt"`
	Picture   *Picture  `json:"picture"`
}

Jump to

Keyboard shortcuts

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