list method

Future<Volumes> list({
  1. List<String>? acquireMethod,
  2. String? country,
  3. String? locale,
  4. int? maxResults,
  5. List<String>? processingState,
  6. String? source,
  7. int? startIndex,
  8. String? $fields,
})

Return a list of books in My Library.

Request parameters:

acquireMethod - How the book was acquired

country - ISO-3166-1 code to override the IP-based location.

locale - ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations.

maxResults - Maximum number of results to return. Value must be between "0" and "100".

processingState - The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod.

source - String to identify the originator of this request.

startIndex - Index of the first result 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.List<core.String>? acquireMethod,
  core.String? country,
  core.String? locale,
  core.int? maxResults,
  core.List<core.String>? processingState,
  core.String? source,
  core.int? startIndex,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (acquireMethod != null) 'acquireMethod': acquireMethod,
    if (country != null) 'country': [country],
    if (locale != null) 'locale': [locale],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (processingState != null) 'processingState': processingState,
    if (source != null) 'source': [source],
    if (startIndex != null) 'startIndex': ['${startIndex}'],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'books/v1/volumes/mybooks';

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