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>>{
if (country != null) 'country': [country],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (projection != null) 'projection': [projection],
if (q != null) 'q': [q],
if (showPreorders != null) 'showPreorders': ['${showPreorders}'],
if (source != null) 'source': [source],
if (startIndex != null) 'startIndex': ['${startIndex}'],
if ($fields != null) 'fields': [$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>);
}