requestAccess method

Future<RequestAccessData> requestAccess(
  1. String cpksver,
  2. String nonce,
  3. String source,
  4. String volumeId, {
  5. String? licenseTypes,
  6. String? locale,
  7. String? $fields,
})

Request concurrent and download access restrictions.

Request parameters:

cpksver - The device/version ID from which to request the restrictions.

nonce - The client nonce value.

source - String to identify the originator of this request.

volumeId - The volume to request concurrent/download restrictions for.

licenseTypes - The type of access license to request. If not specified, the default is BOTH. Possible string values are:

  • "LICENSE_TYPES_UNDEFINED"
  • "BOTH" : Both concurrent and download licenses.
  • "CONCURRENT" : Concurrent access license.
  • "DOWNLOAD" : Offline download access license.

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

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

Completes with a RequestAccessData.

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

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

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