events

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 4 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAlertEvent

type AccountAlertEvent struct {
	BaseBusinessAccountEvent
	EntityType       string
	EntityId         string
	AlertSeverity    AccountAlertSeverityEnum
	AlertStatus      AccountAlertStatusEnum
	AlertType        string
	AlertDescription string
}

func NewAccountAlertEvent

func NewAccountAlertEvent(
	baseEvent *BaseBusinessAccountEvent,
	entityType string,
	entityId string,
	alertSeverity AccountAlertSeverityEnum,
	alertStatus AccountAlertStatusEnum,
	alertType string,
	alertDescription string,
) *AccountAlertEvent

type AccountAlertSeverityEnum added in v0.3.0

type AccountAlertSeverityEnum string
const (
	AccountAlertSeverityEnumCritical AccountAlertSeverityEnum = "CRITICAL"
	AccountAlertSeverityEnumWarning  AccountAlertSeverityEnum = "WARNING"
)

type AccountAlertStatusEnum added in v0.3.0

type AccountAlertStatusEnum string
const (
	AccountAlertStatusEnumActive   AccountAlertStatusEnum = "ACTIVE"
	AccountAlertStatusEnumResolved AccountAlertStatusEnum = "RESOLVED"
)

type AccountReviewUpdateEvent

type AccountReviewUpdateEvent struct {
	BaseBusinessAccountEvent
	Decision AccountReviewUpdateEventEnum
}

type AccountReviewUpdateEventEnum added in v0.3.0

type AccountReviewUpdateEventEnum string
const (
	AccountReviewUpdateEventEnumApproved AccountReviewUpdateEventEnum = "APPROVED"
	AccountReviewUpdateEventEnumRejected AccountReviewUpdateEventEnum = "REJECTED"
)

type AccountUpdateEvent

type AccountUpdateEvent struct {
	BaseBusinessAccountEvent
	StatusUpdate                     AccountUpdateEventEnum
	PhoneNumber                      string
	Country                          string
	WabaInfo                         *WabaInfo
	ViolationInfo                    *ViolationInfo
	AuthInternationalRateEligibility *AuthInternationalRateEligibility
	BanInfo                          *BanInfo
	RestrictionInfo                  *RestrictionInfo
	PartnerClientCertificationInfo   *PartnerClientCertificationInfo
}

func NewAccountUpdateEvent

func NewAccountUpdateEvent(
	baseEvent *BaseBusinessAccountEvent,
	statusUpdate AccountUpdateEventEnum,
	phoneNumber string,
	country string,
	wabaInfo *WabaInfo,
	violationInfo *ViolationInfo,
	authInternationalRateEligibility *AuthInternationalRateEligibility,
	banInfo *BanInfo,
	restrictionInfo *RestrictionInfo,
	partnerClientCertificationInfo *PartnerClientCertificationInfo,
) *AccountUpdateEvent

type AccountUpdateEventEnum added in v0.3.0

type AccountUpdateEventEnum string
const (
	AccountUpdateEventEnumVerifiedAccount    AccountUpdateEventEnum = "VERIFIED_ACCOUNT"
	AccountUpdateEventEnumDisabledAccount    AccountUpdateEventEnum = "DISABLED_UPDATE"
	AccountUpdateEventEnumAccountViolation   AccountUpdateEventEnum = "ACCOUNT_VIOLATION"
	AccountUpdateEventEnumAccountRestriction AccountUpdateEventEnum = "ACCOUNT_RESTRICTION"
	AccountUpdateEventEnumAccountDeleted     AccountUpdateEventEnum = "ACCOUNT_DELETED"
	AccountUpdateEventEnumPartnerRemoved     AccountUpdateEventEnum = "PARTNER_REMOVED"
)

type AdInteractionEvent

type AdInteractionEvent struct {
	BaseMessageEvent `json:",inline"`
	AdSource         AdSource `json:"adSource"`
	Text             string   `json:"text"`
}

AdInteractionEvent represents an ad interaction event.

func NewAdInteractionEvent

func NewAdInteractionEvent(baseMessageEvent BaseMessageEvent, adSource AdSource, text string) *AdInteractionEvent

NewAdInteractionEvent creates a new instance of AdInteractionEvent.

type AdInteractionSourceMediaType

type AdInteractionSourceMediaType string

AdInteractionSourceMediaType represents the media type of an ad interaction source.

const (
	// AdInteractionSourceMediaTypeImage indicates that the ad interaction source is an image.
	AdInteractionSourceMediaTypeImage AdInteractionSourceMediaType = "image"
	// AdInteractionSourceMediaTypeVideo indicates that the ad interaction source is a video.
	AdInteractionSourceMediaTypeVideo AdInteractionSourceMediaType = "video"
)

type AdInteractionSourceType

type AdInteractionSourceType string

AdInteractionSourceType represents the source type of an ad interaction.

