message

package
v0.0.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSent      status = "sent"
	StatusDelivered status = "delivered"
	StatusRead      status = "read"
	StatusFailed    status = "failed"
	StatusDeleted   status = "deleted"
	StatusWarning   status = "warning"
)
View Source
const (
	Endpoint                = "/messages"
	MessagingProduct        = "whatsapp"
	RecipientTypeIndividual = "individual"
	TypeText                = "text"
	TypeVideo               = "video"
	TypeAudio               = "audio"
	TypeSticker             = "sticker"
	TypeDocument            = "document"
	TypeImage               = "image"
	TypeLocation            = "location"
	TypeReaction            = "reaction"
	TypeContacts            = "contacts"
	TypeInteractive         = "interactive"
	TypeTemplate            = "template"
)
View Source
const (
	TypeInteractiveLocationRequest = "location_request_message"
	TypeInteractiveCTAURL          = "cta_url"
	TypeInteractiveButton          = "button"
	TypeInteractiveFlow            = "flow"
	InteractionActionSendLocation  = "send_location"
	InteractiveActionCTAURL        = "cta_url"
	InteractiveActionButtonReply   = "reply"
	InteractiveActionFlow          = "flow"
)
View Source
const (
	TemplateComponentTypeCarousel         = "carousel"
	TemplateComponentTypeHeader           = "header"
	TemplateComponentTypeButton           = "button"
	TemplateComponentTypeButtons          = "buttons"
	TemplateComponentTypeBody             = "body"
	TemplateParameterTypeText             = "text"
	TemplateParameterTypeCurrency         = "currency"
	TemplateParameterTypeDateTime         = "date_time"
	TemplateParameterTypePayload          = "payload"
	TemplateParameterTypeImage            = "image"
	TemplateParameterTypeVideo            = "video"
	TemplateParameterTypeDocument         = "document"
	TemplateParameterTypeLocation         = "location"
	TemplateComponentTypeLimitedTimeOffer = "limited_time_offer"
	TemplateButtonSubTypeCopyCode         = "copy_code"
	TemplateButtonSubTypeURL              = "url"
)
View Source
const (
	TemplateComponentButtonSubTypeURL = "url"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Street      string `json:"street"`
	City        string `json:"city"`
	State       string `json:"state"`
	Zip         string `json:"zip"`
	Country     string `json:"country"`
	CountryCode string `json:"country_code"`
	Type        string `json:"type"`
}

type Addresses

type Addresses []*Address

type Audio

type Audio struct {
	ID string `json:"id,omitempty"`
}

type AuthTemplateRequest

type AuthTemplateRequest struct {
	Name            string
	LanguageCode    string
	LanguagePolicy  string
	OneTimePassword string
}

type BaseClient

type BaseClient struct {
	// contains filtered or unexported fields
}

func NewBaseClient

func NewBaseClient(sender whttp.Sender[Message], reader config.Reader,
	middlewares ...SenderMiddleware,
) (*BaseClient, error)

func (*BaseClient) RequestLocation

func (c *BaseClient) RequestLocation(ctx context.Context, request *Request[string]) (*Response, error)

func (*BaseClient) SendAudio

func (c *BaseClient) SendAudio(ctx context.Context, request *Request[Audio]) (*Response, error)

func (*BaseClient) SendContacts

func (c *BaseClient) SendContacts(ctx context.Context, request *Request[Contacts]) (*Response, error)

func (*BaseClient) SendDocument

func (c *BaseClient) SendDocument(ctx context.Context, request *Request[Document]) (*Response, error)

func (*BaseClient) SendImage

func (c *BaseClient) SendImage(ctx context.Context, request *Request[Image]) (*Response, error)

func (*BaseClient) SendInteractiveMessage

func (c *BaseClient) SendInteractiveMessage(ctx context.Context, request *Request[Interactive]) (*Response, error)

func (*BaseClient) SendLocation

