list method
Lists all albums shown to a user in the Albums tab of the Google Photos app.
Request parameters:
excludeNonAppCreatedData
- If set, the results exclude media items that
were not created by this app. Defaults to false (all albums are returned).
This field is ignored if the photoslibrary.readonly.appcreateddata scope
is used.
pageSize
- Maximum number of albums to return in the response. Fewer
albums might be returned than the specified number. The default pageSize
is 20, the maximum is 50.
pageToken
- A continuation token to get the next page of the results.
Adding this to the request returns the rows after the pageToken
. The
pageToken
should be the value returned in the nextPageToken
parameter
in the response to the listAlbums
request.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListAlbumsResponse.
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<ListAlbumsResponse> list({
core.bool? excludeNonAppCreatedData,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (excludeNonAppCreatedData != null)
'excludeNonAppCreatedData': ['${excludeNonAppCreatedData}'],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/albums';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListAlbumsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}