bookmarks

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package bookmarks is a lightweight wrapper over the "bookmarks" methods in Slack's Web API: https://api.slack.com/methods?filter=bookmarks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Vars sdkservices.Vars
}

func (API) Add

func (a API) Add(ctx context.Context, args []sdktypes.Value, kwargs map[string]sdktypes.Value) (sdktypes.Value, error)

Add a bookmark to a channel.

Based on: https://api.slack.com/methods/bookmarks.add

Required Slack app scopes:

func (API) Edit

func (a API) Edit(ctx context.Context, args []sdktypes.Value, kwargs map[string]sdktypes.Value) (sdktypes.Value, error)

Edit a bookmark in a channel.

Based on: https://api.slack.com/methods/bookmarks.edit

Required Slack app scopes:

func (API) List

func (a API) List(ctx context.Context, args []sdktypes.Value, kwargs map[string]sdktypes.Value) (sdktypes.Value, error)

List bookmarks for a channel.

Based on: https://api.slack.com/methods/bookmarks.list

Required Slack app scopes:

func (API) Remove

func (a API) Remove(ctx context.Context, args []sdktypes.Value, kwargs map[string]sdktypes.Value) (sdktypes.Value, error)

Remove a bookmark from a channel.

Based on: https://api.slack.com/methods/bookmarks.remove

Required Slack app scopes:

type AddRequest

type AddRequest struct {
	// Channel to add bookmarks in. Required.
	ChannelID string `json:"channel_id"`
	// Title of the bookmark. Required.
	Title string `json:"title"`
	// Type of the bookmark, i.e. "link". Required.
	Type string `json:"type"`
	// Emoji tag to apply to the link.
	Emoji string `json:"emoji,omitempty"`
	// ID of the entity being bookmarked.
	// Only applies to message and file types.
	EntityID string `json:"entity_id,omitempty"`
	// Link to bookmark.
	Link string `json:"link,omitempty"`
	// ID of this bookmark's parent.
	ParentID string `json:"parent_id,omitempty"`
}

https://api.slack.com/methods/bookmarks.add#args

type AddResponse

type AddResponse struct {
	api.SlackResponse

	Bookmark *Bookmark `json:"bookmark,omitempty"`
}

https://api.slack.com/methods/bookmarks.add#examples

type Bookmark

type Bookmark struct {
	ID                  string `json:"id,omitempty"`
	ChannelID           string `json:"channel_id,omitempty"`
	Title               string `json:"title,omitempty"`
	Link                string `json:"link,omitempty"`
	Emoji               string `json:"emoji,omitempty"`
	IconURL             string `json:"icon_url,omitempty"`
	Type                string `json:"type,omitempty"`
	EntityID            string `json:"entity_id,omitempty"`
	Created             int    `json:"date_created,omitempty"`
	Updated             int    `json:"date_updated,omitempty"`
	Rank                string `json:"rank,omitempty"`
	LastUpdatedByUserID string `json:"last_updated_by_user_id,omitempty"`
	LastUpdatedByTeamID string `json:"last_updated_by_team_id,omitempty"`
	ShortcutID          string `json:"shortcut_id,omitempty"`
	AppID               string `json:"app_id,omitempty"`
	AppActionID         string `json:"app_action_id,omitempty"`
}

type EditRequest

type EditRequest struct {
	// Bookmark to update. Required.
	BookmarkID string `json:"bookmark_id"`
	// Channel to update bookmark in. Required.
	ChannelID string `json:"channel_id"`
	// Emoji tag to apply to the link.
	Emoji string `json:"emoji,omitempty"`
	// Link to bookmark.
	Link string `json:"link,omitempty"`
	// Title for the bookmark.
	Title string `json:"title,omitempty"`
}

https://api.slack.com/methods/bookmarks.edit#args

type EditResponse

type EditResponse struct {
	api.SlackResponse

	Bookmark *Bookmark `json:"bookmark,omitempty"`
}

https://api.slack.com/methods/bookmarks.edit#examples

type ListRequest

type ListRequest struct {
	// Channel to list bookmarks in. Required.
	ChannelID string `json:"channel_id"`
}

https://api.slack.com/methods/bookmarks.list#args

type ListResponse

type ListResponse struct {
	api.SlackResponse

	Bookmarks []Bookmark `json:"bookmarks,omitempty"`
}

https://api.slack.com/methods/bookmarks.list#examples

type RemoveRequest

type RemoveRequest struct {
	// Bookmark to remove. Required.
	BookmarkID string `json:"bookmark_id"`
	// Channel to remove bookmark from. Required.
	ChannelID string `json:"channel_id"`
	// Quip section ID to unbookmark.
	QuipSectionID string `json:"quip_section_id,omitempty"`
}

https://api.slack.com/methods/bookmarks.remove#args

Jump to

Keyboard shortcuts

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