func (c *BaseClient) SendLocation(ctx context.Context, request *Request[Location]) (*Response, error)

func (*BaseClient) SendMessage

func (c *BaseClient) SendMessage(ctx context.Context, message *Message) (*Response, error)

func (*BaseClient) SendReaction

func (c *BaseClient) SendReaction(ctx context.Context, request *Request[Reaction]) (*Response, error)

func (*BaseClient) SendSticker

func (c *BaseClient) SendSticker(ctx context.Context, request *Request[Sticker]) (*Response, error)

func (*BaseClient) SendTemplate

func (c *BaseClient) SendTemplate(ctx context.Context, request *Request[Template]) (*Response, error)

func (*BaseClient) SendText

func (c *BaseClient) SendText(ctx context.Context, request *Request[Text]) (*Response, error)

func (*BaseClient) SendVideo

func (c *BaseClient) SendVideo(ctx context.Context, request *Request[Video]) (*Response, error)

func (*BaseClient) SetConfigReader

func (c *BaseClient) SetConfigReader(fetcher config.Reader)

func (*BaseClient) UpdateStatus

func (c *BaseClient) UpdateStatus(ctx context.Context, request *StatusUpdateRequest) (*StatusUpdateResponse, error)

type BaseRequest

type BaseRequest struct {
	Method        string
	Endpoints     []string
	Type          whttp.RequestType
	Message       *Message
	DecodeOptions whttp.DecodeOptions
	Metadata      types.Metadata
}

func NewBaseRequest

func NewBaseRequest(message *Message, options ...BaseRequestOption) *BaseRequest

type BaseRequestOption

type BaseRequestOption func(request *BaseRequest)

func WithBaseRequestDecodeOptions

func WithBaseRequestDecodeOptions(options whttp.DecodeOptions) BaseRequestOption

func WithBaseRequestEndpoints

func WithBaseRequestEndpoints(endpoint ...string) BaseRequestOption

func WithBaseRequestMetadata

func WithBaseRequestMetadata(metadata map[string]any) BaseRequestOption

func WithBaseRequestMethod

func WithBaseRequestMethod(method string) BaseRequestOption

func WithBaseRequestType

func WithBaseRequestType(reqType whttp.RequestType) BaseRequestOption

type BaseSender

type BaseSender struct {
	Sender whttp.Sender[Message]
}

func (*BaseSender) Send

func (c *BaseSender) Send(ctx context.Context, conf *config.Config, request *BaseRequest) (*Response, error)

type ButtonParams

type ButtonParams struct {
	Index int
	Text  string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, reader config.Reader, sender whttp.Sender[Message],
	middlewares ...SenderMiddleware,
) (*Client, error)

func (*Client) ReloadConfig

func (c *Client) ReloadConfig(ctx context.Context) error

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, message *Message) (*Response, error)

func (*Client) UpdateStatus

func (c *Client) UpdateStatus(ctx context.Context, request *StatusUpdateRequest) (*StatusUpdateResponse, error)

type Contact

type Contact struct {
	Addresses Addresses `json:"addresses,omitempty"`
	Birthday  string    `json:"birthday"`
	Emails    Emails    `json:"emails,omitempty"`
	Name      *Name     `json:"name"`
	Org       *Org      `json:"org"`
	Phones    Phones    `json:"phones,omitempty"`
	Urls      Urls      `json:"urls,omitempty"`
}

func NewContact

func NewContact(options ...ContactOption) *Contact

type ContactOption

type ContactOption func(*Contact)

func WithContactAddresses

func WithContactAddresses(addresses ...*Address) ContactOption

func WithContactBirthdays

func WithContactBirthdays(birthday time.Time) ContactOption

func WithContactEmails

func WithContactEmails(emails ...*Email) ContactOption

func WithContactName

func WithContactName(name *Name) ContactOption

func WithContactOrganization

func WithContactOrganization(organization *Org) ContactOption

func WithContactPhones

