service

package
v0.0.0-...-59e8576 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

Types

type AttachmentService

type AttachmentService struct {
	// contains filtered or unexported fields
}

func (*AttachmentService) Create

func (s *AttachmentService) Create(caseId string, attach *Attachment) (*Attachment, *http.Response, error)

func (*AttachmentService) Delete

func (s *AttachmentService) Delete(caseId string, attachId string) (*http.Response, error)

func (*AttachmentService) Get

func (s *AttachmentService) Get(caseId string, attachId string) (*Attachment, *http.Response, error)

func (*AttachmentService) List

func (s *AttachmentService) List(caseId string) (*Page, *http.Response, error)

type CaseService

type CaseService struct {
	Message    *MessageService
	Reply      *ReplyService
	Draft      *DraftService
	Note       *NoteService
	Attachment *AttachmentService
	// contains filtered or unexported fields
}

func NewCaseService

func NewCaseService(httpClient *Client) *CaseService

func (*CaseService) Create

func (s *CaseService) Create(cse *Case) (*Case, *http.Response, error)

Create a case.(does not route through customer cases path) See Desk API: http://dev.desk.com/API/cases/#create

func (*CaseService) Delete

func (s *CaseService) Delete(id string) (*http.Response, error)

Delete a case by ID. See Desk API: http://dev.desk.com/API/cases/#delete

func (*CaseService) Feed

func (s *CaseService) Feed(id string, params *url.Values) (*Page, *http.Response, error)

func (*CaseService) Forward

func (s *CaseService) Forward(id string, recipients string, note string) (*http.Response, error)

Forward a case See Desk API: http://dev.desk.com/API/cases/#forward

func (*CaseService) Get

func (s *CaseService) Get(id string) (*Case, *http.Response, error)

