get method
Returns notification details for a given notification id.
Request parameters:
notificationId
- String to identify the notification.
locale
- ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.
Used for generating notification title and body.
source
- String to identify the originator of this request.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Notification.
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<Notification> get(
core.String notificationId, {
core.String? locale,
core.String? source,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'notification_id': [notificationId],
if (locale != null) 'locale': [locale],
if (source != null) 'source': [source],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'books/v1/notification/get';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Notification.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}