Documentation
¶
Overview ¶
Package microsoftteams provides the Microsoft Teams integration definition for integrations
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrOAuthTokenMissing indicates the OAuth access token is missing ErrOAuthTokenMissing = errors.New("microsoftteams: oauth token missing") // ErrChannelMissing indicates the team_id or channel_id is missing ErrChannelMissing = errors.New("microsoftteams: team_id and channel_id are required") // ErrMessageEmpty indicates the message body is empty ErrMessageEmpty = errors.New("microsoftteams: message body is required") // ErrProfileLookupFailed indicates the Graph /me request failed ErrProfileLookupFailed = errors.New("microsoftteams: profile lookup failed") // ErrOperationConfigInvalid indicates operation config could not be decoded ErrOperationConfigInvalid = errors.New("microsoftteams: operation config invalid") // ErrChannelMessageSendFailed indicates the Graph channel message request failed ErrChannelMessageSendFailed = errors.New("microsoftteams: channel message send failed") // ErrResultEncode indicates an operation result could not be serialized ErrResultEncode = errors.New("microsoftteams: result encode failed") // ErrCredentialEncode indicates the credential could not be serialized ErrCredentialEncode = errors.New("microsoftteams: credential encode failed") // ErrCredentialDecode indicates the credential could not be deserialized ErrCredentialDecode = errors.New("microsoftteams: credential decode failed") )
Functions ¶
Types ¶
type Client ¶
type Client struct{}
Client builds Microsoft Graph service clients for one Teams installation
type Config ¶
type Config struct {
// ClientID is the Azure OAuth application client identifier
ClientID string `json:"clientid" koanf:"clientid"`
// ClientSecret is the Azure OAuth application client secret
ClientSecret string `json:"clientsecret" koanf:"clientsecret" sensitive:"true"`
// RedirectURL is the OAuth callback URL registered with the Azure application
RedirectURL string `json:"redirecturl" koanf:"redirecturl" default:"https://api.theopenlane.io/v1/integrations/auth/callback"`
}
Config holds operator-level credentials for the Microsoft Teams definition
type HealthCheck ¶
type HealthCheck struct {
// ID is the Microsoft Graph user identifier
ID string `json:"id"`
// Mail is the user's email address
Mail string `json:"mail"`
}
HealthCheck holds the result of a Microsoft Teams health check
func (HealthCheck) Handle ¶
func (h HealthCheck) Handle() types.OperationHandler
Handle adapts the health check to the generic operation registration boundary
func (HealthCheck) Run ¶
func (HealthCheck) Run(ctx context.Context, c *msgraphsdk.GraphServiceClient) (json.RawMessage, error)
Run executes the Microsoft Teams health check via Microsoft Graph
type InstallationMetadata ¶
type InstallationMetadata struct {
// TenantID is the Microsoft Entra tenant identifier extracted from the access token when available
TenantID string `json:"tenantId,omitempty" jsonschema:"title=Tenant ID"`
}
InstallationMetadata holds the stable Microsoft tenant identity for one Teams installation
func (InstallationMetadata) InstallationIdentity ¶
func (m InstallationMetadata) InstallationIdentity() types.IntegrationInstallationIdentity
InstallationIdentity implements types.InstallationIdentifiable
type MessageSend ¶
type MessageSend struct {
// TeamID is the target team identifier
TeamID string `json:"teamId"`
// ChannelID is the target channel identifier
ChannelID string `json:"channelId"`
// MessageID is the identifier of the created message
MessageID string `json:"messageId"`
}
MessageSend sends a Microsoft Teams channel message
func (MessageSend) Handle ¶
func (m MessageSend) Handle() types.OperationHandler
Handle adapts message send to the generic operation registration boundary
func (MessageSend) Run ¶
func (MessageSend) Run(ctx context.Context, c *msgraphsdk.GraphServiceClient, cfg MessageSendOperation) (json.RawMessage, error)
Run sends a Microsoft Teams channel message via Microsoft Graph
type MessageSendOperation ¶
type MessageSendOperation struct {
// TeamID is the target Microsoft Teams team identifier
TeamID string `json:"team_id" jsonschema:"required,title=Team ID"`
// ChannelID is the target Teams channel identifier
ChannelID string `json:"channel_id" jsonschema:"required,title=Channel ID"`
// Body is the message body content
Body string `json:"body" jsonschema:"required,title=Message Body"`
// BodyFormat controls the content type: text or html
BodyFormat string `json:"body_format,omitempty" jsonschema:"title=Body Format,enum=text,enum=html"`
// Subject is an optional message subject
Subject string `json:"subject,omitempty" jsonschema:"title=Subject"`
}
MessageSendOperation holds per-invocation parameters for the message.send operation