-
Notifications
You must be signed in to change notification settings - Fork 11
/
message.go
49 lines (43 loc) · 1.36 KB
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
// Message to send to Microsoft Teams.
type Message struct {
Type string `json:"@type"`
Context string `json:"@context"`
ThemeColor string `json:"themeColor"`
Title string `json:"title"`
Summary string `json:"summary"`
Sections []Section `json:"sections"`
Actions []OpenURIAction `json:"potentialAction"`
}
// Section to be shown in the message
type Section struct {
ActivityTitle string `json:"activityTitle"`
ActivitySubtitle string `json:"activitySubtitle"`
ActivityImage string `json:"activityImage"`
Facts []Fact `json:"facts"`
Markdown bool `json:"markdown"`
Text string `json:"text"`
HeroImage Image `json:"heroImage"`
Images []Image `json:"images"`
}
// Fact related to the message
type Fact struct {
Name string `json:"name"`
Value string `json:"value"`
}
// OpenURIAction action for link buttons
type OpenURIAction struct {
Type string `json:"@type"`
Name string `json:"name"`
Targets []Target `json:"targets"`
}
// Target object that resides inside `OpenUriAction`s
type Target struct {
OS string `json:"os"`
URI string `json:"uri"`
}
// Image that is displayed either within the Images section or as a HeroImage.
type Image struct {
Image string `json:"image"`
Title string `json:"title"`
}