messages

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ContentType string      `json:"contentType,omitempty"`
	Content     interface{} `json:"content,omitempty"`
}

Attachment represents a message attachment, such as an adaptive card

type Client

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

Client is the messages API client

func New

func New(webexClient *webexsdk.Client, config *Config) *Client

New creates a new Messages plugin

func (*Client) Create

func (c *Client) Create(message *Message) (*Message, error)

Create posts a new message and/or media content into a room

func (*Client) Delete

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

Delete deletes a message

func (*Client) Get

func (c *Client) Get(messageID string) (*Message, error)

Get returns a single message by ID

func (*Client) List

func (c *Client) List(options *ListOptions) (*MessagesPage, error)

List returns a list of messages in a room

func (*Client) Listen

func (c *Client) Listen(handler MessageHandler) error

Listen starts a real-time stream of message events The provided handler will be called for each new message event

func (*Client) StopListening

func (c *Client) StopListening() error

StopListening stops the real-time stream of message events

func (*Client) Update

func (c *Client) Update(messageID string, message *Message) (*Message, error)

Update updates an existing message

type Config

type Config struct {
	// Any configuration settings for the messages plugin can go here
	MercuryConfig *mercury.Config
}

Config holds the configuration for the Messages plugin

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for the Messages plugin

type ListOptions

type ListOptions struct {
	RoomID          string `url:"roomId,omitempty"`
	MentionedPeople string `url:"mentionedPeople,omitempty"`
	Before          string `url:"before,omitempty"`
	BeforeMessage   string `url:"beforeMessage,omitempty"`
	Max             int    `url:"max,omitempty"`
	ThreadID        string `url:"threadId,omitempty"`
}

ListOptions contains the options for listing messages

type Message

type Message struct {
	ID              string       `json:"id,omitempty"`
	RoomID          string       `json:"roomId,omitempty"`
	ParentID        string       `json:"parentId,omitempty"`
	ToPersonID      string       `json:"toPersonId,omitempty"`
	ToPersonEmail   string       `json:"toPersonEmail,omitempty"`
	Text            string       `json:"text,omitempty"`
	Markdown        string       `json:"markdown,omitempty"`
	HTML            string       `json:"html,omitempty"`
	Files           []string     `json:"files,omitempty"`
	PersonID        string       `json:"personId,omitempty"`
	PersonEmail     string       `json:"personEmail,omitempty"`
	Created         *time.Time   `json:"created,omitempty"`
	Updated         *time.Time   `json:"updated,omitempty"`
	MentionedPeople []string     `json:"mentionedPeople,omitempty"`
	MentionedGroups []string     `json:"mentionedGroups,omitempty"`
	Attachments     []Attachment `json:"attachments,omitempty"`
}

Message represents a Webex message

type MessageHandler

type MessageHandler func(message *Message)

MessageHandler is a function that handles a message event

type MessagesPage

type MessagesPage struct {
	Items []Message `json:"items"`
	*webexsdk.Page
}

MessagesPage represents a paginated list of messages

Jump to

Keyboard shortcuts

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