private async Task <GTaskList> PatchTaskListTask(GTaskList taskListToPatch) { GTaskList listToReturn = null; var requestUri = new Uri($"https://www.googleapis.com/tasks/v1/users/@me/lists/{taskListToPatch.Id}"); AddTokenInHeader(_client); var request = new HttpRequestMessage(HttpMethod.Patch, requestUri); var taskListJson = JsonConvert.SerializeObject(taskListToPatch); request.Content = new HttpStringContent(taskListJson, UnicodeEncoding.Utf8, JsonMediaType); var responseMessage = await _client.SendRequestAsync(request); if (responseMessage.IsSuccessStatusCode) { } return(listToReturn); }
internal async Task <GTaskList> GetTaskListTask(string taskListId) { GTaskList taskList = null; var requestUri = new Uri($"https://www.googleapis.com/tasks/v1/users/@me/lists/{taskListId}"); AddTokenInHeader(_client); var responseMessage = await _client.GetAsync(requestUri); if (responseMessage.IsSuccessStatusCode) { var responseJson = await responseMessage.Content.ReadAsStringAsync(); taskList = JsonConvert.DeserializeObject <GTaskList>(responseJson); } return(taskList); }
private async Task <GTaskList> InsertTaskListTask(GTaskList listToInsert) { GTaskList listToReturn = null; var requestUri = new Uri("https://www.googleapis.com/tasks/v1/users/@me/lists"); AddTokenInHeader(_client); var taskListJson = JsonConvert.SerializeObject(listToInsert); var content = new HttpStringContent(taskListJson, UnicodeEncoding.Utf8, JsonMediaType); var responseMessage = await _client.PostAsync(requestUri, content); if (responseMessage.IsSuccessStatusCode) { var responseJson = await responseMessage.Content.ReadAsStringAsync(); listToReturn = JsonConvert.DeserializeObject <GTaskList>(responseJson); } return(listToReturn); }
public IAsyncOperation <GTaskList> UpdateTaskListAsync(GTaskList listToUpdate) { return(UpdateTaskListTask(listToUpdate).AsAsyncOperation()); }
public IAsyncOperation <GTaskList> PatchTaskListAsync(GTaskList taskListToPatch) { return(PatchTaskListTask(taskListToPatch).AsAsyncOperation()); }
public IAsyncOperation <GTaskList> InsertTaskListAsync(GTaskList listToInsert) { return(InsertTaskListTask(listToInsert).AsAsyncOperation()); }