Merge pull request #44 from EddyTravels/feature/attachment-properties
Add ImageAspectRatio, DefaultAction and Sharable properties
This commit is contained in:
commit
3dda3ecdde
41
response.go
41
response.go
@ -18,6 +18,7 @@ import (
|
|||||||
type AttachmentType string
|
type AttachmentType string
|
||||||
type MessagingType string
|
type MessagingType string
|
||||||
type TopElementStyle string
|
type TopElementStyle string
|
||||||
|
type ImageAspectRatio string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// SendMessageURL is API endpoint for sending messages.
|
// SendMessageURL is API endpoint for sending messages.
|
||||||
@ -45,6 +46,11 @@ const (
|
|||||||
CompactTopElementStyle TopElementStyle = "compact"
|
CompactTopElementStyle TopElementStyle = "compact"
|
||||||
// TopElementStyle is large.
|
// TopElementStyle is large.
|
||||||
LargeTopElementStyle TopElementStyle = "large"
|
LargeTopElementStyle TopElementStyle = "large"
|
||||||
|
|
||||||
|
// ImageAspectRatio is horizontal (1.91:1). Default.
|
||||||
|
HorizontalImageAspectRatio ImageAspectRatio = "horizontal"
|
||||||
|
// ImageAspectRatio is square.
|
||||||
|
SquareImageAspectRatio ImageAspectRatio = "square"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QueryResponse is the response sent back by Facebook when setting up things
|
// QueryResponse is the response sent back by Facebook when setting up things
|
||||||
@ -348,21 +354,34 @@ type StructuredMessageAttachment struct {
|
|||||||
// StructuredMessagePayload is the actual payload of an attachment
|
// StructuredMessagePayload is the actual payload of an attachment
|
||||||
type StructuredMessagePayload struct {
|
type StructuredMessagePayload struct {
|
||||||
// TemplateType must be button, generic or receipt
|
// TemplateType must be button, generic or receipt
|
||||||
TemplateType string `json:"template_type,omitempty"`
|
TemplateType string `json:"template_type,omitempty"`
|
||||||
TopElementStyle TopElementStyle `json:"top_element_style,omitempty"`
|
TopElementStyle TopElementStyle `json:"top_element_style,omitempty"`
|
||||||
Text string `json:"text,omitempty"`
|
Text string `json:"text,omitempty"`
|
||||||
Elements *[]StructuredMessageElement `json:"elements,omitempty"`
|
ImageAspectRatio ImageAspectRatio `json:"image_aspect_ratio,omitempty"`
|
||||||
Buttons *[]StructuredMessageButton `json:"buttons,omitempty"`
|
Sharable bool `json:"sharable,omitempty"`
|
||||||
Url string `json:"url,omitempty"`
|
Elements *[]StructuredMessageElement `json:"elements,omitempty"`
|
||||||
|
Buttons *[]StructuredMessageButton `json:"buttons,omitempty"`
|
||||||
|
Url string `json:"url,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StructuredMessageElement is a response containing structural elements
|
// StructuredMessageElement is a response containing structural elements
|
||||||
type StructuredMessageElement struct {
|
type StructuredMessageElement struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
ImageURL string `json:"image_url"`
|
ImageURL string `json:"image_url"`
|
||||||
ItemURL string `json:"item_url"`
|
ItemURL string `json:"item_url"`
|
||||||
Subtitle string `json:"subtitle"`
|
Subtitle string `json:"subtitle"`
|
||||||
Buttons []StructuredMessageButton `json:"buttons"`
|
DefaultAction *DefaultAction `json:"default_action,omitempty"`
|
||||||
|
Buttons []StructuredMessageButton `json:"buttons"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultAction is a response containing default action properties
|
||||||
|
type DefaultAction struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
URL string `json:"url,omitempty"`
|
||||||
|
WebviewHeightRatio string `json:"webview_height_ratio,omitempty"`
|
||||||
|
MessengerExtensions bool `json:"messenger_extensions,omitempty"`
|
||||||
|
FallbackURL string `json:"fallback_url,omitempty"`
|
||||||
|
WebviewShareButton string `json:"webview_share_button,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StructuredMessageButton is a response containing buttons
|
// StructuredMessageButton is a response containing buttons
|
||||||
|
Loading…
Reference in New Issue
Block a user