get method

Future<Volume> get(
  1. String volumeId, {
  2. String? country,
  3. bool? includeNonComicsSeries,
  4. String? partner,
  5. String? projection,
  6. String? source,
  7. bool? userLibraryConsistentRead,
  8. String? $fields,
})

Gets volume information for a single volume.

Request parameters:

volumeId - ID of volume to retrieve.

country - ISO-3166-1 code to override the IP-based location.

includeNonComicsSeries - Set to true to include non-comics series. Defaults to false.

partner - Brand results for partner ID.

projection - Restrict information returned to a set of selected fields. Possible string values are:

  • "PROJECTION_UNDEFINED"
  • "FULL" : Includes all volume data.
  • "LITE" : Includes a subset of fields in volumeInfo and accessInfo.

source - string to identify the originator of this request.

userLibraryConsistentRead - null

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

Completes with a Volume.

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<Volume> get(
  core.String volumeId, {
  core.String? country,
  core.bool? includeNonComicsSeries,
  core.String? partner,
  core.String? projection,
  core.String? source,
  core.bool? userLibraryConsistentRead,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (country != null) 'country': [country],
    if (includeNonComicsSeries != null)
      'includeNonComicsSeries': ['${includeNonComicsSeries}'],
    if (partner != null) 'partner': [partner],
    if (projection != null) 'projection': [projection],
    if (source != null) 'source': [source],
    if (userLibraryConsistentRead != null)
      'user_library_consistent_read': ['${userLibraryConsistentRead}'],
    if ($fields != null) 'fields': [$fields],
  };

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

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