2016-09-08 10:55:48 +03:00
|
|
|
package messenger
|
|
|
|
|
2016-12-09 13:04:14 +03:00
|
|
|
// Defines the different sizes available when setting up a CallToActionsItem
|
|
|
|
// of type "web_url". These values can be used in the "WebviewHeightRatio"
|
|
|
|
// field.
|
|
|
|
const (
|
|
|
|
// WebviewCompact opens the page in a web view that takes half the screen
|
|
|
|
// and covers only part of the conversation.
|
|
|
|
WebviewCompact = "compact"
|
|
|
|
|
|
|
|
// WebviewTall opens the page in a web view that covers about 75% of the
|
|
|
|
// conversation.
|
|
|
|
WebviewTall = "tall"
|
|
|
|
|
|
|
|
// WebviewFull opens the page in a web view that completely covers the
|
|
|
|
// conversation, and has a "back" button instead of a "close" one.
|
|
|
|
WebviewFull = "full"
|
|
|
|
)
|
|
|
|
|
2021-02-17 15:15:29 +03:00
|
|
|
// GreetingSetting is the setting for greeting message.
|
2016-09-08 10:55:48 +03:00
|
|
|
type GreetingSetting struct {
|
|
|
|
SettingType string `json:"setting_type"`
|
|
|
|
Greeting GreetingInfo `json:"greeting"`
|
|
|
|
}
|
|
|
|
|
2021-02-17 15:15:29 +03:00
|
|
|
// GreetingInfo contains greeting message.
|
2016-09-08 10:55:48 +03:00
|
|
|
type GreetingInfo struct {
|
|
|
|
Text string `json:"text"`
|
|
|
|
}
|
|
|
|
|
2021-02-17 15:15:29 +03:00
|
|
|
// CallToActionsSetting is the settings for Get Started and Persist Menu.
|
2016-09-08 10:55:48 +03:00
|
|
|
type CallToActionsSetting struct {
|
|
|
|
SettingType string `json:"setting_type"`
|
|
|
|
ThreadState string `json:"thread_state"`
|
|
|
|
CallToActions []CallToActionsItem `json:"call_to_actions"`
|
|
|
|
}
|
|
|
|
|
2021-02-17 15:15:29 +03:00
|
|
|
// CallToActionsItem contains Get Started button or item of Persist Menu.
|
2016-09-08 10:55:48 +03:00
|
|
|
type CallToActionsItem struct {
|
2016-12-09 13:04:14 +03:00
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Title string `json:"title,omitempty"`
|
|
|
|
Payload string `json:"payload,omitempty"`
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
WebviewHeightRatio string `json:"webview_height_ratio,omitempty"`
|
|
|
|
MessengerExtension bool `json:"messenger_extensions,omitempty"`
|
2016-09-08 10:55:48 +03:00
|
|
|
}
|
2018-11-15 15:56:11 +03:00
|
|
|
|
|
|
|
// HomeURL is the settings for EnableChatExtension
|
|
|
|
// https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url
|
|
|
|
type HomeURL struct {
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
WebviewHeightRatio string `json:"webview_height_ratio,omitempty"`
|
|
|
|
WebviewShareButton string `json:"webview_share_button,omitempty"`
|
|
|
|
InTest bool `json:"in_test,omitempty"`
|
|
|
|
}
|