list method
Gets volume information for volumes on a bookshelf.
Request parameters:
shelf - The bookshelf ID or name retrieve volumes for.
country - ISO-3166-1 code to override the IP-based location.
maxResults - Maximum number of results to return
projection - Restrict information returned to a set of selected fields.
Possible string values are:
- "PROJECTION_UNDEFINED"
- "FULL" : Includes all volume data.
- "LITE" : Includes a subset of fields in volumeInfo and accessInfo.
q - Full-text search query string in this bookshelf.
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 shelf, {
core.String? country,
core.int? maxResults,
core.String? projection,
core.String? q,
core.bool? showPreorders,
core.String? source,
core.int? startIndex,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'country': ?country == null ? null : [country],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'projection': ?projection == null ? null : [projection],
'q': ?q == null ? null : [q],
'showPreorders': ?showPreorders == null ? null : ['${showPreorders}'],
'source': ?source == null ? null : [source],
'startIndex': ?startIndex == null ? null : ['${startIndex}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'books/v1/mylibrary/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>);
}