Documentation
¶
Index ¶
- type AudioMessage
- type AuthResponse
- type BusinessProfile
- type BusinessProfileResponse
- type BusinessResponse
- type Client
- func (s *Client) GenerateAccessToken(ctx context.Context, code, clientID, clientSecret string) (*AuthResponse, error)
- func (s *Client) GetBusiness(ctx context.Context, businessAccountId string) (*BusinessResponse, error)
- func (s *Client) GetBusinessProfile(ctx context.Context, phoneID string) (*BusinessProfile, error)
- func (s *Client) GetMedia(ctx context.Context, mediaID string) (*Media, error)
- func (s *Client) GetPhoneNumber(ctx context.Context, phoneID string) (*PhoneNumberResponse, error)
- func (s *Client) ReadMessage(ctx context.Context, messageID string) (*MessageResponse, error)
- func (s *Client) RegisterPhoneNumber(ctx context.Context, phoneID string, pin string) (*RegisterPhoneNumberResponse, error)
- func (s *Client) SendAudioMessage(ctx context.Context, to string, d AudioMessage, options ...SendMessageOption) (*MessageResponse, error)
- func (s *Client) SendDocumentMessage(ctx context.Context, to string, d DocumentMessage, ...) (*MessageResponse, error)
- func (s *Client) SendImageMessage(ctx context.Context, to string, d ImageMessage, options ...SendMessageOption) (*MessageResponse, error)
- func (s *Client) SendInteractiveMessage(ctx context.Context, to string, d InteractiveMessage, ...) (*MessageResponse, error)
- func (s *Client) SendTextMessage(ctx context.Context, to string, d TextMessage, options ...SendMessageOption) (*MessageResponse, error)
- func (s *Client) SendVideoMessage(ctx context.Context, to string, d VideoMessage, options ...SendMessageOption) (*MessageResponse, error)
- func (s *Client) SetBusinessWebhook(ctx context.Context, businessAccountId string, request *SetWebhookConfig) (*SetBusinessWebhookResponse, error)
- func (s *Client) SetPhoneNumberWebhook(ctx context.Context, phoneID string, request *SetWebhookConfig) (*SetPhoneNumberWebhookResponse, error)
- type DocumentMessage
- type DocumentMessageRequest
- type ErrorResponse
- type ImageMessage
- type InteractiveMessage
- type InteractiveMessageAction
- type InteractiveMessageBody
- type InteractiveMessageFooter
- type InteractiveMessageHeader
- type InteractiveMessageHeaderType
- type InteractiveMessageInternalType
- type InteractiveMessageRequest
- type InteractiveMessageRow
- type InteractiveMessageSection
- type Media
- type MessageContext
- type MessageResponse
- type MessageType
- type Option
- type PhoneNumberResponse
- type PhoneNumberResponseThroughput
- type PhoneNumberResponseWhatsappConfiguration
- type RegisterPhoneNumberRequest
- type RegisterPhoneNumberResponse
- type SendMessageOption
- type SetBusinessWebhookRequest
- type SetBusinessWebhookResponse
- type SetPhoneNumberWebhookRequest
- type SetPhoneNumberWebhookResponse
- type SetWebhookConfig
- type TextMessage
- type VideoMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioMessage ¶
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
*ErrorResponse
}
type BusinessProfile ¶
type BusinessProfile struct {
About string `json:"about"`
Address string `json:"address"`
Description string `json:"description"`
Email string `json:"email"`
MessagingProduct string `json:"messaging_product"`
ProfilePictureUrl string `json:"profile_picture_url"`
Websites []string `json:"websites"`
Vertical string `json:"vertical"`
}
type BusinessProfileResponse ¶
type BusinessProfileResponse struct {
Data []BusinessProfile `json:"data"`
*ErrorResponse
}
type BusinessResponse ¶
type BusinessResponse struct {
Id string `json:"id"`
Name string `json:"name"`
TimezoneId string `json:"timezone_id"`
MessageTemplateNamespace string `json:"message_template_namespace"`
*ErrorResponse
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GenerateAccessToken ¶
func (*Client) GetBusiness ¶
func (*Client) GetBusinessProfile ¶
func (*Client) GetPhoneNumber ¶
func (*Client) ReadMessage ¶
func (*Client) RegisterPhoneNumber ¶
func (*Client) SendAudioMessage ¶
func (s *Client) SendAudioMessage(ctx context.Context, to string, d AudioMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SendDocumentMessage ¶
func (s *Client) SendDocumentMessage(ctx context.Context, to string, d DocumentMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SendImageMessage ¶
func (s *Client) SendImageMessage(ctx context.Context, to string, d ImageMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SendInteractiveMessage ¶
func (s *Client) SendInteractiveMessage(ctx context.Context, to string, d InteractiveMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SendTextMessage ¶
func (s *Client) SendTextMessage(ctx context.Context, to string, d TextMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SendVideoMessage ¶
func (s *Client) SendVideoMessage(ctx context.Context, to string, d VideoMessage, options ...SendMessageOption) (*MessageResponse, error)
func (*Client) SetBusinessWebhook ¶
func (s *Client) SetBusinessWebhook(ctx context.Context, businessAccountId string, request *SetWebhookConfig) (*SetBusinessWebhookResponse, error)
func (*Client) SetPhoneNumberWebhook ¶
func (s *Client) SetPhoneNumberWebhook(ctx context.Context, phoneID string, request *SetWebhookConfig) (*SetPhoneNumberWebhookResponse, error)
type DocumentMessage ¶
type DocumentMessageRequest ¶
type DocumentMessageRequest struct {
Document DocumentMessage `json:"document"`
// contains filtered or unexported fields
}
type ErrorResponse ¶
type ImageMessage ¶
type InteractiveMessage ¶
type InteractiveMessage struct {
Type InteractiveMessageInternalType `json:"type"`
Header InteractiveMessageHeader `json:"header"`
Body InteractiveMessageBody `json:"body"`
Action InteractiveMessageAction `json:"action"`
}
type InteractiveMessageAction ¶
type InteractiveMessageAction struct {
Button string `json:"button"`
Sections []InteractiveMessageSection `json:"sections"`
}
type InteractiveMessageBody ¶
type InteractiveMessageBody struct {
Text string `json:"text"`
}
type InteractiveMessageFooter ¶
type InteractiveMessageFooter struct {
}
type InteractiveMessageHeader ¶
type InteractiveMessageHeader struct {
Type InteractiveMessageHeaderType `json:"type"`
Text string `json:"text"`
}
type InteractiveMessageHeaderType ¶
type InteractiveMessageHeaderType string
const (
InteractiveMessageHeaderTypeText InteractiveMessageHeaderType = "text"
)
type InteractiveMessageInternalType ¶
type InteractiveMessageInternalType string
const (
InteractiveMessageTypeList InteractiveMessageInternalType = "LIST"
)
type InteractiveMessageRequest ¶
type InteractiveMessageRequest struct {
Interactive InteractiveMessage `json:"interactive"`
// contains filtered or unexported fields
}
type InteractiveMessageRow ¶
type InteractiveMessageSection ¶
type InteractiveMessageSection struct {
Title string `json:"title"`
Rows []InteractiveMessageRow `json:"rows"`
}
type MessageContext ¶
type MessageContext struct {
MessageId string `json:"message_id,omitempty"`
}
type MessageResponse ¶
type MessageResponse struct {
MessagingProduct string `json:"messaging_product"`
Contacts []contactMessageResponse `json:"contacts"`
Messages []contentMessageResponse `json:"messages"`
*ErrorResponse
}
type MessageType ¶
type MessageType string
const ( TextMessageType MessageType = "text" ImageMessageType MessageType = "image" AudioMessageType MessageType = "audio" VideoMessageType MessageType = "video" DocumentMessageType MessageType = "document" InteractiveMessageType MessageType = "interactive" )
type Option ¶
type Option func(*Client)
Option is a function that configures a client
func WithBaseUrl ¶
WithBaseUrl sets the base URL of the client
func WithHttpClient ¶
WithHttpClient sets the http client of the client
func WithPhoneNumberId ¶
WithPhoneNumberId sets the phone number id of the client
type PhoneNumberResponse ¶
type PhoneNumberResponse struct {
VerifiedName string `json:"verified_name"`
CodeVerificationStatus string `json:"code_verification_status"`
DisplayPhoneNumber string `json:"display_phone_number"`
QualityRating string `json:"quality_rating"`
PlatformType string `json:"platform_type"`
Throughput PhoneNumberResponseThroughput `json:"throughput"`
LastOnboardedTime string `json:"last_onboarded_time"`
WebhookConfiguration PhoneNumberResponseWhatsappConfiguration `json:"webhook_configuration"`
Id string `json:"id"`
*ErrorResponse
}
type PhoneNumberResponseThroughput ¶
type PhoneNumberResponseThroughput struct {
Level string `json:"level"`
}
type RegisterPhoneNumberRequest ¶
type RegisterPhoneNumberRequest struct {
MessagingProduct messagingProductType `json:"messaging_product"`
Pin string `json:"pin"`
}
type RegisterPhoneNumberResponse ¶
type RegisterPhoneNumberResponse struct {
Success bool `json:"success"`
*ErrorResponse
}
type SendMessageOption ¶
type SendMessageOption func(*MessageContext)
func WithReplyMessage ¶
func WithReplyMessage(messageID string) SendMessageOption
type SetBusinessWebhookRequest ¶
type SetBusinessWebhookRequest struct {
WebhookConfiguration SetWebhookConfig `json:"webhook_configuration"`
}
type SetBusinessWebhookResponse ¶
type SetBusinessWebhookResponse struct {
Success bool `json:"success"`
*ErrorResponse
}
type SetPhoneNumberWebhookRequest ¶
type SetPhoneNumberWebhookRequest struct {
WebhookConfiguration SetWebhookConfig `json:"webhook_configuration"`
}
type SetPhoneNumberWebhookResponse ¶
type SetPhoneNumberWebhookResponse struct {
Success bool `json:"success"`
*ErrorResponse
}
type SetWebhookConfig ¶
type TextMessage ¶
type VideoMessage ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.