toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final targetBucket = this.targetBucket;
  final targetPrefix = this.targetPrefix;
  final targetGrants = this.targetGrants;
  final $children = <_s.XmlNode>[
    _s.encodeXmlStringValue('TargetBucket', targetBucket),
    if (targetGrants != null)
      _s.XmlElement(_s.XmlName('TargetGrants'), [],
          targetGrants.map((e) => e.toXml('Grant'))),
    _s.encodeXmlStringValue('TargetPrefix', targetPrefix),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}