> ## Documentation Index
> Fetch the complete documentation index at: https://golang.wapikit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Components

```go theme={null}
import "github.com/wapikit/wapi.go/pkg/components"
```

<a name="AddressType" />

## type AddressType

```go theme={null}
type AddressType string
```

<a name="HomeAddress" />

```go theme={null}
const (
    HomeAddress AddressType = "HOME"
    WorkAddress AddressType = "WORK"
)
```

<a name="HomeUrl" />

```go theme={null}
const (
    HomeUrl AddressType = "HOME"
    WorkUrl AddressType = "WORK"
)
```

<a name="ApiCompatibleJsonConverterConfigs" />

## type ApiCompatibleJsonConverterConfigs

ApiCompatibleJsonConverterConfigs represents the configuration for converting to JSON.

```go theme={null}
type ApiCompatibleJsonConverterConfigs struct {
    ReplyToMessageId  string
    SendToPhoneNumber string
}
```

<a name="AudioMessage" />

## type AudioMessage

AudioMessage represents an audio message.

```go theme={null}
type AudioMessage struct {
    Id   string `json:"id,omitempty"`
    Link string `json:"link,omitempty"`
}
```

<a name="NewAudioMessage" />

### func NewAudioMessage

```go theme={null}
func NewAudioMessage(params AudioMessageConfigs) (*AudioMessage, error)
```

NewAudioMessage creates a new AudioMessage object.

<a name="AudioMessage.ToJson" />

### func (\*AudioMessage) ToJson

