move method

Future<Event> move(
  1. String calendarId,
  2. String eventId,
  3. String destination, {
  4. bool? sendNotifications,
  5. String? sendUpdates,
  6. String? $fields,
})

Moves an event to another calendar, i.e. changes an event's organizer.

Note that only default events can be moved; outOfOffice, focusTime and workingLocation events cannot be moved.

Request parameters:

calendarId - Calendar identifier of the source calendar where the event currently is on.

eventId - Event identifier.

destination - Calendar identifier of the target calendar where the event is to be moved to.

sendNotifications - Deprecated. Please use sendUpdates instead.

Whether to send notifications about the change of the event's organizer. 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 change of the event's organizer. 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 Event.

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<Event> move(
  core.String calendarId,
  core.String eventId,
  core.String destination, {
  core.bool? sendNotifications,
  core.String? sendUpdates,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'destination': [destination],
    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') +
      '/move';

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
  );
  return Event.fromJson(response_ as core.Map<core.String, core.dynamic>);
}