list method

Future<GoogleCloudAdvisorynotificationsV1ListNotificationsResponse> list(
  1. String parent, {
  2. String? languageCode,
  3. int? pageSize,
  4. String? pageToken,
  5. String? view,
  6. String? $fields,
})

Lists notifications under a given parent.

Request parameters:

parent - Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}" or "projects/{project}/locations/{location}" Value must have pattern ^organizations/\[^/\]+/locations/\[^/\]+$.

languageCode - ISO code for requested localization language. If unset, will be interpereted as "en". If the requested language is valid, but not supported for this notification, English will be returned with an "Not applicable" LocalizationState. If the ISO code is invalid (i.e. not a real language), this RPC will throw an error.

pageSize - The maximum number of notifications to return. The service may return fewer than this value. If unspecified or equal to 0, at most 50 notifications will be returned. The maximum value is 50; values above 50 will be coerced to 50.

pageToken - A page token returned from a previous request. When paginating, all other parameters provided in the request must match the call that returned the page token.

view - Specifies which parts of the notification resource should be returned in the response. Possible string values are:

  • "NOTIFICATION_VIEW_UNSPECIFIED" : Not specified, equivalent to BASIC.
  • "BASIC" : Server responses only include title, creation time and Notification ID. Note: for internal use responses also include the last update time, the latest message text and whether notification has attachments.
  • "FULL" : Include everything.

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

Completes with a GoogleCloudAdvisorynotificationsV1ListNotificationsResponse.

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<GoogleCloudAdvisorynotificationsV1ListNotificationsResponse>
    list(
  core.String parent, {
  core.String? languageCode,
  core.int? pageSize,
  core.String? pageToken,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (languageCode != null) 'languageCode': [languageCode],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/notifications';

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