pub struct Service { /* private fields */ }Expand description
Service is an abstraction over google tasks.
Implementations§
Source§impl Service
impl Service
Sourcepub fn with_auth<P>(token_provider: P) -> Result<Self, TasksError>where
P: TokenProvider,
pub fn with_auth<P>(token_provider: P) -> Result<Self, TasksError>where
P: TokenProvider,
Creates a new service with the given token provider.
Sourcepub fn with_token(access_token: &str) -> Result<Self, TasksError>
pub fn with_token(access_token: &str) -> Result<Self, TasksError>
Creates a new service with the given access token.
Sourcepub fn new(access_token: &str) -> Result<Self, TasksError>
👎Deprecated since 0.5.0: Please use Service::with_token instead
pub fn new(access_token: &str) -> Result<Self, TasksError>
Service::with_token insteadCreates a new service with the given access token.
Sourcepub async fn list_tasklists(
&self,
opt: Option<TasklistsOptions>,
) -> Result<Tasklists, TasksError>
pub async fn list_tasklists( &self, opt: Option<TasklistsOptions>, ) -> Result<Tasklists, TasksError>
Returns all the authenticated user’s task lists.
Sourcepub async fn get_tasklist(&self, id: &str) -> Result<Tasklist, TasksError>
pub async fn get_tasklist(&self, id: &str) -> Result<Tasklist, TasksError>
Returns the authenticated user’s specified task list.
Sourcepub async fn insert_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>
pub async fn insert_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>
Creates a new task list and adds it to the authenticated user’s task lists.
Sourcepub async fn update_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>
pub async fn update_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>
Updates the authenticated user’s specified task list.
Sourcepub async fn delete_tasklist(&self, id: &str) -> Result<(), TasksError>
pub async fn delete_tasklist(&self, id: &str) -> Result<(), TasksError>
Deletes the authenticated user’s specified task list.
Sourcepub async fn patch_tasklist(
&self,
tasklist_id: &str,
v: Tasklist,
) -> Result<Tasklist, TasksError>
pub async fn patch_tasklist( &self, tasklist_id: &str, v: Tasklist, ) -> Result<Tasklist, TasksError>
Updates the authenticated user’s specified task list. This method supports patch semantics.
Sourcepub async fn list_tasks(
&self,
tasklist_id: &str,
opt: Option<TaskOptions>,
etag: Option<String>,
) -> Result<Option<Tasks>, TasksError>
pub async fn list_tasks( &self, tasklist_id: &str, opt: Option<TaskOptions>, etag: Option<String>, ) -> Result<Option<Tasks>, TasksError>
Returns all tasks in the specified task list.
Sourcepub async fn get_task(
&self,
tasklist_id: &str,
task_id: &str,
etag: Option<String>,
) -> Result<Option<Task>, TasksError>
pub async fn get_task( &self, tasklist_id: &str, task_id: &str, etag: Option<String>, ) -> Result<Option<Task>, TasksError>
Returns the specified task.
Sourcepub async fn insert_task(
&self,
tasklist_id: &str,
v: Task,
opts: Option<TaskInsertOptions>,
) -> Result<Task, TasksError>
pub async fn insert_task( &self, tasklist_id: &str, v: Task, opts: Option<TaskInsertOptions>, ) -> Result<Task, TasksError>
Creates a new task on the specified task list.
Sourcepub async fn update_task(
&self,
tasklist_id: &str,
v: Task,
) -> Result<Task, TasksError>
pub async fn update_task( &self, tasklist_id: &str, v: Task, ) -> Result<Task, TasksError>
Updates the specified task.
Sourcepub async fn delete_task(
&self,
tasklist_id: &str,
task_id: &str,
) -> Result<(), TasksError>
pub async fn delete_task( &self, tasklist_id: &str, task_id: &str, ) -> Result<(), TasksError>
Deletes the specified task from the task list.
Sourcepub async fn clear_tasks(&self, tasklist_id: &str) -> Result<(), TasksError>
pub async fn clear_tasks(&self, tasklist_id: &str) -> Result<(), TasksError>
Clears all completed tasks from the specified task list. The affected tasks will be marked as ‘hidden’ and no longer be returned by default when retrieving all tasks for a task list.
Sourcepub async fn move_task(
&self,
tasklist_id: &str,
task_id: &str,
opts: TaskInsertOptions,
) -> Result<Task, TasksError>
pub async fn move_task( &self, tasklist_id: &str, task_id: &str, opts: TaskInsertOptions, ) -> Result<Task, TasksError>
Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.