list method

Future<ListAlertsResponse> list(
  1. String parent, {
  2. String? languageCode,
  3. String? $fields,
})

Lists all the alerts available in an account.

Request parameters:

parent - Required. The account which owns the collection of alerts. Format: accounts/{account} Value must have pattern ^accounts/\[^/\]+$.

languageCode - The language to use for translating alert messages. If unspecified, this defaults to the user's display language. If the given language is not supported, alerts will be returned in English. The language is specified as an [IETF BCP-47 language code](https://en.wikipedia.org/wiki/IETF_language_tag).

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

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/alerts';

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