ScalingPolicy.fromXml constructor

ScalingPolicy.fromXml(
  1. XmlElement elem
)

Implementation

factory ScalingPolicy.fromXml(_s.XmlElement elem) {
  return ScalingPolicy(
    adjustmentType: _s.extractXmlStringValue(elem, 'AdjustmentType'),
    alarms: _s.extractXmlChild(elem, 'Alarms')?.let((elem) =>
        elem.findElements('member').map((c) => Alarm.fromXml(c)).toList()),
    autoScalingGroupName:
        _s.extractXmlStringValue(elem, 'AutoScalingGroupName'),
    cooldown: _s.extractXmlIntValue(elem, 'Cooldown'),
    enabled: _s.extractXmlBoolValue(elem, 'Enabled'),
    estimatedInstanceWarmup:
        _s.extractXmlIntValue(elem, 'EstimatedInstanceWarmup'),
    metricAggregationType:
        _s.extractXmlStringValue(elem, 'MetricAggregationType'),
    minAdjustmentMagnitude:
        _s.extractXmlIntValue(elem, 'MinAdjustmentMagnitude'),
    minAdjustmentStep: _s.extractXmlIntValue(elem, 'MinAdjustmentStep'),
    policyARN: _s.extractXmlStringValue(elem, 'PolicyARN'),
    policyName: _s.extractXmlStringValue(elem, 'PolicyName'),
    policyType: _s.extractXmlStringValue(elem, 'PolicyType'),
    scalingAdjustment: _s.extractXmlIntValue(elem, 'ScalingAdjustment'),
    stepAdjustments: _s.extractXmlChild(elem, 'StepAdjustments')?.let(
        (elem) => elem
            .findElements('member')
            .map((c) => StepAdjustment.fromXml(c))
            .toList()),
    targetTrackingConfiguration: _s
        .extractXmlChild(elem, 'TargetTrackingConfiguration')
        ?.let((e) => TargetTrackingConfiguration.fromXml(e)),
  );
}