Documentation ¶
Index ¶
- Variables
- func ResourcePathOptionSetCollection(rp *ResourcePath)
- type Attachment
- type Case
- type CaseEvent
- type Company
- type Customer
- func (c *Customer) AddAddress(address string, addressType string)
- func (c *Customer) AddEmail(email string, emailType string)
- func (c *Customer) AddPhoneNumber(phone string, phoneType string)
- func (c *Customer) AddToSlice(slice []map[string]string, value string, valueType string) []map[string]string
- func (c Customer) String() string
- type Draft
- type EntryCollection
- type Group
- type Hal
- func (c *Hal) AddHrefLink(class string, href string)
- func (c *Hal) AddLinkSubItemStringValue(link string, subitem string, value string)
- func (c *Hal) GetHrefLink(class string) string
- func (c *Hal) GetId() int
- func (c *Hal) GetLinkSubItemStringValue(link string, subitem string) string
- func (c *Hal) GetResourceId() string
- func (c *Hal) GetResourcePath(resource Resourceful, options ...func(*ResourcePath)) ResourcePath
- func (c *Hal) HasLink(name string) bool
- func (c *Hal) HasLinkAndSubItem(name string, subitem string) bool
- func (c *Hal) SetId(id int)
- func (c *Hal) SetResourceId(id string)
- func (c Hal) String() string
- type Label
- type Message
- type Naming
- type Note
- type Page
- type Reply
- type Resource
- type ResourcePath
- func (p *ResourcePath) AppendPath(rp *ResourcePath) *ResourcePath
- func (p *ResourcePath) Path() string
- func (p *ResourcePath) SetAction(action string) *ResourcePath
- func (p *ResourcePath) SetCollection() *ResourcePath
- func (p *ResourcePath) SetMember() *ResourcePath
- func (p *ResourcePath) SetNested(resource Resourceful) *ResourcePath
- func (p *ResourcePath) SetPrefix(prefix string) *ResourcePath
- func (p *ResourcePath) SetSuffix(suffix string) *ResourcePath
- func (p *ResourcePath) SetTarget(resource Resourceful) *ResourcePath
- func (p ResourcePath) String() string
- type Resourceful
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var CaseBuilder = builder.Register(jsonBuilder{}, Case{}).(jsonBuilder)
View Source
var CompanyBuilder = builder.Register(jsonBuilder{}, Company{}).(jsonBuilder)
View Source
var CustomerBuilder = builder.Register(jsonBuilder{}, Customer{}).(jsonBuilder)
View Source
var DraftBuilder = builder.Register(jsonBuilder{}, Draft{}).(jsonBuilder)
View Source
var MessageBuilder = builder.Register(jsonBuilder{}, Message{}).(jsonBuilder)
View Source
var NoteBuilder = builder.Register(jsonBuilder{}, Note{}).(jsonBuilder)
View Source
var ReplyBuilder = builder.Register(jsonBuilder{}, Reply{}).(jsonBuilder)
Functions ¶
func ResourcePathOptionSetCollection ¶
func ResourcePathOptionSetCollection(rp *ResourcePath)
Types ¶
type Attachment ¶
type Attachment struct { Size *int `json:"size,omitempty"` FileName *string `json:"file_name,omitempty"` ContentType *string `json:"content_type,omitempty"` Content *string `json:"content,omitempty"` URL *string `json:"url,omitempty"` ErasedAt *Timestamp `json:"erased_at,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Resource }
func NewAttachment ¶
func NewAttachment() *Attachment
func (*Attachment) SetContent ¶
func (r *Attachment) SetContent(fileName string) error
func (Attachment) String ¶
func (r Attachment) String() string
type Case ¶
type Case struct { ExternalID *string `json:"external_id,omitempty"` Type *string `json:"type,omitempty"` Status *string `json:"status,omitempty"` Description *string `json:"description,omitempty"` Subject *string `json:"subject,omitempty"` Blurb *string `json:"blurb,omitempty"` Language *string `json:"language,omitempty"` Priority *int `json:"priority,omitempty"` Labels []string `json:"labels,omitempty"` LabelIDs []int `json:"label_ids,omitempty"` SuppressRules *bool `json:"suppress_rules,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` LockedUntil *Timestamp `json:"locked_until",omitempty` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` ChangedAt *Timestamp `json:"changed_at,omitempty"` ReceivedAt *Timestamp `json:"received_at,omitempty"` ActiveAt *Timestamp `json:"active_at,omitempty"` OpenedAt *Timestamp `json:"opened_at,omitempty"` FirstOpenedAt *Timestamp `json:"first_opened_at,omitempty"` ResolvedAt *Timestamp `json:"resolved_at,omitempty"` FirstResolvedAt *Timestamp `json:"first_resolved_at,omitempty"` Message *Message `json:"message,omitempty"` Resource }
type CaseEvent ¶
type CaseEvent struct { Type *string `json:"type,omitempty"` Context *string `json:"context,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` Changes []map[string]interface{} `json:"changes,omitempty"` Resource }
func NewCaseEvent ¶
func NewCaseEvent() *CaseEvent
type Company ¶
type Company struct { ExternalID *string `json:"external_id,omitempty"` Name *string `json:"name,omitempty"` Domains []string `json:"domains,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` Resource }
func NewCompany ¶
func NewCompany() *Company
type Customer ¶
type Customer struct { ExternalID *string `json:"external_id,omitempty"` FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` Company *string `json:"company,omitempty"` Title *string `json:"title,omitempty"` Avatar *string `json:"avatar,omitempty"` Background *string `json:"background,omitempty"` Language *string `json:"language,omitempty"` LockedUntil *Timestamp `json:"locked_until,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` Emails []map[string]string `json:"emails,omitempty"` PhoneNumbers []map[string]string `json:"phone_numbers,omitempty"` Addresses []map[string]string `json:"addresses,omitempty"` Resource }
func NewCustomer ¶
func NewCustomer() *Customer
func (*Customer) AddAddress ¶
func (*Customer) AddPhoneNumber ¶
func (*Customer) AddToSlice ¶
type Draft ¶
type Draft struct { Direction *string `json:"direction,omitempty"` Body *string `json:"body,omitempty"` BodyText *string `json:"body_text,omitempty"` BodyHtml *string `json:"body_html,omitempty"` Headers *string `json:"headers,omitempty"` HeadersRaw *string `json:"headers_raw,omitempty"` Status *string `json:"status,omitempty"` Subject *string `json:"subject,omitempty"` To *string `json:"to,omitempty"` From *string `json:"from,omitempty"` Type *string `json:"type,omitempty"` Cc *string `json:"cc,omitempty"` Bcc *string `json:"bcc,omitempty"` ClientType *string `json:"client_type,omitempty"` FromFacebookName *string `json:"from_facebook_name,omitempty"` PublicUrl *string `json:"public_url,omitempty"` IsBestAnswer *string `json:"is_best_answer,omitempty"` Rating *float32 `json:"rating,omitempty"` RatingCount *int `json:"rating_count,omitempty"` RatingScore *int `json:"rating_score,omitempty"` EnteredAt *Timestamp `json:"entered_at,omitempty"` HiddentAt *Timestamp `json:"hidden_at,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Resource }
type EntryCollection ¶
type EntryCollection struct { RawEntries *json.RawMessage `json:"entries,omitempty"` Entries []interface{} }
EntryCollection holds the raw json data for embedded resources. The RawEntries field is used internally and not something an API user would typically want to access.
Once the EntryCollection has been unmarshaled these resources become available as typed GO objects in the Entries field, which contains the data you probably want to get at.
type Hal ¶
type Hal struct { Id *int `json:"id,int,omitempty"` Links map[string]map[string]interface{} `json:"_links,omitempty"` // contains filtered or unexported fields }
func (*Hal) AddHrefLink ¶
func (*Hal) AddLinkSubItemStringValue ¶
func (*Hal) GetHrefLink ¶
func (*Hal) GetLinkSubItemStringValue ¶
func (*Hal) GetResourceId ¶
func (*Hal) GetResourcePath ¶
func (c *Hal) GetResourcePath(resource Resourceful, options ...func(*ResourcePath)) ResourcePath
func (*Hal) SetResourceId ¶
type Label ¶
type Label struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Color *string `json:"color,omitempty"` Enabled *bool `json:"enabled,omitempty"` Active *bool `json:"active,omitempty"` Postion *int `json:"position,omitempty"` Types []string `json:"types,omitempty"` Resource }
type Message ¶
type Message struct { Direction *string `json:"direction,omitempty"` Body *string `json:"body,omitempty"` BodyText *string `json:"body_text,omitempty"` BodyHtml *string `json:"body_html,omitempty"` Headers *string `json:"headers,omitempty"` HeadersRaw *string `json:"headers_raw,omitempty"` Status *string `json:"status,omitempty"` Subject *string `json:"subject,omitempty"` To *string `json:"to,omitempty"` From *string `json:"from,omitempty"` Cc *string `json:"cc,omitempty"` Bcc *string `json:"bcc,omitempty"` ClientType *string `json:"client_type,omitempty"` FromFacebookName *string `json:"from_facebook_name,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Resource }
func NewMessage ¶
func NewMessage() *Message
type Naming ¶
type Naming struct {
ResourceName string `json:"-"`
}
func (*Naming) GetResourceName ¶
func (*Naming) SetResourceName ¶
func (n *Naming) SetResourceName(thing interface{})
func (*Naming) Singularize ¶
func (n *Naming) Singularize()
type Note ¶
type Page ¶
type Page struct { PageNumber *int `json:"page,omitempty"` TotalEntries *int `json:"total_entries,omitempty"` Embedded *EntryCollection `json:"_embedded,omitempty"` Links map[string]map[string]interface{} `json:"_links,omitempty"` }
Page represents a single page of results, typically from a search or list API method. A page has an embedded collection of resources which, contains the data you probably want to get at. See Desk API (http://dev.desk.com/API/using-the-api/#embedding)
type Reply ¶
type Reply struct { Direction *string `json:"direction,omitempty"` Body *string `json:"body,omitempty"` BodyText *string `json:"body_text,omitempty"` BodyHtml *string `json:"body_html,omitempty"` Headers *string `json:"headers,omitempty"` HeadersRaw *string `json:"headers_raw,omitempty"` Status *string `json:"status,omitempty"` Subject *string `json:"subject,omitempty"` To *string `json:"to,omitempty"` From *string `json:"from,omitempty"` Type *string `json:"type,omitempty"` Cc *string `json:"cc,omitempty"` Bcc *string `json:"bcc,omitempty"` ClientType *string `json:"client_type,omitempty"` FromFacebookName *string `json:"from_facebook_name,omitempty"` PublicUrl *string `json:"public_url,omitempty"` IsBestAnswer *bool `json:"is_best_answer,omitempty"` Rating *float32 `json:"rating,omitempty"` RatingCount *int `json:"rating_count,omitempty"` RatingScore *int `json:"rating_score,omitempty"` EnteredAt *Timestamp `json:"entered_at,omitempty"` HiddentAt *Timestamp `json:"hidden_at,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Resource }
type Resource ¶
func (*Resource) InitializeResource ¶
func (r *Resource) InitializeResource(model interface{})
type ResourcePath ¶
type ResourcePath struct { Target Resourceful Nested Resourceful Member bool Action string Prefix string Suffix string // contains filtered or unexported fields }
func NewIdentityResourcePath ¶
func NewIdentityResourcePath(id string, target Resourceful) *ResourcePath
func NewResourcePath ¶
func NewResourcePath(target Resourceful) *ResourcePath
func (*ResourcePath) AppendPath ¶
func (p *ResourcePath) AppendPath(rp *ResourcePath) *ResourcePath
func (*ResourcePath) Path ¶
func (p *ResourcePath) Path() string
func (*ResourcePath) SetAction ¶
func (p *ResourcePath) SetAction(action string) *ResourcePath
func (*ResourcePath) SetCollection ¶
func (p *ResourcePath) SetCollection() *ResourcePath
func (*ResourcePath) SetMember ¶
func (p *ResourcePath) SetMember() *ResourcePath
func (*ResourcePath) SetNested ¶
func (p *ResourcePath) SetNested(resource Resourceful) *ResourcePath
func (*ResourcePath) SetPrefix ¶
func (p *ResourcePath) SetPrefix(prefix string) *ResourcePath
func (*ResourcePath) SetSuffix ¶
func (p *ResourcePath) SetSuffix(suffix string) *ResourcePath
func (*ResourcePath) SetTarget ¶
func (p *ResourcePath) SetTarget(resource Resourceful) *ResourcePath
func (ResourcePath) String ¶
func (p ResourcePath) String() string
type Resourceful ¶
type Resourceful interface { InitializeResource(model interface{}) GetResourceId() (id string) SetResourceId(id string) GetResourceName() (name string) GetResourcePath(resource Resourceful, options ...func(*ResourcePath)) (path ResourcePath) }
type User ¶
type User struct { Name *string `json:"name,omitempty"` PublicName *string `json:"public_name,omitempty"` Email *string `json:"email,omitempty"` EmailVerified *bool `json:"email_verified,omitempty"` Available *bool `json:"available,omitempty"` Avatar *string `json:"avatar,omitempty"` Level *string `json:"level,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` CurrentLoginAt *Timestamp `json:"current_login_at,omitempty"` LastLoginAt *Timestamp `json:"last_login_at,omitempty"` Resource }
Click to show internal directories.
Click to hide internal directories.