Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Number ¶
type Number struct { Number string Country string Region string Locality string Features []string Tags []string Type string Status string }
Number represents a specific phone number.
func Purchase ¶
func Purchase(c *messagebird.Client, numberPurchaseRequest *NumberPurchaseRequest) (*Number, error)
Purchases purchases a phone number.
func Read ¶
func Read(c *messagebird.Client, phoneNumber string) (*Number, error)
Read get a purchased phone number
func Update ¶
func Update(c *messagebird.Client, phoneNumber string, numberUpdateRequest *NumberUpdateRequest) (*Number, error)
Update updates a purchased phone number. Only updating *tags* is supported at the moment.
type NumberList ¶
NumberList provide a list of all purchased phone numbers.
func List ¶
func List(c *messagebird.Client, listParams *NumberListParams) (*NumberList, error)
List get all purchased phone numbers
type NumberListParams ¶
type NumberListParams struct { Limit int Offset int Number string Country string Region string Locality string Features []string Type string Status string SearchPattern NumberPattern }
NumberListParams can be used to set query params in List().
type NumberPattern ¶
type NumberPattern string
const ( // NumberPatternStart force phone numbers to start with the provided fragment. NumberPatternStart NumberPattern = "start" // NumberPatternEnd phone numbers can be somewhere within the provided fragment. NumberPatternEnd NumberPattern = "end" // NumberPatternAnyWhere force phone numbers to end with the provided fragment. NumberPatternAnyWhere NumberPattern = "anywhere" )
type NumberPurchaseRequest ¶
type NumberPurchaseRequest struct { Number string `json:"number"` Country string `json:"countryCode"` BillingIntervalMonths int `json:"billingIntervalMonths"` }
NumberPurchaseRequest can be used to purchase a number.
type NumberSearchingList ¶
NumberSearchingList provide a list of all phone numbers. that are available for purchase.
func Search ¶
func Search(c *messagebird.Client, countryCode string, listParams *NumberListParams) (*NumberSearchingList, error)
Search for phone numbers available for purchase, countryCode needs to be in Alpha-2 country code (example: NL)
type NumberUpdateRequest ¶
type NumberUpdateRequest struct {
Tags []string `json:"tags"`
}
NumberUpdateRequest can be used to set tags update.