get method

Future<Alert> get(
  1. String name, {
  2. String? $fields,
})

Gets a single alert.

Request parameters:

name - Required. The name of the alert.The format is: projects/[PROJECT_ID_OR_NUMBER]/alerts/[ALERT_ID] The [ALERT_ID] is a system-assigned unique identifier for the alert. Value must have pattern ^projects/\[^/\]+/alerts/\[^/\]+$.

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

Completes with a Alert.

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

  final url_ = 'v3/' + core.Uri.encodeFull('$name');

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