-
Notifications
You must be signed in to change notification settings - Fork 27
/
list.go
41 lines (34 loc) · 1.25 KB
/
list.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
package template
const TemplateTypeList TemplateType = "list"
type ListTemplate struct {
Elements []ListElement `json:"elements"`
Buttons []Button `json:"buttons,omitempty"`
}
func (ListTemplate) Type() TemplateType {
return TemplateTypeList
}
func (ListTemplate) SupportsButtons() bool {
return true
}
type ListElement struct {
Title string `json:"title"`
ImageURL string `json:"image_url,omitempty"`
Subtitle string `json:"subtitle,omitempty"`
DefaultAction `json:"default_action,omitempty"`
Buttons []ListButton `json:"buttons,omitempty"`
}
type DefaultAction struct {
Type string `json:"type"`
URL string `json:"url",omitempty`
MessengerExtensions bool `json:"messenger_extensions",omitempty`
WebviewHeightRatio string `json:"webview_height_ratio",omitempty`
FallbackURL string `json:"fallback_url",omitempty`
}
type ListButton struct {
Title string `json:"title"`
Type string `json:"type",omitempty`
URL string `json:"url",omitempty`
MessengerExtensions bool `json:"messenger_extensions",omitempty`
WebviewHeightRatio string `json:"webview_height_ratio",omitempty`
FallbackURL string `json:"fallback_url",omitempty`
}