const (
	// AdInteractionSourceTypePost indicates that the ad interaction is from a post.
	AdInteractionSourceTypePost AdInteractionSourceType = "post"
	// AdInteractionSourceTypeAd indicates that the ad interaction is from an ad.
	AdInteractionSourceTypeAd AdInteractionSourceType = "ad"
)

type AdSource

type AdSource struct {
	Url          string                       `json:"url"`
	Id           string                       `json:"id"`
	Type         AdInteractionSourceType      `json:"type"`
	Title        string                       `json:"title"`
	Description  string                       `json:"description"`
	MediaUrl     string                       `json:"mediaUrl"`
	MediaType    AdInteractionSourceMediaType `json:"mediaType"`
	ThumbnailUrl string                       `json:"thumbnailUrl"`
	CtwaClid     string                       `json:"ctwaClid"`
}

AdSource represents the source of an ad.

type AudioMessageEvent

type AudioMessageEvent struct {
	BaseMediaMessageEvent `json:",inline"`
	Audio                 components.AudioMessage `json:"audio"`
}

AudioMessageEvent represents an event for an audio message.

func NewAudioMessageEvent

func NewAudioMessageEvent(baseMessageEvent BaseMessageEvent, audio components.AudioMessage, mimeType, sha256, mediaId string) *AudioMessageEvent

NewAudioMessageEvent creates a new AudioMessageEvent instance.

type AuthInternationalRateEligibility added in v0.7.2

type AuthInternationalRateEligibility struct {
	ExceptionCountries []ExceptionCountry
	StartTime          int64
}

type BanInfo added in v0.3.0

type BanInfo struct {
	WabaBanState []string
	WabaBanDate  string
}

type BaseBusinessAccountEvent

type BaseBusinessAccountEvent struct {
	BusinessAccountId string `json:"business_account_id"`
	Timestamp         string `json:"timestamp"`
}

func (BaseBusinessAccountEvent) GetEventType

func (bme BaseBusinessAccountEvent) GetEventType() string

type BaseBusinessAccountEventInterface

type BaseBusinessAccountEventInterface interface {
	BaseEvent
}

type BaseEvent

type BaseEvent interface {
	GetEventType() string
}

type BaseMediaMessageEvent

type BaseMediaMessageEvent struct {
	BaseMessageEvent `json:",inline"`
	MediaId          string `json:"media_id"`
	MimeType         string `json:"mime_type"`
	Sha256           string `json:"sha256"`
}

BaseMediaMessageEvent represents a base media message event which contains media information.

type BaseMessageEvent

type BaseMessageEvent struct {
	BusinessAccountId string `json:"business_account_id"`

	MessageId   string              `json:"message_id"`
	From        string              `json:"from"`
	SenderName  string              `json:"sender_name"`
	Context     MessageContext      `json:"context"`
	Timestamp   string              `json:"timestamp"`
	IsForwarded bool                `json:"is_forwarded"`
	PhoneNumber BusinessPhoneNumber `json:"phone_number"`
	// contains filtered or unexported fields
}

func NewBaseMessageEvent

func NewBaseMessageEvent(params BaseMessageEventParams) BaseMessageEvent

func (BaseMessageEvent) GetEventType

func (bme BaseMessageEvent) GetEventType() string

func (*BaseMessageEvent) React

func (baseMessageEvent *BaseMessageEvent) React(emoji string) (string, error)

React to the message

func (*BaseMessageEvent) Reply

func (baseMessageEvent *BaseMessageEvent) Reply(Message components.BaseMessage) (string, error)

Reply to the message

type BaseMessageEventInterface

type BaseMessageEventInterface interface {
	BaseEvent
	Reply() (string, error)
	React() (string, error)
}

type BaseMessageEventParams added in v0.0.13

type BaseMessageEventParams struct {
	BusinessAccountId string
	MessageId         string
	PhoneNumber       BusinessPhoneNumber
	Timestamp         string
	From              string // * whatsapp account id of the user who sent the message
	SenderName        string
	IsForwarded       bool
	Context           MessageContext // * this context will not be present if in case a message is a reply to another message
	Requester         request_client.RequestClient
}

type BaseSystemEvent

type BaseSystemEvent struct {
	Timestamp string `json:"timestamp"`
}

func (BaseSystemEvent) GetEventType

func (bme BaseSystemEvent) GetEventType() string

type BaseSystemEventInterface

type BaseSystemEventInterface interface {
	BaseEvent
}

type BusinessCapabilityUpdateEvent

type BusinessCapabilityUpdateEvent struct {
	BaseBusinessAccountEvent
	MaxDailyConversationPerPhone int64
	MaxPhoneNumbersPerBusiness   int64
}

func NewBusinessCapabilityUpdateEvent

func NewBusinessCapabilityUpdateEvent(baseEvent *BaseBusinessAccountEvent, maxDailyConversationPerPhone int64, maxPhoneNumbersPerBusiness int64) *BusinessCapabilityUpdateEvent

type BusinessPhoneNumber added in v0.0.15

type BusinessPhoneNumber struct {
	DisplayNumber string `json:"display_number"`
	Id            string `json:"id"`
}

