rate method

Future<BooksVolumesRecommendedRateResponse> rate(
  1. String rating,
  2. String volumeId, {
  3. String? locale,
  4. String? source,
  5. String? $fields,
})

Rate a recommended book for the current user.

Request parameters:

rating - Rating to be given to the volume. Possible string values are:

  • "RATING_UNDEFINED"
  • "HAVE_IT" : Rating indicating a dismissal due to ownership.
  • "NOT_INTERESTED" : Rating indicating a negative dismissal of a volume.

volumeId - ID of the source volume.

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

source - String to identify the originator of this request.

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

Completes with a BooksVolumesRecommendedRateResponse.

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

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

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