delete method

Future<void> delete(
  1. String calendarId,
  2. String eventId, {
  3. bool? sendNotifications,
  4. String? sendUpdates,
  5. String? $fields,
})

Deletes an event.

Request parameters:

calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.

eventId - Event identifier.

sendNotifications - Deprecated. Please use sendUpdates instead.

Whether to send notifications about the deletion of the event. Note that some emails might still be sent even if you set the value to false. The default is false.

sendUpdates - Guests who should receive notifications about the deletion of the event. Possible string values are:

  • "all" : Notifications are sent to all guests.
  • "externalOnly" : Notifications are sent to non-Google Calendar guests only.
  • "none" : No notifications are sent. For calendar migration tasks, consider using the Events.import method instead.

$fields - Selector specifying which fields to include in a partial response.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<void> delete(
  core.String calendarId,
  core.String eventId, {
  core.bool? sendNotifications,
  core.String? sendUpdates,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (sendNotifications != null)
      'sendNotifications': ['${sendNotifications}'],
    if (sendUpdates != null) 'sendUpdates': [sendUpdates],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'calendars/' +
      commons.escapeVariable('$calendarId') +
      '/events/' +
      commons.escapeVariable('$eventId');

  await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}