toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final prefix = this.prefix;
  final status = this.status;
  final abortIncompleteMultipartUpload = this.abortIncompleteMultipartUpload;
  final expiration = this.expiration;
  final id = this.id;
  final noncurrentVersionExpiration = this.noncurrentVersionExpiration;
  final noncurrentVersionTransition = this.noncurrentVersionTransition;
  final transition = this.transition;
  final $children = <_s.XmlNode>[
    if (expiration != null) expiration.toXml('Expiration'),
    if (id != null) _s.encodeXmlStringValue('ID', id),
    _s.encodeXmlStringValue('Prefix', prefix),
    _s.encodeXmlStringValue('Status', status.toValue()),
    if (transition != null) transition.toXml('Transition'),
    if (noncurrentVersionTransition != null)
      noncurrentVersionTransition.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,
  );
}