Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Contact ¶
type Contact struct {
ID string
HRef string
MSISDN int64
FirstName string
LastName string
CustomDetails struct {
Custom1 string
Custom2 string
Custom3 string
Custom4 string
}
Groups struct {
TotalCount int
HRef string
}
Messages struct {
TotalCount int
HRef string
}
CreatedDatetime *time.Time
UpdatedDatetime *time.Time
}
Contact gets returned by the API.
func Create ¶
func Create(c messagebird.Client, contactRequest *CreateRequest) (*Contact, error)
func Read ¶
func Read(c messagebird.Client, id string, req *ViewRequest) (*Contact, error)
Read retrieves the information of an existing contact.
func Update ¶
func Update(c messagebird.Client, id string, contactRequest *CreateRequest) (*Contact, error)
Update updates the record referenced by id with any values set in contactRequest. Do not set any values that should not be updated.
type Contacts ¶
func List ¶
func List(c messagebird.Client, options *messagebird.PaginationRequest) (*Contacts, error)
List retrieves a paginated list of contacts, based on the options provided. It's worth noting DefaultListOptions.
type CreateRequest ¶
type CreateRequest struct {
MSISDN string `json:"msisdn,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Custom1 string `json:"custom1,omitempty"`
Custom2 string `json:"custom2,omitempty"`
Custom3 string `json:"custom3,omitempty"`
Custom4 string `json:"custom4,omitempty"`
}
CreateRequest represents a contact for write operations, e.g. for creating a new contact or updating an existing one.
type ViewRequest ¶
Click to show internal directories.
Click to hide internal directories.