func WithContactPhones(phones ...*Phone) ContactOption

func WithContactURLs

func WithContactURLs(urls ...*URL) ContactOption

type Contacts

type Contacts []*Contact

type Context

type Context struct {
	MessageID string `json:"message_id"`
}

type CouponCodeTemplateRequest

type CouponCodeTemplateRequest struct {
	Name        string               // Template name
	Language    *TemplateLanguage    // Language code and policy
	Body        []*TemplateParameter // Parameters for the body text
	CouponCode  string               // Coupon code to be copied
	ButtonIndex int                  // Index of the button in the template
}

type Document

type Document struct {
	ID       string `json:"id,omitempty"`
	Link     string `json:"link,omitempty"`
	Caption  string `json:"caption,omitempty"`
	Filename string `json:"filename,omitempty"`
}

type Email

type Email struct {
	Email string `json:"email"`
	Type  string `json:"type"`
}

type Emails

type Emails []*Email

type FlowActionPayload

type FlowActionPayload struct {
	Screen string                 `json:"screen"`
	Data   map[string]interface{} `json:"data"`
}

type ID

type ID struct {
	ID            string `json:"id,omitempty"`
	MessageStatus string `json:"message_status,omitempty"`
}

type Image

type Image struct {
	ID       string `json:"id,omitempty"`
	Link     string `json:"link,omitempty"`
	Caption  string `json:"caption,omitempty"`
	Filename string `json:"filename,omitempty"`
}

type Interactive

type Interactive struct {
	Type   string             `json:"type,omitempty"`
	Action *InteractiveAction `json:"action,omitempty"`
	Body   *InteractiveBody   `json:"body,omitempty"`
	Footer *InteractiveFooter `json:"footer,omitempty"`
	Header *InteractiveHeader `json:"header,omitempty"`
}

func NewInteractiveCTAURLButton

func NewInteractiveCTAURLButton(request *InteractiveCTARequest) *Interactive

func NewInteractiveMessageContent

func NewInteractiveMessageContent(interactiveType string, options ...InteractiveOption) *Interactive

type InteractiveAction

type InteractiveAction struct {
	Button            string                       `json:"button,omitempty"`
	Buttons           []*InteractiveButton         `json:"buttons,omitempty"`
	CatalogID         string                       `json:"catalog_id,omitempty"`
	ProductRetailerID string                       `json:"product_retailer_id,omitempty"`
	Sections          []*InteractiveSection        `json:"sections,omitempty"`
	Name              string                       `json:"name,omitempty"`
	Parameters        *InteractiveActionParameters `json:"parameters,omitempty"`
}

type InteractiveActionParameters

type InteractiveActionParameters struct {
	DisplayText        string             `json:"display_text,omitempty"`
	URL                string             `json:"url,omitempty"`
	FlowMessageVersion string             `json:"flow_message_version"`
	FlowToken          string             `json:"flow_token"`
	FlowID             string             `json:"flow_id"`
	FlowCTA            string             `json:"flow_cta"`
	FlowAction         string             `json:"flow_action"`
	FlowActionPayload  *FlowActionPayload `json:"flow_action_payload"`
}

type InteractiveBody

type InteractiveBody struct {
	Text string `json:"text,omitempty"`
}

InteractiveBody contains information about an interactive body.

type InteractiveButton

type InteractiveButton struct {
	Type  string                  `json:"type,omitempty"`
	Title string                  `json:"title,omitempty"`
	ID    string                  `json:"id,omitempty"`
	Reply *InteractiveReplyButton `json:"reply,omitempty"`
}

type InteractiveButtonTemplate

type InteractiveButtonTemplate struct {
	SubType string
	Index   int
	Button  *TemplateButton
}

type InteractiveCTARequest

type InteractiveCTARequest struct {
	DisplayText string
	URL         string
	Body        string
	Header      *InteractiveHeader
	Footer      string
}

type InteractiveFlowRequest

