wundergo

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2015 License: MIT Imports: 1 Imported by: 0

README

wundergo Build Status Coverage Status

Golang API client for Wunderlist.

Copyright © 2014-2015, Robert Dimsdale. Licensed under the MIT License.

Supported Golang versions

The code is tested against the latest patch versions of golang 1.2, 1.3, 1.4 and 1.5.

Getting the code

The develop branch is where active development takes place; it is not guaranteed that any given commit will be stable.

The master branch points to a stable commit. All tests should pass.

Development

Go dependencies

There are no dependencies for the library or the CLI binary.

There are dependencies for the tests; they are safe to install from HEAD of their respective repositories and hence are not vendored in.

Test dependencies are installed as follows:

go get -u github.com/onsi/ginkgo
go get -u github.com/onsi/gomega
go get -u github.com/nu7hatch/gouuid
Running tests

Running the tests will require ginkgo.

Execute the unit tests with:

./scripts/unit-tests

The integration tests require the following environment variables to be set: WL_CLIENT_ID and WL_ACCESS_TOKEN. Values for these are obtained via the method documented at https://developer.wunderlist.com/documentation/concepts/authorization.

In the cloned directory run the following command:

WL_CLIENT_ID=my_client_id WL_ACCESS_TOKEN=my_access_token ./scripts/integration_tests

Project administration

Tracker

Documentation

Overview

Package wundergo provides a client to the Wunderlist API.

For more information on the API, see https://developer.wunderlist.com/documentation

Index

Constants

View Source
const (
	// APIURL is the default URL for Wunderlist API.
	APIURL = "https://a.wunderlist.com/api/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	User() (User, error)
	UpdateUser(user User) (User, error)
	Users() ([]User, error)
	UsersForListID(listID uint) ([]User, error)

	Lists() ([]List, error)
	List(listID uint) (List, error)
	CreateList(title string) (List, error)
	UpdateList(list List) (List, error)
	DeleteList(list List) error
	DeleteAllLists() error

	NotesForListID(listID uint) ([]Note, error)
	NotesForTaskID(taskID uint) ([]Note, error)
	Note(noteID uint) (Note, error)
	CreateNote(content string, taskID uint) (Note, error)
	UpdateNote(note Note) (Note, error)
	DeleteNote(note Note) error

	TasksForListID(listID uint) ([]Task, error)
	CompletedTasksForListID(listID uint, completed bool) ([]Task, error)
	Task(taskID uint) (Task, error)
	CreateTask(
		title string,
		listID uint,
		assigneeID uint,
		completed bool,
		recurrenceType string,
		recurrenceCount uint,
		dueDate string,
		starred bool,
	) (Task, error)
	UpdateTask(task Task) (Task, error)
	DeleteTask(task Task) error

	SubtasksForListID(listID uint) ([]Subtask, error)
	SubtasksForTaskID(taskID uint) ([]Subtask, error)
	CompletedSubtasksForListID(listID uint, completed bool) ([]Subtask, error)
	CompletedSubtasksForTaskID(taskID uint, completed bool) ([]Subtask, error)
	Subtask(subtaskID uint) (Subtask, error)
	CreateSubtask(
		title string,
		taskID uint,
		completed bool,
	) (Subtask, error)
	UpdateSubtask(subtask Subtask) (Subtask, error)
	DeleteSubtask(subtask Subtask) error

	RemindersForListID(listID uint) ([]Reminder, error)
	RemindersForTaskID(taskID uint) ([]Reminder, error)
	Reminder(reminderID uint) (Reminder, error)
	CreateReminder(
		date string,
		taskID uint,
		createdByDeviceUdid string,
	) (Reminder, error)
	UpdateReminder(reminder Reminder) (Reminder, error)
	DeleteReminder(reminder Reminder) error

	ListPositions() ([]Position, error)
	ListPosition(listPositionID uint) (Position, error)
	UpdateListPosition(listPosition Position) (Position, error)

	TaskPositionsForListID(listID uint) ([]Position, error)
	TaskPosition(taskPositionID uint) (Position, error)
	UpdateTaskPosition(taskPosition Position) (Position, error)

	SubtaskPositionsForListID(listID uint) ([]Position, error)
	SubtaskPositionsForTaskID(taskID uint) ([]Position, error)
	SubtaskPosition(subtaskPositionID uint) (Position, error)
	UpdateSubtaskPosition(subtaskPosition Position) (Position, error)

	Memberships() ([]Membership, error)
	MembershipsForListID(listID uint) ([]Membership, error)
	Membership(membershipID uint) (Membership, error)
	AddMemberToListViaUserID(userID uint, listID uint, muted bool) (Membership, error)
	AddMemberToListViaEmailAddress(emailAddress string, listID uint, muted bool) (Membership, error)
	RejectInvite(membership Membership) error
	RemoveMemberFromList(membership Membership) error
	AcceptMember(membership Membership) (Membership, error)

	TaskCommentsForListID(listID uint) ([]TaskComment, error)
	TaskCommentsForTaskID(taskID uint) ([]TaskComment, error)
	CreateTaskComment(text string, taskID uint) (TaskComment, error)
	TaskComment(taskCommentID uint) (TaskComment, error)
	DeleteTaskComment(taskComment TaskComment) error

	AvatarURL(userID uint, size int, fallback bool) (string, error)

	CreateWebhook(listID uint, url string, processorType string, configuration string) (Webhook, error)
	DeleteWebhook(webhook Webhook) error
	WebhooksForListID(listID uint) ([]Webhook, error)

	Folders() ([]Folder, error)
	CreateFolder(title string, listIDs []uint) (Folder, error)
	Folder(folderID uint) (Folder, error)
	UpdateFolder(folder Folder) (Folder, error)
	DeleteFolder(folder Folder) error
	FolderRevisions() ([]FolderRevision, error)
	DeleteAllFolders() error
}

