type ContactAddress struct { Street string `json:"street,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Zip string `json:"zip,omitempty"` Country string `json:"country,omitempty"` CountryCode string `json:"countryCode,omitempty"` Type AddressType `json:"type" validate:"required"`}
type ContactOrg struct { Company string `json:"company,omitempty"` Title string `json:"title,omitempty"` Department string `json:"department,omitempty"`}
ListMessageParams represents the parameters for creating a list message.
Copy
type ListMessageParams struct { ButtonText string `json:"-" validate:"required"` // Text of the button. BodyText string `json:"-" validate:"required"` // Text of the body.}
LocationMessage represents a location message with latitude, longitude, address, and name.
Copy
type LocationMessage struct { Latitude float64 `json:"latitude" validate:"required"` // Latitude of the location Longitude float64 `json:"longitude" validate:"required"` // Longitude of the location Address string `json:"address,omitempty"` // Address of the location (optional) Name string `json:"name,omitempty"` // Name of the location (optional)}
type Order struct { CatalogID string `json:"catalog_id"` // CatalogID is the ID of the catalog associated with the order. ProductItems []ProductItem `json:"product_items"` // ProductItems is a list of product items in the order. Text string `json:"text"` // Text is an additional text associated with the order.}
ProductItem represents a product item in an order.
Copy
type ProductItem struct { Currency string `json:"currency"` // Currency is the currency of the product item. ItemPrice string `json:"item_price"` // ItemPrice is the price of the product item. ProductRetailerID string `json:"product_retailer_id"` // ProductRetailerID is the ID of the retailer associated with the product item. Quantity string `json:"quantity"` // Quantity is the quantity of the product item.}
type ProductListMessageHeader struct { Type ProductListMessageHeaderType `json:"type" validate:"required"` Text string `json:"text" validate:"required"`}
QuickReplyButtonMessage represents a quick reply button message.
Copy
type QuickReplyButtonMessage struct { Type InteractiveMessageType `json:"type" validate:"required"` // Type of the quick reply button message. Body QuickReplyButtonMessageBody `json:"body" validate:"required"` // Body of the quick reply button message. Action QuickReplyButtonMessageAction `json:"action" validate:"required"` // Action of the quick reply button message.}
QuickReplyButtonMessageAction represents the action of a quick reply button message.
Copy
type QuickReplyButtonMessageAction struct { Buttons []quickReplyButtonMessageButton `json:"buttons" validate:"required"` // List of quick reply buttons.}
QuickReplyButtonMessageApiPayload represents the API payload for a quick reply button message.
Copy
type QuickReplyButtonMessageApiPayload struct { BaseMessagePayload Interactive QuickReplyButtonMessage `json:"interactive" validate:"required"` // Interactive part of the API payload.}
ReactionMessage represents a reaction to a message.
Copy
type ReactionMessage struct { MessageId string `json:"message_id" validate:"required"` // The ID of the message to react to. Emoji string `json:"emoji" validate:"required"` // The emoji representing the reaction.}
TemplateMessageBodyAndHeaderParameter represents parameters for body and header components.
Copy
type TemplateMessageBodyAndHeaderParameter struct { Type TemplateMessageParameterType `json:"type" validate:"required"` // e.g., "text", "currency", etc. ParameterName *string `json:"parameter_name,omitempty"` // Optional: name of the parameter (for named parameters). Currency *TemplateMessageParameterCurrency `json:"currency,omitempty"` // Currency details (if type is currency). DateTime *TemplateMessageParameterDateTime `json:"date_time,omitempty"` // Date/time details (if type is date_time). Document *TemplateMessageParameterMedia `json:"document,omitempty"` // Document details (if type is document). Image *TemplateMessageParameterMedia `json:"image,omitempty"` // Image details (if type is image). Text *string `json:"text,omitempty"` // Text content (if type is text). Video *TemplateMessageParameterMedia `json:"video,omitempty"` // Video details (if type is video). Location *TemplateMessageParameterLocation `json:"location,omitempty"` // Location details (if type is location). Product *TemplateMessageParameterProduct `json:"product,omitempty"` // Product details (if type is product).}
type TemplateMessageCaraouselCard struct { CardIndex int `json:"card_index" validate:"required"` Components []TemplateMessageComponent `json:"components" validate:"required"` // only header, buttons and body}
TemplateMessageComponentBodyType represents a body component.
Copy
type TemplateMessageComponentBodyType struct { Type TemplateMessageComponentType `json:"type" validate:"required"` // "body" Parameters []TemplateMessageParameter `json:"parameters" validate:"required"` // Parameters for the body component.}
TemplateMessageComponentButtonType represents a button component.
Copy
type TemplateMessageComponentButtonType struct { Type TemplateMessageComponentType `json:"type" validate:"required"` // e.g., "button" SubType TemplateMessageButtonComponentType `json:"sub_type" validate:"required"` // e.g., "quick_reply", "url", etc. Index int `json:"index" validate:"required"` // Position index of the button (0 to 9) Parameters *[]TemplateMessageParameter `json:"parameters,omitempty" validate:"required"` // Parameters for the button component.}
TemplateMessageComponentHeaderType represents a header component.
Copy
type TemplateMessageComponentHeaderType struct { Type TemplateMessageComponentType `json:"type" validate:"required"` // "header" Parameters *[]TemplateMessageParameter `json:"parameters,omitempty" validate:"required"` // Parameters for the header component.}
TemplateMessageConfigs represents basic configurations for a template message.
Copy
type TemplateMessageConfigs struct { Name string `json:"name" validate:"required"` // Template name. Language string `json:"language" validate:"required"` // Language code.}
TemplateMessageParameterDateTime represents a date-time parameter.
Copy
type TemplateMessageParameterDateTime struct { FallbackValue string `json:"fallback_value" validate:"required"` // Default text if localization fails.}
TextMessageApiPayload represents the payload for the WhatsApp API.
Copy
type TextMessageApiPayload struct { BaseMessagePayload `json:",inline"` Text TextMessageApiPayloadText `json:"text" validate:"required"` // The text content of the message.}
TextMessageApiPayloadText represents the text payload for the WhatsApp API.
Copy
type TextMessageApiPayloadText struct { Body string `json:"body" validate:"required"` // The text content of the message. AllowPreview bool `json:"preview_url,omitempty"` // Whether to allow preview of the message.}
TextMessageConfigs represents the configuration options for a text message.
Copy
type TextMessageConfigs struct { Text string `json:"text" validate:"required"` // The text content of the message. AllowPreview bool `json:"allowPreview,omitempty"` // Whether to allow preview of the message.}
listMessage represents an interactive list message.
Copy
type listMessage struct { Type InteractiveMessageType `json:"type" validate:"required"` // Type of the message. Action listMessageAction `json:"action" validate:"required"` // Action of the message. Body ListMessageBody `json:"body,omitempty"` // Body of the message.}
listMessageAction represents the action of the list message.
Copy
type listMessageAction struct { ButtonText string `json:"button" validate:"required"` // Text of the button. Sections []listSection `json:"sections" validate:"required"` // Sections in the list message.}
listSection represents a section in the list message.
Copy
type listSection struct { Title string `json:"title" validate:"required"` // Title of the section. Rows []listSectionRow `json:"rows" validate:"required"` // Rows in the section.}
listSectionRow represents a row in the list section.
Copy
type listSectionRow struct { Id string `json:"id" validate:"required"` // ID of the row. Description string `json:"description" validate:"required"` // Description of the row. Title string `json:"title" validate:"required"` // Title of the row.}
quickReplyButtonMessageButton represents a quick reply button.
Copy
type quickReplyButtonMessageButton struct { Type string `json:"type" validate:"required"` // Type of the quick reply button. Reply quickReplyButtonMessageButtonReply `json:"reply" validate:"required"` // Reply structure of the quick reply button.}
quickReplyButtonMessageButtonReply represents the reply structure of a quick reply button.
Copy
type quickReplyButtonMessageButtonReply struct { Title string `json:"title" validate:"required"` // Title of the quick reply button. Id string `json:"id" validate:"required"` // ID of the quick reply button.}