type ContactSync added in v0.7.2

type ContactSync struct {
	FullName    string `json:"full_name,omitempty"`
	FirstName   string `json:"first_name,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
}

type ContactsMessageEvent

type ContactsMessageEvent struct {
	BaseMessageEvent `json:",inline"`
	Contacts         components.ContactMessage `json:"contacts"`
}

ContactsMessageEvent represents an event that occurs when a message with contacts is received.

func NewContactsMessageEvent

func NewContactsMessageEvent(baseMessageEvent BaseMessageEvent, contacts components.ContactMessage) *ContactsMessageEvent

NewContactsMessageEvent creates a new ContactsMessageEvent instance.

type CustomerIdentityChangedEvent

type CustomerIdentityChangedEvent struct {
	BaseSystemEvent   `json:",inline"`
	Acknowledged      string `json:"acknowledged"`
	CreationTimestamp string `json:"creationTime"`
	Hash              string `json:"hash"`
}

type CustomerNumberChangedEvent

type CustomerNumberChangedEvent struct {
	BaseSystemEvent   `json:",inline"`
	ChangeDescription string `json:"changeDescription"`
	NewWaId           string `json:"newWaId"`
	OldWaId           string `json:"oldWaId"`
}

type DocumentMessageEvent

type DocumentMessageEvent struct {
	BaseMediaMessageEvent
	Document components.DocumentMessage
}

DocumentMessageEvent represents an event that occurs when a document message is received.

func NewDocumentMessageEvent

func NewDocumentMessageEvent(baseMessageEvent BaseMessageEvent, document components.DocumentMessage, mediaId, sha256, mimeType string) *DocumentMessageEvent

NewDocumentMessageEvent creates a new DocumentMessageEvent instance.

type EventType

type EventType string
const (
	TextMessageEventType                     EventType = "text_message"
	AudioMessageEventType                    EventType = "audio_message"
	VideoMessageEventType                    EventType = "video_message"
	ImageMessageEventType                    EventType = "image_message"
	ContactMessageEventType                  EventType = "contact_message"
	DocumentMessageEventType                 EventType = "document_message"
	LocationMessageEventType                 EventType = "location_message"
	ReactionMessageEventType                 EventType = "reaction_message"
	ListInteractionMessageEventType          EventType = "list_interaction_message"
	TemplateMessageEventType                 EventType = "template_message"
	QuickReplyMessageEventType               EventType = "quick_reply_message"
	ReplyButtonInteractionEventType          EventType = "reply_button_interaction"
	StickerMessageEventType                  EventType = "sticker_message"
	AdInteractionEventType                   EventType = "ad_interaction_message"
	CustomerIdentityChangedEventType         EventType = "customer_identity_changed"
	CustomerNumberChangedEventType           EventType = "customer_number_changed"
	MessageDeliveredEventType                EventType = "message_delivered"
	MessageFailedEventType                   EventType = "message_failed"
	MessageReadEventType                     EventType = "message_read"
	MessageSentEventType                     EventType = "message_sent"
	MessageUndeliveredEventType              EventType = "message_undelivered"
	OrderReceivedEventType                   EventType = "order_received"
	ProductInquiryEventType                  EventType = "product_inquiry"
	UnknownEventType                         EventType = "unknown"
	ErrorEventType                           EventType = "error"
	WarnEventType                            EventType = "warn"
	ReadyEventType                           EventType = "ready"
	MessageTemplateStatusUpdateEventType     EventType = "message_template_status_update"
	MessageTemplateQualityUpdateEventType    EventType = "message_template_quality_update"
	PhoneNumberNameUpdateEventType           EventType = "phone_number_name_update"
	PhoneNumberQualityUpdateEventType        EventType = "phone_number_quality_update"
	SecurityEventType                        EventType = "security"
	AccountUpdateEventType                   EventType = "account_update"
	AccountReviewUpdateEventType             EventType = "account_review_update"
	AccountAlertsEventType                   EventType = "account_alerts"
	BusinessCapabilityUpdateEventType        EventType = "business_capability_update"
	UserPreferencesEventType                 EventType = "user_preferences"
	MessageTemplateComponentsUpdateEventType EventType = "message_template_components_update"
	PaymentConfigurationUpdateEventType      EventType = "payment_configuration_update"
	SmbAppStateSyncEventType                 EventType = "smb_app_state_sync"
	SmbMessageEchoesEventType                EventType = "smb_message_echoes"
	TemplateCategoryUpdateEventType          EventType = "template_category_update"
	HistoryEventType                         EventType = "history"
)

type ExceptionCountry added in v0.7.2

type ExceptionCountry struct {
	CountryCode string
	StartTime   int64
}

type HistoryChunk added in v0.7.2

type HistoryChunk struct {
	Phase      int             `json:"phase"`
	ChunkOrder int             `json:"chunk_order"`
	Progress   int             `json:"progress"`
	Threads    []HistoryThread `json:"threads"`
}

type HistoryEvent added in v0.7.2

type HistoryEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	MessagingProduct         string         `json:"messaging_product"`
	DisplayPhoneNumber       string         `json:"display_phone_number"`
	PhoneNumberId            string         `json:"phone_number_id"`
	HistoryChunks            []HistoryChunk `json:"history_chunks"`
}

HistoryEvent represents an event for chat history synchronization

func NewHistoryEvent added in v0.7.2

func NewHistoryEvent(
	baseEvent *BaseBusinessAccountEvent,
	messagingProduct string,
	displayPhoneNumber string,
	phoneNumberId string,
	historyChunks []HistoryChunk,
) *HistoryEvent

NewHistoryEvent creates a new HistoryEvent instance

func (*HistoryEvent) GetEventType added in v0.7.2

func (e *HistoryEvent) GetEventType() string

type HistoryMessage added in v0.7.2

type HistoryMessage struct {
	From          string `json:"from"`
	To            string `json:"to,omitempty"` // Only included if SMB message echo
	Id            string `json:"id"`
	Timestamp     string `json:"timestamp"`
	Type          string `json:"type"`
	MessageStatus string `json:"message_status"` // From history_context.status
}

type HistoryThread added in v0.7.2

type HistoryThread struct {
	Id       string           `json:"id"` // WhatsApp user phone number
	Messages []HistoryMessage `json:"messages"`
}

type ImageMessageEvent

type ImageMessageEvent struct {
	BaseMediaMessageEvent `json:",inline"`
	Image                 components.ImageMessage `json:"image"`
}

ImageMessageEvent represents an event for an image message.

func NewImageMessageEvent

func NewImageMessageEvent(baseMessageEvent BaseMessageEvent, image components.ImageMessage, mimeType, sha256, mediaId string) *ImageMessageEvent

NewImageMessageEvent creates a new ImageMessageEvent instance.

type ListInteractionEvent

type ListInteractionEvent struct {
	BaseMessageEvent `json:",inline"`
	Title            string `json:"title"`
	ListId           string `json:"list_id"`
	Description      string `json:"description"`
}

ListInteractionEvent represents an interaction event related to a list.

func NewListInteractionEvent

func NewListInteractionEvent(baseMessageEvent BaseMessageEvent, title, listId, description string) *ListInteractionEvent

NewListInteractionEvent creates a new ListInteractionEvent instance.

type LocationMessageEvent

type LocationMessageEvent struct {
	BaseMessageEvent `json:",inline"`
	Location         components.LocationMessage `json:"location"`
}

LocationMessageEvent represents an event that contains a location message.

func NewLocationMessageEvent

func NewLocationMessageEvent(baseMessageEvent BaseMessageEvent, location components.LocationMessage) *LocationMessageEvent

NewLocationMessageEvent creates a new LocationMessageEvent instance.

type MessageContext

type MessageContext struct {
	RepliedToMessageId string `json:"replied_to_message_id"`
}

type MessageDeliveredEvent

type MessageDeliveredEvent struct {
	BaseSystemEvent `json:",inline"`
	MessageId       string `json:"messageId"`
	SentTo          string `json:"sentTo"`
}

MessageDeliveredEvent represents an event related to an undelivered message.

func NewMessageDeliveredEvent

func NewMessageDeliveredEvent(baseSystemEvent BaseSystemEvent, messageId, sendTo string) *MessageDeliveredEvent

MessageDeliveredEvent creates a new instance of MessageUndeliveredEvent.

type MessageEcho added in v0.7.2

type MessageEcho struct {
	From      string `json:"from"`
	To        string `json:"to"`
	Id        string `json:"id"`
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
}

type MessageFailedEvent

type MessageFailedEvent struct {
	BaseSystemEvent `json:",inline"`
	MessageId       string `json:"messageId"`
	SentTo          string `json:"sentTo"`
	FailReason      string `json:"failReason"`
	ErrorCode       int    `json:"errorCode"`
	ErrorMessage    string `json:"errorMessage"`
}

func NewMessageFailedEvent

func NewMessageFailedEvent(baseSystemEvent BaseSystemEvent, messageId, sendTo, failReason string, errCode int, errorMessage string) *MessageFailedEvent

type MessageReadEvent

type MessageReadEvent struct {
	BaseSystemEvent `json:",inline"`
	MessageId       string `json:"messageId"`
	SentTo          string `json:"sentTo"`
}

MessageReadEvent represents an event indicating that a message has been read.

func NewMessageReadEvent

func NewMessageReadEvent(baseSystemEvent BaseSystemEvent, messageId, sendTo string) *MessageReadEvent

NewMessageReadEvent creates a new instance of MessageReadEvent.

type MessageSentEvent

type MessageSentEvent struct {
	BaseSystemEvent `json:",inline"`
	MessageId       string `json:"messageId"`
	SentTo          string `json:"sentTo"`
}

MessageSentEvent represents an event indicating that a message has been sent.

func NewMessageSentEvent

func NewMessageSentEvent(baseSystemEvent BaseSystemEvent, messageId, sendTo string) *MessageSentEvent

NewMessageSentEvent creates a new instance of MessageSentEvent.

type MessageTemplateButton added in v0.7.2

type MessageTemplateButton struct {
	Type        string `json:"type"`
	Text        string `json:"text"`
	Url         string `json:"url,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
}

