get method
Gets the specified alert.
Attempting to get a nonexistent alert returns NOT_FOUND
error.
Request parameters:
alertId
- Required. The identifier of the alert to retrieve.
customerId
- Optional. The unique identifier of the Google Workspace
account of the customer the alert is associated with. The customer_id
must have the initial "C" stripped (for example, 046psxkn
). Inferred
from the caller identity if not provided.
Find your customer ID.
$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 alertId, {
core.String? customerId,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (customerId != null) 'customerId': [customerId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1beta1/alerts/' + commons.escapeVariable('$alertId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Alert.fromJson(response_ as core.Map<core.String, core.dynamic>);
}