toXml method

XmlElement toXml(
  1. String elemName, {
  2. List<XmlAttribute>? attributes,
})

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final status = this.status;
  final abortIncompleteMultipartUpload = this.abortIncompleteMultipartUpload;
  final expiration = this.expiration;
  final filter = this.filter;
  final id = this.id;
  final noncurrentVersionExpiration = this.noncurrentVersionExpiration;
  final noncurrentVersionTransitions = this.noncurrentVersionTransitions;
  final prefix = this.prefix;
  final transitions = this.transitions;
  final $children = <_s.XmlNode>[
    if (expiration != null) expiration.toXml('Expiration'),
    if (id != null) _s.encodeXmlStringValue('ID', id),
    if (prefix != null) _s.encodeXmlStringValue('Prefix', prefix),
    if (filter != null) filter.toXml('Filter'),
    _s.encodeXmlStringValue('Status', status.toValue()),
    if (transitions != null) ...transitions.map((e) => e.toXml('Transition')),
    if (noncurrentVersionTransitions != null)
      ...noncurrentVersionTransitions
          .map((e) => e.toXml('NoncurrentVersionTransition')),
    if (noncurrentVersionExpiration != null)
      noncurrentVersionExpiration.toXml('NoncurrentVersionExpiration'),
    if (abortIncompleteMultipartUpload != null)
      abortIncompleteMultipartUpload.toXml('AbortIncompleteMultipartUpload'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}