type MessageTemplateCategoryEnum added in v0.3.0

type MessageTemplateCategoryEnum string
const (
	MessageTemplateCategoryEnumMarketing      MessageTemplateCategoryEnum = "MARKETING"
	MessageTemplateCategoryEnumOtp            MessageTemplateCategoryEnum = "OTP"
	MessageTemplateCategoryEnumTransactional  MessageTemplateCategoryEnum = "TRANSACTIONAL"
	MessageTemplateCategoryEnumAuthentication MessageTemplateCategoryEnum = "AUTHENTICATION"
	MessageTemplateCategoryEnumUtility        MessageTemplateCategoryEnum = "UTILITY"
)

type MessageTemplateComponentsUpdateEvent added in v0.7.2

type MessageTemplateComponentsUpdateEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	MessageTemplateId        int64                   `json:"message_template_id"`
	MessageTemplateName      string                  `json:"message_template_name"`
	MessageTemplateLanguage  string                  `json:"message_template_language"`
	MessageTemplateElement   string                  `json:"message_template_element"` // Template body text
	MessageTemplateTitle     string                  `json:"message_template_title,omitempty"`
	MessageTemplateFooter    string                  `json:"message_template_footer,omitempty"`
	MessageTemplateButtons   []MessageTemplateButton `json:"message_template_buttons,omitempty"`
}

