addVolume method
Adds a volume to a bookshelf.
Request parameters:
shelf
- ID of bookshelf to which to add a volume.
volumeId
- ID of volume to add.
reason
- The reason for which the book is added to the library.
Possible string values are:
- "REASON_UNDEFINED"
- "IOS_PREX" : Volumes added from the PREX flow on iOS.
- "IOS_SEARCH" : Volumes added from the Search flow on iOS.
- "ONBOARDING" : Volumes added from the Onboarding flow.
source
- String to identify the originator of this request.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Empty.
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<Empty> addVolume(
core.String shelf,
core.String volumeId, {
core.String? reason,
core.String? source,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'volumeId': [volumeId],
if (reason != null) 'reason': [reason],
if (source != null) 'source': [source],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'books/v1/mylibrary/bookshelves/' +
commons.escapeVariable('$shelf') +
'/addVolume';
final response_ = await _requester.request(
url_,
'POST',
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}