quip

package module
v0.0.0-...-a3aedd0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

README

go-quip

Quip bindings for Go

Installation

go get should work:

go get github.com/mduvall/go-quip

API Support

The library currently supports the documented endpoints.

Usage/Examples

For usage of go-quip and examples using the library, refer to the godoc page.

A quick rundown:

q := quip.NewClient("access_token")

// Getting recent messages...
rmp := quip.GetRecentMessagesParams{
    ThreadId: "thread_id",
}
messages := q.GetRecentMessages(&rmp)

for _, message := range messages {
    fmt.Println(message.Text)
}

// Creating a new message

nm := quip.NewMessageParams{
    ThreadId: "YLZAAAQV9Py",
    Content:  "Byah!",
}
message := q.NewMessage(&nm)

Documentation

Index

Constants

View Source
const (
	APPEND          = "0"
	PREPEND         = "1"
	AFTER_SECTION   = "2"
	BEFORE_SECTION  = "3"
	REPLACE_SECTION = "4"
	DELETE_SECTION  = "5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFolderMembersParams

type AddFolderMembersParams struct {
	FolderId  string
	MemberIds []string
}

type AddMembersParams

type AddMembersParams struct {
	ThreadId  string
	MemberIds []string
}

type Blob

type Blob struct {
	ID  string
	URL string
}

type Client

type Client struct {

	// Number of seconds spent waiting due to rate limiting
	RateLimitDelays float64
	// contains filtered or unexported fields
}

func NewClient

func NewClient(accessToken string) *Client

func NewClientOAuth

func NewClientOAuth(accessToken string, clientId string, clientSecret string, redirectUri string) *Client

func (*Client) AddFolderMembers

func (q *Client) AddFolderMembers(params *AddFolderMembersParams) (*Folder, error)

func (*Client) AddMembers

func (q *Client) AddMembers(params *AddMembersParams) (*Thread, error)

func (*Client) EditDocument

func (q *Client) EditDocument(params *EditDocumentParams) (*Thread, error)

func (*Client) GetAuthenticatedUser

func (q *Client) GetAuthenticatedUser() (*User, error)

func (*Client) GetBlob

func (q *Client) GetBlob(blobId, threadId string) ([]byte, error)

XXX Return *Blob instead

func (*Client) GetContacts

func (q *Client) GetContacts() ([]*User, error)

func (*Client) GetFolder

func (q *Client) GetFolder(params *GetFolderParams) (*Folder, error)

func (*Client) GetFolders

func (q *Client) GetFolders(params *GetFoldersParams) ([]*Folder, error)

func (*Client) GetRecentMessages

func (q *Client) GetRecentMessages(params *GetRecentMessagesParams) ([]*Message, error)

func (*Client) GetRecentThreads

func (q *Client) GetRecentThreads(params *GetRecentThreadsParams) ([]*Thread, error)

func (*Client) GetThread

func (q *Client) GetThread(id string) (*Thread, error)

func (*Client) GetThreads

func (q *Client) GetThreads(ids []string) ([]*Thread, error)

func (*Client) GetUser

func (q *Client) GetUser(params *GetUserParams) (*User, error)

func (*Client) GetUsers

func (q *Client) GetUsers(params *GetUsersParams) ([]*User, error)

func (*Client) NewBlob

func (q *Client) NewBlob(path string, threadId string) (*Blob, error)

func (*Client) NewDocument

func (q *Client) NewDocument(params *NewDocumentParams) (*Thread, error)

func (*Client) NewFolder

func (q *Client) NewFolder(params *NewFolderParams) (*Folder, error)

func (*Client) NewMessage

func (q *Client) NewMessage(params *NewMessageParams) (*Message, error)

func (*Client) RemoveFolderMembers

func (q *Client) RemoveFolderMembers(params *RemoveFolderMembersParams) (*Folder, error)

func (*Client) RemoveMembers

func (q *Client) RemoveMembers(params *RemoveMembersParams) (*Thread, error)

func (*Client) SetApiUrl

func (q *Client) SetApiUrl(url string)

type EditDocumentParams

type EditDocumentParams struct {
	ThreadId  string
	Content   string
	Format    string
	Location  string
	SectionId string
}

type Folder

type Folder struct {
	Info struct {
		Id          string
		Title       string
		CreatedUsec int `json:"created_usec"`
		UpdatedUsec int `json:"updated_usec"`
		Color       string
		ParentId    string `json:"parent_id"`
	} `json:"folder"`

	MemberIds []string `json:"member_ids"`
	Children  []FolderItem
}

type FolderItem

type FolderItem struct {
	// Either FolderID or ThreadID will be set but not both
	FolderID   string `json:"folder_id"`
	ThreadID   string `json:"thread_id"`
	Restricted bool   `json:"restricted"`
}

func (FolderItem) ItemKindID

func (fi FolderItem) ItemKindID() (string, string)

type GetFolderParams

type GetFolderParams struct {
	Id string
}

type GetFoldersParams

type GetFoldersParams struct {
	Ids []string
}

type GetRecentMessagesParams

type GetRecentMessagesParams struct {
	ThreadId       string
	Count          int
	MaxUpdatedUsec int
}

type GetRecentThreadsParams

type GetRecentThreadsParams struct {
	Count          int
	MaxUpdatedUsec int
}

type GetUserParams

type GetUserParams struct {
	Id string
}

type GetUsersParams

type GetUsersParams struct {
	Ids []string
}

type Message

type Message struct {
	AuthorId    string `json:"author_id"`
	CreatedUsec int    `json:"created_usec"`
	Id          string
	Text        string
}

type NewDocumentParams

type NewDocumentParams struct {
	Content   string
	Format    string
	Title     string
	MemberIds []string
}

type NewFolderParams

type NewFolderParams struct {
	Title     string
	ParentId  string
	Color     int
	MemberIds []string
}

type NewMessageParams

type NewMessageParams struct {
	ThreadId string
	Content  string
	Silent   bool
}

type RemoveFolderMembersParams

type RemoveFolderMembersParams struct {
	FolderId  string
	MemberIds []string
}

type RemoveMembersParams

type RemoveMembersParams struct {
	ThreadId  string
	MemberIds []string
}

type Thread

type Thread struct {
	ExpandedUserIds []string `json:"expanded_user_ids"`
	UserIds         []string `json:"user_ids"`
	SharedFolderIds []string `json:"shared_folder_ids"`
	Html            string
	Thread          ThreadDetails
}

type ThreadDetails

type ThreadDetails struct {
	ID          string
	AuthorID    string `json:"author_id"`
	ThreadClass string `json:"thread_class"`
	Created     int64  `json:"created_usec"`
	Updated     int64  `json:"updated_usec"`
	Title       string
	Link        string
	Type        string
	Sharing     ThreadSharing
}

type ThreadSharing

type ThreadSharing struct {
	CompanyID   string `json:"company_id"`
	CompanyMode string `json:"company_mode"`
}

type User

type User struct {
	Id              string
	Name            string
	Affinity        float64
	ChatThreadId    string `mapstructure:"chat_thread_id"`
	DesktopFolderId string `mapstructure:"desktop_folder_id"`
	ArchiveFolderId string `mapstructure:"archive_folder_id"`
}

Jump to

Keyboard shortcuts

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