Documentation
¶
Index ¶
- type Activity
- type Channel
- type ChannelAccount
- type ChannelInfo
- type ChannelMetadata
- type Client
- func (c *Client) FindChannelByID(channelID string) (*ChannelInfo, error)
- func (c *Client) GetBotToken() (*TokenResponse, error)
- func (c *Client) GetChannel(teamID, channelID string) (*Channel, error)
- func (c *Client) GetGraphToken() (*TokenResponse, error)
- func (c *Client) ListTeamChannels(teamID string) ([]Channel, error)
- func (c *Client) ListTeams() ([]Team, error)
- func (c *Client) SendActivity(serviceURL, conversationID string, activity Activity) (*Activity, error)
- type ConversationInfo
- type Entity
- type JWK
- type JWKS
- type JWTValidator
- type Metadata
- type OnMention
- func (t *OnMention) Actions() []core.Action
- func (t *OnMention) Cleanup(ctx core.TriggerContext) error
- func (t *OnMention) Color() string
- func (t *OnMention) Configuration() []configuration.Field
- func (t *OnMention) Description() string
- func (t *OnMention) Documentation() string
- func (t *OnMention) ExampleData() map[string]any
- func (t *OnMention) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnMention) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnMention) Icon() string
- func (t *OnMention) Label() string
- func (t *OnMention) Name() string
- func (t *OnMention) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
- func (t *OnMention) Setup(ctx core.TriggerContext) error
- type OnMentionConfiguration
- type OnMentionMetadata
- type OnMessage
- func (t *OnMessage) Actions() []core.Action
- func (t *OnMessage) Cleanup(ctx core.TriggerContext) error
- func (t *OnMessage) Color() string
- func (t *OnMessage) Configuration() []configuration.Field
- func (t *OnMessage) Description() string
- func (t *OnMessage) Documentation() string
- func (t *OnMessage) ExampleData() map[string]any
- func (t *OnMessage) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnMessage) Icon() string
- func (t *OnMessage) Label() string
- func (t *OnMessage) Name() string
- func (t *OnMessage) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
- func (t *OnMessage) Setup(ctx core.TriggerContext) error
- type OnMessageConfiguration
- type OnMessageMetadata
- type OpenIDConfiguration
- type SendTextMessage
- func (c *SendTextMessage) Actions() []core.Action
- func (c *SendTextMessage) Cancel(ctx core.ExecutionContext) error
- func (c *SendTextMessage) Cleanup(ctx core.SetupContext) error
- func (c *SendTextMessage) Color() string
- func (c *SendTextMessage) Configuration() []configuration.Field
- func (c *SendTextMessage) Description() string
- func (c *SendTextMessage) Documentation() string
- func (c *SendTextMessage) ExampleOutput() map[string]any
- func (c *SendTextMessage) Execute(ctx core.ExecutionContext) error
- func (c *SendTextMessage) HandleAction(ctx core.ActionContext) error
- func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *SendTextMessage) Icon() string
- func (c *SendTextMessage) Label() string
- func (c *SendTextMessage) Name() string
- func (c *SendTextMessage) OutputChannels(configuration any) []core.OutputChannel
- func (c *SendTextMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *SendTextMessage) Setup(ctx core.SetupContext) error
- type SendTextMessageConfiguration
- type SendTextMessageMetadata
- type SubscriptionConfiguration
- type Team
- type Teams
- func (t *Teams) Actions() []core.Action
- func (t *Teams) Cleanup(ctx core.IntegrationCleanupContext) error
- func (t *Teams) Components() []core.Component
- func (t *Teams) Configuration() []configuration.Field
- func (t *Teams) Description() string
- func (t *Teams) HandleAction(ctx core.IntegrationActionContext) error
- func (t *Teams) HandleRequest(ctx core.HTTPRequestContext)
- func (t *Teams) Icon() string
- func (t *Teams) Instructions() string
- func (t *Teams) Label() string
- func (t *Teams) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (t *Teams) Name() string
- func (t *Teams) Sync(ctx core.SyncContext) error
- func (t *Teams) Triggers() []core.Trigger
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
ChannelID string `json:"channelId,omitempty"`
ServiceURL string `json:"serviceUrl,omitempty"`
From ChannelAccount `json:"from,omitempty"`
Conversation ConversationInfo `json:"conversation,omitempty"`
Recipient ChannelAccount `json:"recipient,omitempty"`
Text string `json:"text,omitempty"`
Entities []Entity `json:"entities,omitempty"`
ChannelData map[string]any `json:"channelData,omitempty"`
MembersAdded []ChannelAccount `json:"membersAdded,omitempty"`
MembersRemoved []ChannelAccount `json:"membersRemoved,omitempty"`
ReplyToID string `json:"replyToId,omitempty"`
TextFormat string `json:"textFormat,omitempty"`
AttachmentLayout string `json:"attachmentLayout,omitempty"`
}
Activity represents a Bot Framework Activity object.
type Channel ¶
type Channel struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
}
Channel represents a Microsoft Teams channel.
type ChannelAccount ¶
type ChannelAccount struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
AADObjectID string `json:"aadObjectId,omitempty"`
}
ChannelAccount represents a user or bot account.
type ChannelInfo ¶
ChannelInfo contains channel information resolved from the Graph API.
type ChannelMetadata ¶
type ChannelMetadata struct {
ID string `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
}
ChannelMetadata stores channel identification information.
type Client ¶
type Client struct {
AppID string
AppPassword string
TenantID string
// contains filtered or unexported fields
}
Client handles Bot Framework REST API and Graph API interactions.
func NewClient ¶
func NewClient(ctx core.IntegrationContext) (*Client, error)
NewClient creates a new Teams client from integration context.
func NewClientFromConfig ¶
NewClientFromConfig creates a client directly from config values.
func (*Client) FindChannelByID ¶
func (c *Client) FindChannelByID(channelID string) (*ChannelInfo, error)
FindChannelByID searches all accessible teams for a channel matching the given ID.
func (*Client) GetBotToken ¶
func (c *Client) GetBotToken() (*TokenResponse, error)
GetBotToken fetches a Bot Framework access token from Azure AD.
func (*Client) GetChannel ¶
GetChannel retrieves a specific channel by ID.
func (*Client) GetGraphToken ¶
func (c *Client) GetGraphToken() (*TokenResponse, error)
GetGraphToken fetches a Microsoft Graph API access token from Azure AD.
func (*Client) ListTeamChannels ¶
ListTeamChannels lists channels in a specific team.
type ConversationInfo ¶
type ConversationInfo struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
IsGroup bool `json:"isGroup,omitempty"`
ConversationType string `json:"conversationType,omitempty"`
TenantID string `json:"tenantId,omitempty"`
}
ConversationInfo represents a conversation.
type Entity ¶
type Entity struct {
Type string `json:"type"`
Mentioned *ChannelAccount `json:"mentioned,omitempty"`
Text string `json:"text,omitempty"`
}
Entity represents an entity in a message (mention, etc.).
type JWK ¶
type JWK struct {
KID string `json:"kid"`
N string `json:"n"`
E string `json:"e"`
Kty string `json:"kty"`
}
JWK represents a single JSON Web Key.
type JWTValidator ¶
type JWTValidator struct {
// contains filtered or unexported fields
}
JWTValidator validates Bot Framework JWT tokens.
func NewJWTValidator ¶
func NewJWTValidator(appID string) *JWTValidator
NewJWTValidator creates a new JWT validator for a given app ID.
func (*JWTValidator) ValidateToken ¶
func (v *JWTValidator) ValidateToken(tokenString string) (*jwt.Token, error)
ValidateToken validates a Bot Framework JWT token.
type Metadata ¶
type Metadata struct {
AppID string `json:"appId" mapstructure:"appId"`
TenantID string `json:"tenantId,omitempty" mapstructure:"tenantId,omitempty"`
BotName string `json:"botName,omitempty" mapstructure:"botName,omitempty"`
Installed bool `json:"installed,omitempty" mapstructure:"installed,omitempty"`
}
Metadata stores integration metadata after successful authentication.
type OnMention ¶
type OnMention struct{}
OnMention triggers when the bot is @mentioned in a Teams channel.
func (*OnMention) Configuration ¶
func (t *OnMention) Configuration() []configuration.Field
func (*OnMention) Description ¶
func (*OnMention) Documentation ¶
func (*OnMention) ExampleData ¶
func (*OnMention) HandleAction ¶
func (*OnMention) HandleWebhook ¶
func (t *OnMention) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnMention) OnIntegrationMessage ¶
func (t *OnMention) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
type OnMentionConfiguration ¶
type OnMentionConfiguration struct {
Channel string `json:"channel" mapstructure:"channel"`
ContentFilter string `json:"contentFilter" mapstructure:"contentFilter"`
}
OnMentionConfiguration defines the trigger's configurable fields.
type OnMentionMetadata ¶
type OnMentionMetadata struct {
Channel *ChannelMetadata `json:"channel,omitempty" mapstructure:"channel,omitempty"`
AppSubscriptionID *string `json:"appSubscriptionID,omitempty" mapstructure:"appSubscriptionID,omitempty"`
}
OnMentionMetadata stores metadata after trigger setup.
type OnMessage ¶
type OnMessage struct{}
OnMessage triggers when any message is posted in a Teams channel.
func (*OnMessage) Configuration ¶
func (t *OnMessage) Configuration() []configuration.Field
func (*OnMessage) Description ¶
func (*OnMessage) Documentation ¶
func (*OnMessage) ExampleData ¶
func (*OnMessage) HandleAction ¶
func (*OnMessage) HandleWebhook ¶
func (t *OnMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnMessage) OnIntegrationMessage ¶
func (t *OnMessage) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
type OnMessageConfiguration ¶
type OnMessageConfiguration struct {
Channel string `json:"channel" mapstructure:"channel"`
ContentFilter string `json:"contentFilter" mapstructure:"contentFilter"`
}
OnMessageConfiguration defines the trigger's configurable fields.
type OnMessageMetadata ¶
type OnMessageMetadata struct {
Channel *ChannelMetadata `json:"channel,omitempty" mapstructure:"channel,omitempty"`
AppSubscriptionID *string `json:"appSubscriptionID,omitempty" mapstructure:"appSubscriptionID,omitempty"`
}
OnMessageMetadata stores metadata after trigger setup.
type OpenIDConfiguration ¶
type OpenIDConfiguration struct {
JWKSURI string `json:"jwks_uri"`
}
OpenIDConfiguration represents the OpenID Connect discovery document.
type SendTextMessage ¶
type SendTextMessage struct{}
SendTextMessage sends a text message to a Teams channel.
func (*SendTextMessage) Actions ¶
func (c *SendTextMessage) Actions() []core.Action
func (*SendTextMessage) Cancel ¶
func (c *SendTextMessage) Cancel(ctx core.ExecutionContext) error
func (*SendTextMessage) Cleanup ¶
func (c *SendTextMessage) Cleanup(ctx core.SetupContext) error
func (*SendTextMessage) Color ¶
func (c *SendTextMessage) Color() string
func (*SendTextMessage) Configuration ¶
func (c *SendTextMessage) Configuration() []configuration.Field
func (*SendTextMessage) Description ¶
func (c *SendTextMessage) Description() string
func (*SendTextMessage) Documentation ¶
func (c *SendTextMessage) Documentation() string
func (*SendTextMessage) ExampleOutput ¶
func (c *SendTextMessage) ExampleOutput() map[string]any
func (*SendTextMessage) Execute ¶
func (c *SendTextMessage) Execute(ctx core.ExecutionContext) error
func (*SendTextMessage) HandleAction ¶
func (c *SendTextMessage) HandleAction(ctx core.ActionContext) error
func (*SendTextMessage) HandleWebhook ¶
func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*SendTextMessage) Icon ¶
func (c *SendTextMessage) Icon() string
func (*SendTextMessage) Label ¶
func (c *SendTextMessage) Label() string
func (*SendTextMessage) Name ¶
func (c *SendTextMessage) Name() string
func (*SendTextMessage) OutputChannels ¶
func (c *SendTextMessage) OutputChannels(configuration any) []core.OutputChannel
func (*SendTextMessage) ProcessQueueItem ¶
func (c *SendTextMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*SendTextMessage) Setup ¶
func (c *SendTextMessage) Setup(ctx core.SetupContext) error
type SendTextMessageConfiguration ¶
type SendTextMessageConfiguration struct {
Channel string `json:"channel" mapstructure:"channel"`
Text string `json:"text" mapstructure:"text"`
}
SendTextMessageConfiguration defines the action's configurable fields.
type SendTextMessageMetadata ¶
type SendTextMessageMetadata struct {
Channel *ChannelMetadata `json:"channel" mapstructure:"channel"`
}
SendTextMessageMetadata stores metadata after action setup.
type SubscriptionConfiguration ¶
type SubscriptionConfiguration struct {
EventTypes []string `json:"eventTypes"`
}
SubscriptionConfiguration defines which event types a trigger subscribes to.
type Team ¶
type Team struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
}
Team represents a Microsoft Teams team.
type Teams ¶
type Teams struct{}
Teams implements the Microsoft Teams integration.
func (*Teams) Components ¶
func (*Teams) Configuration ¶
func (t *Teams) Configuration() []configuration.Field
func (*Teams) Description ¶
func (*Teams) HandleAction ¶
func (t *Teams) HandleAction(ctx core.IntegrationActionContext) error
func (*Teams) HandleRequest ¶
func (t *Teams) HandleRequest(ctx core.HTTPRequestContext)
func (*Teams) Instructions ¶
func (*Teams) ListResources ¶
func (t *Teams) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
}
TokenResponse represents an OAuth2 token response from Azure AD.