MetricAlarm.fromXml constructor
MetricAlarm.fromXml(
- XmlElement elem
Implementation
factory MetricAlarm.fromXml(_s.XmlElement elem) {
return MetricAlarm(
actionsEnabled: _s.extractXmlBoolValue(elem, 'ActionsEnabled'),
alarmActions: _s
.extractXmlChild(elem, 'AlarmActions')
?.let((elem) => _s.extractXmlStringListValues(elem, 'member')),
alarmArn: _s.extractXmlStringValue(elem, 'AlarmArn'),
alarmConfigurationUpdatedTimestamp: _s.extractXmlDateTimeValue(
elem, 'AlarmConfigurationUpdatedTimestamp'),
alarmDescription: _s.extractXmlStringValue(elem, 'AlarmDescription'),
alarmName: _s.extractXmlStringValue(elem, 'AlarmName'),
comparisonOperator: _s
.extractXmlStringValue(elem, 'ComparisonOperator')
?.toComparisonOperator(),
datapointsToAlarm: _s.extractXmlIntValue(elem, 'DatapointsToAlarm'),
dimensions: _s.extractXmlChild(elem, 'Dimensions')?.let((elem) => elem
.findElements('member')
.map((c) => Dimension.fromXml(c))
.toList()),
evaluateLowSampleCountPercentile:
_s.extractXmlStringValue(elem, 'EvaluateLowSampleCountPercentile'),
evaluationPeriods: _s.extractXmlIntValue(elem, 'EvaluationPeriods'),
extendedStatistic: _s.extractXmlStringValue(elem, 'ExtendedStatistic'),
insufficientDataActions: _s
.extractXmlChild(elem, 'InsufficientDataActions')
?.let((elem) => _s.extractXmlStringListValues(elem, 'member')),
metricName: _s.extractXmlStringValue(elem, 'MetricName'),
metrics: _s.extractXmlChild(elem, 'Metrics')?.let((elem) => elem
.findElements('member')
.map((c) => MetricDataQuery.fromXml(c))
.toList()),
namespace: _s.extractXmlStringValue(elem, 'Namespace'),
oKActions: _s
.extractXmlChild(elem, 'OKActions')
?.let((elem) => _s.extractXmlStringListValues(elem, 'member')),
period: _s.extractXmlIntValue(elem, 'Period'),
stateReason: _s.extractXmlStringValue(elem, 'StateReason'),
stateReasonData: _s.extractXmlStringValue(elem, 'StateReasonData'),
stateUpdatedTimestamp:
_s.extractXmlDateTimeValue(elem, 'StateUpdatedTimestamp'),
stateValue: _s.extractXmlStringValue(elem, 'StateValue')?.toStateValue(),
statistic: _s.extractXmlStringValue(elem, 'Statistic')?.toStatistic(),
threshold: _s.extractXmlDoubleValue(elem, 'Threshold'),
thresholdMetricId: _s.extractXmlStringValue(elem, 'ThresholdMetricId'),
treatMissingData: _s.extractXmlStringValue(elem, 'TreatMissingData'),
unit: _s.extractXmlStringValue(elem, 'Unit')?.toStandardUnit(),
);
}