list method
Retrieves volumes in a specific bookshelf for the specified user.
Request parameters:
userId - ID of user for whom to retrieve bookshelf volumes.
shelf - ID of bookshelf to retrieve volumes.
maxResults - Maximum number of results to return
showPreorders - Set to true to show pre-ordered books. Defaults to
false.
source - String to identify the originator of this request.
startIndex - Index of the first element to return (starts at 0)
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Volumes.
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<Volumes> list(
core.String userId,
core.String shelf, {
core.int? maxResults,
core.bool? showPreorders,
core.String? source,
core.int? startIndex,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'showPreorders': ?showPreorders == null ? null : ['${showPreorders}'],
'source': ?source == null ? null : [source],
'startIndex': ?startIndex == null ? null : ['${startIndex}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'books/v1/users/' +
commons.escapeVariable('$userId') +
'/bookshelves/' +
commons.escapeVariable('$shelf') +
'/volumes';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Volumes.fromJson(response_ as core.Map<core.String, core.dynamic>);
}