miro

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// EndpointOAUTHToken /oauth-token endpoint
	EndpointOAUTHToken = "oauth-token"
	// EndpointOAUTH /oauth endpoint
	EndpointOAUTH = "oauth"
)
View Source
const (
	// EndpointBoards /boards endpoint
	EndpointBoards = "boards"

	// QueryParamCopyFrom Unique identifier (ID) of the board that you want to copy (required).
	QueryParamCopyFrom = "copy_from"
)
View Source
const (
	AccessPrivate Access = "private"
	AccessView    Access = "view"
	AccessEdit    Access = "edit"
	AccessComment Access = "comment"

	InviteAccessNoAccess  InviteAccess = "no_access"
	InviteAccessViewer    InviteAccess = "viewer"
	InviteAccessCommenter InviteAccess = "commenter"
	InviteAccessEditor    InviteAccess = "editor"
)
View Source
const (
	CollabAccessAllEditors             CollabAccess = "all_editors"
	CollabAccessBoardOwnersAndCoOwners CollabAccess = "board_owners_and_coowners"

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

	SharingAccessTeamMemberWithEditingRights SharingAccess = "team_members_with_editing_rights"
	SharingAccessOwnersAndCoOwners           SharingAccess = "owner_and_coowners"
)

Variables

This section is empty.

Functions

func EncodeQueryParams

func EncodeQueryParams(queryParams []Parameter) string

Types

type Access added in v1.0.4

type Access string

type AccessToken added in v1.0.4

type AccessToken struct {
	Type         string          `json:"type"`
	Team         BasicEntityInfo `json:"team"`
	CreatedBy    BasicEntityInfo `json:"createdBy"`
	Scopes       []string        `json:"scopes"`
	Organization BasicEntityInfo `json:"organization"`
	User         BasicEntityInfo `json:"user"`
}

type AccessTokenService added in v1.0.4

type AccessTokenService struct {
	BaseVersion string
	// contains filtered or unexported fields
}

func (*AccessTokenService) Get added in v1.0.4

func (a *AccessTokenService) Get() (*AccessToken, error)

Get information about an access token, such as the token type, scopes, team, user, token creation date and time, and the user who created the token.

func (*AccessTokenService) Revoke added in v1.0.4

func (a *AccessTokenService) Revoke(accessToken string) error

Revoke Revoking an access token means that the access token will no longer work. When an access token is revoked, the refresh token is also revoked and no longer valid. This does not uninstall the application for the user.

type BasicEntityInfo added in v1.0.4

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

BasicEntityInfo info type for different entities (i.e. users, teams & organizations)

type Board

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

type BoardInvitationResponse added in v1.0.4

type BoardInvitationResponse struct {
	Failed []struct {
		Email  string `json:"email,omitempty"`
		Reason string `json:"reason,omitempty"`
	} `json:"failed,omitempty"`
	Successful string `json:"successful,omitempty"`
}
type BoardLinks struct {
	Related string `json:"related"`
	Self    string `json:"self"`
}

type BoardMember added in v1.0.4

type BoardMember struct {
	BasicEntityInfo
	Role  Role            `json:"role"`
	Links PaginationLinks `json:"links,omitempty"`
}

type BoardMemberSearchParams added in v1.0.4

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

type BoardMembersService

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

func (*BoardMembersService) Delete added in v1.0.4

func (b *BoardMembersService) Delete(boardID, boardMemberID string) error

Delete Removes a board member from a board. Required scope: boards:write | Rate limiting: Level 2

func (*BoardMembersService) Get added in v1.0.4

func (b *BoardMembersService) Get(boardID, boardMemberID string) (*BoardMember, error)

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

func (*BoardMembersService) GetAll added in v1.0.4

func (b *BoardMembersService) GetAll(boardID string, queryParams ...BoardMemberSearchParams) (*ListBoardMembersResponse, error)

GetAll Retrieves a pageable list of members for a board. Required scope: boards:read | Rate limiting: Level 1 Search query params: BoardMemberSearchParams{}

func (*BoardMembersService) ShareBoard added in v1.0.4

func (b *BoardMembersService) ShareBoard(payload ShareBoardInvitation, boardID string) (*BoardInvitationResponse, error)

ShareBoard Shares the board and Invites new members to collaborate on a board by sending an invitation email. Depending on the board's Sharing policy, there might be various scenarios where membership in the team is required in order to share the board with a user. Required scope: boards:write | Rate limiting: Level 3

func (*BoardMembersService) Update added in v1.0.4

