Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client a high level sms client that communicates the backend through GraphQL client
func (*Client) Send ¶
func (c *Client) Send(inputs []SendSmsInput, variables map[string]string) (*SendSmsOutput, error)
Send a sms request
type MessageType ¶
type MessageType int
const ( MessageNormal MessageType = 0 MessageOTP MessageType = 1 ErrCodeUnsupported )
type Recipient ¶
type Recipient struct {
PhoneCode int `json:"phone_code"`
PhoneNumber string `json:"phone_number"`
}
Recipient represents the international phone number
type SendSmsInput ¶
type SendSmsInput struct {
ClientName string `json:"client_name,omitempty" graphql:"client_name"`
TemplateID string `json:"template_id,omitempty" graphql:"template_id"`
Content string `json:"content,omitempty" graphql:"content"`
Recipient []Recipient `json:"recipient" graphql:"recipient"`
SendAfter time.Time `json:"send_after,omitempty" graphql:"send_after"`
Metadata *SmsMetadata `json:"metadata,omitempty" graphql:"metadata" scalar:"true"`
Save bool `json:"save"`
Locale string `json:"locale"`
}
SendSmsInput represents send sms input payload
type SendSmsOutput ¶
type SendSmsOutput struct {
Responses []SendSmsResponse `json:"responses" graphql:"responses"`
SuccessCount int `json:"success_count" graphql:"success_count"`
FailureCount int `json:"failure_count" graphql:"failure_count"`
}
SendSmsOutput represents the summary result of sending sms
type SendSmsResponse ¶
type SendSmsResponse struct {
Success bool `json:"success" graphql:"success"`
RequestID *string `json:"request_id,omitempty" graphql:"request_id"`
MessageID string `json:"message_id,omitempty" graphql:"message_id"`
Error interface{} `json:"error,omitempty" graphql:"error"`
}
SendSmsResponse represents sms response from external service
type SmsMetadata ¶
type SmsMetadata struct {
BrandName string `json:"brand_name,omitempty"`
MessageType MessageType `json:"message_type,omitempty"`
Unicode *bool `json:"unicode,omitempty"`
}
SmsMetadata represents a sms metadata payload
Click to show internal directories.
Click to hide internal directories.