releaseDownloadAccess method

Future<DownloadAccesses> releaseDownloadAccess(
  1. String cpksver,
  2. List<String> volumeIds, {
  3. String? locale,
  4. String? source,
  5. String? $fields,
})

Release downloaded content access restriction.

Request parameters:

cpksver - The device/version ID from which to release the restriction.

volumeIds - The volume(s) to release restrictions for.

locale - ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.

source - String to identify the originator of this request.

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

Completes with a DownloadAccesses.

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<DownloadAccesses> releaseDownloadAccess(
  core.String cpksver,
  core.List<core.String> volumeIds, {
  core.String? locale,
  core.String? source,
  core.String? $fields,
}) async {
  if (volumeIds.isEmpty) {
    throw core.ArgumentError('Parameter volumeIds cannot be empty.');
  }
  final queryParams_ = <core.String, core.List<core.String>>{
    'cpksver': [cpksver],
    'volumeIds': volumeIds,
    if (locale != null) 'locale': [locale],
    if (source != null) 'source': [source],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'books/v1/myconfig/releaseDownloadAccess';

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