updateCloudWatchAlarmTemplate method

Future<UpdateCloudWatchAlarmTemplateResponse> updateCloudWatchAlarmTemplate({
  1. required String identifier,
  2. CloudWatchAlarmTemplateComparisonOperator? comparisonOperator,
  3. int? datapointsToAlarm,
  4. String? description,
  5. int? evaluationPeriods,
  6. String? groupIdentifier,
  7. String? metricName,
  8. String? name,
  9. int? period,
  10. CloudWatchAlarmTemplateStatistic? statistic,
  11. CloudWatchAlarmTemplateTargetResourceType? targetResourceType,
  12. double? threshold,
  13. CloudWatchAlarmTemplateTreatMissingData? treatMissingData,
})

Updates the specified cloudwatch alarm template.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter identifier : A cloudwatch alarm template's identifier. Can be either be its id or current name.

Parameter datapointsToAlarm : The number of datapoints within the evaluation period that must be breaching to trigger the alarm.

Parameter description : A resource's optional description.

Parameter evaluationPeriods : The number of periods over which data is compared to the specified threshold.

Parameter groupIdentifier : A cloudwatch alarm template group's identifier. Can be either be its id or current name.

Parameter metricName : The name of the metric associated with the alarm. Must be compatible with targetResourceType.

Parameter name : A resource's name. Names must be unique within the scope of a resource type in a specific region.

Parameter period : The period, in seconds, over which the specified statistic is applied.

Parameter threshold : The threshold value to compare with the specified statistic.

Implementation

Future<UpdateCloudWatchAlarmTemplateResponse> updateCloudWatchAlarmTemplate({
  required String identifier,
  CloudWatchAlarmTemplateComparisonOperator? comparisonOperator,
  int? datapointsToAlarm,
  String? description,
  int? evaluationPeriods,
  String? groupIdentifier,
  String? metricName,
  String? name,
  int? period,
  CloudWatchAlarmTemplateStatistic? statistic,
  CloudWatchAlarmTemplateTargetResourceType? targetResourceType,
  double? threshold,
  CloudWatchAlarmTemplateTreatMissingData? treatMissingData,
}) async {
  final $payload = <String, dynamic>{
    if (comparisonOperator != null)
      'comparisonOperator': comparisonOperator.value,
    if (datapointsToAlarm != null) 'datapointsToAlarm': datapointsToAlarm,
    if (description != null) 'description': description,
    if (evaluationPeriods != null) 'evaluationPeriods': evaluationPeriods,
    if (groupIdentifier != null) 'groupIdentifier': groupIdentifier,
    if (metricName != null) 'metricName': metricName,
    if (name != null) 'name': name,
    if (period != null) 'period': period,
    if (statistic != null) 'statistic': statistic.value,
    if (targetResourceType != null)
      'targetResourceType': targetResourceType.value,
    if (threshold != null) 'threshold': _s.encodeJsonDouble(threshold),
    if (treatMissingData != null) 'treatMissingData': treatMissingData.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/prod/cloudwatch-alarm-templates/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateCloudWatchAlarmTemplateResponse.fromJson(response);
}