LifecycleRule.fromXml constructor

LifecycleRule.fromXml(
  1. XmlElement elem
)

Implementation

factory LifecycleRule.fromXml(_s.XmlElement elem) {
  return LifecycleRule(
    status: _s.extractXmlStringValue(elem, 'Status')!.toExpirationStatus(),
    abortIncompleteMultipartUpload: _s
        .extractXmlChild(elem, 'AbortIncompleteMultipartUpload')
        ?.let((e) => AbortIncompleteMultipartUpload.fromXml(e)),
    expiration: _s
        .extractXmlChild(elem, 'Expiration')
        ?.let((e) => LifecycleExpiration.fromXml(e)),
    filter: _s
        .extractXmlChild(elem, 'Filter')
        ?.let((e) => LifecycleRuleFilter.fromXml(e)),
    id: _s.extractXmlStringValue(elem, 'ID'),
    noncurrentVersionExpiration: _s
        .extractXmlChild(elem, 'NoncurrentVersionExpiration')
        ?.let((e) => NoncurrentVersionExpiration.fromXml(e)),
    noncurrentVersionTransitions: elem
        .findElements('NoncurrentVersionTransition')
        .map((c) => NoncurrentVersionTransition.fromXml(c))
        .toList(),
    prefix: _s.extractXmlStringValue(elem, 'Prefix'),
    transitions: elem
        .findElements('Transition')
        .map((c) => Transition.fromXml(c))
        .toList(),
  );
}