type InteractiveFlowRequest struct {
	Body               string             `json:"body"`
	Header             *InteractiveHeader `json:"header"`
	Footer             string             `json:"footer"`
	FlowMessageVersion string             `json:"flow_message_version"`
	FlowToken          string             `json:"flow_token"`
	FlowID             string             `json:"flow_id"`
	FlowCTA            string             `json:"flow_cta"`
	FlowAction         string             `json:"flow_action"`
	FlowScreen         string             `json:"flow_screen"`
	FlowData           map[string]any     `json:"flow_data"`
}

type InteractiveFooter

type InteractiveFooter struct {
	Text string `json:"text,omitempty"`
}

InteractiveFooter contains information about an interactive footer.

type InteractiveHeader

type InteractiveHeader struct {
	Document *Document `json:"document,omitempty"`
	Image    *Image    `json:"image,omitempty"`
	Video    *Video    `json:"video,omitempty"`
	Text     string    `json:"text,omitempty"`
	Type     string    `json:"type,omitempty"`
}

func InteractiveHeaderImage

func InteractiveHeaderImage(image *Image) *InteractiveHeader

func InteractiveHeaderText

func InteractiveHeaderText(text string) *InteractiveHeader

func InteractiveHeaderVideo

func InteractiveHeaderVideo(video *Video) *InteractiveHeader

type InteractiveMessage

type InteractiveMessage string

type InteractiveOption

type InteractiveOption func(*Interactive)

func WithInteractiveAction

func WithInteractiveAction(action *InteractiveAction) InteractiveOption

func WithInteractiveBody

func WithInteractiveBody(body string) InteractiveOption

func WithInteractiveFooter

func WithInteractiveFooter(footer string) InteractiveOption

func WithInteractiveHeader

func WithInteractiveHeader(header *InteractiveHeader) InteractiveOption

type InteractiveReplyButton

type InteractiveReplyButton struct {
	ID    string `json:"id,omitempty"`
	Title string `json:"title,omitempty"`
}

type InteractiveReplyButtonsRequest

type InteractiveReplyButtonsRequest struct {
	Buttons []*InteractiveReplyButton
	Body    string
	Header  *InteractiveHeader
	Footer  string
}

type InteractiveSection

type InteractiveSection struct {
	Title        string                   `json:"title,omitempty"`
	ProductItems []*Product               `json:"product_items,omitempty"`
	Rows         []*InteractiveSectionRow `json:"rows,omitempty"`
}

type InteractiveSectionRow

