Documentation ¶
Overview ¶
Package wundergo provides a client to the Wunderlist API.
For more information on the API, see https://developer.wunderlist.com/documentation
Index ¶
- Variables
- type Client
- type DefaultHTTPTransportHelper
- type DefaultJSONHelper
- type File
- type FilePreview
- type HTTPHelper
- type HTTPTransportHelper
- type JSONHelper
- type List
- type ListTaskCount
- type Logger
- type Membership
- type Note
- type OauthClient
- func (c OauthClient) AcceptMember(membership Membership) (*Membership, error)
- func (c OauthClient) AddMemberToListViaEmailAddress(emailAddress string, listID uint, muted bool) (*Membership, error)
- func (c OauthClient) AddMemberToListViaUserID(userID uint, listID uint, muted bool) (*Membership, error)
- func (c OauthClient) ChunkedUploadPart(uploadID uint, partNumber uint, md5Sum string) (*Upload, error)
- func (c OauthClient) CompletedSubtasksForListID(listID uint, completed bool) (*[]Subtask, error)
- func (c OauthClient) CompletedSubtasksForTaskID(taskID uint, completed bool) (*[]Subtask, error)
- func (c OauthClient) CompletedTasksForListID(listID uint, completed bool) (*[]Task, error)
- func (c OauthClient) CreateFile(uploadID uint, taskID uint, localCreatedAt time.Time) (*File, error)
- func (c OauthClient) CreateList(title string) (*List, error)
- func (c OauthClient) CreateNote(content string, taskID uint) (*Note, error)
- func (c OauthClient) CreateReminder(date string, taskID uint, createdByDeviceUdid string) (*Reminder, error)
- func (c OauthClient) CreateSubtask(title string, taskID uint, completed bool) (*Subtask, error)
- func (c OauthClient) CreateTask(title string, listID uint, assigneeID uint, completed bool, ...) (*Task, error)
- func (c OauthClient) CreateTaskComment(text string, taskID uint) (*TaskComment, error)
- func (c OauthClient) CreateUpload(contentType string, fileName string, fileSize uint, partNumber uint, ...) (*Upload, error)
- func (c OauthClient) DeleteList(list List) error
- func (c OauthClient) DeleteNote(note Note) error
- func (c OauthClient) DeleteReminder(reminder Reminder) error
- func (c OauthClient) DeleteSubtask(subtask Subtask) error
- func (c OauthClient) DeleteTask(task Task) error
- func (c OauthClient) DeleteTaskComment(taskComment TaskComment) error
- func (c OauthClient) DestroyFile(file File) error
- func (c OauthClient) File(fileID uint) (*File, error)
- func (c OauthClient) FilePreview(fileID uint) (*FilePreview, error)
- func (c OauthClient) FilesForListID(listID uint) (*[]File, error)
- func (c OauthClient) FilesForTaskID(taskID uint) (*[]File, error)
- func (c OauthClient) List(listID uint) (*List, error)
- func (c OauthClient) ListPosition(listPositionID uint) (*Position, error)
- func (c OauthClient) ListPositions() (*[]Position, error)
- func (c OauthClient) ListTaskCount(listID uint) (*ListTaskCount, error)
- func (c OauthClient) Lists() (*[]List, error)
- func (c OauthClient) MarkUploadComplete(uploadID uint) (*Upload, error)
- func (c OauthClient) Membership(membershipID uint) (*Membership, error)
- func (c OauthClient) Memberships() (*[]Membership, error)
- func (c OauthClient) MembershipsForListID(listID uint) (*[]Membership, error)
- func (c OauthClient) Note(noteID uint) (*Note, error)
- func (c OauthClient) NotesForListID(listID uint) (*[]Note, error)
- func (c OauthClient) NotesForTaskID(taskID uint) (*[]Note, error)
- func (c OauthClient) RejectInvite(membership Membership) error
- func (c OauthClient) Reminder(reminderID uint) (*Reminder, error)
- func (c OauthClient) RemindersForListID(listID uint) (*[]Reminder, error)
- func (c OauthClient) RemindersForTaskID(taskID uint) (*[]Reminder, error)
- func (c OauthClient) RemoveMemberFromList(membership Membership) error
- func (c OauthClient) Subtask(subtaskID uint) (*Subtask, error)
- func (c OauthClient) SubtaskPosition(subTaskPositionID uint) (*Position, error)
- func (c OauthClient) SubtaskPositionsForListID(listID uint) (*[]Position, error)
- func (c OauthClient) SubtaskPositionsForTaskID(taskID uint) (*[]Position, error)
- func (c OauthClient) SubtasksForListID(listID uint) (*[]Subtask, error)
- func (c OauthClient) SubtasksForTaskID(taskID uint) (*[]Subtask, error)
- func (c OauthClient) Task(taskID uint) (*Task, error)
- func (c OauthClient) TaskComment(taskCommentID uint) (*TaskComment, error)
- func (c OauthClient) TaskCommentsForListID(listID uint) (*[]TaskComment, error)
- func (c OauthClient) TaskCommentsForTaskID(taskID uint) (*[]TaskComment, error)
- func (c OauthClient) TaskPosition(taskPositionID uint) (*Position, error)
- func (c OauthClient) TaskPositionsForListID(listID uint) (*[]Position, error)
- func (c OauthClient) TasksForListID(listID uint) (*[]Task, error)
- func (c OauthClient) UpdateList(list List) (*List, error)
- func (c OauthClient) UpdateListPosition(listPosition Position) (*Position, error)
- func (c OauthClient) UpdateNote(note Note) (*Note, error)
- func (c OauthClient) UpdateReminder(reminder Reminder) (*Reminder, error)
- func (c OauthClient) UpdateSubtask(subtask Subtask) (*Subtask, error)
- func (c OauthClient) UpdateSubtaskPosition(subTaskPosition Position) (*Position, error)
- func (c OauthClient) UpdateTask(task Task) (*Task, error)
- func (c OauthClient) UpdateTaskPosition(taskPosition Position) (*Position, error)
- func (c OauthClient) UpdateUser(user User) (*User, error)
- func (c OauthClient) User() (*User, error)
- func (c OauthClient) Users() (*[]User, error)
- func (c OauthClient) UsersForListID(listID uint) (*[]User, error)
- type OauthClientHTTPHelper
- func (h OauthClientHTTPHelper) Delete(url string) (*http.Response, error)
- func (h OauthClientHTTPHelper) Get(url string) (*http.Response, error)
- func (h OauthClientHTTPHelper) Patch(url string, body []byte) (*http.Response, error)
- func (h OauthClientHTTPHelper) Post(url string, body []byte) (*http.Response, error)
- func (h OauthClientHTTPHelper) Put(url string, body []byte) (*http.Response, error)
- type Position
- type Reminder
- type Subtask
- type Task
- type TaskComment
- type TaskUpdateConfig
- type Upload
- type UploadPart
- type User
Constants ¶
This section is empty.
Variables ¶
var NewHTTPHelper = func(accessToken string, clientID string) HTTPHelper { return NewOauthClientHTTPHelper(accessToken, clientID) }
NewHTTPHelper allows for the injection of an HTTPHelper boundary object. Isolates the client from directly interacting with HTTP - adding auth headers etc. Defaults to NewOauthClientHTTPHelper.
var NewHTTPTransportHelper = func() HTTPTransportHelper { return &DefaultHTTPTransportHelper{ client: http.Client{}, } }
NewHTTPTransportHelper allows for the injection of a HTTPTransportHelper boundary object.
var NewJSONHelper = func() JSONHelper { return &DefaultJSONHelper{} }
NewJSONHelper allows for the injection of a JSONHelper boundary object. Isolates the client from JSON marshalling and unmarshalling. Defaults to NewDefaultJSONHelper.
var NewLogger = func() Logger {
return &defaultLogger{}
}
NewLogger allows for the injection of a Logger boundary object. Isolates the client from logging implementation details. Defaults to return NewPrintlnLogger.
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) ListTaskCount(listID uint) (*ListTaskCount, error) CreateList(title string) (*List, error) UpdateList(list List) (*List, error) DeleteList(list List) 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) FilesForListID(listID uint) (*[]File, error) FilesForTaskID(taskID uint) (*[]File, error) File(fileID uint) (*File, error) CreateFile(uploadID uint, taskID uint, localCreatedAt time.Time) (*File, error) DestroyFile(file File) error CreateUpload( contentType string, fileName string, fileSize uint, partNumber uint, md5Sum string, ) (*Upload, error) ChunkedUploadPart(uploadID uint, partNumber uint, md5Sum string) (*Upload, error) MarkUploadComplete(uploadID uint) (*Upload, error) FilePreview(fileID uint) (*FilePreview, 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 }
Client represents the methods that the API supports.
type DefaultHTTPTransportHelper ¶
type DefaultHTTPTransportHelper struct {
// contains filtered or unexported fields
}
DefaultHTTPTransportHelper is an implementation of HTTPTransportHelper.
func (DefaultHTTPTransportHelper) DoRequest ¶
DoRequest executes the provided http.Request, returning its response.
func (DefaultHTTPTransportHelper) NewRequest ¶
func (h DefaultHTTPTransportHelper) NewRequest(method, urlStr string, body io.Reader) (*http.Request, error)
NewRequest returns a new http.Request.
type DefaultJSONHelper ¶
type DefaultJSONHelper struct { }
DefaultJSONHelper is an implementation of JSONHelper.
func (DefaultJSONHelper) Marshal ¶
func (h DefaultJSONHelper) Marshal(v interface{}) ([]byte, error)
Marshal is a wrapper around json.Marshal.
func (DefaultJSONHelper) Unmarshal ¶
func (h DefaultJSONHelper) Unmarshal(data []byte, v interface{}) (interface{}, error)
Unmarshal is a wrapper around json.Unmarshal.
type File ¶
type File struct { ID uint `json:"id"` URL string `json:"url"` TaskID uint `json:"task_id"` ListID uint `json:"list_id"` UserID uint `json:"user_id"` FileName string `json:"file_name"` ContentType string `json:"content_type"` FileSize string `json:"file_size"` LocalCreatedAt time.Time `json:"local_created_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Type string `json:"type"` Revision uint `json:"revision"` }
File contains the information about an uploaded file. See also Upload.
type FilePreview ¶
type FilePreview struct { URL string `json:"url"` Size string `json:"size"` ExpiresAt time.Time `json:"expires_at"` }
FilePreview contains information about an image thumnail for a file.
type HTTPHelper ¶
type HTTPHelper interface { Get(url string) (*http.Response, error) Post(url string, body []byte) (*http.Response, error) Put(url string, body []byte) (*http.Response, error) Patch(url string, body []byte) (*http.Response, error) Delete(url string) (*http.Response, error) }
HTTPHelper provides a wrapper around a variety of HTTP methods such as GET and POST. It is primarily useful to encapsulate things like authentication headers.
type HTTPTransportHelper ¶
type HTTPTransportHelper interface { NewRequest(method, urlStr string, body io.Reader) (*http.Request, error) DoRequest(req *http.Request) (resp *http.Response, err error) }
HTTPTransportHelper provides a boundary object for creation and execution of http requests.
type JSONHelper ¶
type JSONHelper interface { Marshal(v interface{}) ([]byte, error) Unmarshal(data []byte, v interface{}) (interface{}, error) }
JSONHelper provides a wrapper around JSON marshalling/unmarshalling.
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 Logger ¶
type Logger interface {
Println(message string)
}
Logger provides the ability to log a message.
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 OauthClient ¶
type OauthClient struct {
// contains filtered or unexported fields
}
OauthClient is an implementation of Client.
func NewOauthClient ¶
func NewOauthClient(accessToken string, clientID string) *OauthClient
NewOauthClient is a utility method to simplify initialization of a new OauthClient.
func (OauthClient) AcceptMember ¶
func (c OauthClient) AcceptMember(membership Membership) (*Membership, error)
AcceptMember updates the provided Membership to reflect the User has accepted the Membership request.
func (OauthClient) AddMemberToListViaEmailAddress ¶
func (c OauthClient) AddMemberToListViaEmailAddress(emailAddress string, listID uint, muted bool) (*Membership, error)
AddMemberToListViaEmailAddress creates a new Membership joining the List with the user associated with the provided email address.
func (OauthClient) AddMemberToListViaUserID ¶
func (c OauthClient) AddMemberToListViaUserID(userID uint, listID uint, muted bool) (*Membership, error)
AddMemberToListViaUserID creates a new Membership associating the User with the List.
func (OauthClient) ChunkedUploadPart ¶
func (c OauthClient) ChunkedUploadPart(uploadID uint, partNumber uint, md5Sum string) (*Upload, error)
ChunkedUploadPart returns an existing Upload with an updated UploadPart, corresponding to the provided partNumber.
func (OauthClient) CompletedSubtasksForListID ¶
func (c OauthClient) CompletedSubtasksForListID(listID uint, completed bool) (*[]Subtask, error)
CompletedSubtasksForListID returns subtasks for the provided List, filtered on whether they are completed.
func (OauthClient) CompletedSubtasksForTaskID ¶
func (c OauthClient) CompletedSubtasksForTaskID(taskID uint, completed bool) (*[]Subtask, error)
CompletedSubtasksForTaskID returns subtasks for the provided List, filtered on whether they are completed.
func (OauthClient) CompletedTasksForListID ¶
func (c OauthClient) CompletedTasksForListID(listID uint, completed bool) (*[]Task, error)
CompletedTasksForListID returns tasks filtered by whether they are completed.
func (OauthClient) CreateFile ¶
func (c OauthClient) CreateFile(uploadID uint, taskID uint, localCreatedAt time.Time) (*File, error)
CreateFile creates a new file with the provided parameters. All fields are required, uploadID and taskID must be > 0. If localCreatedAt is uninitialized it is ignored. Using initialized values for localCreatedAt is recommened, as it assists ordering of file uploads and comments.
func (OauthClient) CreateList ¶
func (c OauthClient) CreateList(title string) (*List, error)
CreateList creates a list with the provided title.
func (OauthClient) CreateNote ¶
func (c OauthClient) CreateNote(content string, taskID uint) (*Note, error)
CreateNote creates a note with the provided content associated with the Task for the corresponding taskID.
func (OauthClient) CreateReminder ¶
func (c OauthClient) CreateReminder( date string, taskID uint, createdByDeviceUdid string, ) (*Reminder, error)
CreateReminder creates a Reminder with the provided parameters.
func (OauthClient) CreateSubtask ¶
CreateSubtask creates a Subtask for the provided parameters.
func (OauthClient) CreateTask ¶
func (c OauthClient) CreateTask( title string, listID uint, assigneeID uint, completed bool, recurrenceType string, recurrenceCount uint, dueDate string, starred bool, ) (*Task, error)
CreateTask creates a task with the provided parameters.
func (OauthClient) CreateTaskComment ¶
func (c OauthClient) CreateTaskComment(text string, taskID uint) (*TaskComment, error)
CreateTaskComment creates a TaskComment with the provided content associated with the Task for the corresponding taskID.
func (OauthClient) CreateUpload ¶
func (c OauthClient) CreateUpload( contentType string, fileName string, fileSize uint, partNumber uint, md5Sum string, ) (*Upload, error)
CreateUpload creates an Upload with the provided paramters. contentType, fileName and fileSize are required; partNumber and md5Sum are optional.
func (OauthClient) DeleteList ¶
func (c OauthClient) DeleteList(list List) error
DeleteList deletes the provided list.
func (OauthClient) DeleteNote ¶
func (c OauthClient) DeleteNote(note Note) error
DeleteNote deletes the provided note.
func (OauthClient) DeleteReminder ¶
func (c OauthClient) DeleteReminder(reminder Reminder) error
DeleteReminder deletes the provided Reminder.
func (OauthClient) DeleteSubtask ¶
func (c OauthClient) DeleteSubtask(subtask Subtask) error
DeleteSubtask deletes the provided Subtask.
func (OauthClient) DeleteTask ¶
func (c OauthClient) DeleteTask(task Task) error
DeleteTask deletes the provided Task.
func (OauthClient) DeleteTaskComment ¶
func (c OauthClient) DeleteTaskComment(taskComment TaskComment) error
DeleteTaskComment deletes the provided TaskComment.
func (OauthClient) DestroyFile ¶
func (c OauthClient) DestroyFile(file File) error
DestroyFile deletes the provided File.
func (OauthClient) File ¶
func (c OauthClient) File(fileID uint) (*File, error)
File returns the File associated with the provided fileID.
func (OauthClient) FilePreview ¶
func (c OauthClient) FilePreview(fileID uint) (*FilePreview, error)
FilePreview returns a FilePreview associated with the provided File. Currently this only works for image files.
func (OauthClient) FilesForListID ¶
func (c OauthClient) FilesForListID(listID uint) (*[]File, error)
FilesForListID returns the Files associated with the provided List.
func (OauthClient) FilesForTaskID ¶
func (c OauthClient) FilesForTaskID(taskID uint) (*[]File, error)
FilesForTaskID returns the Files associated with the provided Task.
func (OauthClient) List ¶
func (c OauthClient) List(listID uint) (*List, error)
List returns the list for the corresponding listID.
func (OauthClient) ListPosition ¶
func (c OauthClient) ListPosition(listPositionID uint) (*Position, error)
ListPosition returns the ListPosition associated with the provided listPositionID.
func (OauthClient) ListPositions ¶
func (c OauthClient) ListPositions() (*[]Position, error)
ListPositions returns the positions of all Lists the client can access. The returned ListPosition.Values might be empty if the Lists have never been reordered.
func (OauthClient) ListTaskCount ¶
func (c OauthClient) ListTaskCount(listID uint) (*ListTaskCount, error)
ListTaskCount returns a ListTaskCount for the corresponding listID.
func (OauthClient) Lists ¶
func (c OauthClient) Lists() (*[]List, error)
Lists returns all lists the client has permission to access.
func (OauthClient) MarkUploadComplete ¶
func (c OauthClient) MarkUploadComplete(uploadID uint) (*Upload, error)
MarkUploadComplete marks as complete the Upload associated with the provided uploadID.
func (OauthClient) Membership ¶
func (c OauthClient) Membership(membershipID uint) (*Membership, error)
Membership returns the Membership associated with the provided membershipID.
func (OauthClient) Memberships ¶
func (c OauthClient) Memberships() (*[]Membership, error)
Memberships returns the memberships the client can access.
func (OauthClient) MembershipsForListID ¶
func (c OauthClient) MembershipsForListID(listID uint) (*[]Membership, error)
MembershipsForListID returns the Memberships for the List associated with the provided listID.
func (OauthClient) Note ¶
func (c OauthClient) Note(noteID uint) (*Note, error)
Note returns the Note for the corresponding noteID.
func (OauthClient) NotesForListID ¶
func (c OauthClient) NotesForListID(listID uint) (*[]Note, error)
NotesForListID returns Notes for the provided listID.
func (OauthClient) NotesForTaskID ¶
func (c OauthClient) NotesForTaskID(taskID uint) (*[]Note, error)
NotesForTaskID returns Notes for the provided taskID.
func (OauthClient) RejectInvite ¶
func (c OauthClient) RejectInvite(membership Membership) error
RejectInvite deletes the provided Membership.
func (OauthClient) Reminder ¶
func (c OauthClient) Reminder(reminderID uint) (*Reminder, error)
Reminder returns the Reminder associated with the provided reminderID.
func (OauthClient) RemindersForListID ¶
func (c OauthClient) RemindersForListID(listID uint) (*[]Reminder, error)
RemindersForListID returns the Reminders for the List associated with the provided listID.
func (OauthClient) RemindersForTaskID ¶
func (c OauthClient) RemindersForTaskID(taskID uint) (*[]Reminder, error)
RemindersForTaskID returns the Reminders for the Task associated with the provided taskID.
func (OauthClient) RemoveMemberFromList ¶
func (c OauthClient) RemoveMemberFromList(membership Membership) error
RemoveMemberFromList deletes the provided Membership.
func (OauthClient) Subtask ¶
func (c OauthClient) Subtask(subtaskID uint) (*Subtask, error)
Subtask returns the subtask for the corresponding subtaskID.
func (OauthClient) SubtaskPosition ¶
func (c OauthClient) SubtaskPosition(subTaskPositionID uint) (*Position, error)
SubtaskPosition returns the SubtaskPosition associated with the provided subtaskPositionID.
func (OauthClient) SubtaskPositionsForListID ¶
func (c OauthClient) SubtaskPositionsForListID(listID uint) (*[]Position, error)
SubtaskPositionsForListID returns the positions of all Subtasks in the List associated with the provided listID. The returned SubtaskPosition.Values might be empty if the Subtasks have never been reordered.
func (OauthClient) SubtaskPositionsForTaskID ¶
func (c OauthClient) SubtaskPositionsForTaskID(taskID uint) (*[]Position, error)
SubtaskPositionsForTaskID returns the positions of all Subtasks in the Task associated with the provided taskID. The returned SubtaskPosition.Values might be empty if the Subtasks have never been reordered.
func (OauthClient) SubtasksForListID ¶
func (c OauthClient) SubtasksForListID(listID uint) (*[]Subtask, error)
SubtasksForListID returns the Subtasks associated with the provided listID.
func (OauthClient) SubtasksForTaskID ¶
func (c OauthClient) SubtasksForTaskID(taskID uint) (*[]Subtask, error)
SubtasksForTaskID returns the Subtasks associated with the provided taskID.
func (OauthClient) Task ¶
func (c OauthClient) Task(taskID uint) (*Task, error)
Task returns the Task for the corresponding taskID.
func (OauthClient) TaskComment ¶
func (c OauthClient) TaskComment(taskCommentID uint) (*TaskComment, error)
TaskComment returns the TaskComment for the corresponding taskCommentID.
func (OauthClient) TaskCommentsForListID ¶
func (c OauthClient) TaskCommentsForListID(listID uint) (*[]TaskComment, error)
TaskCommentsForListID returns TaskComments for the provided listID.
func (OauthClient) TaskCommentsForTaskID ¶
func (c OauthClient) TaskCommentsForTaskID(taskID uint) (*[]TaskComment, error)
TaskCommentsForTaskID returns TaskComments for the provided taskID.
func (OauthClient) TaskPosition ¶
func (c OauthClient) TaskPosition(taskPositionID uint) (*Position, error)
TaskPosition returns the TaskPosition associated with the provided taskPositionID.
func (OauthClient) TaskPositionsForListID ¶
func (c OauthClient) TaskPositionsForListID(listID uint) (*[]Position, error)
TaskPositionsForListID returns the positions of all Tasks in the List associated with the provided listID. The returned TaskPosition.Values might be empty if the Tasks have never been reordered.
func (OauthClient) TasksForListID ¶
func (c OauthClient) TasksForListID(listID uint) (*[]Task, error)
TasksForListID returns Tasks for the provided listID.
func (OauthClient) UpdateList ¶
func (c OauthClient) UpdateList(list List) (*List, error)
UpdateList updates the provided List.
func (OauthClient) UpdateListPosition ¶
func (c OauthClient) UpdateListPosition(listPosition Position) (*Position, error)
UpdateListPosition updates the provided ListPosition. This will reorder the Lists.
func (OauthClient) UpdateNote ¶
func (c OauthClient) UpdateNote(note Note) (*Note, error)
UpdateNote updates the provided Note.
func (OauthClient) UpdateReminder ¶
func (c OauthClient) UpdateReminder(reminder Reminder) (*Reminder, error)
UpdateReminder updates the provided Reminder.
func (OauthClient) UpdateSubtask ¶
func (c OauthClient) UpdateSubtask(subtask Subtask) (*Subtask, error)
UpdateSubtask updates the provided Subtask.
func (OauthClient) UpdateSubtaskPosition ¶
func (c OauthClient) UpdateSubtaskPosition(subTaskPosition Position) (*Position, error)
UpdateSubtaskPosition updates the provided SubtaskPosition. This will reorder the Subtasks.
func (OauthClient) UpdateTask ¶
func (c OauthClient) UpdateTask(task Task) (*Task, error)
UpdateTask updates the provided Task.
func (OauthClient) UpdateTaskPosition ¶
func (c OauthClient) UpdateTaskPosition(taskPosition Position) (*Position, error)
UpdateTaskPosition updates the provided TaskPosition. This will reorder the Tasks.
func (OauthClient) UpdateUser ¶
func (c OauthClient) UpdateUser(user User) (*User, error)
UpdateUser is a currently undocumented method which updates the provided user. Currently the only field that is updated is user.Name
func (OauthClient) User ¶
func (c OauthClient) User() (*User, error)
User returns the currently logged in user. This makes it a good method to validate the auth credentials provided in NewOauthClient.
func (OauthClient) Users ¶
func (c OauthClient) Users() (*[]User, error)
Users returns a list of all users the client can access.
func (OauthClient) UsersForListID ¶
func (c OauthClient) UsersForListID(listID uint) (*[]User, error)
UsersForListID returns a list of users the client can access, restricted to users that have access to the provided list.
type OauthClientHTTPHelper ¶
type OauthClientHTTPHelper struct {
// contains filtered or unexported fields
}
OauthClientHTTPHelper implements HTTPHelper, utilizing oath credentials for authentication.
func NewOauthClientHTTPHelper ¶
func NewOauthClientHTTPHelper(accessToken string, clientID string) *OauthClientHTTPHelper
NewOauthClientHTTPHelper provides a conveinient mechanism for initializing an OauthClientHTTPHelper.
func (OauthClientHTTPHelper) Delete ¶
func (h OauthClientHTTPHelper) Delete(url string) (*http.Response, error)
Delete provides a wrapper around http.Delete. Response is guaranteed to be non-nil if error is nil
func (OauthClientHTTPHelper) Get ¶
func (h OauthClientHTTPHelper) Get(url string) (*http.Response, error)
Get provides a wrapper around http.Get. Response is guaranteed to be non-nil if error is nil
func (OauthClientHTTPHelper) Patch ¶
Patch provides a wrapper around http.Patch. Response is guaranteed to be non-nil if error is nil
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 TaskUpdateConfig ¶
type TaskUpdateConfig struct { Title string `json:"title"` Revision uint `json:"revision"` AssigneeID uint `json:"assignee_id,omitempty"` Completed bool `json:"completed,omitempty"` RecurrenceType string `json:"recurrence_type,omitempty"` RecurrenceCount uint `json:"recurrence_count,omitempty"` DueDate string `json:"due_date,omitempty"` Starred bool `json:"starred,omitempty"` Remove []string `json:"remove,omitempty"` }
TaskUpdateConfig contains information required to update an existing task.
type Upload ¶
type Upload struct { ID uint `json:"id"` UserID uint `json:"user_id"` State string `json:"state"` ExpiresAt time.Time `json:"expires_at"` Part UploadPart `json:"part"` }
Upload contains information about an upload. See also File.
type UploadPart ¶
type UploadPart struct { URL string `json:"url"` Date string `json:"date"` Authorization string `json:"authorization"` }
UploadPart contains information about a partial upload.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |