get method

Future<Event> get(
  1. String calendarId,
  2. String eventId, {
  3. bool? alwaysIncludeEmail,
  4. int? maxAttendees,
  5. String? timeZone,
  6. String? $fields,
})

Returns an event based on its Google Calendar ID.

To retrieve an event using its iCalendar ID, call the events.list method using the iCalUID parameter.

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).

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.

timeZone - Time zone used in the response. Optional. The default is the time zone of the calendar.

$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> get(
  core.String calendarId,
  core.String eventId, {
  core.bool? alwaysIncludeEmail,
  core.int? maxAttendees,
  core.String? timeZone,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'alwaysIncludeEmail': ?alwaysIncludeEmail == null
        ? null
        : ['${alwaysIncludeEmail}'],
    'maxAttendees': ?maxAttendees == null ? null : ['${maxAttendees}'],
    'timeZone': ?timeZone == null ? null : [timeZone],
    'fields': ?$fields == null ? null : [$fields],
  };

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

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