Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Contact ¶
type Contact struct { ID string HRef string DisplayName string FirstName string LastName string Identifiers []Identifier Languages []string Timezone string Country string Avatar string Gender string Profiles []Profile Attributes map[string]string Status 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) (*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 CreateRequest ¶
type CreateRequest struct { DisplayName string `json:"displayName,omitempty"` FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` Avatar string `json:"avatar,omitempty"` Gender string `json:"gender,omitempty"` Country string `json:"country,omitempty"` Languages []string `json:"languages,omitempty"` Identifiers []Identifier `json:"identifiers,omitempty"` Profiles []Profile `json:"profiles,omitempty"` Attributes map[string]string `json:"attributes,omitempty"` }
CreateRequest represents a contact for write operations, e.g. for creating a new contact or updating an existing one.
type Filter ¶
type Filter struct { IDs []string ChannelId string IdentifierExact string Status string Offset int Limit int }
Filter can be applied to a list request to filter the results and paginate through them.
func (*Filter) QueryParams ¶
type Identifier ¶
type Identifier struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Value string `json:"value,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` }
func ReadIdentifier ¶
func ReadIdentifier(c messagebird.Client, contact, id string) (*Identifier, error)
type Identifiers ¶
type Identifiers struct {
Count, TotalCount int
Offset, Limit int
Items []Identifier
}
func ListIdentifiers ¶
func ListIdentifiers(c messagebird.Client, contact string) (*Identifiers, error)
type UpsertRequest ¶
type UpsertRequest struct { UpdateContact bool `json:"updateContact"` Contact *CreateRequest `json:"contact"` }
type UpsertResponse ¶
func Upsert ¶
func Upsert(c messagebird.Client, contactRequest *UpsertRequest) (*UpsertResponse, error)
Upsert looks for an existing contact matching the criteria and either updates it or creates a new one. The contact ID is always returned as well as an indicator if the contact has been created.
Click to show internal directories.
Click to hide internal directories.