list method

Future<ListAlertsResponse> list({
  1. String? customerId,
  2. String? filter,
  3. String? orderBy,
  4. int? pageSize,
  5. String? pageToken,
  6. String? $fields,
})

Lists the alerts.

Request parameters:

customerId - Optional. The unique identifier of the Google Workspace organization account of the customer the alerts are associated with. Inferred from the caller identity if not provided.

filter - Optional. A query string for filtering alert results. For more details, see Query filters and Supported query filter fields.

orderBy - Optional. The sort order of the list results. If not specified results may be returned in arbitrary order. You can sort the results in descending order based on the creation timestamp using order_by="create_time desc". Currently, supported sorting are create_time asc, create_time desc, update_time desc

pageSize - Optional. The requested page size. Server may return fewer items than requested. If unspecified, server picks an appropriate default.

pageToken - Optional. A token identifying a page of results the server should return. If empty, a new iteration is started. To continue an iteration, pass in the value from the previous ListAlertsResponse's next_page_token field.

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

Completes with a ListAlertsResponse.

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<ListAlertsResponse> list({
  core.String? customerId,
  core.String? filter,
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (customerId != null) 'customerId': [customerId],
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  const _url = 'v1beta1/alerts';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return ListAlertsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}