list method
Returns the calendars on the user's calendar list.
Request parameters:
maxResults
- Maximum number of entries returned on one result page. By
default the value is 100 entries. The page size can never be larger than
250 entries. Optional.
minAccessRole
- The minimum access role for the user in the returned
entries. Optional. The default is no restriction.
Possible string values are:
- "freeBusyReader" : The user can read free/busy information.
- "owner" : The user can read and modify events and access control lists.
- "reader" : The user can read events that are not private.
- "writer" : The user can read and modify events.
pageToken
- Token specifying which result page to return. Optional.
showDeleted
- Whether to include deleted calendar list entries in the
result. Optional. The default is False.
showHidden
- Whether to show hidden entries. Optional. The default is
False.
syncToken
- Token obtained from the nextSyncToken field returned on the
last page of results from the previous list request. It makes the result
of this list request contain only entries that have changed since then. If
only read-only fields such as calendar properties or ACLs have changed,
the entry won't be returned. All entries deleted and hidden since the
previous list request will always be in the result set and it is not
allowed to set showDeleted neither showHidden to False.
To ensure client state consistency minAccessRole query parameter cannot be
specified together with nextSyncToken.
If the syncToken expires, the server will respond with a 410 GONE response
code and the client should clear its storage and perform a full
synchronization without any syncToken.
Learn more about incremental synchronization.
Optional. The default is to return all entries.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a CalendarList.
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<CalendarList> list({
core.int? maxResults,
core.String? minAccessRole,
core.String? pageToken,
core.bool? showDeleted,
core.bool? showHidden,
core.String? syncToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (minAccessRole != null) 'minAccessRole': [minAccessRole],
if (pageToken != null) 'pageToken': [pageToken],
if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
if (showHidden != null) 'showHidden': ['${showHidden}'],
if (syncToken != null) 'syncToken': [syncToken],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'users/me/calendarList';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return CalendarList.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}