number

package
v7.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(c *messagebird.Client, phoneNumber string) error

Delete a purchased phone number

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

type NumberList struct {
	Offset     int
	Limit      int
	Count      int
	TotalCount int
	Items      []*Number
}

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

type NumberSearchingList struct {
	Items []*Number
	Limit int
	Count int
}

NumberSearchingList provide a list of all phone numbers. that are available for purchase.

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.

Jump to

Keyboard shortcuts

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