Skip to content

models

import "github.com/pzsp-teams/lib/models"

Package models contains simplified Microsoft Teams domain types used by this library.

Index

type Channel

Channel represents a Microsoft Teams channel.

type Channel struct {
    ID        string
    Name      string
    IsGeneral bool
}

type Chat

Chat represents a chat in Microsoft Teams.

type Chat struct {
    ID       string
    Type     ChatType
    IsHidden bool
    Topic    *string
}

type ChatType

ChatType represents the type of chat in Microsoft Teams. Type can be either one-on-one or group chat

type ChatType string

const (
    // ChatTypeOneOnOne represents a one-on-one chat.
    ChatTypeOneOnOne ChatType = "one-on-one"
    // ChatTypeGroup represents a group chat.
    ChatTypeGroup ChatType = "group"
)

type ListMessagesOptions

ListMessagesOptions contains options for listing messages.

type ListMessagesOptions struct {
    Top           *int32
    ExpandReplies bool
}

type Member

Member represents a member of a Microsoft Teams channel, direct chat or team.

type Member struct {
    ID          string
    UserID      string
    DisplayName string
    Role        string
    Email       string
}

type Mention

Mention represents a mention in a Microsoft Teams message.

type Mention struct {
    Kind     MentionKind
    AtID     int32
    Text     string
    TargetID string
}

type MentionKind

MentionKind represents the kind of mention in a Microsoft Teams message.

type MentionKind string

const (
    // MentionUser represents a user mention.
    MentionUser MentionKind = "user"
    // MentionChannel represents a channel mention.
    MentionChannel MentionKind = "channel"
    // MentionTeam represents a team mention.
    MentionTeam MentionKind = "team"
    // MentionEveryone represents an everyone mention - applicable to group chats only
    MentionEveryone MentionKind = "everyone"
)

type Message

Message represents a Microsoft Teams chat message. It can be used in both chats and channels.

type Message struct {
    ID              string
    Content         string
    ContentType     MessageContentType
    CreatedDateTime time.Time
    From            *MessageFrom
    ReplyCount      int
}

type MessageBody

MessageBody represents the body of a message in Microsoft Teams.

type MessageBody struct {
    Content     string
    ContentType MessageContentType
    Mentions    []Mention
}

type MessageCollection

MessageCollection represents a collection of messages, potentially with a link to the next page of results.

type MessageCollection struct {
    Messages []*Message
    NextLink *string
}

type MessageContentType

MessageContentType represents the type of content in a Microsoft Teams message. It can be either text or HTML.

type MessageContentType string

const (
    // MessageContentTypeText represents plain text content.
    MessageContentTypeText MessageContentType = "text"
    // MessageContentTypeHTML represents HTML content.
    MessageContentTypeHTML MessageContentType = "html"
)

type MessageFrom

MessageFrom represents the sender of a message in Microsoft Teams.

type MessageFrom struct {
    UserID      string
    DisplayName string
}

type Team

Team represents a Microsoft Teams team.

type Team struct {
    ID          string
    DisplayName string
    Description string
    IsArchived  bool
    Visibility  *string
}

type TeamUpdate

TeamUpdate represents the fields that can be updated for a Team.

type TeamUpdate struct {
    DisplayName *string
    Description *string
    Visibility  *string
}

Generated by gomarkdoc