listCategoryVolumes method

Future<Volume2> listCategoryVolumes({
  1. List<String>? categoryId,
  2. String? locale,
  3. String? maxAllowedMaturityRating,
  4. int? pageSize,
  5. String? pageToken,
  6. String? $fields,
})

List available volumes under categories for onboarding experience.

Request parameters:

categoryId - List of category ids requested.

locale - ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.

maxAllowedMaturityRating - The maximum allowed maturity rating of returned volumes. 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.

pageSize - Number of maximum results per page to be included in the response.

pageToken - The value of the nextToken from the previous page.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Volume2.

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

  const url_ = 'books/v1/onboarding/listCategoryVolumes';

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