intercom

package
v0.0.0-...-1f0e7e2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {

	// BaseURL for API requests. Defaults to the public Intercom V3 API.
	BaseURL *url.URL

	// UserAgent used when communicating with the Intercom API.
	UserAgent string

	// Log is used to log debugging messages, if set.
	Log *log.Logger
	// contains filtered or unexported fields
}

A APIClient manages communication with the Intercom API.

func NewAPIClient

func NewAPIClient(httpClient *http.Client) *APIClient

NewAPIClient returns a new Intercom API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the goauth2 library).

func (*APIClient) Do

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

Do sends an API request and returns the API response. The API response is decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.

func (*APIClient) ListTags

func (c *APIClient) ListTags() ([]*Tag, error)

ListTags returns all of the tags that belong to a client.

See https://doc.intercom.io/api/#tags for more information.

func (*APIClient) NewRequest

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

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the APIClient. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type APIKeyAuthTransport

type APIKeyAuthTransport struct {
	Transport http.RoundTripper
	AppID     string
	APIKey    string
}

func (*APIKeyAuthTransport) RoundTrip

func (t *APIKeyAuthTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

type IntercomError

type IntercomError struct {
	Code    int
	Message string
}

func (*IntercomError) Error

func (e *IntercomError) Error() string

type Tag

type Tag struct {
	ID   string
	Name string
}

Tag represents a tag.

See https://doc.intercom.io/api/#tags for more information.

Jump to

Keyboard shortcuts

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