Documentation
¶
Index ¶
- type AccountAnalyticsOptions
- type AnalyticsDataPoint
- type AnalyticsRequestGranularityType
- type BusinessClient
- func (client *BusinessClient) ConversationAnalytics(options ConversationAnalyticsOptions) (*WhatsAppConversationAnalyticsResponse, error)
- func (client *BusinessClient) Fetch() (*FetchBusinessAccountResponse, error)
- func (client *BusinessClient) FetchAnalytics(options AccountAnalyticsOptions) (WhatsappBusinessAccountAnalyticsResponse, error)
- func (bc *BusinessClient) GetBusinessId() string
- func (bc *BusinessClient) SetBusinessId(id string)
- type BusinessClientConfig
- type BusinessRole
- type ConversationAnalyticsGranularityType
- type ConversationAnalyticsOptions
- type ConversationCategoryType
- type ConversationDimensionType
- type ConversationDirection
- type ConversationType
- type FetchBusinessAccountResponse
- type WhatsAppBusinessAccountAnalyticsProductType
- type WhatsAppConversationAnalyticsEdge
- type WhatsAppConversationAnalyticsNode
- type WhatsAppConversationAnalyticsResponse
- type WhatsappBusinessAccount
- type WhatsappBusinessAccountAnalyticsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAnalyticsOptions ¶
type AccountAnalyticsOptions struct {
Start time.Time `json:"start" validate:"required"`
End time.Time `json:"end" validate:"required"`
Granularity AnalyticsRequestGranularityType `json:"granularity" validate:"required"`
PhoneNumbers []string `json:"phone_numbers,omitempty"`
// * NOT SUPPORTED AS OF NOW
// ProductTypes []WhatsAppBusinessAccountAnalyticsProductType `json:"product_types,omitempty"`
CountryCodes []string `json:"country_codes,omitempty"`
}
type AnalyticsDataPoint ¶
type AnalyticsRequestGranularityType ¶
type AnalyticsRequestGranularityType string
const ( AnalyticsRequestGranularityTypeHalfHour AnalyticsRequestGranularityType = "HALF_HOUR" AnalyticsRequestGranularityTypeDay AnalyticsRequestGranularityType = "DAY" AnalyticsRequestGranularityTypeMonth AnalyticsRequestGranularityType = "MONTH" )
type BusinessClient ¶
type BusinessClient struct {
BusinessAccountId string `json:"businessAccountId" validate:"required"`
AccessToken string `json:"accessToken" validate:"required"`
PhoneNumber *manager.PhoneNumberManager
Template *manager.TemplateManager
Catalog *manager.CatalogManager
// contains filtered or unexported fields
}
BusinessClient is responsible for managing business account related operations.
func NewBusinessClient ¶
func NewBusinessClient(config *BusinessClientConfig) *BusinessClient
NewBusinessClient creates a new instance of BusinessClient.
func (*BusinessClient) ConversationAnalytics ¶
func (client *BusinessClient) ConversationAnalytics(options ConversationAnalyticsOptions) (*WhatsAppConversationAnalyticsResponse, error)
ConversationAnalytics fetches the conversation analytics for the business account.
func (*BusinessClient) Fetch ¶
func (client *BusinessClient) Fetch() (*FetchBusinessAccountResponse, error)
This method fetches the business account details.
func (*BusinessClient) FetchAnalytics ¶
func (client *BusinessClient) FetchAnalytics(options AccountAnalyticsOptions) (WhatsappBusinessAccountAnalyticsResponse, error)
FetchAnalytics fetches the analytics for the business account.
func (*BusinessClient) GetBusinessId ¶
func (bc *BusinessClient) GetBusinessId() string
GetBusinessId returns the business account ID.
func (*BusinessClient) SetBusinessId ¶
func (bc *BusinessClient) SetBusinessId(id string)
SetBusinessId sets the business account ID.
type BusinessClientConfig ¶
type BusinessClientConfig struct {
BusinessAccountId string `json:"businessAccountId" validate:"required"`
AccessToken string `json:"accessToken" validate:"required"`
Requester *request_client.RequestClient
}
BusinessClientConfig holds the configuration for BusinessClient.
type BusinessRole ¶
type BusinessRole string
const ( BusinessRoleManage BusinessRole = "MANAGE" BusinessRoleDevelop BusinessRole = "DEVELOP" BusinessRoleManageTemplates BusinessRole = "MANAGE_TEMPLATES" BusinessRoleManagePhone BusinessRole = "MANAGE_PHONE" BusinessRoleViewCost BusinessRole = "VIEW_COST" BusinessRoleManageExtensions BusinessRole = "MANAGE_EXTENSIONS" BusinessRoleViewPhoneAssets BusinessRole = "VIEW_PHONE_ASSETS" BusinessRoleManagePhoneAssets BusinessRole = "MANAGE_PHONE_ASSETS" BusinessRoleViewTemplates BusinessRole = "VIEW_TEMPLATES" BusinessRoleMessaging BusinessRole = "MESSAGING" BusinessRoleManageBusinessPhones BusinessRole = "MANAGE_BUSINESS_PHONES" )
type ConversationAnalyticsGranularityType ¶
type ConversationAnalyticsGranularityType string
const ( ConversationAnalyticsGranularityTypeHalfHour ConversationAnalyticsGranularityType = "HALF_HOUR" ConversationAnalyticsGranularityTypeDay ConversationAnalyticsGranularityType = "DAILY" ConversationAnalyticsGranularityTypeMonth ConversationAnalyticsGranularityType = "MONTHLY" )
type ConversationAnalyticsOptions ¶
type ConversationAnalyticsOptions struct {
Start time.Time `json:"start" validate:"required"`
End time.Time `json:"end" validate:"required"`
Granularity ConversationAnalyticsGranularityType `json:"granularity" validate:"required"`
PhoneNumbers []string `json:"phone_numbers,omitempty"`
ConversationCategory []ConversationCategoryType `json:"conversation_category,omitempty"`
ConversationTypes []ConversationCategoryType `json:"conversation_types,omitempty"`
ConversationDirection []ConversationDirection `json:"conversation_direction,omitempty"`
Dimensions []ConversationDimensionType `json:"dimensions,omitempty"`
}
type ConversationCategoryType ¶
type ConversationCategoryType string
const ( ConversationCategoryTypeAuthentication ConversationCategoryType = "AUTHENTICATION" ConversationCategoryTypeMarketing ConversationCategoryType = "MARKETING" ConversationCategoryTypeService ConversationCategoryType = "SERVICE" ConversationCategoryTypeUtility ConversationCategoryType = "UTILITY" )
type ConversationDimensionType ¶
type ConversationDimensionType string
const ( ConversationDimensionTypeConversationCategory ConversationDimensionType = "CONVERSATION_CATEGORY" ConversationDimensionTypeConversationDirection ConversationDimensionType = "CONVERSATION_DIRECTION" ConversationDimensionTypeConversationType ConversationDimensionType = "CONVERSATION_TYPE" ConversationDimensionTypeCountry ConversationDimensionType = "COUNTRY" ConversationDimensionTypePhone ConversationDimensionType = "PHONE" )
type ConversationDirection ¶
type ConversationDirection string
const ( ConversationDirectionBusinessInitiated ConversationDirection = "BUSINESS_INITIATED" ConversationDirectionUserInitiated ConversationDirection = "USER_INITIATED" )
type ConversationType ¶
type ConversationType string
const ( ConversationTypeFreeEntry ConversationType = "FREE_ENTRY" ConversationTypeFreeTier ConversationType = "FREE_TIER" ConversationTypeRegular ConversationType = "REGULAR" )
type FetchBusinessAccountResponse ¶
type FetchBusinessAccountResponse struct {
Id string `json:"id" validate:"required"`
Name string `json:"name" validate:"required"`
TimezoneId string `json:"timezone_id" validate:"required"`
Currency string `json:"currency" validate:"required"`
OwnerBusinessInfo struct {
Name string `json:"name" validate:"required"`
Id string `json:"id" validate:"required"`
} `json:"owner_business_info" validate:"required"`
MarketingMessagesOnboardingStatus string `json:"marketing_messages_onboarding_status" validate:"required"`
MessageTemplateNamespace string `json:"message_template_namespace" validate:"required"`
AccountReviewStatus string `json:"account_review_status" validate:"required"`
BusinessVerificationStatus string `json:"business_verification_status" validate:"required"`
Country string `json:"country" validate:"required"`
OwnershipType string `json:"ownership_type" validate:"required"`
PrimaryBusinessLocation string `json:"primary_business_location" validate:"required"`
}
type WhatsAppBusinessAccountAnalyticsProductType ¶
type WhatsAppBusinessAccountAnalyticsProductType int
const ( WhatsAppBusinessAccountAnalyticsProductTypeNotificationMessages WhatsAppBusinessAccountAnalyticsProductType = 0 WhatsAppBusinessAccountAnalyticsProductTypeCustomerSupportMessages WhatsAppBusinessAccountAnalyticsProductType = 2 )
type WhatsAppConversationAnalyticsEdge ¶
type WhatsAppConversationAnalyticsEdge struct {
Data []struct {
DataPoints []WhatsAppConversationAnalyticsNode `json:"data_points,omitempty"`
} `json:"data,omitempty"`
Paging manager.PaginationDetails `json:"paging,omitempty"`
}
type WhatsAppConversationAnalyticsNode ¶
type WhatsAppConversationAnalyticsNode struct {
Start int `json:"start" validate:"required"`
End int `json:"end,omitempty" validate:"required"`
Conversation int `json:"conversation,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
Country string `json:"country,omitempty"`
ConversationType string `json:"conversation_type,omitempty"`
ConversationDirection string `json:"conversation_direction,omitempty"`
ConversationCategory string `json:"conversation_category,omitempty"`
Cost int `json:"cost,omitempty"`
}
type WhatsAppConversationAnalyticsResponse ¶
type WhatsAppConversationAnalyticsResponse struct {
ConversationAnalytics []WhatsAppConversationAnalyticsEdge `json:"conversation_analytics" validate:"required"`
}
type WhatsappBusinessAccount ¶
type WhatsappBusinessAccount struct {
BusinessVerificationStatus string `json:"business_verification_status,omitempty"`
Country string `json:"country,omitempty"`
Currency string `json:"currency,omitempty"`
IsTemplateAnalyticsEnabled string `json:"is_enabled_for_insights,omitempty"`
MessageTemplateNamespace string `json:"message_template_namespace,omitempty"`
Name string `json:"name,omitempty"`
OwnershipType string `json:"ownership_type,omitempty"`
PrimaryFundingId string `json:"primary_funding_id,omitempty"`
PurchaseOrderNumber string `json:"purchase_order_number,omitempty"`
TimezoneId string `json:"timezone_id,omitempty"`
}
WhatsappBusinessAccount represents a WhatsApp Business Account.
type WhatsappBusinessAccountAnalyticsResponse ¶
type WhatsappBusinessAccountAnalyticsResponse struct {
PhoneNumbers []string `json:"phone_numbers,omitempty"`
Granularity string `json:"granularity,omitempty"`
DataPoints []AnalyticsDataPoint `json:"data_points,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.