quickAdd method

Future<Event> quickAdd(
  1. String calendarId,
  2. String text, {
  3. bool? sendNotifications,
  4. String? sendUpdates,
  5. String? $fields,
})

Creates an event based on a simple text string.

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.

text - The text describing the event to be created.

sendNotifications - Deprecated. Please use sendUpdates instead.

Whether to send notifications about the creation 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 creation of the new 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 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> quickAdd(
  core.String calendarId,
  core.String text, {
  core.bool? sendNotifications,
  core.String? sendUpdates,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'text': [text],
    if (sendNotifications != null)
      'sendNotifications': ['${sendNotifications}'],
    if (sendUpdates != null) 'sendUpdates': [sendUpdates],
    if ($fields != null) 'fields': [$fields],
  };

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

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