/// <summary> /// /// </summary> /// <param name="label"></param> /// <param name="service"></param> /// <param name="labelId">The id of the label. Use if <paramref name="label"/> is new instance of <see cref="GmailLabel"/> or to change an another label.</param> /// <returns></returns> public static async Task <GmailLabel> EditLabelAsync(GmailLabel label, Service service, string labelId = null) { var id = labelId ?? label.Id; var requestList = service.GmailService.Users.Labels.Update(label, "me", id); return(await requestList.ExecuteAsync()); }
public static async Task <GmailLabel> CreateLabelAsync(string labelName, Service service) { var label = new GmailLabel { Name = labelName }; var request = service.GmailService.Users.Labels.Create(label, "me"); return(await request.ExecuteAsync()); }