type InteractiveSectionRow struct {
	ID          string `json:"id,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

InteractiveSectionRow contains information about a row in an interactive section.

type LimitedTimeOffer

type LimitedTimeOffer struct {
	ExpirationTimeMs int64 `json:"expiration_time_ms"`
}

type LimitedTimeOfferTemplateRequest

type LimitedTimeOfferTemplateRequest struct {
	Name            string
	Language        *TemplateLanguage
	HeaderComponent *TemplateComponent
	Body            []*TemplateParameter
	ExpirationTime  int64
	CouponCode      *string
	URLVariable     string
}

type Location

type Location struct {
	Longitude float64 `json:"longitude"`
	Latitude  float64 `json:"latitude"`
	Name      string  `json:"name"`
	Address   string  `json:"address"`
}

type Media

type Media struct {
	ID       string `json:"id,omitempty"`
	Link     string `json:"link,omitempty"`
	Caption  string `json:"caption,omitempty"`
	Filename string `json:"filename,omitempty"`
	Provider string `json:"provider,omitempty"`
}

type MediaCard

type MediaCard struct {
	Header  *MediaCardHeader  `json:"header"`
	Body    *MediaCardBody    `json:"body"`
	Buttons []*TemplateButton `json:"buttons,omitempty"`
}

type MediaCardBody

type MediaCardBody struct {
	Text string `json:"text"`
}

type MediaCardHeader

type MediaCardHeader struct {
	Format string `json:"format"`
	Handle string `json:"handle"`
}

type MediaCardTemplateRequest

type MediaCardTemplateRequest struct {
	Name     string
	Language *TemplateLanguage
	BodyText string
	Cards    []*MediaCard
	Category string
}

type MediaInfo

type MediaInfo struct {
	ID       string `json:"id,omitempty"`
	Caption  string `json:"caption,omitempty"`
	MimeType string `json:"mime_type,omitempty"`
	Sha256   string `json:"sha256,omitempty"`
	Filename string `json:"filename,omitempty"`
	Animated bool   `json:"animated,omitempty"` // used with stickers true if animated
}

type Message

type Message struct {
	Product         string           `json:"messaging_product"`
	To              string           `json:"to"`
	RecipientType   string           `json:"recipient_type"`
	Type            string           `json:"type"`
	PreviewURL      bool             `json:"preview_url,omitempty"`
	Context         *Context         `json:"context,omitempty"`
	Text            *Text            `json:"text,omitempty"`
	Location        *Location        `json:"location,omitempty"`
	Reaction        *Reaction        `json:"reaction,omitempty"`
	Contacts        Contacts         `json:"contacts,omitempty"`
	Interactive     *Interactive     `json:"interactive,omitempty"`
	Document        *Document        `json:"document,omitempty"`
	Sticker         *Sticker         `json:"sticker,omitempty"`
	Video           *Video           `json:"video,omitempty"`
	Image           *Image           `json:"image,omitempty"`
	Audio           *Audio           `json:"audio,omitempty"`
	Status          *string          `json:"status,omitempty"`     // used to update message status
	MessageID       *string          `json:"message_id,omitempty"` // used to update message status
	Template        *Template        `json:"template,omitempty"`
	TypingIndicator *TypingIndicator `json:"typing_indicator,omitempty"`
}

func New

func New(recipient string, options ...Option) (*Message, error)

type Name

type Name struct {
	FormattedName string `json:"formatted_name"`
	FirstName     string `json:"first_name"`
	LastName      string `json:"last_name"`
	MiddleName    string `json:"middle_name"`
	Suffix        string `json:"suffix"`
	Prefix        string `json:"prefix"`
}

type Option

type Option func(message *Message)

func WithAudio

func WithAudio(image *Audio) Option

func WithContacts

func WithContacts(contacts *Contacts) Option

func WithDocument

func WithDocument(doc *Document) Option

func WithImage

func WithImage(image *Image) Option

func WithInteractiveCTAURLButton

func WithInteractiveCTAURLButton(request *InteractiveCTARequest) Option

func WithInteractiveFlow

func WithInteractiveFlow(req *InteractiveFlowRequest) Option

func WithInteractiveMessage

func WithInteractiveMessage(request *Interactive) Option

func WithInteractiveReplyButtons

func WithInteractiveReplyButtons(params *InteractiveReplyButtonsRequest) Option

func WithLocationMessage

func WithLocationMessage(location *Location) Option

func WithMessageAsReplyTo

func WithMessageAsReplyTo(messageID string) Option

func WithReaction

func WithReaction(reaction *Reaction) Option

func WithRequestLocationMessage

func WithRequestLocationMessage(text *string) Option

func WithSticker

func WithSticker(image *Sticker) Option

func WithTemplateMessage

func WithTemplateMessage(tmpl *Template) Option

func WithTextMessage

func WithTextMessage(text *Text) Option

func WithVideo

func WithVideo(image *Video) Option

type Org

type Org struct {
	Company    string `json:"company"`
	Department string `json:"department"`
	Title      string `json:"title"`
}

type Phone

type Phone struct {
	Phone string `json:"phone"`
	Type  string `json:"type"`
	WaID  string `json:"wa_id,omitempty"`
}

type Phones

type Phones []*Phone

type Product

type Product struct {
	RetailerID string `json:"product_retailer_id,omitempty"`
}

type Reaction

type Reaction struct {
	MessageID string `json:"message_id"`
	Emoji     string `json:"emoji"`
}

type Request

type Request[T any] struct {
	Recipient string
	ReplyTo   string
	Message   *T
}

func NewRequest

func NewRequest[T any](recipient string, message *T, replyTo string) *Request[T]

type Response

type Response struct {
	Product         string             `json:"messaging_product,omitempty"`
	Contacts        []*ResponseContact `json:"contacts,omitempty"`
	Messages        []*ID              `json:"messages,omitempty"`
	MessageMetadata types.Metadata     `json:"-"`
	Success         bool               `json:"success"`
}

type ResponseContact

type ResponseContact struct {
	Input      string `json:"input"`
	WhatsappID string `json:"wa_id"`
}

type Sender

type Sender interface {
	Send(ctx context.Context, conf *config.Config, request *BaseRequest) (*Response, error)
}

type SenderFunc

type SenderFunc func(ctx context.Context, conf *config.Config, request *BaseRequest) (*Response, error)

func (SenderFunc) Send

func (fn SenderFunc) Send(ctx context.Context, conf *config.Config, request *BaseRequest) (*Response, error)

type SenderMiddleware

type SenderMiddleware func(senderFunc SenderFunc) SenderFunc

type Service

type Service interface {
	SendText(ctx context.Context, request *Request[Text]) (*Response, error)
	SendLocation(ctx context.Context, request *Request[Location]) (*Response, error)
	SendVideo(ctx context.Context, request *Request[Video]) (*Response, error)
	SendReaction(ctx context.Context, request *Request[Reaction]) (*Response, error)
	SendTemplate(ctx context.Context, request *Request[Template]) (*Response, error)
	SendImage(ctx context.Context, request *Request[Image]) (*Response, error)
	SendAudio(ctx context.Context, request *Request[Audio]) (*Response, error)
	SendDocument(ctx context.Context, request *Request[Document]) (*Response, error)
	SendSticker(ctx context.Context, request *Request[Sticker]) (*Response, error)
	SendContacts(ctx context.Context, request *Request[Contacts]) (*Response, error)
	RequestLocation(ctx context.Context, request *Request[string]) (*Response, error)
	SendInteractiveMessage(ctx context.Context, request *Request[Interactive]) (*Response, error)
}

type StatusUpdateRequest

type StatusUpdateRequest struct {
	MessageID           string
	Status              status
	WithTypingIndicator bool
}

type StatusUpdateResponse

type StatusUpdateResponse struct {
	Success bool `json:"success"`
}

type StatusUpdater

type StatusUpdater interface {
	UpdateStatus(ctx context.Context,
		request *StatusUpdateRequest) (*StatusUpdateResponse, error)
}

type Sticker

type Sticker struct {
	ID string `json:"id,omitempty"`
}

type Template

type Template struct {
	Name       string               `json:"name,omitempty"`
	Language   *TemplateLanguage    `json:"language,omitempty"`
	Category   string               `json:"category,omitempty"`
	Components []*TemplateComponent `json:"components,omitempty"`
}

func NewAuthTemplate

func NewAuthTemplate(request *AuthTemplateRequest) *Template

func NewCouponCodeTemplate

func NewCouponCodeTemplate(req *CouponCodeTemplateRequest) *Template

func NewInteractiveTemplate

func NewInteractiveTemplate(name string, language *TemplateLanguage, headers []*TemplateParameter,
	bodies []*TemplateParameter, buttons []*InteractiveButtonTemplate,
) *Template

func NewLimitedTimeOfferTemplate

func NewLimitedTimeOfferTemplate(req *LimitedTimeOfferTemplateRequest) *Template

func NewMediaCardTemplate

func NewMediaCardTemplate(req *MediaCardTemplateRequest) *Template

type TemplateButton

type TemplateButton struct {
	Type           string `json:"type,omitempty"`
	Payload        string `json:"payload,omitempty"`
	Text           string `json:"text,omitempty"`
	FlowID         string `json:"flow_id"`
	NavigateScreen string `json:"navigate_screen"`
	FlowAction     string `json:"flow_action"`
}

type TemplateComponent

type TemplateComponent struct {
	Type       string               `json:"type"`
	SubType    string               `json:"sub_type,omitempty"`
	Index      int                  `json:"index"`
	Parameters []*TemplateParameter `json:"parameters"`
	Buttons    []*TemplateButton    `json:"buttons,omitempty"`
	Text       string               `json:"text,omitempty"`
	Cards      []*MediaCard         `json:"cards,omitempty"`
}

func NewCopyCodeButton

func NewCopyCodeButton(params *ButtonParams) *TemplateComponent

func NewLimitedTimeOfferTemplateDocumentHeader

func NewLimitedTimeOfferTemplateDocumentHeader(document *Document) *TemplateComponent

func NewLimitedTimeOfferTemplateImageHeader

func NewLimitedTimeOfferTemplateImageHeader(image *Image) *TemplateComponent

func NewTemplateComponentLimitedTimeOffer

func NewTemplateComponentLimitedTimeOffer(expiresAt int64) *TemplateComponent

func NewURLButton

func NewURLButton(params *ButtonParams) *TemplateComponent

type TemplateCurrency

type TemplateCurrency struct {
	FallbackValue string  `json:"fallback_value"`
	Code          string  `json:"code"`
	Amount1000    float64 `json:"amount_1000"`
}

type TemplateDateTime

type TemplateDateTime struct {
	FallbackValue string `json:"fallback_value"`
	DayOfWeek     int    `json:"day_of_week"`
	Year          int    `json:"year"`
	Month         int    `json:"month"`
	DayOfMonth    int    `json:"day_of_month"`
	Hour          int    `json:"hour"`
	Minute        int    `json:"minute"`
	Calendar      string `json:"calendar,omitempty"`
}

type TemplateFlowButton

type TemplateFlowButton struct {
	Type           string `json:"type"`
	Text           string `json:"text"`
	FlowID         string `json:"flow_id"`
	NavigateScreen string `json:"navigate_screen"`
	FlowAction     string `json:"flow_action"`
}

type TemplateLanguage

type TemplateLanguage struct {
	Code   string `json:"code"`
	Policy string `json:"policy"`
}

type TemplateParameter

type TemplateParameter struct {
	Type             string            `json:"type"`
	Text             string            `json:"text"`
	Name             string            `json:"parameter_name,omitempty"`
	Payload          string            `json:"payload,omitempty"`
	Currency         *TemplateCurrency `json:"currency"`
	DateTime         *TemplateDateTime `json:"date_time"`
	LimitedTimeOffer *LimitedTimeOffer `json:"limited_time_offer,omitempty"`
	Image            *Image            `json:"image"`
	Document         *Document         `json:"document"`
	Video            *Video            `json:"video"`
	Location         *Location         `json:"location"`
}

type Text

type Text struct {
	PreviewURL bool   `json:"preview_url,omitempty"`
	Body       string `json:"body,omitempty"`
}

type TypingIndicator

type TypingIndicator struct {
	Type string `json:"type"`
}

type URL

type URL struct {
	URL  string `json:"url"`
	Type string `json:"type"`
}

type UpdateStatusFunc

type UpdateStatusFunc func(ctx context.Context,
	request *StatusUpdateRequest) (*StatusUpdateResponse, error)

func (UpdateStatusFunc) UpdateStatus

func (fn UpdateStatusFunc) UpdateStatus(ctx context.Context,
	request *StatusUpdateRequest,
) (*StatusUpdateResponse, error)

type Urls

type Urls []*URL

type Video

type Video struct {
	ID      string `json:"id,omitempty"`
	Link    string `json:"link,omitempty"`
	Caption string `json:"caption,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL