list method

Future<ListSharedAlbumsResponse> list({
  1. bool? excludeNonAppCreatedData,
  2. int? pageSize,
  3. String? pageToken,
  4. String? $fields,
})

Lists all shared albums available in the Sharing tab of the user's 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 listSharedAlbums request.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListSharedAlbumsResponse.

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<ListSharedAlbumsResponse> 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/sharedAlbums';

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