```go theme={null}
func (audio *AudioMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the AudioMessage object to JSON.

<a name="AudioMessageApiPayload" />

## type AudioMessageApiPayload

AudioMessageApiPayload represents the payload for an audio message API request.

```go theme={null}
type AudioMessageApiPayload struct {
    BaseMessagePayload
    Audio AudioMessage `json:"audio" validate:"required"`
}
```

<a name="AudioMessageConfigs" />

## type AudioMessageConfigs

AudioMessageConfigs is an alias for AudioMessage.

```go theme={null}
type AudioMessageConfigs = AudioMessage
```

<a name="BaseMessage" />

## type BaseMessage

BaseMessage is an interface for sending messages.

```go theme={null}
type BaseMessage interface {
    ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
}
```

<a name="BaseMessagePayload" />

## type BaseMessagePayload

BaseMessagePayload represents the base payload to send messages.

```go theme={null}
type BaseMessagePayload struct {
    Context          *Context    `json:"context,omitempty"`
    To               string      `json:"to"`
    Type             MessageType `json:"type"`
    MessagingProduct string      `json:"messaging_product"`
    RecipientType    string      `json:"recipient_type"`
}
```

<a name="NewBaseMessagePayload" />

### func NewBaseMessagePayload

```go theme={null}
func NewBaseMessagePayload(to string, messageType MessageType) BaseMessagePayload
```

NewBaseMessagePayload creates a new instance of BaseMessagePayload.

<a name="CatalogMessage" />

## type CatalogMessage

ProductMessage represents a product message.

```go theme={null}
type CatalogMessage struct {
    Type   InteractiveMessageType `json:"type" validate:"required"`
    Action CatalogMessageAction   `json:"action" validate:"required"`
    Body   CatalogMessageBody     `json:"body" validate:"required"`
    Footer *CatalogMessageFooter  `json:"footer,omitempty"`
    Header *CatalogMessageHeader  `json:"header,omitempty"`
}
```

<a name="NewCatalogMessage" />

### func NewCatalogMessage

```go theme={null}
func NewCatalogMessage(name, thumbnailProductRetailerId string) (*CatalogMessage, error)
```

<a name="CatalogMessage.SetBody" />

### func (\*CatalogMessage) SetBody

```go theme={null}
func (m *CatalogMessage) SetBody(text string)
```

<a name="CatalogMessage.SetFooter" />

### func (\*CatalogMessage) SetFooter

```go theme={null}
func (m *CatalogMessage) SetFooter(text string)
```

<a name="CatalogMessage.SetHeader" />

### func (\*CatalogMessage) SetHeader

```go theme={null}
func (m *CatalogMessage) SetHeader(text string)
```

<a name="CatalogMessage.ToJson" />

### func (\*CatalogMessage) ToJson

```go theme={null}
func (m *CatalogMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the product message to JSON with the given configurations.

<a name="CatalogMessageAction" />

## type CatalogMessageAction

```go theme={null}
type CatalogMessageAction struct {
    Name       string                        `json:"name" validate:"required"`
    Parameters CatalogMessageActionParameter `json:"parameters,omitempty"`
}
```

<a name="CatalogMessageActionParameter" />

## type CatalogMessageActionParameter

```go theme={null}
type CatalogMessageActionParameter struct {
    ThumbnailProductRetailerId string `json:"thumbnail_product_retailer_id" validate:"required"`
}
```

<a name="CatalogMessageApiPayload" />

## type CatalogMessageApiPayload

ProductMessageApiPayload represents the API payload for a product message.

```go theme={null}
type CatalogMessageApiPayload struct {
    BaseMessagePayload
    Interactive CatalogMessage `json:"interactive" validate:"required"`
}
```

<a name="CatalogMessageBody" />

## type CatalogMessageBody

```go theme={null}
type CatalogMessageBody struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="CatalogMessageFooter" />

## type CatalogMessageFooter

```go theme={null}
type CatalogMessageFooter struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="CatalogMessageHeader" />

## type CatalogMessageHeader

```go theme={null}
type CatalogMessageHeader struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="Contact" />

## type Contact

```go theme={null}
type Contact struct {
    Name      ContactName      `json:"name" validate:"required"`
    Org       ContactOrg       `json:"org,omitempty"`
    Addresses []ContactAddress `json:"addresses,omitempty"`
    Urls      []ContactUrl     `json:"urls,omitempty"`
    Emails    []ContactEmail   `json:"emails,omitempty"`
    Phones    []ContactPhone   `json:"phones,omitempty"`
    Birthday  string           `json:"birthday,omitempty"`
}
```

<a name="NewContact" />

### func NewContact

```go theme={null}
func NewContact(name ContactName) *Contact
```

<a name="Contact.AddEmail" />

### func (\*Contact) AddEmail

```go theme={null}
func (contact *Contact) AddEmail(params ContactEmail)
```

<a name="Contact.AddPhone" />

### func (\*Contact) AddPhone

```go theme={null}
func (contact *Contact) AddPhone(params ContactPhone)
```

<a name="Contact.AddUrl" />

### func (\*Contact) AddUrl

```go theme={null}
func (contact *Contact) AddUrl(params ContactUrl)
```

<a name="Contact.SetBirthday" />

### func (\*Contact) SetBirthday

```go theme={null}
func (contact *Contact) SetBirthday(params string)
```

! TODO: add regex check here in the params

<a name="Contact.SetFirstName" />

### func (\*Contact) SetFirstName

```go theme={null}
func (contact *Contact) SetFirstName(firstName string)
```

<a name="Contact.SetLastName" />

### func (\*Contact) SetLastName

```go theme={null}
func (contact *Contact) SetLastName(lastName string)
```

<a name="Contact.SetMiddleName" />

### func (\*Contact) SetMiddleName

```go theme={null}
func (contact *Contact) SetMiddleName(middleName string)
```

<a name="Contact.SetOrg" />

### func (\*Contact) SetOrg

```go theme={null}
func (contact *Contact) SetOrg(params ContactOrg)
```

<a name="ContactAddress" />

## type ContactAddress

```go theme={null}
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"`
}
```

<a name="ContactEmail" />

## type ContactEmail

```go theme={null}
type ContactEmail struct {
    Email string    `json:"email,omitempty"`
    Type  EmailType `json:"type,omitempty"`
}
```

<a name="ContactMessage" />

## type ContactMessage

```go theme={null}
type ContactMessage struct {
    Contacts []Contact `json:"contacts" validate:"required"`
}
```

<a name="NewContactMessage" />

### func NewContactMessage

```go theme={null}
func NewContactMessage(configs []Contact) (*ContactMessage, error)
```

<a name="ContactMessage.AddContact" />

### func (\*ContactMessage) AddContact

```go theme={null}
func (contact *ContactMessage) AddContact(params Contact)
```

<a name="ContactMessage.ToJson" />

### func (\*ContactMessage) ToJson

```go theme={null}
func (m *ContactMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

<a name="ContactMessageApiPayload" />

## type ContactMessageApiPayload

```go theme={null}
type ContactMessageApiPayload struct {
    BaseMessagePayload
    Contacts []Contact `json:"contacts" validate:"required"`
}
```

<a name="ContactMessageConfigs" />

## type ContactMessageConfigs

```go theme={null}
type ContactMessageConfigs struct {
    Name string `json:"name" validate:"required"`
}
```

<a name="ContactName" />

## type ContactName

```go theme={null}
type ContactName struct {
    FormattedName string `json:"formatted_name" validate:"required"`
    FirstName     string `json:"first_name,omitempty"`
    LastName      string `json:"last_name,omitempty"`
    MiddleName    string `json:"middle_name,omitempty"`
    Suffix        string `json:"suffix,omitempty"`
    Prefix        string `json:"prefix,omitempty"`
}
```

<a name="ContactOrg" />

## type ContactOrg

```go theme={null}
type ContactOrg struct {
    Company    string `json:"company,omitempty"`
    Title      string `json:"title,omitempty"`
    Department string `json:"department,omitempty"`
}
```

<a name="ContactPhone" />

## type ContactPhone

```go theme={null}
type ContactPhone struct {
    Phone string    `json:"phone,omitempty"`
    WaId  string    `json:"wa_id,omitempty"`
    Type  PhoneType `json:"type" validate:"required"`
}
```

<a name="ContactUrl" />

## type ContactUrl

```go theme={null}
type ContactUrl struct {
    Url  string  `json:"url" validate:"required"`
    Type UrlType `json:"type" validate:"required"`
}
```

<a name="Context" />

## type Context

Context represents the context of the message.

```go theme={null}
type Context struct {
    MessageId string `json:"message_id,omitempty"`
}
```

<a name="DocumentMessage" />

## type DocumentMessage

DocumentMessage represents a document message.

```go theme={null}
type DocumentMessage struct {
    Id       string  `json:"id,omitempty"`
    Link     *string `json:"link,omitempty"`
    Caption  *string `json:"caption,omitempty"`
    FileName string  `json:"filename" validate:"required"`
}
```

<a name="NewDocumentMessage" />

### func NewDocumentMessage

```go theme={null}
func NewDocumentMessage(params DocumentMessageConfigs) (*DocumentMessage, error)
```

NewDocumentMessage creates a new DocumentMessage instance.

<a name="DocumentMessage.ToJson" />

### func (\*DocumentMessage) ToJson

```go theme={null}
func (dm *DocumentMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the DocumentMessage instance to JSON.

<a name="DocumentMessageApiPayload" />

## type DocumentMessageApiPayload

DocumentMessageApiPayload represents the API payload for a document message.

```go theme={null}
type DocumentMessageApiPayload struct {
    BaseMessagePayload
    Document DocumentMessage `json:"document" validate:"required"`
}
```

<a name="DocumentMessageConfigs" />

## type DocumentMessageConfigs

DocumentMessageConfigs represents the configurations for a document message.

```go theme={null}
type DocumentMessageConfigs struct {
    Id       string  `json:"id" validate:"required"`
    Link     *string `json:"link,omitempty"`
    Caption  *string `json:"caption,omitempty"`
    FileName string  `json:"filename" validate:"required"`
}
```

<a name="EmailType" />

## type EmailType

```go theme={null}
type EmailType string
```

<a name="HomeEmail" />

```go theme={null}
const (
    HomeEmail EmailType = "HOME"
    WorkEmail EmailType = "WORK"
)
```

<a name="ImageMessage" />

## type ImageMessage

ImageMessage represents a message with an image.

```go theme={null}
type ImageMessage struct {
    Id      string `json:"id,omitempty"`
    Link    string `json:"link,omitempty"`
    Caption string `json:"caption,omitempty"`
}
```

<a name="NewImageMessage" />

### func NewImageMessage

```go theme={null}
func NewImageMessage(params ImageMessageConfigs) (*ImageMessage, error)
```

NewImageMessage creates a new ImageMessage instance.

<a name="ImageMessage.SetCaption" />

### func (\*ImageMessage) SetCaption

```go theme={null}
func (image *ImageMessage) SetCaption(params string)
```

SetCaption sets the caption for the image message.

<a name="ImageMessage.ToJson" />

### func (\*ImageMessage) ToJson

```go theme={null}
func (image *ImageMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the ImageMessage to JSON.

<a name="ImageMessageApiPayload" />

## type ImageMessageApiPayload

ImageMessageApiPayload represents the API payload for an image message.

```go theme={null}
type ImageMessageApiPayload struct {
    BaseMessagePayload
    Image ImageMessage `json:"image" validate:"required"`
}
```

<a name="ImageMessageConfigs" />

## type ImageMessageConfigs

ImageMessageConfigs is an alias for ImageMessage.

```go theme={null}
type ImageMessageConfigs = ImageMessage
```

<a name="InteractiveMessageType" />

## type InteractiveMessageType

```go theme={null}
type InteractiveMessageType string
```

<a name="InteractiveMessageTypeButton" />

```go theme={null}
const (
    InteractiveMessageTypeButton          InteractiveMessageType = "button"
    InteractiveMessageTypeProduct         InteractiveMessageType = "product"
    InteractiveMessageTypeProductList     InteractiveMessageType = "product_list"
    InteractiveMessageTypeList            InteractiveMessageType = "list"
    InteractiveMessageTypeCatalog         InteractiveMessageType = "catalog_message"
    InteractiveMessageTypeLocationRequest InteractiveMessageType = "location_request_message"
)
```

<a name="ListMessageApiPayload" />

## type ListMessageApiPayload

ListMessageApiPayload represents the API payload for the list message.

```go theme={null}
type ListMessageApiPayload struct {
    BaseMessagePayload
    Interactive listMessage `json:"interactive" validate:"required"` // Interactive message.
}
```

<a name="ListMessageBody" />

## type ListMessageBody

ListMessageBody represents the body of the list message.

```go theme={null}
type ListMessageBody struct {
    Text string `json:"text" validate:"required"` // Text of the body.
}
```

<a name="ListMessageFooter" />

## type ListMessageFooter

ListMessageFooter represents the footer of the list message.

```go theme={null}
type ListMessageFooter struct {
    Text string `json:"text" validate:"required"` // Text of the footer.
}
```

<a name="ListMessageHeader" />

## type ListMessageHeader

```go theme={null}
type ListMessageHeader struct {
    Type string `json:"type" validate:"required"` // Type of the header.
    Text string `json:"text" validate:"required"` // Text of the header.
}
```

<a name="ListMessageParams" />

## type ListMessageParams

ListMessageParams represents the parameters for creating a list message.

```go theme={null}
type ListMessageParams struct {
    ButtonText string `json:"-" validate:"required"` // Text of the button.
    BodyText   string `json:"-" validate:"required"` // Text of the body.
}
```

<a name="ListSection" />

## type ListSection

ListSection represents a section in the list message.

```go theme={null}
type ListSection struct {
    Title string           `json:"title" validate:"required"` // Title of the section.
    Rows  []listSectionRow `json:"rows" validate:"required"`  // Rows in the section.
}
```

<a name="NewListSection" />

### func NewListSection

```go theme={null}
func NewListSection(title string) (*ListSection, error)
```

NewListSection creates a new list section with the given title.

<a name="ListSection.AddRow" />

### func (\*ListSection) AddRow

```go theme={null}
func (section *ListSection) AddRow(row *listSectionRow)
```

AddRow adds a new row to the list section.

<a name="ListSection.SetTitle" />

### func (\*ListSection) SetTitle

```go theme={null}
func (section *ListSection) SetTitle(title string)
```

SetTitle sets the title of the list section.

<a name="LocationMessage" />

## type LocationMessage

LocationMessage represents a location message with latitude, longitude, address, and name.

```go theme={null}
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)
}
```

<a name="NewLocationMessage" />

### func NewLocationMessage

```go theme={null}
func NewLocationMessage(latitude float64, longitude float64) (*LocationMessage, error)
```

NewLocationMessage creates a new LocationMessage with the given latitude and longitude.

<a name="LocationMessage.SetAddress" />

### func (\*LocationMessage) SetAddress

```go theme={null}
func (location *LocationMessage) SetAddress(params string)
```

SetAddress sets the address of the location.

<a name="LocationMessage.SetName" />

### func (\*LocationMessage) SetName

```go theme={null}
func (location *LocationMessage) SetName(params string)
```

SetName sets the name of the location.

<a name="LocationMessage.ToJson" />

### func (\*LocationMessage) ToJson

```go theme={null}
func (location *LocationMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the LocationMessage to JSON with the given configurations.

<a name="LocationMessageApiPayload" />

## type LocationMessageApiPayload

LocationMessageApiPayload represents the API payload for a location message.

```go theme={null}
type LocationMessageApiPayload struct {
    BaseMessagePayload
    Location LocationMessage `json:"location" validate:"required"` // Location message
}
```

<a name="LocationRequestMessage" />

## type LocationRequestMessage

```go theme={null}
type LocationRequestMessage struct {
    Type   InteractiveMessageType     `json:"type" validate:"required"`   // Type of the message.
    Action locationMessageAction      `json:"action" validate:"required"` // Action of the message.
    Body   LocationRequestMessageBody `json:"body,omitempty"`             // Body of the message.
}
```

<a name="NewLocationRequestMessage" />

### func NewLocationRequestMessage

```go theme={null}
func NewLocationRequestMessage(params LocationRequestMessageParams) (*LocationRequestMessage, error)
```

<a name="LocationRequestMessage.SetBodyText" />

### func (\*LocationRequestMessage) SetBodyText

```go theme={null}
func (m *LocationRequestMessage) SetBodyText(bodyText string)
```

SetBodyText sets the body text of the list message.

<a name="LocationRequestMessage.ToJson" />

### func (\*LocationRequestMessage) ToJson

```go theme={null}
func (m *LocationRequestMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the list message to JSON.

<a name="LocationRequestMessageApiPayload" />

## type LocationRequestMessageApiPayload

```go theme={null}
type LocationRequestMessageApiPayload struct {
    BaseMessagePayload
    Interactive LocationRequestMessage `json:"interactive" validate:"required"` // Interactive message.
}
```

<a name="LocationRequestMessageBody" />

## type LocationRequestMessageBody

```go theme={null}
type LocationRequestMessageBody struct {
    Text string `json:"text" validate:"required"` // Text of the body.
}
```

<a name="LocationRequestMessageParams" />

## type LocationRequestMessageParams

```go theme={null}
type LocationRequestMessageParams struct {
    BodyText string `json:"-" validate:"required"` // Text of the body.
}
```

<a name="MessageType" />

## type MessageType

MessageType represents the type of message.

```go theme={null}
type MessageType string
```

<a name="MessageTypeLocation" />Constants for different message types.

```go theme={null}
const (
    MessageTypeLocation    MessageType = "location"
    MessageTypeAudio       MessageType = "audio"
    MessageTypeVideo       MessageType = "video"
    MessageTypeDocument    MessageType = "document"
    MessageTypeText        MessageType = "text"
    MessageTypeContact     MessageType = "contacts"
    MessageTypeInteractive MessageType = "interactive"
    MessageTypeTemplate    MessageType = "template"
    MessageTypeReaction    MessageType = "reaction"
    MessageTypeSticker     MessageType = "sticker"
    MessageTypeImage       MessageType = "image"
)
```

<a name="Order" />

## type Order

Order represents an order in the system.

```go theme={null}
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.
}
```

<a name="PhoneType" />

## type PhoneType

```go theme={null}
type PhoneType string
```

<a name="CellPhone" />

```go theme={null}
const (
    CellPhone   PhoneType = "CELL"
    MainPhone   PhoneType = "MAIN"
    IphonePhone PhoneType = "IPHONE"
    HomePhone   PhoneType = "HOME"
    WorkPhone   PhoneType = "WORK"
)
```

<a name="Product" />

## type Product

```go theme={null}
type Product struct {
    RetailerId string `json:"product_retailer_id" validate:"required"`
}
```

<a name="Product.SetRetailerId" />

### func (\*Product) SetRetailerId

```go theme={null}
func (p *Product) SetRetailerId(id string)
```

<a name="ProductItem" />

## type ProductItem

ProductItem represents a product item in an order.

```go theme={null}
type ProductItem struct {
    Currency          string  `json:"currency"`            // Currency is the currency of the product item.
    ItemPrice         float64 `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          int     `json:"quantity"`            // Quantity is the quantity of the product item.
}
```

<a name="ProductListMessage" />

## type ProductListMessage

ProductListMessage represents a product list message.

```go theme={null}
type ProductListMessage struct {
    Action ProductListMessageAction  `json:"action" validate:"required"`
    Body   ProductListMessageBody    `json:"body" validate:"required"`
    Footer *ProductListMessageFooter `json:"footer,omitempty"`
    Header ProductListMessageHeader  `json:"header,omitempty"`
    Type   InteractiveMessageType    `json:"type" validate:"required"`
}
```

<a name="NewProductListMessage" />

### func NewProductListMessage

```go theme={null}
func NewProductListMessage(params ProductListMessageParams) (*ProductListMessage, error)
```

NewProductListMessage creates a new product list message.

<a name="ProductListMessage.AddSection" />

### func (\*ProductListMessage) AddSection

```go theme={null}
func (message *ProductListMessage) AddSection(section ProductSection)
```

<a name="ProductListMessage.SetBody" />

### func (\*ProductListMessage) SetBody

```go theme={null}
func (message *ProductListMessage) SetBody(text string)
```

<a name="ProductListMessage.SetCatalogId" />

### func (\*ProductListMessage) SetCatalogId

```go theme={null}
func (message *ProductListMessage) SetCatalogId(catalogId string)
```

<a name="ProductListMessage.SetFooter" />

### func (\*ProductListMessage) SetFooter

```go theme={null}
func (message *ProductListMessage) SetFooter(text string)
```

<a name="ProductListMessage.SetHeader" />

### func (\*ProductListMessage) SetHeader

```go theme={null}
func (message *ProductListMessage) SetHeader(text string)
```

<a name="ProductListMessage.SetProductRetailerId" />

### func (\*ProductListMessage) SetProductRetailerId

```go theme={null}
func (message *ProductListMessage) SetProductRetailerId(productRetailerId string)
```

<a name="ProductListMessage.ToJson" />

### func (\*ProductListMessage) ToJson

```go theme={null}
func (m *ProductListMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the product list message to JSON.

<a name="ProductListMessageAction" />

## type ProductListMessageAction

```go theme={null}
type ProductListMessageAction struct {
    Sections          []ProductSection `json:"sections" validate:"required"` // minimum 1 and maximum 10
    CatalogId         string           `json:"catalog_id" validate:"required"`
    ProductRetailerId string           `json:"product_retailer_id" validate:"required"`
}
```

<a name="ProductListMessageAction.AddSection" />

### func (\*ProductListMessageAction) AddSection

```go theme={null}
func (a *ProductListMessageAction) AddSection(section ProductSection)
```

<a name="ProductListMessageApiPayload" />

## type ProductListMessageApiPayload

ProductListMessageApiPayload represents the API payload for a product list message.

```go theme={null}
type ProductListMessageApiPayload struct {
    BaseMessagePayload
    Interactive ProductListMessage `json:"interactive" validate:"required"`
}
```

<a name="ProductListMessageBody" />

## type ProductListMessageBody

```go theme={null}
type ProductListMessageBody struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="ProductListMessageFooter" />

## type ProductListMessageFooter

```go theme={null}
type ProductListMessageFooter struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="ProductListMessageHeader" />

## type ProductListMessageHeader

! TODO: support more header types

```go theme={null}
type ProductListMessageHeader struct {
    Type ProductListMessageHeaderType `json:"type" validate:"required"`
    Text string                       `json:"text" validate:"required"`
}
```

<a name="ProductListMessageHeaderType" />

## type ProductListMessageHeaderType

```go theme={null}
type ProductListMessageHeaderType string
```

<a name="ProductListMessageHeaderTypeText" />

```go theme={null}
const (
    ProductListMessageHeaderTypeText ProductListMessageHeaderType = "text"
)
```

<a name="ProductListMessageParams" />

## type ProductListMessageParams

ProductListMessageParams represents the parameters for creating a product list message.

```go theme={null}
type ProductListMessageParams struct {
    CatalogId         string `validate:"required"`
    ProductRetailerId string `validate:"required"`
    BodyText          string `validate:"required"`
    Sections          []ProductSection
}
```

<a name="ProductMessage" />

## type ProductMessage

ProductMessage represents a product message.

```go theme={null}
type ProductMessage struct {
    Type   InteractiveMessageType `json:"type" validate:"required"`
    Body   *ProductMessageBody    `json:"body" validate:"required"`
    Footer *ProductMessageFooter  `json:"footer,omitempty"`
    Header *ProductMessageHeader  `json:"header,omitempty"`
    Action productMessageAction   `json:"action" validate:"required"`
}
```

<a name="NewProductMessage" />

### func NewProductMessage

```go theme={null}
func NewProductMessage(params ProductMessageParams) (*ProductMessage, error)
```

NewProductMessage creates a new product message with the given parameters.

<a name="ProductMessage.SetBody" />

### func (\*ProductMessage) SetBody

```go theme={null}
func (m *ProductMessage) SetBody(text string)
```

<a name="ProductMessage.SetCatalogId" />

### func (\*ProductMessage) SetCatalogId

```go theme={null}
func (m *ProductMessage) SetCatalogId(id string)
```

<a name="ProductMessage.SetFooter" />

### func (\*ProductMessage) SetFooter

```go theme={null}
func (m *ProductMessage) SetFooter(text string)
```

<a name="ProductMessage.SetHeader" />

### func (\*ProductMessage) SetHeader

```go theme={null}
func (m *ProductMessage) SetHeader(text string)
```

<a name="ProductMessage.SetProductRetailerId" />

### func (\*ProductMessage) SetProductRetailerId

```go theme={null}
func (m *ProductMessage) SetProductRetailerId(id string)
```

<a name="ProductMessage.ToJson" />

### func (\*ProductMessage) ToJson

```go theme={null}
func (m *ProductMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the product message to JSON with the given configurations.

<a name="ProductMessageApiPayload" />

## type ProductMessageApiPayload

ProductMessageApiPayload represents the API payload for a product message.

```go theme={null}
type ProductMessageApiPayload struct {
    BaseMessagePayload
    Interactive ProductMessage `json:"interactive" validate:"required"`
}
```

<a name="ProductMessageBody" />

## type ProductMessageBody

```go theme={null}
type ProductMessageBody struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="ProductMessageFooter" />

## type ProductMessageFooter

```go theme={null}
type ProductMessageFooter struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="ProductMessageHeader" />

## type ProductMessageHeader

```go theme={null}
type ProductMessageHeader struct {
    Text string `json:"text" validate:"required"`
}
```

<a name="ProductMessageParams" />

## type ProductMessageParams

ProductMessageParams represents the parameters for creating a product message.

```go theme={null}
type ProductMessageParams struct {
    CatalogId         string `validate:"required"`
    ProductRetailerId string `validate:"required"`
    BodyText          string `validate:"required"`
}
```

<a name="ProductSection" />

## type ProductSection

```go theme={null}
type ProductSection struct {
    Title    string    `json:"title" validate:"required"`
    Products []Product `json:"product_items" validate:"required"`
}
```

<a name="ProductSection.AddProduct" />

### func (\*ProductSection) AddProduct

```go theme={null}
func (ps *ProductSection) AddProduct(product Product)
```

<a name="ProductSection.SetTitle" />

### func (\*ProductSection) SetTitle

```go theme={null}
func (ps *ProductSection) SetTitle(title string)
```

<a name="QuickReplyButtonMessage" />

## type QuickReplyButtonMessage

QuickReplyButtonMessage represents a quick reply button message.

```go theme={null}
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.
    Footer *QuickReplyButtonMessageFooter `json:"footer,omitempty"`           // Footer of the quick reply button message.
    Header *QuickReplyButtonMessageHeader `json:"header,omitempty"`           // Header of the quick reply button message.
}
```

<a name="NewQuickReplyButtonMessage" />

### func NewQuickReplyButtonMessage

```go theme={null}
func NewQuickReplyButtonMessage(bodyText string) (*QuickReplyButtonMessage, error)
```

NewQuickReplyButtonMessage creates a new quick reply button message with the given body text.

<a name="QuickReplyButtonMessage.AddButton" />

### func (\*QuickReplyButtonMessage) AddButton

```go theme={null}
func (m *QuickReplyButtonMessage) AddButton(id, title string) error
```

<a name="QuickReplyButtonMessage.SetFooter" />

### func (\*QuickReplyButtonMessage) SetFooter

```go theme={null}
func (m *QuickReplyButtonMessage) SetFooter(text string)
```

<a name="QuickReplyButtonMessage.SetHeader" />

### func (\*QuickReplyButtonMessage) SetHeader

```go theme={null}
func (m *QuickReplyButtonMessage) SetHeader(text string)
```

<a name="QuickReplyButtonMessage.ToJson" />

### func (\*QuickReplyButtonMessage) ToJson

```go theme={null}
func (m *QuickReplyButtonMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the quick reply button message to JSON.

<a name="QuickReplyButtonMessageAction" />

## type QuickReplyButtonMessageAction

QuickReplyButtonMessageAction represents the action of a quick reply button message.

```go theme={null}
type QuickReplyButtonMessageAction struct {
    Buttons []quickReplyButtonMessageButton `json:"buttons" validate:"required"` // List of quick reply buttons.
}
```

<a name="QuickReplyButtonMessageApiPayload" />

## type QuickReplyButtonMessageApiPayload

QuickReplyButtonMessageApiPayload represents the API payload for a quick reply button message.

```go theme={null}
type QuickReplyButtonMessageApiPayload struct {
    BaseMessagePayload
    Interactive QuickReplyButtonMessage `json:"interactive" validate:"required"` // Interactive part of the API payload.
}
```

<a name="QuickReplyButtonMessageBody" />

## type QuickReplyButtonMessageBody

QuickReplyButtonMessageBody represents the body of a quick reply button message.

```go theme={null}
type QuickReplyButtonMessageBody struct {
    Text string `json:"text" validate:"required"` // Text of the quick reply button message.
}
```

<a name="QuickReplyButtonMessageFooter" />

## type QuickReplyButtonMessageFooter

QuickReplyButtonMessageFooter represents the footer of a quick reply button message.

```go theme={null}
type QuickReplyButtonMessageFooter struct {
    Text string `json:"text" validate:"required"` // Text of the quick reply button message footer.
}
```

<a name="QuickReplyButtonMessageHeader" />

## type QuickReplyButtonMessageHeader

```go theme={null}
type QuickReplyButtonMessageHeader struct {
    Type string `json:"type" validate:"required"` // Type of the quick reply button message header.
    Text string `json:"text" validate:"required"` // Text of the quick reply button message header.
}
```

<a name="ReactionMessage" />

## type ReactionMessage

ReactionMessage represents a reaction to a message.

```go theme={null}
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.
}
```

<a name="NewReactionMessage" />

### func NewReactionMessage

```go theme={null}
func NewReactionMessage(params ReactionMessageParams) (*ReactionMessage, error)
```

NewReactionMessage creates a new ReactionMessage instance.

<a name="ReactionMessage.ToJson" />

### func (\*ReactionMessage) ToJson

```go theme={null}
func (reaction *ReactionMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the ReactionMessage to JSON.

<a name="ReactionMessageApiPayload" />

## type ReactionMessageApiPayload

ReactionMessageApiPayload represents the API payload for a reaction message.

```go theme={null}
type ReactionMessageApiPayload struct {
    BaseMessagePayload
    Reaction ReactionMessage `json:"reaction" validate:"required"` // The reaction message.
}
```

<a name="ReactionMessageParams" />

## type ReactionMessageParams

ReactionMessageParams is an alias for ReactionMessage.

```go theme={null}
type ReactionMessageParams = ReactionMessage
```

<a name="StickerMessage" />

## type StickerMessage

StickerMessage represents a sticker message.

```go theme={null}
type StickerMessage struct {
    Id   string `json:"id,omitempty"`
    Link string `json:"link,omitempty"`
}
```

<a name="NewStickerMessage" />

### func NewStickerMessage

```go theme={null}
func NewStickerMessage(params *StickerMessageConfigs) (*StickerMessage, error)
```

NewStickerMessage creates a new sticker message based on the provided configurations.

<a name="StickerMessage.ToJson" />

### func (\*StickerMessage) ToJson

```go theme={null}
func (sticker *StickerMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the sticker message to JSON based on the provided configurations.

<a name="StickerMessageApiPayload" />

## type StickerMessageApiPayload

StickerMessageApiPayload represents the API payload for a sticker message.

```go theme={null}
type StickerMessageApiPayload struct {
    BaseMessagePayload
    Sticker StickerMessage `json:"sticker" validate:"required"`
}
```

<a name="StickerMessageConfigs" />

## type StickerMessageConfigs

StickerMessageConfigs represents the configurations for a sticker message.

```go theme={null}
type StickerMessageConfigs struct {
    Id   string `json:"id,omitempty"`
    Link string `json:"link,omitempty"`
}
```

<a name="TemplateMessage" />

## type TemplateMessage

TemplateMessage represents a template message.

```go theme={null}
type TemplateMessage struct {
    Name       string                     `json:"name" validate:"required"`       // Template name.
    Language   TemplateMessageLanguage    `json:"language" validate:"required"`   // Language configuration.
    Components []TemplateMessageComponent `json:"components" validate:"required"` // Array of components.
}
```

<a name="NewTemplateMessage" />

### func NewTemplateMessage

```go theme={null}
func NewTemplateMessage(params *TemplateMessageConfigs) (*TemplateMessage, error)
```

NewTemplateMessage creates a new TemplateMessage instance.

<a name="TemplateMessage.AddBody" />

### func (\*TemplateMessage) AddBody

```go theme={null}
func (tm *TemplateMessage) AddBody(params TemplateMessageComponentBodyType)
```

AddBody adds (or overrides) a body component in the template message. Only one body component is allowed.

<a name="TemplateMessage.AddButton" />

### func (\*TemplateMessage) AddButton

```go theme={null}
func (tm *TemplateMessage) AddButton(params TemplateMessageComponentButtonType) error
```

AddButton adds a button component to the template message. A maximum of 10 buttons is allowed.

<a name="TemplateMessage.AddHeader" />

### func (\*TemplateMessage) AddHeader

```go theme={null}
func (tm *TemplateMessage) AddHeader(params TemplateMessageComponentHeaderType)
```

AddHeader adds (or overrides) a header component in the template message. Only one header is allowed.

<a name="TemplateMessage.ToJson" />

### func (\*TemplateMessage) ToJson

```go theme={null}
func (m *TemplateMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the template message into a JSON payload compatible with the API.

<a name="TemplateMessageApiPayload" />

## type TemplateMessageApiPayload

TemplateMessageApiPayload represents the API payload for sending a template message.

```go theme={null}
type TemplateMessageApiPayload struct {
    BaseMessagePayload
    Template TemplateMessage `json:"template" validate:"required"`
}
```

<a name="TemplateMessageBodyAndHeaderParameter" />

## type TemplateMessageBodyAndHeaderParameter

TemplateMessageBodyAndHeaderParameter represents parameters for body and header components.

```go theme={null}
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).
}
```

<a name="TemplateMessageBodyAndHeaderParameter.GetParameterType" />

### func (TemplateMessageBodyAndHeaderParameter) GetParameterType

```go theme={null}
func (t TemplateMessageBodyAndHeaderParameter) GetParameterType() string
```

GetParameterType returns the parameter type as a string.

<a name="TemplateMessageButtonComponentType" />

## type TemplateMessageButtonComponentType

TemplateMessageButtonComponentType represents the subtype of a button component.

```go theme={null}
type TemplateMessageButtonComponentType string
```

<a name="TemplateMessageButtonComponentTypeQuickReply" />

```go theme={null}
const (
    TemplateMessageButtonComponentTypeQuickReply          TemplateMessageButtonComponentType = "quick_reply"
    TemplateMessageButtonComponentTypeUrl                 TemplateMessageButtonComponentType = "url"
    TemplateMessageButtonComponentTypeCatalog             TemplateMessageButtonComponentType = "catalog"
    TemplateMessageButtonComponentTypeCopyCode            TemplateMessageButtonComponentType = "copy_code"
    TemplateMessageButtonComponentTypeMultiProductMessage TemplateMessageButtonComponentType = "mpm"
)
```

<a name="TemplateMessageButtonParameter" />

## type TemplateMessageButtonParameter

TemplateMessageButtonParameter represents a parameter for a button component.

```go theme={null}
type TemplateMessageButtonParameter struct {
    Type       TemplateMessageButtonParameterType    `json:"type" validate:"required"` // e.g., "payload" or "text" or "action"
    Payload    *string                               `json:"payload,omitempty"`        // Required for quick_reply buttons.
    Text       *string                               `json:"text,omitempty"`           // Required for URL buttons.
    Action     *TemplateMessageButtonParameterAction `json:"action,omitempty"`         // Required for catalog buttons.
    CouponCode *string                               `json:"coupon_code,omitempty"`    // Required for copy code button in coupon_code parameter.
}
```

<a name="TemplateMessageButtonParameter.GetParameterType" />

### func (TemplateMessageButtonParameter) GetParameterType

```go theme={null}
func (t TemplateMessageButtonParameter) GetParameterType() string
```

GetParameterType returns the button parameter type as a string.

<a name="TemplateMessageButtonParameterAction" />

## type TemplateMessageButtonParameterAction

```go theme={null}
type TemplateMessageButtonParameterAction struct {
    ThumbnailProductRetailerId string                                                     `json:"thumbnail_product_retailer_id" validate:"required"`
    Sections                   *[]TemplateMessageMultiProductButtonActionParameterSection `json:"sections,omitempty"` // Required for MPM buttons. UPTO 10 sections in a buttons parameter
}
```

<a name="TemplateMessageButtonParameterType" />

## type TemplateMessageButtonParameterType

TemplateMessageButtonParameterType represents the type for button parameters.

```go theme={null}
type TemplateMessageButtonParameterType string
```

<a name="TemplateMessageButtonParameterTypePayload" />

```go theme={null}
const (
    TemplateMessageButtonParameterTypePayload    TemplateMessageButtonParameterType = "payload"
    TemplateMessageButtonParameterTypeText       TemplateMessageButtonParameterType = "text"
    TemplateMessageButtonParameterTypeAction     TemplateMessageButtonParameterType = "action"
    TemplateMessageButtonParameterTypeCouponCode TemplateMessageButtonParameterType = "coupon_code"
)
```

<a name="TemplateMessageCaraouselCard" />

## type TemplateMessageCaraouselCard

```go theme={null}
type TemplateMessageCaraouselCard struct {
    CardIndex  int                        `json:"card_index" validate:"required"`
    Components []TemplateMessageComponent `json:"components" validate:"required"` // only header, buttons and body
}
```

<a name="TemplateMessageComponent" />

## type TemplateMessageComponent

TemplateMessageComponent is an interface for all template message components.

```go theme={null}
type TemplateMessageComponent interface {
    GetComponentType() string
}
```

<a name="TemplateMessageComponentBodyType" />

## type TemplateMessageComponentBodyType

TemplateMessageComponentBodyType represents a body component.

```go theme={null}
type TemplateMessageComponentBodyType struct {
    Type       TemplateMessageComponentType `json:"type" validate:"required"`       // "body"
    Parameters []TemplateMessageParameter   `json:"parameters" validate:"required"` // Parameters for the body component.
}
```

<a name="TemplateMessageComponentBodyType.GetComponentType" />

### func (TemplateMessageComponentBodyType) GetComponentType

```go theme={null}
func (t TemplateMessageComponentBodyType) GetComponentType() string
```

GetComponentType returns the component type.

<a name="TemplateMessageComponentButtonType" />

## type TemplateMessageComponentButtonType

TemplateMessageComponentButtonType represents a button component.

```go theme={null}
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.
}
```

<a name="TemplateMessageComponentButtonType.GetComponentType" />

### func (TemplateMessageComponentButtonType) GetComponentType

```go theme={null}
func (t TemplateMessageComponentButtonType) GetComponentType() string
```

<a name="TemplateMessageComponentCarouselType" />

## type TemplateMessageComponentCarouselType

```go theme={null}
type TemplateMessageComponentCarouselType struct {
    Type  TemplateMessageComponentType   `json:"type" validate:"required"` // "carousel"
    Cards []TemplateMessageCaraouselCard `json:"cards" validate:"required"`
}
```

<a name="TemplateMessageComponentHeaderType" />

## type TemplateMessageComponentHeaderType

TemplateMessageComponentHeaderType represents a header component.

```go theme={null}
type TemplateMessageComponentHeaderType struct {
    Type       TemplateMessageComponentType `json:"type" validate:"required"`                 // "header"
    Parameters *[]TemplateMessageParameter  `json:"parameters,omitempty" validate:"required"` // Parameters for the header component.
}
```

<a name="TemplateMessageComponentHeaderType.GetComponentType" />

### func (TemplateMessageComponentHeaderType) GetComponentType

```go theme={null}
func (t TemplateMessageComponentHeaderType) GetComponentType() string
```

GetComponentType returns the component type.

<a name="TemplateMessageComponentLimitedTimeOfferType" />

## type TemplateMessageComponentLimitedTimeOfferType

```go theme={null}
type TemplateMessageComponentLimitedTimeOfferType struct {
    Type       TemplateMessageComponentType                `json:"type" validate:"required"`
    Parameters *[]TemplateMessageLimitedTimeOfferParameter `json:"parameters,omitempty" validate:"required"`
}
```

<a name="TemplateMessageComponentLimitedTimeOfferType.GetComponentType" />

### func (TemplateMessageComponentLimitedTimeOfferType) GetComponentType

```go theme={null}
func (t TemplateMessageComponentLimitedTimeOfferType) GetComponentType() string
```

<a name="TemplateMessageComponentType" />

## type TemplateMessageComponentType

TemplateMessageComponentType represents the type of a template message component.

```go theme={null}
type TemplateMessageComponentType string
```

<a name="TemplateMessageComponentTypeHeader" />

```go theme={null}
const (
    TemplateMessageComponentTypeHeader           TemplateMessageComponentType = "header"
    TemplateMessageComponentTypeBody             TemplateMessageComponentType = "body"
    TemplateMessageComponentTypeButton           TemplateMessageComponentType = "button"
    TemplateMessageComponentTypeLimitedTimeOffer TemplateMessageComponentType = "limited_time_offer"
    TemplateMessageComponentTypeCarousel         TemplateMessageComponentType = "carousel"
)
```

<a name="TemplateMessageConfigs" />

## type TemplateMessageConfigs

TemplateMessageConfigs represents basic configurations for a template message.

```go theme={null}
type TemplateMessageConfigs struct {
    Name     string `json:"name" validate:"required"`     // Template name.
    Language string `json:"language" validate:"required"` // Language code.
}
```

<a name="TemplateMessageLanguage" />

## type TemplateMessageLanguage

TemplateMessageLanguage represents the language configuration.

```go theme={null}
type TemplateMessageLanguage struct {
    Code   string `json:"code" validate:"required"`   // e.g., "en_US"
    Policy string `json:"policy" validate:"required"` // e.g., "deterministic"
}
```

<a name="TemplateMessageLimitedTimeOfferParameter" />

## type TemplateMessageLimitedTimeOfferParameter

```go theme={null}
type TemplateMessageLimitedTimeOfferParameter struct {
    Type             TemplateMessageParameterType `json:"type" validate:"required"` // e.g., "text", "currency", etc.
    LimitedTimeOffer struct {
        ExpirationTimeMs int64 `json:"expiration_time_ms" validate:"required"` // Expiration time in milliseconds.
    }   `json:"limited_time_offer" validate:"required"`
}
```

<a name="TemplateMessageMultiProductButtonActionParameterProductItem" />

## type TemplateMessageMultiProductButtonActionParameterProductItem

```go theme={null}
type TemplateMessageMultiProductButtonActionParameterProductItem struct {
    ProductRetailerId string `json:"product_retailer_id" validate:"required"`
}
```

<a name="TemplateMessageMultiProductButtonActionParameterSection" />

## type TemplateMessageMultiProductButtonActionParameterSection

```go theme={null}
type TemplateMessageMultiProductButtonActionParameterSection struct {
    Title string `json:"title" validate:"required"`
    // Upto 30 product items only
    ProductItems []TemplateMessageMultiProductButtonActionParameterProductItem `json:"product_items" validate:"required"`
}
```

<a name="TemplateMessageParameter" />

## type TemplateMessageParameter

TemplateMessageParameter is an interface for all parameter types.

```go theme={null}
type TemplateMessageParameter interface {
    GetParameterType() string
}
```

<a name="TemplateMessageParameterCurrency" />

## type TemplateMessageParameterCurrency

TemplateMessageParameterCurrency represents a currency parameter.

```go theme={null}
type TemplateMessageParameterCurrency struct {
    FallbackValue string `json:"fallback_value" validate:"required"` // Default text if localization fails.
    Code          string `json:"code" validate:"required"`           // ISO 4217 currency code.
    Amount1000    int    `json:"amount_1000" validate:"required"`    // Amount multiplied by 1000.
}
```

<a name="TemplateMessageParameterDateTime" />

## type TemplateMessageParameterDateTime

TemplateMessageParameterDateTime represents a date-time parameter.

```go theme={null}
type TemplateMessageParameterDateTime struct {
    FallbackValue string `json:"fallback_value" validate:"required"` // Default text if localization fails.
}
```

<a name="TemplateMessageParameterLocation" />

## type TemplateMessageParameterLocation

TemplateMessageParameterLocation represents a location parameter.

```go theme={null}
type TemplateMessageParameterLocation struct {
    Latitude  string `json:"latitude" validate:"required"`  // Latitude.
    Longitude string `json:"longitude" validate:"required"` // Longitude.
    Name      string `json:"name" validate:"required"`      // Location name.
    Address   string `json:"address" validate:"required"`   // Address.
}
```

<a name="TemplateMessageParameterMedia" />

## type TemplateMessageParameterMedia

TemplateMessageParameterMedia represents a media parameter (for document, image, video).

```go theme={null}
type TemplateMessageParameterMedia struct {
    Link string `json:"link" validate:"required"` // URL link of the media.
}
```

<a name="TemplateMessageParameterProduct" />

## type TemplateMessageParameterProduct

```go theme={null}
type TemplateMessageParameterProduct struct {
    ProductRetailerId string `json:"product_retailer_id" validate:"required"`
    CatalogId         string `json:"catalog_id" validate:"required"`
}
```

<a name="TemplateMessageParameterType" />

## type TemplateMessageParameterType

TemplateMessageParameterType represents the type of a parameter.

```go theme={null}
type TemplateMessageParameterType string
```

<a name="TemplateMessageParameterTypeCurrency" />

```go theme={null}
const (
    TemplateMessageParameterTypeCurrency         TemplateMessageParameterType = "currency"
    TemplateMessageParameterTypeDateTime         TemplateMessageParameterType = "date_time"
    TemplateMessageParameterTypeDocument         TemplateMessageParameterType = "document"
    TemplateMessageParameterTypeImage            TemplateMessageParameterType = "image"
    TemplateMessageParameterTypeText             TemplateMessageParameterType = "text"
    TemplateMessageParameterTypeVideo            TemplateMessageParameterType = "video"
    TemplateMessageParameterTypeLocation         TemplateMessageParameterType = "location"
    TemplateMessageParameterTypeLimitedTimeOffer TemplateMessageParameterType = "limited_time_offer"
    TemplateMessageParameterTypeProduct          TemplateMessageParameterType = "product"
)
```

<a name="TextMessageApiPayload" />

## type TextMessageApiPayload

TextMessageApiPayload represents the payload for the WhatsApp API.

```go theme={null}
type TextMessageApiPayload struct {
    BaseMessagePayload `json:",inline"`
    Text               TextMessageApiPayloadText `json:"text" validate:"required"` // The text content of the message.
}
```

<a name="TextMessageApiPayloadText" />

## type TextMessageApiPayloadText

TextMessageApiPayloadText represents the text payload for the WhatsApp API.

```go theme={null}
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.
}
```

<a name="TextMessageConfigs" />

## type TextMessageConfigs

TextMessageConfigs represents the configuration options for a text message.

```go theme={null}
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.
}
```

<a name="UrlType" />

## type UrlType

```go theme={null}
type UrlType string
```

<a name="VideoMessage" />

## type VideoMessage

VideoMessage represents a video message.

```go theme={null}
type VideoMessage struct {
    Id      string `json:"id,omitempty"`
    Link    string `json:"link,omitempty"`
    Caption string `json:"caption,omitempty"`
}
```

<a name="NewVideoMessage" />

### func NewVideoMessage

```go theme={null}
func NewVideoMessage(params VideoMessageConfigs) (*VideoMessage, error)
```

NewVideoMessage creates a new VideoMessage instance.

<a name="VideoMessage.SetCaption" />

### func (\*VideoMessage) SetCaption

```go theme={null}
func (video *VideoMessage) SetCaption(params string)
```

SetCaption sets the caption for the video message.

<a name="VideoMessage.ToJson" />

### func (\*VideoMessage) ToJson

```go theme={null}
func (video *VideoMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the video message to JSON.

<a name="VideoMessageApiPayload" />

## type VideoMessageApiPayload

VideoMessageApiPayload represents the API payload for a video message.

```go theme={null}
type VideoMessageApiPayload struct {
    BaseMessagePayload
    Video VideoMessage `json:"video" validate:"required"`
}
```

<a name="VideoMessageConfigs" />

## type VideoMessageConfigs

VideoMessageConfigs is an alias for VideoMessage.

```go theme={null}
type VideoMessageConfigs = VideoMessage
```

<a name="listMessage" />

## type listMessage

listMessage represents an interactive list message.

```go theme={null}
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.
    Footer *ListMessageFooter     `json:"footer,omitempty"`           // Footer of the message.
    Header *ListMessageHeader     `json:"header,omitempty"`           // Header of the message.
}
```

<a name="NewListMessage" />

### func NewListMessage

```go theme={null}
func NewListMessage(params ListMessageParams) (*listMessage, error)
```

NewListMessage creates a new list message with the given parameters.

<a name="listMessage.AddSection" />

### func (\*listMessage) AddSection

```go theme={null}
func (m *listMessage) AddSection(section *ListSection)
```

AddSection adds a new section to the list message.

<a name="listMessage.SetBodyText" />

### func (\*listMessage) SetBodyText

```go theme={null}
func (m *listMessage) SetBodyText(section *ListSection)
```

SetBodyText sets the body text of the list message.

<a name="listMessage.SetFooterText" />

### func (\*listMessage) SetFooterText

```go theme={null}
func (m *listMessage) SetFooterText(footerText string)
```

<a name="listMessage.SetHeaderText" />

### func (\*listMessage) SetHeaderText

```go theme={null}
func (m *listMessage) SetHeaderText(headerText string)
```

<a name="listMessage.ToJson" />

### func (\*listMessage) ToJson

```go theme={null}
func (m *listMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the list message to JSON.

<a name="listMessageAction" />

## type listMessageAction

listMessageAction represents the action of the list message.

```go theme={null}
type listMessageAction struct {
    ButtonText string        `json:"button" validate:"required"`   // Text of the button.
    Sections   []ListSection `json:"sections" validate:"required"` // Sections in the list message.
}
```

<a name="listSectionRow" />

## type listSectionRow

listSectionRow represents a row in the list section.

```go theme={null}
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.
}
```

<a name="NewListSectionRow" />

### func NewListSectionRow

```go theme={null}
func NewListSectionRow(id, title, description string) (*listSectionRow, error)
```

NewListSectionRow creates a new list section row with the given ID, title, and description.

<a name="listSectionRow.SetDescription" />

### func (\*listSectionRow) SetDescription

```go theme={null}
func (row *listSectionRow) SetDescription(description string)
```

SetDescription sets the description of the list section row.

<a name="listSectionRow.SetId" />

### func (\*listSectionRow) SetId

```go theme={null}
func (row *listSectionRow) SetId(id string)
```

SetId sets the ID of the list section row.

<a name="listSectionRow.SetTitle" />

### func (\*listSectionRow) SetTitle

```go theme={null}
func (row *listSectionRow) SetTitle(title string)
```

SetTitle sets the title of the list section row.

<a name="locationMessageAction" />

## type locationMessageAction

```go theme={null}
type locationMessageAction struct {
    Name string `json:"name" validate:"required"` // Name of the action.
}
```

<a name="productMessageAction" />

## type productMessageAction

```go theme={null}
type productMessageAction struct {
    CatalogId         string `json:"catalog_id" validate:"required"`
    ProductRetailerId string `json:"product_retailer_id" validate:"required"`
}
```

<a name="quickReplyButtonMessageButton" />

## type quickReplyButtonMessageButton

quickReplyButtonMessageButton represents a quick reply button.

```go theme={null}
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.
}
```

<a name="NewQuickReplyButton" />

### func NewQuickReplyButton

```go theme={null}
func NewQuickReplyButton(id, title string) (*quickReplyButtonMessageButton, error)
```

NewQuickReplyButton creates a new quick reply button with the given ID and title.

<a name="quickReplyButtonMessageButtonReply" />

## type quickReplyButtonMessageButtonReply

quickReplyButtonMessageButtonReply represents the reply structure of a quick reply button.

```go theme={null}
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.
}
```

<a name="textMessage" />

## type textMessage

textMessage represents a text message.

```go theme={null}
type textMessage struct {
    Text         string // The text content of the message.
    AllowPreview bool   // Whether to allow preview of the message.
}
```

<a name="NewTextMessage" />

### func NewTextMessage

```go theme={null}
func NewTextMessage(configs TextMessageConfigs) (*textMessage, error)
```

NewTextMessage creates a new text message with the given configurations.

<a name="textMessage.SetText" />

### func (\*textMessage) SetText

```go theme={null}
func (m *textMessage) SetText(text string)
```

SetText sets the text content of the message.

<a name="textMessage.ToJson" />

### func (\*textMessage) ToJson

```go theme={null}
func (m *textMessage) ToJson(configs ApiCompatibleJsonConverterConfigs) ([]byte, error)
```

ToJson converts the text message struct to WhatsApp API compatible JSON.
