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.
- "writerWithoutPrivateAccess" : The user can read and modify events that aren't private. The user can read free/busy information about private events. The user can't modify private 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.
showOwnOrganizationOnly - Whether to show only entries for calendars
from the organization. This parameter is only applicable to Google
Workspace users. 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 and
showOwnOrganizationOnly query parameters 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.bool? showOwnOrganizationOnly,
core.String? syncToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'minAccessRole': ?minAccessRole == null ? null : [minAccessRole],
'pageToken': ?pageToken == null ? null : [pageToken],
'showDeleted': ?showDeleted == null ? null : ['${showDeleted}'],
'showHidden': ?showHidden == null ? null : ['${showHidden}'],
'showOwnOrganizationOnly': ?showOwnOrganizationOnly == null
? null
: ['${showOwnOrganizationOnly}'],
'syncToken': ?syncToken == null ? null : [syncToken],
'fields': ?$fields == null ? null : [$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>,
);
}