Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HttpClient utils.HTTPDoer // HTTP client for sending requests
Endpoint string // Endpoint base URL for the Graph API
}
Client posts messages using the Microsoft Graph API.
func NewWithToken ¶
NewWithToken returns a Teams client configured with a bearer token.
type Error ¶
type Error struct {
Code string `json:"code"` // Error code
Message string `json:"message"` // Error message
InnerError any `json:"innerError"` // Optional nested error
}
Error represents Graph API error details.
type ItemBody ¶
type ItemBody struct {
ContentType string `json:"contentType"` // e.g., "html"
Content string `json:"content"` // Message body
}
ItemBody wraps the message content in HTML format.
type Message ¶
type Message struct {
Body ItemBody `json:"body"` // Body contains the message content.
}
Message represents the payload structure for a Teams message.
type Option ¶
type Option func(*Client)
Option configures the Teams client.
func WithEndpointBase ¶ added in v0.21.0
WithEndpointBase overrides the default Graph API base URL.
func WithHeaders ¶
WithHeaders adds custom headers to the request.
func WithInsecureTLS ¶
WithInsecureTLS disables TLS certificate verification.
func WithTimeout ¶ added in v0.21.0
WithTimeout sets the per-request timeout.
type Response ¶
type Response struct {
ID string `json:"id,omitempty"` // ID of the message
WebURL string `json:"webUrl,omitempty"` // Web link to the posted message
Error *Error `json:"error,omitempty"` // Optional error object
Message string `json:"message,omitempty"` // Sometimes returned on failure
}
Response represents a simplified Graph API response.
func (*Response) ErrorOrMessage ¶
ErrorOrMessage returns a formatted error string from the Graph API response.