update method
Updates an event.
request
- The metadata request object.
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.
alwaysIncludeEmail
- Deprecated and ignored. A value will always be
returned in the email field for the organizer, creator and attendees, even
if no real email address is available (i.e. a generated, non-working value
will be provided).
conferenceDataVersion
- Version number of conference data supported by
the API client. Version 0 assumes no conference data support and ignores
conference data in the event's body. Version 1 enables support for copying
of ConferenceData as well as for creating new conferences using the
createRequest field of conferenceData. The default is 0.
Value must be between "0" and "1".
maxAttendees
- The maximum number of attendees to include in the
response. If there are more than the specified number of attendees, only
the participant is returned. Optional.
sendNotifications
- Deprecated. Please use sendUpdates instead.
Whether to send notifications about the event update (for example, description changes, etc.). 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 event
update (for example, title changes, etc.).
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.
supportsAttachments
- Whether API client performing operation supports
event attachments. Optional. The default is False.
$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> update(
Event request,
core.String calendarId,
core.String eventId, {
core.bool? alwaysIncludeEmail,
core.int? conferenceDataVersion,
core.int? maxAttendees,
core.bool? sendNotifications,
core.String? sendUpdates,
core.bool? supportsAttachments,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (alwaysIncludeEmail != null)
'alwaysIncludeEmail': ['${alwaysIncludeEmail}'],
if (conferenceDataVersion != null)
'conferenceDataVersion': ['${conferenceDataVersion}'],
if (maxAttendees != null) 'maxAttendees': ['${maxAttendees}'],
if (sendNotifications != null)
'sendNotifications': ['${sendNotifications}'],
if (sendUpdates != null) 'sendUpdates': [sendUpdates],
if (supportsAttachments != null)
'supportsAttachments': ['${supportsAttachments}'],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'calendars/' +
commons.escapeVariable('$calendarId') +
'/events/' +
commons.escapeVariable('$eventId');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Event.fromJson(response_ as core.Map<core.String, core.dynamic>);
}