Client represents the methods that the API supports.

type Folder added in v0.6.0

type Folder struct {
	ID                 uint      `json:"id"`
	Title              string    `json:"title"`
	ListIDs            []uint    `json:"list_ids"`
	CreatedAt          time.Time `json:"created_at"`
	CreatedByRequestID string    `json:"created_by_request_id"`
	UpdatedAt          time.Time `json:"updated_at"`
	TypeString         string    `json:"type"`
	Revision           uint      `json:"revision"`
}

Folder contains information about a folder. A list may or may not belong to a folder.

type FolderRevision added in v0.6.0

type FolderRevision struct {
	ID         uint   `json:"id"`
	TypeString string `json:"type"`
	Revision   uint   `json:"revision"`
}

FolderRevision contains information about the revision of folder.

type List

type List struct {
	ID         uint      `json:"id"`
	Title      string    `json:"title"`
	CreatedAt  time.Time `json:"created_at"`
	ListType   string    `json:"list_type"`
	Revision   uint      `json:"revision"`
	TypeString string    `json:"type"`
	Public     bool      `json:"public"`
}

List contains information about a List.

type ListTaskCount

type ListTaskCount struct {
	ID               uint   `json:"id"`
	CompletedCount   uint   `json:"completed_count"`
	UncompletedCount uint   `json:"uncompleted_count"`
	TypeString       string `json:"type"`
}

ListTaskCount contains information about the number and type of tasks a List contains.

type Membership

type Membership struct {
	ID       uint   `json:"id"`
	UserID   uint   `json:"user_id"`
	ListID   uint   `json:"list_id"`
	State    string `json:"state"`
	Owner    bool   `json:"owner"`
	Muted    bool   `json:"muted"`
	Revision uint   `json:"revision"`
}

Membership joins Users and Lists.

type Note

type Note struct {
	ID        uint      `json:"id"`
	TaskID    uint      `json:"task_id"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Revision  uint      `json:"revision"`
}

Note represents the information about a note. Notes are large text blobs, and are children of tasks.

type Position

type Position struct {
	ID       uint   `json:"id"`
	Values   []uint `json:"values"`
	Revision uint   `json:"revision"`
}

Position contains an ordered list of IDs of Lists, Tasks or Subtasks.

type Reminder

type Reminder struct {
	ID        uint      `json:"id"`
	Date      string    `json:"date"`
	TaskID    uint      `json:"task_id"`
	Revision  uint      `json:"revision"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Reminder contains information about a task reminder.

type Subtask

type Subtask struct {
	ID            uint      `json:"id"`
	TaskID        uint      `json:"task_id"`
	CreatedAt     time.Time `json:"created_at"`
	CreatedByID   uint      `json:"created_by_id"`
	Revision      uint      `json:"revision"`
	Title         string    `json:"title"`
	CompletedAt   time.Time `json:"completed_at"`
	CompletedByID uint      `json:"completed_by"`
}

Subtask contains information about a subtask. Subtasks are children of tasks.

type Task

type Task struct {
	ID              uint      `json:"id"`
	AssigneeID      uint      `json:"assignee_id"`
	AssignerID      uint      `json:"assigner_id"`
	CreatedAt       time.Time `json:"created_at"`
	CreatedByID     uint      `json:"created_by_id"`
	DueDate         string    `json:"due_date"`
	ListID          uint      `json:"list_id"`
	Revision        uint      `json:"revision"`
	Starred         bool      `json:"starred"`
	Title           string    `json:"title"`
	Completed       bool      `json:"completed"`
	CompletedAt     time.Time `json:"completed_at"`
	CompletedByID   uint      `json:"completed_by"`
	RecurrenceType  string    `json:"recurrence_type"`
	RecurrenceCount uint      `json:"recurrence_count"`
}

Task contains information about tasks. Tasks are children of lists.

type TaskComment

type TaskComment struct {
	ID        uint      `json:"id"`
	TaskID    uint      `json:"task_id"`
	Revision  uint      `json:"revision"`
	Text      string    `json:"text"`
	CreatedAt time.Time `json:"created_at"`
}

TaskComment represents information about a comment on a Task.

type User

type User struct {
	ID        uint      `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Revision  uint      `json:"revision"`
}

User contains information about a User.

type Webhook added in v0.5.0

type Webhook struct {
	ID             uint      `json:"id"`
	ListID         uint      `json:"list_id"`
	MembershipID   uint      `json:"membership_id"`
	MembershipType string    `json:"membership_type"`
	URL            string    `json:"url"`
	ProcessorType  string    `json:"processor_type"`
	Configuration  string    `json:"configuration"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

Webhook contains information about webhooks. A webhook sends notifications when a list is updated.

Directories

Path Synopsis
cmd
wl

Jump to

Keyboard shortcuts

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