1
0
mirror of synced 2024-11-26 06:46:04 +03:00

Add TopElementStyle attribute to StructuredMessagePayload

This commit is contained in:
Vytautas Galaunia 2018-10-29 13:10:44 +02:00
parent 65752d0a98
commit 78e9ea3089

View File

@ -17,6 +17,7 @@ import (
// AttachmentType is attachment type. // AttachmentType is attachment type.
type AttachmentType string type AttachmentType string
type MessagingType string type MessagingType string
type TopElementStyle string
const ( const (
// SendMessageURL is API endpoint for sending messages. // SendMessageURL is API endpoint for sending messages.
@ -39,6 +40,11 @@ const (
MessageTagType MessagingType = "MESSAGE_TAG" MessageTagType MessagingType = "MESSAGE_TAG"
// NonPromotionalSubscriptionType is NON_PROMOTIONAL_SUBSCRIPTION messaging type // NonPromotionalSubscriptionType is NON_PROMOTIONAL_SUBSCRIPTION messaging type
NonPromotionalSubscriptionType MessagingType = "NON_PROMOTIONAL_SUBSCRIPTION" NonPromotionalSubscriptionType MessagingType = "NON_PROMOTIONAL_SUBSCRIPTION"
// TopElementStyle is compact.
CompactTopElementStyle TopElementStyle = "compact"
// TopElementStyle is large.
LargeTopElementStyle TopElementStyle = "large"
) )
// QueryResponse is the response sent back by Facebook when setting up things // QueryResponse is the response sent back by Facebook when setting up things
@ -342,11 +348,12 @@ 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"`
Text string `json:"text,omitempty"` TopElementStyle TopElementStyle `json:"top_element_style,omitempty"`
Elements *[]StructuredMessageElement `json:"elements,omitempty"` Text string `json:"text,omitempty"`
Buttons *[]StructuredMessageButton `json:"buttons,omitempty"` Elements *[]StructuredMessageElement `json:"elements,omitempty"`
Url string `json:"url,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