list method
List all media items from a user's Google Photos library.
Request parameters:
pageSize
- Maximum number of media items to return in the response.
Fewer media items might be returned than the specified number. The default
pageSize
is 25, the maximum is 100.
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 listMediaItems
request.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListMediaItemsResponse.
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<ListMediaItemsResponse> list({
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/mediaItems';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListMediaItemsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}