toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final blockPublicAcls = this.blockPublicAcls;
  final blockPublicPolicy = this.blockPublicPolicy;
  final ignorePublicAcls = this.ignorePublicAcls;
  final restrictPublicBuckets = this.restrictPublicBuckets;
  final $children = <_s.XmlNode>[
    if (blockPublicAcls != null)
      _s.encodeXmlBoolValue('BlockPublicAcls', blockPublicAcls),
    if (ignorePublicAcls != null)
      _s.encodeXmlBoolValue('IgnorePublicAcls', ignorePublicAcls),
    if (blockPublicPolicy != null)
      _s.encodeXmlBoolValue('BlockPublicPolicy', blockPublicPolicy),
    if (restrictPublicBuckets != null)
      _s.encodeXmlBoolValue('RestrictPublicBuckets', restrictPublicBuckets),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}