requestAccess method
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>);
}