AnomalyDetector.fromXml constructor

AnomalyDetector.fromXml(
  1. XmlElement elem
)

Implementation

factory AnomalyDetector.fromXml(_s.XmlElement elem) {
  return AnomalyDetector(
    configuration: _s
        .extractXmlChild(elem, 'Configuration')
        ?.let((e) => AnomalyDetectorConfiguration.fromXml(e)),
    dimensions: _s.extractXmlChild(elem, 'Dimensions')?.let((elem) => elem
        .findElements('Dimensions')
        .map((c) => Dimension.fromXml(c))
        .toList()),
    metricName: _s.extractXmlStringValue(elem, 'MetricName'),
    namespace: _s.extractXmlStringValue(elem, 'Namespace'),
    stat: _s.extractXmlStringValue(elem, 'Stat'),
    stateValue: _s
        .extractXmlStringValue(elem, 'StateValue')
        ?.toAnomalyDetectorStateValue(),
  );
}