UsageLimit.fromXml constructor

UsageLimit.fromXml(
  1. XmlElement elem
)

Implementation

factory UsageLimit.fromXml(_s.XmlElement elem) {
  return UsageLimit(
    amount: _s.extractXmlIntValue(elem, 'Amount'),
    breachAction: _s
        .extractXmlStringValue(elem, 'BreachAction')
        ?.toUsageLimitBreachAction(),
    clusterIdentifier: _s.extractXmlStringValue(elem, 'ClusterIdentifier'),
    featureType: _s
        .extractXmlStringValue(elem, 'FeatureType')
        ?.toUsageLimitFeatureType(),
    limitType:
        _s.extractXmlStringValue(elem, 'LimitType')?.toUsageLimitLimitType(),
    period: _s.extractXmlStringValue(elem, 'Period')?.toUsageLimitPeriod(),
    tags: _s.extractXmlChild(elem, 'Tags')?.let((elem) =>
        elem.findElements('Tag').map((c) => Tag.fromXml(c)).toList()),
    usageLimitId: _s.extractXmlStringValue(elem, 'UsageLimitId'),
  );
}