clockwork

package module
v0.0.0-...-600700c Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2016 License: MIT Imports: 5 Imported by: 0

README

clockwork-go

Golang API for ClockworkSMS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountType

type AccountType int
const (
	PayAsYouGo AccountType = iota
	Invoice
)

type Balance

type Balance struct {
	XMLName        xml.Name        `xml:"Balance_Resp"`
	Balance        decimal.Decimal `xml:"Balance"`
	CurrencySymbol string          `xml:"Currency>Symbol"`
	CurrencyCode   string          `xml:"Currency>Code"`
	AccountType    string          `xml:"AccountType"`
}

type Clockwork

type Clockwork struct {
	Key string
	SSL bool
}

Clockwork is the main class used to communicate with the Clockwork API

func NewClockwork

func NewClockwork(Key string) *Clockwork

NewClockwork returns a new instance of the Clockwork client, using the given API key

func (*Clockwork) GetBalance

func (clockwork *Clockwork) GetBalance() *Balance

GetBalance returns number of SMS credits available to the account associated with this Clockwork API key. Deprecated: Use the GetBalance function to return a cash balance

func (*Clockwork) GetCredit

func (clockwork *Clockwork) GetCredit() *Credit

GetCredit returns the current cash balance and currency information for the account associated with this Clockwork API key.

func (*Clockwork) SendMultipleSMS

func (clockwork *Clockwork) SendMultipleSMS(givenSMS []SMS) *MessageResponse

SendMultipleSMS sends an array of SMS messages

func (*Clockwork) SendSMS

func (clockwork *Clockwork) SendSMS(givenSMS SMS) *MessageResponse

SendSMS sends a single SMS message

type Credit

type Credit struct {
	XMLName xml.Name `xml:"Credit_Resp"`
	Credit  int      `xml:"Credit"`
}

type InvalidCharacterAction

type InvalidCharacterAction int
const (
	AccountDefault InvalidCharacterAction = iota
	Error
	Remove
	Replace
)

type MessageRequest

type MessageRequest struct {
	XMLName xml.Name `xml:"Message"`
	Key     string   `xml:"Key"`
	SMS     []SMS    `xml:"SMS"`
}

type MessageResponse

type MessageResponse struct {
	XMLName   xml.Name    `xml:"Message_Resp"`
	SMSResult []SMSResult `xml:"SMS_Resp"`
	ErrNo     int         `xml:"ErrNo"`
	ErrDesc   int         `xml:"ErrDesc"`
}

type SMS

type SMS struct {
	To                     string                 `xml:"To"`
	Message                string                 `xml:"Content"`
	From                   string                 `xml:"From"`
	ClientID               string                 `xml:"ClientID"`
	Truncate               bool                   `xml:"Truncate"`
	InvalidCharacterAction InvalidCharacterAction `xml:"InvalidCharAction"`
}

type SMSResult

type SMSResult struct {
	To           string `xml:"To"`
	MessageID    string `xml:"MessageID"`
	ClientID     string `xml:"ClientID"`
	ErrorCode    int    `xml:"ErrNo"`
	ErrorMessage string `xml:"ErrDesc"`
}

Jump to

Keyboard shortcuts

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