pullNotificationSet method

Future<NotificationSet> pullNotificationSet({
  1. String? requestMode,
  2. String? $fields,
})

Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request.

The notification set may be empty if no notification are pending. A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.

Request parameters:

requestMode - The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Specifying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications. Possible string values are:

  • "waitForNotifications" : Wait until one or more notifications are present.
  • "returnImmediately" : Returns immediately whether notifications are present or not.

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

Completes with a NotificationSet.

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<NotificationSet> pullNotificationSet({
  core.String? requestMode,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (requestMode != null) 'requestMode': [requestMode],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'androidenterprise/v1/enterprises/pullNotificationSet';

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