endpoints

package
v0.0.0-...-47b9fc9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	api.Client
}

Client is a wrapper around api.Client that adds new methods

func NewClient

func NewClient(ctx context.Context, url string, auth api.Auth) *Client

NewClient creates a new Client by wrapping api.Client

func (*Client) Files

func (cl *Client) Files() Files

Files retuns an instance of Files interface that can be used to perform file uploads and downloads

func (*Client) Me

func (cl *Client) Me(options ...api.RequestOption) (*UserInfo, error)

Me calls /me endpoint

type FileMetadata

type FileMetadata struct {
	Name     string `json:"name"`
	Size     int    `json:"size"`
	MIMEType string `json:"mime_type"`
	Modified int    `json:"modified"`
}

FileMetadata represents metadata of Document, DocumentRevision or a Note attachment

type Files

type Files interface {
	Download(model string, id string, options ...api.RequestOption) (io.ReadCloser, error)
	Metadata(model string, id string, options ...api.RequestOption) (*FileMetadata, error)
	Upload(name string, content io.Reader, options ...api.RequestOption) (string, error)
}

Files is an interface providing file-related oprations

type UserInfo

type UserInfo struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Role      string `json:"role"`
	Email     string `json:"email"`
	Timezone  string `json:"timezone"`
	IsPartner bool   `json:"is_partner"`
}

UserInfo is the result of calling /me endpoint

Jump to

Keyboard shortcuts

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