deleteAlarm method

Future<DeleteAlarmResult> deleteAlarm({
  1. required String alarmName,
})

Deletes an alarm.

An alarm is used to monitor a single metric for one of your resources. When a metric condition is met, the alarm can notify you by email, SMS text message, and a banner displayed on the Amazon Lightsail console. For more information, see Alarms in Amazon Lightsail.

May throw ServiceException. May throw InvalidInputException. May throw OperationFailureException. May throw UnauthenticatedException. May throw AccessDeniedException. May throw NotFoundException.

Parameter alarmName : The name of the alarm to delete.

Implementation

Future<DeleteAlarmResult> deleteAlarm({
  required String alarmName,
}) async {
  ArgumentError.checkNotNull(alarmName, 'alarmName');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.DeleteAlarm'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'alarmName': alarmName,
    },
  );

  return DeleteAlarmResult.fromJson(jsonResponse.body);
}