MessageTemplateComponentsUpdateEvent represents an event for message template components update

func NewMessageTemplateComponentsUpdateEvent added in v0.7.2

func NewMessageTemplateComponentsUpdateEvent(
	baseEvent *BaseBusinessAccountEvent,
	templateId int64,
	templateName string,
	templateLanguage string,
	element string,
	title string,
	footer string,
	buttons []MessageTemplateButton,
) *MessageTemplateComponentsUpdateEvent

NewMessageTemplateComponentsUpdateEvent creates a new MessageTemplateComponentsUpdateEvent instance

func (*MessageTemplateComponentsUpdateEvent) GetEventType added in v0.7.2

func (e *MessageTemplateComponentsUpdateEvent) GetEventType() string

type MessageTemplateQualityUpdateEvent

type MessageTemplateQualityUpdateEvent struct {
	BaseBusinessAccountEvent
	PreviousQualityScore    MessageTemplateQualityUpdateQualityScoreEnum
	NewQualityScore         MessageTemplateQualityUpdateQualityScoreEnum
	MessageTemplateId       int64
	MessageTemplateName     string
	MessageTemplateLanguage string
}

func NewMessageTemplateQualityUpdateEvent

func NewMessageTemplateQualityUpdateEvent(baseEvent *BaseBusinessAccountEvent, previousQualityScore MessageTemplateQualityUpdateQualityScoreEnum, newQualityScore MessageTemplateQualityUpdateQualityScoreEnum, messageTemplateId int64, messageTemplateName string, messageTemplateLanguage string) *MessageTemplateQualityUpdateEvent

type MessageTemplateQualityUpdateQualityScoreEnum added in v0.3.0

type MessageTemplateQualityUpdateQualityScoreEnum string
const (
	MessageTemplateQualityUpdateQualityScoreEnumGreen   MessageTemplateQualityUpdateQualityScoreEnum = "GREEN"
	MessageTemplateQualityUpdateQualityScoreEnumRed     MessageTemplateQualityUpdateQualityScoreEnum = "RED"
	MessageTemplateQualityUpdateQualityScoreEnumUnknown MessageTemplateQualityUpdateQualityScoreEnum = "UNKNOWN"
	MessageTemplateQualityUpdateQualityScoreEnumYellow  MessageTemplateQualityUpdateQualityScoreEnum = "YELLOW"
)

type MessageTemplateStatusUpdateEvent

type MessageTemplateStatusUpdateEvent struct {
	BaseBusinessAccountEvent
	Event                   MessageTemplateStatusUpdateEventEnum
	MessageTemplateId       int64
	MessageTemplateName     string
	MessageTemplateLanguage string
	Reason                  MessageTemplateStatusUpdateReason
}

func NewMessageTemplateStatusUpdateEvent

func NewMessageTemplateStatusUpdateEvent(baseEvent *BaseBusinessAccountEvent, event MessageTemplateStatusUpdateEventEnum, messageTemplateId int64, messageTemplateName string, messageTemplateLanguage string, reason MessageTemplateStatusUpdateReason) *MessageTemplateStatusUpdateEvent

type MessageTemplateStatusUpdateEventEnum added in v0.3.0

