list method

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

Return a list of associated books.

Request parameters:

volumeId - ID of the source volume.

association - Association type. Possible string values are:

  • "ASSOCIATION_UNDEFINED"
  • "end-of-sample" : Recommendations for display end-of-sample.
  • "end-of-volume" : Recommendations for display end-of-volume.
  • "related-for-play" : Related volumes for Play Store.

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

  final url_ = 'books/v1/volumes/' +
      commons.escapeVariable('$volumeId') +
      '/associated';

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