ChannelEvent represents an event that can be published and subscribed to.
Copy
type ChannelEvent struct { Type events.EventType // Type is the type of the event. Data events.BaseEvent // Data is the data associated with the event.}
EventManager is responsible for managing events and their subscribers.
Copy
type EventManager struct { subscribers map[events.EventType]chan ChannelEvent // subscribers is a map of event types to channels of ChannelEvent. sync.RWMutex // RWMutex is used to synchronize access to the subscribers map.}
func (em *EventManager) On(eventName events.EventType, handler func(events.BaseEvent)) events.EventType
On registers a handler function for the specified event type. The handler function will be called whenever the event is published. It returns the event type that the handler is registered for.
type MessageTemplateCreationResponse struct { Id string `json:"id,omitempty"` Status MessageTemplateStatus `json:"status,omitempty"` Category MessageTemplateCategory `json:"category,omitempty"`}
type TemplateMessagePreviewEdge struct { Data []TemplateMessagePreviewNode `json:"data,omitempty"` Paging internal.WhatsAppBusinessApiPaginationMeta `json:"paging,omitempty"`}
type WhatsAppBusinessAccountMessageTemplatePreviewButton
Copy
type WhatsAppBusinessAccountMessageTemplatePreviewButton struct { AutoFillText string `json:"auto_fill_text,omitempty"` Text string `json:"text,omitempty"`}
type WhatsAppBusinessHSMWhatsAppBusinessHSMQualityScoreShape
WhatsAppBusinessHSMWhatsAppBusinessHSMQualityScoreShape represents the quality score of a WhatsApp Business message template.
Copy
type WhatsAppBusinessHSMWhatsAppBusinessHSMQualityScoreShape struct { Date int `json:"date,omitempty"` Reasons []string `json:"reasons,omitempty"` Score int `json:"score,omitempty"`}
WhatsAppBusinessTemplatesFetchResponseEdge represents the response structure for fetching WhatsApp Business message templates.
Copy
type WhatsAppBusinessTemplatesFetchResponseEdge struct { Data []WhatsAppBusinessMessageTemplateNode `json:"data,omitempty"` Paging internal.WhatsAppBusinessApiPaginationMeta `json:"paging,omitempty"`}
type WhatsappMessageTemplateComponentCreateOrUpdateRequestBody
WhatsappMessageTemplateComponentCreateOrUpdateRequestBody represents the request body for creating or updating a component in a message template.
Copy
type WhatsappMessageTemplateComponentCreateOrUpdateRequestBody struct { Type MessageTemplateComponentType `json:"type,omitempty"` Format MessageTemplateComponentFormat `json:"format,omitempty"` Text string `json:"text,omitempty"` Buttons []WhatsappMessageTemplateButtonCreateRequestBody `json:"buttons,omitempty"`}