type MessageTemplateStatusUpdateEventEnum string
const (
	MessageTemplateStatusUpdateEventEnumApproved   MessageTemplateStatusUpdateEventEnum = "APPROVED"
	MessageTemplateStatusUpdateEventEnumDisabled   MessageTemplateStatusUpdateEventEnum = "DISABLED"
	MessageTemplateStatusUpdateEventEnumInAppeal   MessageTemplateStatusUpdateEventEnum = "IN_APPEAL"
	MessageTemplateStatusUpdateEventEnumPending    MessageTemplateStatusUpdateEventEnum = "PENDING"
	MessageTemplateStatusUpdateEventEnumReinstated MessageTemplateStatusUpdateEventEnum = "REINSTATED"
	MessageTemplateStatusUpdateEventEnumRejected   MessageTemplateStatusUpdateEventEnum = "REJECTED"
	MessageTemplateStatusUpdateEventEnumFlagged    MessageTemplateStatusUpdateEventEnum = "FLAGGED"
)

type MessageTemplateStatusUpdateReason added in v0.3.0

type MessageTemplateStatusUpdateReason string
const (
	MessageTemplateStatusUpdateReasonAbusiveContent    MessageTemplateStatusUpdateReason = "ABUSIVE_CONTENT"
	MessageTemplateStatusUpdateReasonIncorrectCategory MessageTemplateStatusUpdateReason = "INCORRECT_CATEGORY"
	MessageTemplateStatusUpdateReasonInvalidFormat     MessageTemplateStatusUpdateReason = "INVALID_FORMAT"
	MessageTemplateStatusUpdateReasonNone              MessageTemplateStatusUpdateReason = "NONE"
	MessageTemplateStatusUpdateReasonScam              MessageTemplateStatusUpdateReason = "SCAM"
)

type MessageUndeliveredEvent

type MessageUndeliveredEvent struct {
	BaseSystemEvent `json:",inline"`
	MessageId       string `json:"messageId"`
	SentTo          string `json:"sentTo"`
	Reason          string `json:"reason"`
	ErrorCode       int    `json:"errorCode"`
	ErrorMessage    string `json:"errorMessage"`
}

MessageUndeliveredEvent represents an event related to an undelivered message.

func NewMessageUndeliveredEvent

func NewMessageUndeliveredEvent(baseSystemEvent BaseSystemEvent, messageId, sendTo, reason string, errorCode int, errorMessage string) *MessageUndeliveredEvent

NewMessageUndeliveredEvent creates a new instance of MessageUndeliveredEvent.

type OrderEvent

type OrderEvent struct {
	BaseMessageEvent `json:",inline"`
	Order            components.Order `json:"order"`
}

OrderEvent represents an event related to an order.

func NewOrderEvent

func NewOrderEvent(baseMessageEvent BaseMessageEvent, order components.Order) *OrderEvent

NewOrderEvent creates a new OrderEvent instance.

type PartnerClientCertificationInfo added in v0.7.2

type PartnerClientCertificationInfo struct {
	ClientBusinessId string
	Status           string
	RejectionReasons []string
}

type PaymentConfigurationUpdateEvent added in v0.7.2

type PaymentConfigurationUpdateEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	ConfigurationName        string `json:"configuration_name"`
	ProviderName             string `json:"provider_name"`
	ProviderMid              string `json:"provider_mid"`
	Status                   string `json:"status"`
	CreatedTimestamp         int64  `json:"created_timestamp"`
	UpdatedTimestamp         int64  `json:"updated_timestamp"`
}

PaymentConfigurationUpdateEvent represents an event for payment configuration update

func NewPaymentConfigurationUpdateEvent added in v0.7.2

func NewPaymentConfigurationUpdateEvent(
	baseEvent *BaseBusinessAccountEvent,
	configName string,
	providerName string,
	providerMid string,
	status string,
	createdTs int64,
	updatedTs int64,
) *PaymentConfigurationUpdateEvent

NewPaymentConfigurationUpdateEvent creates a new PaymentConfigurationUpdateEvent instance

func (*PaymentConfigurationUpdateEvent) GetEventType added in v0.7.2

func (e *PaymentConfigurationUpdateEvent) GetEventType() string

type PhoneNumberNameUpdateEvent

type PhoneNumberNameUpdateEvent struct {
	BaseBusinessAccountEvent
	PhoneNumber     string
	Name            string
	Decision        string
	RejectionReason *string
}

func NewPhoneNumberNameUpdateEvent

func NewPhoneNumberNameUpdateEvent(baseEvent *BaseBusinessAccountEvent, phoneNumber string, name string, decision string, reason *string) *PhoneNumberNameUpdateEvent

type PhoneNumberQualityUpdateCurrentLimitEnum added in v0.3.0

type PhoneNumberQualityUpdateCurrentLimitEnum string
const (
	PhoneNumberQualityUpdateCurrentLimitEnumTier50        PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_50"
	PhoneNumberQualityUpdateCurrentLimitEnumTier250       PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_250"
	PhoneNumberQualityUpdateCurrentLimitEnumTier1K        PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_1K"
	PhoneNumberQualityUpdateCurrentLimitEnumTier10K       PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_10K"
	PhoneNumberQualityUpdateCurrentLimitEnumTier100K      PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_100K"
	PhoneNumberQualityUpdateCurrentLimitEnumTierUnlimited PhoneNumberQualityUpdateCurrentLimitEnum = "TIER_UNLIMITED"
)

