public async Task DeleteAsync(int id, int revision, CancellationToken cancellationToken) { var parameters = new Dictionary <string, object> { { "revision", revision } }; await client.SendAsync(ServiceClient.BuildCommand("webhooks", id), parameters, null, HttpMethod.Delete, cancellationToken).ConfigureAwait(false); }
private async Task UploadFinishedAsync(uint uploadId, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "state", "finished" } }; await client.PatchAsync <ResourcePart>(ServiceClient.BuildCommand("uploads", uploadId), null, requestContent, cancellationToken).ConfigureAwait(false); }
public Task DeleteAsync(uint id, int revision, CancellationToken cancellationToken) { var parameters = new Dictionary <string, object> { { "revision", revision } }; return(client.SendAsync(ServiceClient.BuildCommand("tasks", id), parameters, null, HttpMethod.Delete, cancellationToken)); }
public async Task <Reminder> UpdateAsync(int id, int revision, DateTime date, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "date", date } }; return(await client.PatchAsync <Reminder>(ServiceClient.BuildCommand("reminders", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public async Task <Membership> UpdateAsync(int id, int revision, MembershipState state, bool muted, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "state", state }, { "muted", muted } }; return(await client.PatchAsync <Membership>(ServiceClient.BuildCommand("memberships", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public Task <Note> UpdateAsync(uint id, int revision, string content, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "content", content } }; return(client.PatchAsync <Note>(ServiceClient.BuildCommand("notes", id), null, requestContent, cancellationToken)); }
public async Task <Comment> UpdateAsync(int id, int revision, string comment, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "text", comment } }; return(await client.PatchAsync <Comment>(ServiceClient.BuildCommand("task_comments", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public async Task <SubTask> UpdateAsync(int id, int revision, string name, bool?completed, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "title", name }, { "completed", completed } }; return(await client.PatchAsync <SubTask>(ServiceClient.BuildCommand("subtasks", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public async Task <Positions> UpdatePositionAsync(int id, int revision, IEnumerable <int> positions, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "values", positions } }; return(await client.PatchAsync <Positions>(ServiceClient.BuildCommand("subtask_positions", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public Task <List> UpdateAsync(uint id, int revision, string name, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "title", name } }; return(client.PatchAsync <List>(ServiceClient.BuildCommand("lists", id), null, requestContent, cancellationToken)); }
public async Task <bool> ChangeStateAsync(int id, int revision, bool makePublic, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "public", makePublic } }; var response = await client.PatchAsync(ServiceClient.BuildCommand("lists", id), null, requestContent, cancellationToken).ConfigureAwait(false); return((await DeserializeDynamic(response)).Value <bool>("public")); }
public Task <bool> ChangeStateAsync(uint id, int revision, bool makePublic, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "public", makePublic } }; return(client.PatchDynamicAsync(ServiceClient.BuildCommand("lists", id), null, requestContent, cancellationToken) .ContinueWith(t => (bool)t.Result.Value <bool>("public"), TaskContinuationOptions.OnlyOnRanToCompletion)); }
private async Task <JObject> UploadFinishedAsync(int uploadId, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "state", "finished" } }; var response = await client.PatchAsync(ServiceClient.BuildCommand("uploads", uploadId), null, requestContent, cancellationToken).ConfigureAwait(false); return(await DeserializeDynamic(response)); }
public Task <IEnumerable <List> > GetAsync(uint?id, CancellationToken cancellationToken) { if (id.HasValue) { return(client.GetAsync <List>(ServiceClient.BuildCommand("lists", id), null, cancellationToken) .ContinueWith <IEnumerable <List> >(t => new List <List> { t.Result }, TaskContinuationOptions.OnlyOnRanToCompletion)); } return(client.GetAsync <IEnumerable <List> >("lists", null, cancellationToken)); }
public Task <MainTask> UpdateAsync(uint id, int revision, uint?listId, string name, uint?assigneeId, bool?completed, RecurrenceType?recurrenceType, int?recurrenceCount, DateTime?dueDate, bool?starred, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "list_id", listId }, { "title", name }, { "assignee_id", assigneeId }, { "recurrence_type", recurrenceType }, { "recurrence_count", recurrenceCount }, { "due_date", dueDate }, { "starred", starred } }; requestContent.Add("remove", requestContent.Where(s => s.Value == null).Select(s => s.Key).ToArray()); requestContent.Add("completed", completed); // completed attribute cannot be removed if (recurrenceType.HasValue && !recurrenceCount.HasValue) { throw new ArgumentNullException("recurrenceCount"); } return(client.PatchAsync <MainTask>(ServiceClient.BuildCommand("tasks", id), null, requestContent, cancellationToken)); }
public async Task <MainTask> UpdateAsync(int id, int revision, string name, int?assigneeId, bool?completed, RecurrenceType?recurrenceType, int?recurrenceCount, DateTime?dueDate, bool?starred, CancellationToken cancellationToken) { var requestContent = new Dictionary <string, object> { { "revision", revision }, { "title", name }, { "assignee_id", assigneeId }, { "completed", completed }, { "recurrence_type", recurrenceType }, { "due_date", dueDate }, { "starred", starred } }; requestContent.Add("remove", requestContent.Where(s => s.Value == null).ToArray()); if (recurrenceType.HasValue) { if (!recurrenceCount.HasValue) { throw new ArgumentNullException("recurrenceCount"); } requestContent.Add("recurrence_count", recurrenceCount); } return(await client.PatchAsync <MainTask>(ServiceClient.BuildCommand("tasks", id), null, requestContent, cancellationToken).ConfigureAwait(false)); }
public Task <Positions> GetPositionAsync(uint id, CancellationToken cancellationToken) { return(client.GetAsync <Positions>(ServiceClient.BuildCommand("subtask_positions", id), null, cancellationToken)); }
public Task <IEnumerable <Membership> > GetByListAsync(uint?listId, CancellationToken cancellationToken) { return(client.GetAsync <IEnumerable <Membership> >(ServiceClient.BuildCommand("memberships", listId), null, cancellationToken)); }
public Task <Note> GetAsync(uint id, CancellationToken cancellationToken) { return(client.GetAsync <Note>(ServiceClient.BuildCommand("notes", id), null, cancellationToken)); }
public async Task <Positions> GetPositionAsync(int id, CancellationToken cancellationToken) { return(await client.GetAsync <Positions>(ServiceClient.BuildCommand("subtask_positions", id), null, cancellationToken).ConfigureAwait(false)); }
public async Task <MainTask> GetAsync(int id, CancellationToken cancellationToken) { return(await client.GetAsync <MainTask>(ServiceClient.BuildCommand("tasks", id), null, cancellationToken).ConfigureAwait(false)); }
public Task <Reminder> GetAsync(uint id, CancellationToken cancellationToken) { return(client.GetAsync <Reminder>(ServiceClient.BuildCommand("reminders", id), null, cancellationToken)); }
public Task <Comment> GetAsync(uint id, CancellationToken cancellationToken) { return(client.GetAsync <Comment>(ServiceClient.BuildCommand("task_comments", id), null, cancellationToken)); }
public async Task <IEnumerable <Membership> > GetAsync(int?listId, CancellationToken cancellationToken) { return(await client.GetAsync <IEnumerable <Membership> >(ServiceClient.BuildCommand("memberships", listId), null, cancellationToken).ConfigureAwait(false)); }
public Task <SubTask> GetAsync(uint id, CancellationToken cancellationToken) { return(client.GetAsync <SubTask>(ServiceClient.BuildCommand("subtasks", id), null, cancellationToken)); }
public async Task <Reminder> GetAsync(uint id, CancellationToken cancellationToken) { return(await client.GetAsync <Reminder>(ServiceClient.BuildCommand("reminders", id), null, cancellationToken).ConfigureAwait(false)); }