instances method
Returns instances of the specified recurring 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
- Recurring 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.
maxResults
- Maximum number of events returned on one result page. By
default the value is 250 events. The page size can never be larger than
2500 events. Optional.
originalStart
- The original start time of the instance in the result.
Optional.
pageToken
- Token specifying which result page to return. Optional.
showDeleted
- Whether to include deleted events (with status equals
"cancelled") in the result. Cancelled instances of recurring events will
still be included if singleEvents is False. Optional. The default is
False.
timeMax
- Upper bound (exclusive) for an event's start time to filter
by. Optional. The default is not to filter by start time. Must be an
RFC3339 timestamp with mandatory time zone offset.
timeMin
- Lower bound (inclusive) for an event's end time to filter by.
Optional. The default is not to filter by end time. Must be an RFC3339
timestamp with mandatory time zone offset.
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 Events.
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<Events> instances(
core.String calendarId,
core.String eventId, {
core.bool? alwaysIncludeEmail,
core.int? maxAttendees,
core.int? maxResults,
core.String? originalStart,
core.String? pageToken,
core.bool? showDeleted,
core.DateTime? timeMax,
core.DateTime? timeMin,
core.String? timeZone,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (alwaysIncludeEmail != null)
'alwaysIncludeEmail': ['${alwaysIncludeEmail}'],
if (maxAttendees != null) 'maxAttendees': ['${maxAttendees}'],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (originalStart != null) 'originalStart': [originalStart],
if (pageToken != null) 'pageToken': [pageToken],
if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
if (timeMax != null) 'timeMax': [timeMax.toUtc().toIso8601String()],
if (timeMin != null) 'timeMin': [timeMin.toUtc().toIso8601String()],
if (timeZone != null) 'timeZone': [timeZone],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'calendars/' +
commons.escapeVariable('$calendarId') +
'/events/' +
commons.escapeVariable('$eventId') +
'/instances';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Events.fromJson(response_ as core.Map<core.String, core.dynamic>);
}