type PhoneNumberQualityUpdateEvent

type PhoneNumberQualityUpdateEvent struct {
	BaseBusinessAccountEvent
	DisplayPhoneNumber string
	Event              PhoneNumberUpdateEventEnum
	CurrentLimit       PhoneNumberQualityUpdateCurrentLimitEnum
}

type PhoneNumberUpdateEventEnum added in v0.3.0

type PhoneNumberUpdateEventEnum string
const (
	PhoneNumberUpdateEventEnumDowngrade  PhoneNumberUpdateEventEnum = "DOWNGRADE"
	PhoneNumberUpdateEventEnumFlagged    PhoneNumberUpdateEventEnum = "FLAGGED"
	PhoneNumberUpdateEventEnumOnboarding PhoneNumberUpdateEventEnum = "ONBOARDING"
	PhoneNumberUpdateEventEnumUnflagged  PhoneNumberUpdateEventEnum = "UNFLAGGED"
	PhoneNumberUpdateEventEnumUpgrade    PhoneNumberUpdateEventEnum = "UPGRADE"
)

type ProductInquiryEvent

type ProductInquiryEvent struct {
	BaseMessageEvent `json:",inline"`
	ProductId        string `json:"productId"`
	CatalogId        string `json:"catalogId"`
	Text             string `json:"text"`
}

ProductInquiryEvent represents an event related to a product inquiry.

func NewProductInquiryEvent

func NewProductInquiryEvent(baseMessageEvent BaseMessageEvent, productId, catalogId, text string) *ProductInquiryEvent

NewProductInquiryEvent creates a new instance of ProductInquiryEvent.

type QuickReplyButtonInteractionEvent

type QuickReplyButtonInteractionEvent struct {
	BaseMessageEvent `json:",inline"`
	ButtonText       string `json:"button_text"`
	ButtonPayload    string `json:"button_payload"`
}

QuickReplyButtonInteractionEvent represents an event triggered when a user interacts with a quick reply button.

func NewQuickReplyButtonInteractionEvent

func NewQuickReplyButtonInteractionEvent(baseMessageEvent BaseMessageEvent, buttonText, buttonPayload string) *QuickReplyButtonInteractionEvent

NewQuickReplyButtonInteractionEvent creates a new instance of QuickReplyButtonInteractionEvent.

type ReactionMessageEvent

type ReactionMessageEvent struct {
	BaseMessageEvent `json:",inline"`
	Reaction         components.ReactionMessage
}

ReactionMessageEvent represents an event that occurs when a reaction is added to a message.

func NewReactionMessageEvent

func NewReactionMessageEvent(baseMessageEvent BaseMessageEvent, reaction components.ReactionMessage) *ReactionMessageEvent

NewReactionMessageEvent creates a new ReactionMessageEvent instance.

type ReadyEvent

type ReadyEvent struct {
	BaseSystemEvent `json:",inline"`
}

ReadyEvent represents an event that is triggered when the system is ready.

func NewReadyEvent

func NewReadyEvent() *ReadyEvent

NewReadyEvent creates a new instance of ReadyEvent.

type ReplyButtonInteractionEvent

type ReplyButtonInteractionEvent struct {
	BaseMessageEvent `json:",inline"`
	Title            string `json:"title"`
	ButtonId         string `json:"button_id"`
}

ReplyButtonInteractionEvent represents an interaction event triggered by a reply button.

func NewReplyButtonInteractionEvent

func NewReplyButtonInteractionEvent(baseMessageEvent BaseMessageEvent, title, buttonId string) *ReplyButtonInteractionEvent

NewReplyButtonInteractionEvent creates a new instance of ReplyButtonInteractionEvent.

type RestrictionInfo added in v0.3.0

type RestrictionInfo struct {
	RestrictionType string
	Expiration      string
}

type SecurityEvent

type SecurityEvent struct {
	BaseBusinessAccountEvent
}

func NewSecurity

func NewSecurity() *SecurityEvent

type SmbAppStateSyncEvent added in v0.7.2

type SmbAppStateSyncEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	MessagingProduct         string          `json:"messaging_product"`
	DisplayPhoneNumber       string          `json:"display_phone_number"`
	PhoneNumberId            string          `json:"phone_number_id"`
	StateSync                []StateSyncItem `json:"state_sync"`
}

SmbAppStateSyncEvent represents an event for SMB app state synchronization

func NewSmbAppStateSyncEvent added in v0.7.2

func NewSmbAppStateSyncEvent(
	baseEvent *BaseBusinessAccountEvent,
	messagingProduct string,
	displayPhoneNumber string,
	phoneNumberId string,
	stateSync []StateSyncItem,
) *SmbAppStateSyncEvent