func (b *BoardMembersService) Update(boardID, boardMemberID string, role Role) (*BoardMember, error)

Update Updates the role of a board member. Required scope: boards:write | Rate limiting: Level 2

type BoardSearchParams added in v1.0.2

type BoardSearchParams 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 Sort `query:"sort,omitempty"`
}

type BoardsService

type BoardsService struct {
	BaseVersion string
	// 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) Delete added in v1.0.3

func (b *BoardsService) Delete(id string) error

Delete Deletes a board. 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 ...BoardSearchParams) (*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: BoardSearchParams{}

func (*BoardsService) Update added in v1.0.2

func (b *BoardsService) Update(body CreateBoard, id string) (*Board, error)

Update Updates a specific board. Required scope: boards:write | Rate limiting: Level 2

type Client

type Client struct {
	BaseURL string

	AccessToken  *AccessTokenService
	Boards       *BoardsService
	BoardMembers *BoardMembersService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) Delete added in v1.0.3

func (c *Client) Delete(url string) error

Delete Native DELETE function

func (*Client) Get

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

Get Native GET function

func (*Client) Patch added in v1.0.2

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

Patch Native PATCH function

func (*Client) Post

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

Post Native POST function

func (*Client) PostNoContent added in v1.0.4

func (c *Client) PostNoContent(url string, queryParams ...Parameter) error

PostNoContent Native POST function (pretending to be a DELETE method... but with query params?!)

func (*Client) Put

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

Put Native PUT function

type CollabAccess added in v1.0.4

type CollabAccess string

type CopyAccess added in v1.0.4

type CopyAccess string

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 {
	BasicEntityInfo
	Role string `json:"role"`
}

type InviteAccess added in v1.0.4

type InviteAccess string

type ListBoardMembersResponse added in v1.0.4

type ListBoardMembersResponse struct {
	Data   []*BoardMember   `json:"data"`
	Total  int              `json:"total"`
	Size   int              `json:"size"`
	Offset int              `json:"offset"`
	Limit  int              `json:"limit"`
	Links  *PaginationLinks `json:"links"`
	Type   string           `json:"type"`
}

type ListBoards

type ListBoards struct {
	Data   []*Board         `json:"data"`
	Total  int              `json:"total"`
	Size   int              `json:"size"`
	Offset int              `json:"offset"`
	Limit  int              `json:"limit"`
	Links  *PaginationLinks `json:"links"`
	Type   string           `json:"type"`
}
type PaginationLinks 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 CollabAccess `json:"collaborationToolsStartAccess,omitempty"`
	// 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 CopyAccess `json:"copyAccess,omitempty"`
	// CopyAccessLevel ...
	CopyAccessLevel string `json:"copyAccessLevel,omitempty"`
	// 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 SharingAccess `json:"sharingAccess,omitempty"`
}

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,omitempty"`
	// 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,omitempty"`
}

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 Role added in v1.0.4

type Role string
const (
	RoleViewer    Role = "viewer"
	RoleCommenter Role = "commenter"
	RoleEditor    Role = "editor"
	RoleCoOwner   Role = "coowner"
	RoleOwner     Role = "owner"
	RoleGuest     Role = "guest"
)

type RoleUpdate added in v1.0.4

type RoleUpdate struct {
	Role Role `json:"role"`
}

type ShareBoardInvitation added in v1.0.4

type ShareBoardInvitation struct {
	// Emails Email IDs of the users you want to invite to the board. You can invite up to 20 members per call (required).
	Emails []string `json:"emails"`
	// Role of the board member.
	Role Role `json:"role,omitempty"`
	// Message The message that will be sent in the invitation email.
	Message string `json:"message,omitempty"`
}

type SharingAccess added in v1.0.4

type SharingAccess string

type SharingPolicy

type SharingPolicy struct {
	// Access Defines the public-level access to the board.
	// Valid options: private | view | edit | comment
	Access Access `json:"access,omitempty"`
	// 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 InviteAccess `json:"inviteToAccountAndBoardLinkAccess,omitempty"`
	// 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.
	// Warning: may result in a "One of the requested features is not supported. (4.0408)" error message if you don't have the necessary access level.
	// Valid options: private | view | edit | comment
	OrganizationAccess Access `json:"organizationAccess,omitempty"`
	// TeamAccess Defines the team-level access to the board.
	// Valid options: private | view | edit | comment
	TeamAccess Access `json:"teamAccess,omitempty"`
}

type Sort added in v1.0.4

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

type Team

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

type User

type User struct {
	BasicEntityInfo
	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