Documentation
¶
Overview ¶
Package todoist implements a client for interacting with the Todoist API v1.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) ExecuteCommand(ctx context.Context, args sync.CommandArgs) (*sync.SyncResponse, error)
- func (c *Client) ExecuteCommands(ctx context.Context, cmds sync.Commands) (*sync.SyncResponse, error)
- func (c *Client) Sync(ctx context.Context, request *sync.SyncRequest) (*sync.SyncResponse, error)
- func (c *Client) SyncWithAutoToken(ctx context.Context, fullSync bool) (*sync.SyncResponse, error)
- type FilterService
- func (s *FilterService) AddFilter(ctx context.Context, args *sync.FilterAddArgs) (*sync.SyncResponse, error)
- func (s *FilterService) DeleteFilter(ctx context.Context, args *sync.FilterDeleteArgs) (*sync.SyncResponse, error)
- func (s *FilterService) DeleteFilters(ctx context.Context, args []*sync.FilterDeleteArgs) (*sync.SyncResponse, error)
- func (s *FilterService) ReorderFilters(ctx context.Context, args *sync.FilterReorderArgs) (*sync.SyncResponse, error)
- func (s *FilterService) UpdateFilter(ctx context.Context, args *sync.FilterUpdateArgs) (*sync.SyncResponse, error)
- type Handler
- type LabelService
- func (s *LabelService) AddLabel(ctx context.Context, args *sync.LabelAddArgs) (*sync.SyncResponse, error)
- func (s *LabelService) DeleteLabel(ctx context.Context, args *sync.LabelDeleteArgs) (*sync.SyncResponse, error)
- func (s *LabelService) DeleteLabels(ctx context.Context, args []*sync.LabelDeleteArgs) (*sync.SyncResponse, error)
- func (s *LabelService) DeleteSharedLabel(ctx context.Context, args *sync.LabelDeleteSharedArgs) (*sync.SyncResponse, error)
- func (s *LabelService) DeleteSharedLabels(ctx context.Context, args []*sync.LabelDeleteSharedArgs) (*sync.SyncResponse, error)
- func (s *LabelService) RenameSharedLabel(ctx context.Context, args *sync.LabelRenameSharedArgs) (*sync.SyncResponse, error)
- func (s *LabelService) ReorderLabels(ctx context.Context, args *sync.LabelReorderArgs) (*sync.SyncResponse, error)
- func (s *LabelService) UpdateLabel(ctx context.Context, args *sync.LabelUpdateArgs) (*sync.SyncResponse, error)
- type LocationService
- type ProjectService
- func (s *ProjectService) AddProject(ctx context.Context, args *sync.ProjectAddArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) ArchiveProject(ctx context.Context, args *sync.ProjectArchiveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) ArchiveProjects(ctx context.Context, args []*sync.ProjectArchiveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) DeleteProject(ctx context.Context, args *sync.ProjectDeleteArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) DeleteProjects(ctx context.Context, args []*sync.ProjectDeleteArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) GetAllArchivedProjects(ctx context.Context, params *rest.ProjectGetArchivedParams) ([]*sync.Project, error)
- func (s *ProjectService) GetArchivedProjects(ctx context.Context, params *rest.ProjectGetArchivedParams) (*rest.ProjectGetArchivedResponse, error)
- func (s *ProjectService) LeaveProject(ctx context.Context, args *sync.ProjectLeaveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) MoveProject(ctx context.Context, args *sync.ProjectMoveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) MoveProjectToPersonal(ctx context.Context, args *sync.ProjectMoveToPersonalArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) MoveProjectToWorkspace(ctx context.Context, args *sync.ProjectMoveToWorkspaceArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) ReorderProjects(ctx context.Context, args *sync.ProjectReorderArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) UnarchiveProject(ctx context.Context, args *sync.ProjectUnarchiveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) UnarchiveProjects(ctx context.Context, args []*sync.ProjectUnarchiveArgs) (*sync.SyncResponse, error)
- func (s *ProjectService) UpdateProject(ctx context.Context, args *sync.ProjectUpdateArgs) (*sync.SyncResponse, error)
- type ReminderService
- func (s *ReminderService) AddReminder(ctx context.Context, args *sync.ReminderAddArgs) (*sync.SyncResponse, error)
- func (s *ReminderService) DeleteReminder(ctx context.Context, args *sync.ReminderDeleteArgs) (*sync.SyncResponse, error)
- func (s *ReminderService) DeleteReminders(ctx context.Context, args []*sync.ReminderDeleteArgs) (*sync.SyncResponse, error)
- func (s *ReminderService) UpdateReminder(ctx context.Context, args *sync.ReminderUpdateArgs) (*sync.SyncResponse, error)
- type SectionService
- func (s *SectionService) AddSection(ctx context.Context, args *sync.SectionAddArgs) (*sync.SyncResponse, error)
- func (s *SectionService) ArchiveSection(ctx context.Context, args *sync.SectionArchiveArgs) (*sync.SyncResponse, error)
- func (s *SectionService) ArchiveSections(ctx context.Context, args []*sync.SectionArchiveArgs) (*sync.SyncResponse, error)
- func (s *SectionService) DeleteSection(ctx context.Context, args *sync.SectionDeleteArgs) (*sync.SyncResponse, error)
- func (s *SectionService) DeleteSections(ctx context.Context, args []*sync.SectionDeleteArgs) (*sync.SyncResponse, error)
- func (s *SectionService) MoveSection(ctx context.Context, args *sync.SectionMoveArgs) (*sync.SyncResponse, error)
- func (s *SectionService) ReorderSections(ctx context.Context, args *sync.SectionReorderArgs) (*sync.SyncResponse, error)
- func (s *SectionService) UnarchiveSection(ctx context.Context, args *sync.SectionUnarchiveArgs) (*sync.SyncResponse, error)
- func (s *SectionService) UnarchiveSections(ctx context.Context, args []*sync.SectionUnarchiveArgs) (*sync.SyncResponse, error)
- func (s *SectionService) UpdateSection(ctx context.Context, args *sync.SectionUpdateArgs) (*sync.SyncResponse, error)
- type TaskService
- func (s *TaskService) AddTask(ctx context.Context, args *sync.TaskAddArgs) (*sync.SyncResponse, error)
- func (s *TaskService) CloseTask(ctx context.Context, args *sync.TaskCloseArgs) (*sync.SyncResponse, error)
- func (s *TaskService) CloseTasks(ctx context.Context, args []*sync.TaskCloseArgs) (*sync.SyncResponse, error)
- func (s *TaskService) CompleteTask(ctx context.Context, args *sync.TaskCompleteArgs) (*sync.SyncResponse, error)
- func (s *TaskService) CompleteTaskRecurring(ctx context.Context, args *sync.TaskCompleteRecurringArgs) (*sync.SyncResponse, error)
- func (s *TaskService) DeleteTask(ctx context.Context, args *sync.TaskDeleteArgs) (*sync.SyncResponse, error)
- func (s *TaskService) DeleteTasks(ctx context.Context, args []*sync.TaskDeleteArgs) (*sync.SyncResponse, error)
- func (s *TaskService) GetAllCompletedTasksByCompletionDate(ctx context.Context, params *rest.TaskGetCompletedByCompletionDateParams) ([]*sync.Task, error)
- func (s *TaskService) GetAllCompletedTasksByDueDate(ctx context.Context, params *rest.TaskGetCompletedByDueDateParams) ([]*sync.Task, error)
- func (s *TaskService) GetCompletedTasksByCompletionDate(ctx context.Context, params *rest.TaskGetCompletedByCompletionDateParams) (*rest.TaskGetCompletedResponse, error)
- func (s *TaskService) GetCompletedTasksByDueDate(ctx context.Context, params *rest.TaskGetCompletedByDueDateParams) (*rest.TaskGetCompletedResponse, error)
- func (s *TaskService) MoveTask(ctx context.Context, args *sync.TaskMoveArgs) (*sync.SyncResponse, error)
- func (s *TaskService) QuickAddTask(ctx context.Context, request *rest.TaskQuickAddRequest) (*sync.Task, error)
- func (s *TaskService) ReorderTasks(ctx context.Context, args *sync.TaskReorderArgs) (*sync.SyncResponse, error)
- func (s *TaskService) UncompleteTask(ctx context.Context, args *sync.TaskUncompleteArgs) (*sync.SyncResponse, error)
- func (s *TaskService) UncompleteTasks(ctx context.Context, args []*sync.TaskUncompleteArgs) (*sync.SyncResponse, error)
- func (s *TaskService) UpdateTask(ctx context.Context, args *sync.TaskUpdateArgs) (*sync.SyncResponse, error)
- func (s *TaskService) UpdateTaskDayOrders(ctx context.Context, args *sync.TaskUpdateDayOrdersArgs) (*sync.SyncResponse, error)
- type UserService
Constants ¶
const ( TaskEndpoint = baseURL + "/tasks" TaskQuickAddEndpoint = TaskEndpoint + "/quick" TaskCompletedByCompletionDateEndpoint = TaskEndpoint + "/completed/by_completion_date" TaskCompletedByDueDateEndpoint = TaskEndpoint + "/completed/by_due_date" ProjectEndpoint = baseURL + "/projects" ProjectArchivedEndpoint = ProjectEndpoint + "/archived" LabelEndpoint = baseURL + "/labels" UserEndpoint = baseURL + "/user" )
Variables ¶
var DefaultHandler = &defaultHandler{syncToken: sync.DefaultSyncToken}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client to interact with the Todoist API v1.
func (*Client) ExecuteCommand ¶
func (c *Client) ExecuteCommand(ctx context.Context, args sync.CommandArgs) (*sync.SyncResponse, error)
ExecuteCommand executes a single command in a single sync request.
func (*Client) ExecuteCommands ¶
func (c *Client) ExecuteCommands(ctx context.Context, cmds sync.Commands) (*sync.SyncResponse, error)
ExecuteCommands executes multiple commands in a single sync request.
func (*Client) Sync ¶
func (c *Client) Sync(ctx context.Context, request *sync.SyncRequest) (*sync.SyncResponse, error)
Sync data between the Todoist client.
func (*Client) SyncWithAutoToken ¶
SyncWithAutoToken performs a sync operation with automatic handling of the sync token.
type FilterService ¶ added in v0.2.0
type FilterService struct {
// contains filtered or unexported fields
}
FilterService provides methods for managing filters.
func NewFilterService ¶ added in v0.2.0
func NewFilterService(client *Client) *FilterService
func (*FilterService) AddFilter ¶ added in v0.2.0
func (s *FilterService) AddFilter(ctx context.Context, args *sync.FilterAddArgs) (*sync.SyncResponse, error)
AddFilter adds a filter.
See Add a filter for more details.
func (*FilterService) DeleteFilter ¶ added in v0.2.0
func (s *FilterService) DeleteFilter(ctx context.Context, args *sync.FilterDeleteArgs) (*sync.SyncResponse, error)
DeleteFilter deletes a filter.
See Delete a filter for more details.
func (*FilterService) DeleteFilters ¶ added in v0.2.0
func (s *FilterService) DeleteFilters(ctx context.Context, args []*sync.FilterDeleteArgs) (*sync.SyncResponse, error)
DeleteFilters is a simple wrapper around FilterService.DeleteFilter that deletes multiple.
func (*FilterService) ReorderFilters ¶ added in v0.2.0
func (s *FilterService) ReorderFilters(ctx context.Context, args *sync.FilterReorderArgs) (*sync.SyncResponse, error)
ReorderFilters updates multiple filter orders.
See Update multiple filter orders for more details.
func (*FilterService) UpdateFilter ¶ added in v0.2.0
func (s *FilterService) UpdateFilter(ctx context.Context, args *sync.FilterUpdateArgs) (*sync.SyncResponse, error)
UpdateFilter updates a filter.
See Update a filter for more details.
type Handler ¶
type Handler interface {
// SyncToken returns the sync token.
SyncToken(ctx context.Context) (*string, error)
// ResourceTypes returns the resource types to sync.
ResourceTypes(ctx context.Context) (*sync.ResourceTypes, error)
// HandleResponse handles the sync response.
HandleResponse(ctx context.Context, resp any) error
}
Handler defines the interface for handling sync messages.
type LabelService ¶ added in v0.2.0
type LabelService struct {
// contains filtered or unexported fields
}
LabelService provides methods for managing labels.
func NewLabelService ¶ added in v0.2.0
func NewLabelService(client *Client) *LabelService
func (*LabelService) AddLabel ¶ added in v0.2.0
func (s *LabelService) AddLabel(ctx context.Context, args *sync.LabelAddArgs) (*sync.SyncResponse, error)
AddLabel adds a new personal label.
See Add a personal label for more details.
func (*LabelService) DeleteLabel ¶ added in v0.2.0
func (s *LabelService) DeleteLabel(ctx context.Context, args *sync.LabelDeleteArgs) (*sync.SyncResponse, error)
DeleteLabel deletes a personal label.
See Delete a personal label for more details.
func (*LabelService) DeleteLabels ¶ added in v0.2.0
func (s *LabelService) DeleteLabels(ctx context.Context, args []*sync.LabelDeleteArgs) (*sync.SyncResponse, error)
DeleteLabels is a simple wrapper around LabelService.DeleteLabel that deletes multiple.
func (*LabelService) DeleteSharedLabel ¶ added in v0.2.0
func (s *LabelService) DeleteSharedLabel(ctx context.Context, args *sync.LabelDeleteSharedArgs) (*sync.SyncResponse, error)
DeleteSharedLabel deletes all occurrences of a shared label from any active tasks.
See Delete shared label occurrences for more details.
func (*LabelService) DeleteSharedLabels ¶ added in v0.2.0
func (s *LabelService) DeleteSharedLabels(ctx context.Context, args []*sync.LabelDeleteSharedArgs) (*sync.SyncResponse, error)
DeleteSharedLabels is a simple wrapper around LabelService.DeleteSharedLabel that deletes multiple.
func (*LabelService) RenameSharedLabel ¶ added in v0.2.0
func (s *LabelService) RenameSharedLabel(ctx context.Context, args *sync.LabelRenameSharedArgs) (*sync.SyncResponse, error)
RenameSharedLabel renames a shared label.
See Rename a shared label for more details.
func (*LabelService) ReorderLabels ¶ added in v0.2.0
func (s *LabelService) ReorderLabels(ctx context.Context, args *sync.LabelReorderArgs) (*sync.SyncResponse, error)
ReorderLabels updates multiple label orders.
See Update multiple label orders for more details.
func (*LabelService) UpdateLabel ¶ added in v0.2.0
func (s *LabelService) UpdateLabel(ctx context.Context, args *sync.LabelUpdateArgs) (*sync.SyncResponse, error)
UpdateLabel updates a personal label.
See Update a personal label for more details.
type LocationService ¶ added in v0.2.0
type LocationService struct {
// contains filtered or unexported fields
}
LocationService provides methods for managing locations.
func NewLocationService ¶ added in v0.2.0
func NewLocationService(client *Client) *LocationService
func (*LocationService) ClearLocations ¶ added in v0.2.0
func (s *LocationService) ClearLocations(ctx context.Context) (*sync.SyncResponse, error)
ClearLocations clears the locations list, which is used for location reminders.
See Clear locations for more details.
type ProjectService ¶ added in v0.2.0
type ProjectService struct {
// contains filtered or unexported fields
}
ProjectService provides methods to manage projects in Todoist.
func NewProjectService ¶ added in v0.2.0
func NewProjectService(client *Client) *ProjectService
func (*ProjectService) AddProject ¶ added in v0.2.0
func (s *ProjectService) AddProject(ctx context.Context, args *sync.ProjectAddArgs) (*sync.SyncResponse, error)
AddProject adds a new project.
See Add a project for more details.
func (*ProjectService) ArchiveProject ¶ added in v0.2.0
func (s *ProjectService) ArchiveProject(ctx context.Context, args *sync.ProjectArchiveArgs) (*sync.SyncResponse, error)
ArchiveProject archives a project and its descendants.
See Archive a project for more details.
func (*ProjectService) ArchiveProjects ¶ added in v0.2.0
func (s *ProjectService) ArchiveProjects(ctx context.Context, args []*sync.ProjectArchiveArgs) (*sync.SyncResponse, error)
ArchiveProjects is a simple wrapper around ProjectService.ArchiveProject that archives multiple.
func (*ProjectService) DeleteProject ¶ added in v0.2.0
func (s *ProjectService) DeleteProject(ctx context.Context, args *sync.ProjectDeleteArgs) (*sync.SyncResponse, error)
DeleteProject deletes an existing project and all its descendants. Workspace projects can only be deleted by ADMINs and it must be archived first.
See Delete a project for more details.
func (*ProjectService) DeleteProjects ¶ added in v0.2.0
func (s *ProjectService) DeleteProjects(ctx context.Context, args []*sync.ProjectDeleteArgs) (*sync.SyncResponse, error)
DeleteProjects is a simple wrapper around ProjectService.DeleteProject that deletes multiple.
func (*ProjectService) GetAllArchivedProjects ¶ added in v0.2.0
func (s *ProjectService) GetAllArchivedProjects(ctx context.Context, params *rest.ProjectGetArchivedParams) ([]*sync.Project, error)
GetAllArchivedProjects is a simple wrapper around ProjectService.GetAllArchivedProjects that gets all archived projects.
func (*ProjectService) GetArchivedProjects ¶ added in v0.2.0
func (s *ProjectService) GetArchivedProjects(ctx context.Context, params *rest.ProjectGetArchivedParams) (*rest.ProjectGetArchivedResponse, error)
GetArchivedProjects gets archived projects.
func (*ProjectService) LeaveProject ¶ added in v0.2.0
func (s *ProjectService) LeaveProject(ctx context.Context, args *sync.ProjectLeaveArgs) (*sync.SyncResponse, error)
LeaveProject is used to remove self from a workspace project. As this is a v2-only command, it will only accept v2 project id.
See Leave a project for more details.
func (*ProjectService) MoveProject ¶ added in v0.2.0
func (s *ProjectService) MoveProject(ctx context.Context, args *sync.ProjectMoveArgs) (*sync.SyncResponse, error)
MoveProject updates parent project relationships of the project.
See Move a project for more details.
func (*ProjectService) MoveProjectToPersonal ¶ added in v0.2.0
func (s *ProjectService) MoveProjectToPersonal(ctx context.Context, args *sync.ProjectMoveToPersonalArgs) (*sync.SyncResponse, error)
MoveProjectToPersonal moves a project inside a workspace back into a user's personal space.
Only the original creator of the workspace has permissions to do this, and only if they are still currently an admin of said workspace.
See Move a Project out of a Workspace for more details.
func (*ProjectService) MoveProjectToWorkspace ¶ added in v0.2.0
func (s *ProjectService) MoveProjectToWorkspace(ctx context.Context, args *sync.ProjectMoveToWorkspaceArgs) (*sync.SyncResponse, error)
MoveProjectToWorkspace moves a personal project into the target workspace.
- Moving a parent project to a workspace will also move all its child projects to that workspace.
- If no folder_id is supplied, child projects will be moved into a folder with the same name as the parent project being moved
- If a folder_id is supplied, the parent and child projects will be moved into that folder.
- At the moment, it is not possible to move a project to another workspace (changing its workspace_id), or to the user's personal workspace.
- Moving a project to a workspace affects all its collaborators. Collaborators who are not members of the target workspace will be added as guests, if guest members are allowed in the target workspace
See Move a Project to a Workspace for more details.
func (*ProjectService) ReorderProjects ¶ added in v0.2.0
func (s *ProjectService) ReorderProjects(ctx context.Context, args *sync.ProjectReorderArgs) (*sync.SyncResponse, error)
ReorderProjects updates child_order properties of projects in bulk.
See Reorder projects for more details.
func (*ProjectService) UnarchiveProject ¶ added in v0.2.0
func (s *ProjectService) UnarchiveProject(ctx context.Context, args *sync.ProjectUnarchiveArgs) (*sync.SyncResponse, error)
UnarchiveProject unarchives a project. No ancestors will be unarchived along with the unarchived project. Instead, the project is unarchived alone, loses any parent relationship (becomes a root project), and is placed at the end of the list of other root projects.
See Unarchive a project for more details.
func (*ProjectService) UnarchiveProjects ¶ added in v0.2.0
func (s *ProjectService) UnarchiveProjects(ctx context.Context, args []*sync.ProjectUnarchiveArgs) (*sync.SyncResponse, error)
UnarchiveProjects is a simple wrapper around ProjectService.UnarchiveProject that unarchives multiple.
func (*ProjectService) UpdateProject ¶ added in v0.2.0
func (s *ProjectService) UpdateProject(ctx context.Context, args *sync.ProjectUpdateArgs) (*sync.SyncResponse, error)
UpdateProject updates a project.
See Update a project for more details.
type ReminderService ¶ added in v0.2.0
type ReminderService struct {
// contains filtered or unexported fields
}
ReminderService provides methods for managing reminders.
func NewReminderService ¶ added in v0.2.0
func NewReminderService(client *Client) *ReminderService
func (*ReminderService) AddReminder ¶ added in v0.2.0
func (s *ReminderService) AddReminder(ctx context.Context, args *sync.ReminderAddArgs) (*sync.SyncResponse, error)
AddReminder adds a new reminder to the user account related to the API credentials.
See Add a reminder for more details.
func (*ReminderService) DeleteReminder ¶ added in v0.2.0
func (s *ReminderService) DeleteReminder(ctx context.Context, args *sync.ReminderDeleteArgs) (*sync.SyncResponse, error)
DeleteReminder deletes a reminder from the current user account.
See Delete a reminder for more details.
func (*ReminderService) DeleteReminders ¶ added in v0.2.0
func (s *ReminderService) DeleteReminders(ctx context.Context, args []*sync.ReminderDeleteArgs) (*sync.SyncResponse, error)
DeleteReminders is a simple wrapper around ReminderService.DeleteReminder that deletes multiple.
func (*ReminderService) UpdateReminder ¶ added in v0.2.0
func (s *ReminderService) UpdateReminder(ctx context.Context, args *sync.ReminderUpdateArgs) (*sync.SyncResponse, error)
UpdateReminder updates a reminder from the user account related to the API credentials.
See Update a reminder for more details.
type SectionService ¶ added in v0.2.0
type SectionService struct {
// contains filtered or unexported fields
}
SectionService provides methods for managing sections.
func NewSectionService ¶ added in v0.2.0
func NewSectionService(client *Client) *SectionService
func (*SectionService) AddSection ¶ added in v0.2.0
func (s *SectionService) AddSection(ctx context.Context, args *sync.SectionAddArgs) (*sync.SyncResponse, error)
AddSection adds a new section to a project.
See Add a section for more details.
func (*SectionService) ArchiveSection ¶ added in v0.2.0
func (s *SectionService) ArchiveSection(ctx context.Context, args *sync.SectionArchiveArgs) (*sync.SyncResponse, error)
ArchiveSection archives a section and all its child tasks.
See Archive a section for more details.
func (*SectionService) ArchiveSections ¶ added in v0.2.0
func (s *SectionService) ArchiveSections(ctx context.Context, args []*sync.SectionArchiveArgs) (*sync.SyncResponse, error)
ArchiveSections is a simple wrapper around SectionService.ArchiveSection that archives multiple.
func (*SectionService) DeleteSection ¶ added in v0.2.0
func (s *SectionService) DeleteSection(ctx context.Context, args *sync.SectionDeleteArgs) (*sync.SyncResponse, error)
DeleteSection deletes a section and all its child tasks.
See Delete a section for more details.
func (*SectionService) DeleteSections ¶ added in v0.2.0
func (s *SectionService) DeleteSections(ctx context.Context, args []*sync.SectionDeleteArgs) (*sync.SyncResponse, error)
DeleteSections is a simple wrapper around SectionService.DeleteSection that deletes multiple.
func (*SectionService) MoveSection ¶ added in v0.2.0
func (s *SectionService) MoveSection(ctx context.Context, args *sync.SectionMoveArgs) (*sync.SyncResponse, error)
MoveSection moves section to a different location.
See Move a section for more details.
func (*SectionService) ReorderSections ¶ added in v0.2.0
func (s *SectionService) ReorderSections(ctx context.Context, args *sync.SectionReorderArgs) (*sync.SyncResponse, error)
ReorderSections updates section_order properties of sections in bulk.
See Reorder sections for more details.
func (*SectionService) UnarchiveSection ¶ added in v0.2.0
func (s *SectionService) UnarchiveSection(ctx context.Context, args *sync.SectionUnarchiveArgs) (*sync.SyncResponse, error)
UnarchiveSection unarchives a section.
See Unarchive a section for more details.
func (*SectionService) UnarchiveSections ¶ added in v0.2.0
func (s *SectionService) UnarchiveSections(ctx context.Context, args []*sync.SectionUnarchiveArgs) (*sync.SyncResponse, error)
UnarchiveSections is a simple wrapper around SectionService.UnarchiveSection that unarchives multiple.
func (*SectionService) UpdateSection ¶ added in v0.2.0
func (s *SectionService) UpdateSection(ctx context.Context, args *sync.SectionUpdateArgs) (*sync.SyncResponse, error)
UpdateSection updates section attributes.
See Update a section for more details.
type TaskService ¶ added in v0.2.0
type TaskService struct {
// contains filtered or unexported fields
}
TaskService provides methods for managing tasks.
func NewTaskService ¶ added in v0.2.0
func NewTaskService(client *Client) *TaskService
func (*TaskService) AddTask ¶ added in v0.2.0
func (s *TaskService) AddTask(ctx context.Context, args *sync.TaskAddArgs) (*sync.SyncResponse, error)
AddTask adds a new task to a project.
See Add a task for more details.
func (*TaskService) CloseTask ¶ added in v0.2.0
func (s *TaskService) CloseTask(ctx context.Context, args *sync.TaskCloseArgs) (*sync.SyncResponse, error)
CloseTask is a simplified version of item_complete / item_update_date_complete. The command does exactly what official clients do when you close a task:
- regular tasks are completed and moved to the archive
- recurring tasks are scheduled to their next occurrence
See Close task for more details.
func (*TaskService) CloseTasks ¶ added in v0.2.0
func (s *TaskService) CloseTasks(ctx context.Context, args []*sync.TaskCloseArgs) (*sync.SyncResponse, error)
CloseTasks is a simple wrapper around TaskService.CloseTask that closes multiple tasks.
func (*TaskService) CompleteTask ¶ added in v0.2.0
func (s *TaskService) CompleteTask(ctx context.Context, args *sync.TaskCompleteArgs) (*sync.SyncResponse, error)
CompleteTask completes a task and its sub-tasks and moves them to the archive. See also [TaskCloseArgs] for a simplified version of the command.
See Complete task for more details.
func (*TaskService) CompleteTaskRecurring ¶ added in v0.2.0
func (s *TaskService) CompleteTaskRecurring(ctx context.Context, args *sync.TaskCompleteRecurringArgs) (*sync.SyncResponse, error)
CompleteTaskRecurring completes a recurring task. The reason why this is a special case is because we need to mark a recurring completion (and using item_update won't do this). See also [TaskCloseArgs] for a simplified version of the command.
See Complete a recurring task for more details.
func (*TaskService) DeleteTask ¶ added in v0.2.0
func (s *TaskService) DeleteTask(ctx context.Context, args *sync.TaskDeleteArgs) (*sync.SyncResponse, error)
DeleteTask deletes a task and all its sub-tasks.
See Delete a task for more details.
func (*TaskService) DeleteTasks ¶ added in v0.2.0
func (s *TaskService) DeleteTasks(ctx context.Context, args []*sync.TaskDeleteArgs) (*sync.SyncResponse, error)
DeleteTasks is a simple wrapper around TaskService.DeleteTask that deletes multiple.
func (*TaskService) GetAllCompletedTasksByCompletionDate ¶ added in v0.2.0
func (s *TaskService) GetAllCompletedTasksByCompletionDate(ctx context.Context, params *rest.TaskGetCompletedByCompletionDateParams) ([]*sync.Task, error)
GetAllCompletedTasksByCompletionDate is a simple wrapper around TaskService.GetAllCompletedTasksByCompletionDate that retrieves all.
func (*TaskService) GetAllCompletedTasksByDueDate ¶ added in v0.2.0
func (s *TaskService) GetAllCompletedTasksByDueDate(ctx context.Context, params *rest.TaskGetCompletedByDueDateParams) ([]*sync.Task, error)
GetAllCompletedTasksByDueDate is a simple wrapper around TaskService.GetCompletedTasksByDueDate that retrieves all.
func (*TaskService) GetCompletedTasksByCompletionDate ¶ added in v0.2.0
func (s *TaskService) GetCompletedTasksByCompletionDate(ctx context.Context, params *rest.TaskGetCompletedByCompletionDateParams) (*rest.TaskGetCompletedResponse, error)
GetCompletedTasksByCompletionDate retrieves a list of completed tasks strictly limited by the specified completion date range (up to 3 months).
It can retrieve completed items:
- From all the projects the user has joined in a workspace
- From all the projects of the user
- That match many supported filters
By default, the response is limited to a page containing a maximum of 50 items (configurable using limit).
Subsequent pages of results can be fetched by using the next_cursor value from the response as the cursor value for the next request.
See Tasks Completed By Completion Date for more details.
func (*TaskService) GetCompletedTasksByDueDate ¶ added in v0.2.0
func (s *TaskService) GetCompletedTasksByDueDate(ctx context.Context, params *rest.TaskGetCompletedByDueDateParams) (*rest.TaskGetCompletedResponse, error)
GetCompletedTasksByDueDate retrieves a list of completed items strictly limited by the specified due date range (up to 6 weeks).
It can retrieve completed items:
- From within a project, section, or parent item
- From all the projects the user has joined in a workspace
- From all the projects of the user
- That match many supported filters
By default, the response is limited to a page containing a maximum of 50 items (configurable using limit).
Subsequent pages of results can be fetched by using the next_cursor value from the response as the cursor value for the next request.
See Tasks Completed By Due Date for more details.
func (*TaskService) MoveTask ¶ added in v0.2.0
func (s *TaskService) MoveTask(ctx context.Context, args *sync.TaskMoveArgs) (*sync.SyncResponse, error)
MoveTask moves task to a different location. Only one of parent_id, section_id or project_id must be set.
See Move a task for more details.
func (*TaskService) QuickAddTask ¶ added in v0.2.0
func (s *TaskService) QuickAddTask(ctx context.Context, request *rest.TaskQuickAddRequest) (*sync.Task, error)
QuickAddTask adds a new task using the Quick Add implementation similar to that used in the official clients.
See Quick add a task for more details.
func (*TaskService) ReorderTasks ¶ added in v0.2.0
func (s *TaskService) ReorderTasks(ctx context.Context, args *sync.TaskReorderArgs) (*sync.SyncResponse, error)
ReorderTasks updates child_order properties of items in bulk.
See Reorder tasks for more details.
func (*TaskService) UncompleteTask ¶ added in v0.2.0
func (s *TaskService) UncompleteTask(ctx context.Context, args *sync.TaskUncompleteArgs) (*sync.SyncResponse, error)
UncompleteTask uncompletes and restores an archived item.
Any ancestor items or sections will also be reinstated. Items will have the checked value reset.
The reinstated items and sections will appear at the end of the list within their parent, after any previously active tasks.
See Uncomplete task for more details.
func (*TaskService) UncompleteTasks ¶ added in v0.2.0
func (s *TaskService) UncompleteTasks(ctx context.Context, args []*sync.TaskUncompleteArgs) (*sync.SyncResponse, error)
UncompleteTasks is a simple wrapper around TaskService.UncompleteTask that uncompletes multiple tasks.
func (*TaskService) UpdateTask ¶ added in v0.2.0
func (s *TaskService) UpdateTask(ctx context.Context, args *sync.TaskUpdateArgs) (*sync.SyncResponse, error)
UpdateTask updates task attributes. Please note that updating the parent, moving, completing or uncompleting tasks is not supported by item_update, more specific commands have to be used instead.
See Update a task for more details.
func (*TaskService) UpdateTaskDayOrders ¶ added in v0.2.0
func (s *TaskService) UpdateTaskDayOrders(ctx context.Context, args *sync.TaskUpdateDayOrdersArgs) (*sync.SyncResponse, error)
UpdateTaskDayOrders updates the day orders of multiple tasks at once.
See Update day orders for more details.
type UserService ¶ added in v0.2.0
type UserService struct {
// contains filtered or unexported fields
}
UserService provides methods for managing user information.
func NewUserService ¶ added in v0.2.0
func NewUserService(client *Client) *UserService