public async Task InsertEventsAsync(string calendar, IEnumerable <Event> events) { var batch = new UnlimitedBatch(Service); foreach (var @event in events) { batch.Queue(Service.Events.Insert(@event, calendar)); } await batch.ExecuteAsync(); }
private async Task DeleteEventsAsync(IEnumerable <Event> events) { var deleteBatch = new UnlimitedBatch(Service); foreach (var ev in events) { deleteBatch.Queue(Service.Events.Delete(calendarId, ev.Id)); } await deleteBatch.ExecuteWithRetryAsync(); }
public async Task DeleteEventsAsync(string calendar, IEnumerable <string> events) { var batch = new UnlimitedBatch(Service); foreach (var @event in events) { batch.Queue(Service.Events.Delete(calendar, @event)); } await batch.ExecuteAsync(); }
private async Task AddEventsAsync(string calendarId, IEnumerable <Event> events) { var insertBatch = new UnlimitedBatch(Service); foreach (var ev in events) { var insertRequest = Service.Events.Insert(ev, calendarId); insertRequest.Fields = "id"; insertBatch.Queue(insertRequest); } await insertBatch.ExecuteWithRetryAsync(); }
private async Task AddEventsAsync(IEnumerable <Event> events) { var insertBatch = new UnlimitedBatch(Service); foreach (var ev in events) { ev.ColorId = eventColor; ev.ExtendedProperties = eventProperties; var insertRequest = Service.Events.Insert(ev, calendarId); insertRequest.Fields = "id"; insertBatch.Queue(insertRequest); } await insertBatch.ExecuteWithRetryAsync(); }