listCategories method

Future<Category> listCategories({
  1. String? locale,
  2. String? $fields,
})

List categories for onboarding experience.

Request parameters:

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

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

Completes with a Category.

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

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

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