list method

Future<Volumes> list({
  1. String? locale,
  2. String? maxAllowedMaturityRating,
  3. String? source,
  4. String? $fields,
})

Return a list of recommended books for the current user.

Request parameters:

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

maxAllowedMaturityRating - The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. Possible string values are:

  • "MAX_ALLOWED_MATURITY_RATING_UNDEFINED"
  • "MATURE" : Show books which are rated mature or lower.
  • "not-mature" : Show books which are rated not mature.

source - String to identify the originator of this request.

$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? locale,
  core.String? maxAllowedMaturityRating,
  core.String? source,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (locale != null) 'locale': [locale],
    if (maxAllowedMaturityRating != null)
      'maxAllowedMaturityRating': [maxAllowedMaturityRating],
    if (source != null) 'source': [source],
    if ($fields != null) 'fields': [$fields],
  };

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

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