Get retrieves a single case by ID. See Desk API method show (http://dev.desk.com/API/cases/#show)

func (*CaseService) History

func (s *CaseService) History(id string, params *url.Values) (*Page, *http.Response, error)

func (*CaseService) Labels

func (s *CaseService) Labels(id string, params *url.Values) (*Page, *http.Response, error)

func (*CaseService) List

func (s *CaseService) List(params *url.Values) (*Page, *http.Response, error)

List cases with filtering and pagination. See Desk API method list (http://dev.desk.com/API/cases/#list)

func (*CaseService) Search

func (s *CaseService) Search(params *url.Values, q *string) (*Page, *http.Response, error)

Search for cases with filtering and pagination. See Desk API method list (http://dev.desk.com/API/cases/#search)

func (*CaseService) Update

func (s *CaseService) Update(cse *Case) (*Case, *http.Response, error)

Update a case. See Desk API: http://dev.desk.com/API/cases/#update

type Client

type Client struct {
	BaseURL      *url.URL
	UserEmail    string
	UserPassword string
	Case         *CaseService
	Customer     *CustomerService
	Company      *CompanyService
	User         *UserService
	Group        *GroupService
	InsightsV3   *InsightsV3Service
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, endpointURL string, userEmail string, userPassword string) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

type CompanyService

type CompanyService struct {
	// contains filtered or unexported fields
}

func (*CompanyService) Cases

func (c *CompanyService) Cases(id string, params *url.Values) (*Page, *http.Response, error)

Cases provides a list of companies associated with a company. See Desk API: http://dev.desk.com/API/companies/#list-cases

func (*CompanyService) Create

func (c *CompanyService) Create(company *Company) (*Company, *http.Response, error)

Create a company. See Desk API: http://dev.desk.com/API/companies/#create

func (*CompanyService) Customers

func (c *CompanyService) Customers(id string, params *url.Values) (*Page, *http.Response, error)

Customers provides a list of companies associated with a company. See Desk API: http://dev.desk.com/API/companies/#customers-list

func (*CompanyService) Get

func (c *CompanyService) Get(id string) (*Company, *http.Response, error)

Get retrieves a company. See Desk API: http://dev.desk.com/API/companies/#show

func (*CompanyService) List

func (c *CompanyService) List(params *url.Values) (*Page, *http.Response, error)

List companies with filtering and pagination. See Desk API: http://dev.desk.com/API/companies/#list

func (*CompanyService) Search

func (c *CompanyService) Search(params *url.Values, q *string) (*Page, *http.Response, error)

Search companies with filtering and pagination. See Desk API: http://dev.desk.com/API/companies/#search

func (*CompanyService) Update

func (c *CompanyService) Update(company *Company) (*Company, *http.Response, error)

Update a company. See Desk API: http://dev.desk.com/API/companies/#update

type CustomerService

type CustomerService struct {
	// contains filtered or unexported fields
}

func (*CustomerService) Cases

func (c *CustomerService) Cases(id string, params *url.Values) (*Page, *http.Response, error)

Cases provides a list of cases associated with a customer. See Desk API: http://dev.desk.com/API/customers/#list-cases

func (*CustomerService) Create

func (c *CustomerService) Create(customer *Customer) (*Customer, *http.Response, error)

Create a customer. See Desk API: http://dev.desk.com/API/customers/#create

func (*CustomerService) Get

func (c *CustomerService) Get(id string) (*Customer, *http.Response, error)

Get retrieves a customer. See Desk API: http://dev.desk.com/API/customers/#show

func (*CustomerService) List

func (c *CustomerService) List(params *url.Values) (*Page, *http.Response, error)

List customers with filtering and pagination. See Desk API: http://dev.desk.com/API/customers/#list

func (*CustomerService) Search

func (c *CustomerService) Search(params *url.Values, q *string) (*Page, *http.Response, error)

Search customers with filtering and pagination. See Desk API: http://dev.desk.com/API/customers/#search

func (*CustomerService) Update

func (c *CustomerService) Update(customer *Customer) (*Customer, *http.Response, error)

Update a customer. See Desk API: http://dev.desk.com/API/customers/#update

type DraftService

type DraftService struct {
	// contains filtered or unexported fields
}

func (*DraftService) Create

func (c *DraftService) Create(id string, draft *Draft) (*Draft, *http.Response, error)

Create a draft. See Desk API: http://dev.desk.com/API/cases/#drafts-create

func (*DraftService) Get

func (c *DraftService) Get(id string) (*Draft, *http.Response, error)

Get retrieves the draft reply for a case. See Desk API: http://dev.desk.com/API/cases/#drafts-show

func (*DraftService) Update

func (c *DraftService) Update(id string, draft *Draft) (*Draft, *http.Response, error)

Update a draft. See Desk API: http://dev.desk.com/API/replies/#update

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response
	Message  string `json:"message"`
}

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type GroupService

type GroupService struct {
	// contains filtered or unexported fields
}

func NewGroupService

func NewGroupService(httpClient *Client) *GroupService

func (*GroupService) Get

func (c *GroupService) Get(id string) (*Group, *http.Response, error)

Get retrieves a group. See Desk API: http://dev.desk.com/API/groups/#show

func (*GroupService) GetUserGroups

func (c *GroupService) GetUserGroups(id string) (*Page, *http.Response, error)

func (*GroupService) List

func (c *GroupService) List(params *url.Values) (*Page, *http.Response, error)

List group with filtering and pagination. See Desk API: http://dev.desk.com/API/groups/#list

func (*GroupService) Users

func (c *GroupService) Users(id string) (*Page, *http.Response, error)

type InsightsV3Service

type InsightsV3Service struct {
	// contains filtered or unexported fields
}

func (*InsightsV3Service) Report

func (s *InsightsV3Service) Report(query *InsightsV3Query) (*InsightsV3Report, *http.Response, error)

type MessageService

type MessageService struct {
	// contains filtered or unexported fields
}

func (*MessageService) Delete

func (s *MessageService) Delete(caseId string) (*http.Response, error)

Delete the case message. See Desk API: http://dev.desk.com/API/cases/#message-delete

func (*MessageService) Get

func (s *MessageService) Get(caseId string) (*Message, *http.Response, error)

Get retrieves the message for a case. See Desk API: http://dev.desk.com/API/cases/#message-show

func (*MessageService) Update

func (s *MessageService) Update(caseId string, msg *Message, params *url.Values) (*Message, *http.Response, error)

Update the case message. See Desk API: http://dev.desk.com/API/cases/#message-update

type NoteService

type NoteService struct {
	// contains filtered or unexported fields
}

func NewNoteService

func NewNoteService(httpClient *Client) *NoteService

func (*NoteService) Create

func (s *NoteService) Create(caseId string, note *Note) (*Note, *http.Response, error)

func (*NoteService) Delete

func (s *NoteService) Delete(caseId string, noteId string) (*http.Response, error)

func (*NoteService) Get

func (s *NoteService) Get(caseId string, noteId string) (*Note, *http.Response, error)

func (*NoteService) List

func (s *NoteService) List(caseId string, params *url.Values) (*Page, *http.Response, error)

func (*NoteService) Update

func (s *NoteService) Update(caseId string, note *Note) (*Note, *http.Response, error)

type ReplyService

type ReplyService struct {
	// contains filtered or unexported fields
}

func (*ReplyService) Create

func (c *ReplyService) Create(caseId string, reply *Reply) (*Reply, *http.Response, error)

Create a reply. See Desk API: http://dev.desk.com/API/cases/#replies-create

func (*ReplyService) Delete

func (c *ReplyService) Delete(caseId string, replyId string) (*http.Response, error)

Delete a reply for a case. See Desk API: http://dev.desk.com/API/cases/#replies-show

func (*ReplyService) Get

func (c *ReplyService) Get(caseId string, replyId string) (*Reply, *http.Response, error)

Get retrieves a reply for a case. See Desk API: http://dev.desk.com/API/cases/#replies-show

func (*ReplyService) List

func (c *ReplyService) List(caseId string, params *url.Values) (*Page, *http.Response, error)

List replies with filtering and pagination. See Desk API: http://dev.desk.com/API/cases/#replies-list

func (*ReplyService) Update

func (c *ReplyService) Update(caseId string, reply *Reply) (*Reply, *http.Response, error)

Update a reply. See Desk API: http://dev.desk.com/API/replies/#update

type Restful

type Restful struct {
	// contains filtered or unexported fields
}

func (*Restful) Body

func (r *Restful) Body(b interface{}) *Restful

func (*Restful) Client

func (r *Restful) Client(c *Client) *Restful

func (*Restful) Delete

func (r *Restful) Delete(p string) *Restful

func (*Restful) Do

func (r *Restful) Do() (*http.Response, error)

func (*Restful) Get

func (r *Restful) Get(p string) *Restful

func (*Restful) Json

func (r *Restful) Json(j interface{}) *Restful

func (*Restful) Method

func (r *Restful) Method(m string) *Restful

func (*Restful) Params

func (r *Restful) Params(p *url.Values) *Restful

func (*Restful) Patch

func (r *Restful) Patch(p string) *Restful

func (*Restful) Path

func (r *Restful) Path(p string) *Restful

func (*Restful) Post

func (r *Restful) Post(p string) *Restful

func (*Restful) Put

func (r *Restful) Put(p string) *Restful

func (*Restful) Query

func (r *Restful) Query(q *string) *Restful

func (Restful) String

func (r Restful) String() string

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func (*UserService) Get

func (c *UserService) Get(id string) (*User, *http.Response, error)

Get retrieves a user. See Desk API: http://dev.desk.com/API/users/#show

func (*UserService) List

func (c *UserService) List(params *url.Values) (*Page, *http.Response, error)

List users with filtering and pagination. See Desk API: http://dev.desk.com/API/users/#list

func (*UserService) Update

func (c *UserService) Update(user *User) (*User, *http.Response, error)

Update a user. See Desk API: http://dev.desk.com/API/users/#update

Jump to

Keyboard shortcuts

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