CloudWatchAlarmDefinition.fromJson constructor
CloudWatchAlarmDefinition.fromJson(
- Map<String, dynamic> json
)
Implementation
factory CloudWatchAlarmDefinition.fromJson(Map<String, dynamic> json) {
return CloudWatchAlarmDefinition(
comparisonOperator:
(json['ComparisonOperator'] as String).toComparisonOperator(),
metricName: json['MetricName'] as String,
period: json['Period'] as int,
threshold: json['Threshold'] as double,
dimensions: (json['Dimensions'] as List?)
?.whereNotNull()
.map((e) => MetricDimension.fromJson(e as Map<String, dynamic>))
.toList(),
evaluationPeriods: json['EvaluationPeriods'] as int?,
namespace: json['Namespace'] as String?,
statistic: (json['Statistic'] as String?)?.toStatistic(),
unit: (json['Unit'] as String?)?.toUnit(),
);
}