NewSmbAppStateSyncEvent creates a new SmbAppStateSyncEvent instance

func (*SmbAppStateSyncEvent) GetEventType added in v0.7.2

func (e *SmbAppStateSyncEvent) GetEventType() string

type SmbMessageEchoesEvent added in v0.7.2

type SmbMessageEchoesEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	MessagingProduct         string        `json:"messaging_product"`
	DisplayPhoneNumber       string        `json:"display_phone_number"`
	PhoneNumberId            string        `json:"phone_number_id"`
	MessageEchoes            []MessageEcho `json:"message_echoes"`
}

SmbMessageEchoesEvent represents an event for SMB message echoes

func NewSmbMessageEchoesEvent added in v0.7.2

func NewSmbMessageEchoesEvent(
	baseEvent *BaseBusinessAccountEvent,
	messagingProduct string,
	displayPhoneNumber string,
	phoneNumberId string,
	messageEchoes []MessageEcho,
) *SmbMessageEchoesEvent

NewSmbMessageEchoesEvent creates a new SmbMessageEchoesEvent instance

func (*SmbMessageEchoesEvent) GetEventType added in v0.7.2

func (e *SmbMessageEchoesEvent) GetEventType() string

type StateSyncItem added in v0.7.2

type StateSyncItem struct {
	Type      string      `json:"type"` // e.g., "contact"
	Contact   ContactSync `json:"contact,omitempty"`
	Action    string      `json:"action"` // e.g., "add", "remove", "update"
	Timestamp string      `json:"timestamp"`
}

type StickerMessageEvent

type StickerMessageEvent struct {
	BaseMediaMessageEvent `json:",inline"`
	Sticker               components.StickerMessage
}

StickerMessageEvent represents an event for a sticker message.

func NewStickerMessageEvent

func NewStickerMessageEvent(baseMessageEvent BaseMessageEvent, sticker components.StickerMessage, mediaId, sha256, mimeType string) *StickerMessageEvent

NewStickerMessageEvent creates a new StickerMessageEvent instance.

type TemplateCategoryUpdateEvent

type TemplateCategoryUpdateEvent struct {
	BaseBusinessAccountEvent
	MessageTemplateId       int64
	MessageTemplateName     string
	MessageTemplateLanguage string
	PreviousCategory        MessageTemplateCategoryEnum
	NewCategory             MessageTemplateCategoryEnum
}

func NewMessageTemplateCategoryUpdateEvent

func NewMessageTemplateCategoryUpdateEvent(baseEvent *BaseBusinessAccountEvent, messageTemplateId int64, messageTemplateName string, messageTemplateLanguage string, previousCategory MessageTemplateCategoryEnum, newCategory MessageTemplateCategoryEnum) *TemplateCategoryUpdateEvent

type TextMessageEvent

type TextMessageEvent struct {
	BaseMessageEvent `json:",inline"`
	Text             string `json:"text"`
}

TextMessageEvent represents an event for a text message.

func NewTextMessageEvent

func NewTextMessageEvent(baseMessageEvent BaseMessageEvent, text string) *TextMessageEvent

NewTextMessageEvent creates a new TextMessageEvent instance.

type UserPreference added in v0.7.2

type UserPreference struct {
	WaId      string `json:"wa_id"`
	Detail    string `json:"detail"`
	Category  string `json:"category"` // e.g., "marketing_messages"
	Value     string `json:"value"`    // Preference value
	Timestamp int64  `json:"timestamp"`
}

type UserPreferencesEvent added in v0.7.2

type UserPreferencesEvent struct {
	BaseBusinessAccountEvent `json:",inline"`
	UserPreferences          []UserPreference `json:"user_preferences"`
}

UserPreferencesEvent represents an event for user marketing preferences update

func NewUserPreferencesEvent added in v0.7.2

func NewUserPreferencesEvent(baseEvent *BaseBusinessAccountEvent, preferences []UserPreference) *UserPreferencesEvent

NewUserPreferencesEvent creates a new UserPreferencesEvent instance

func (*UserPreferencesEvent) GetEventType added in v0.7.2

func (e *UserPreferencesEvent) GetEventType() string

type VideoMessageEvent

type VideoMessageEvent struct {
	BaseMediaMessageEvent `json:",inline"`
	Video                 components.VideoMessage `json:"video"`
}

VideoMessageEvent represents a WhatsApp video message event.

func NewVideoMessageEvent

func NewVideoMessageEvent(baseMessageEvent BaseMessageEvent, video components.VideoMessage, mimeType, sha256, mediaId string) *VideoMessageEvent

NewVideoMessageEvent creates a new VideoMessageEvent instance.

type ViolationInfo added in v0.3.0

type ViolationInfo struct {
	ViolationType string
}

type WabaInfo added in v0.7.2

type WabaInfo struct {
	WabaId                     string
	OwnerBusinessId            string
	AdAccountLinked            string
	PartnerAppId               string
	SolutionId                 string
	SolutionPartnerBusinessIds []string
}

Jump to

Keyboard shortcuts

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