toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final bucket = this.bucket;
  final accessControlTranslation = this.accessControlTranslation;
  final account = this.account;
  final encryptionConfiguration = this.encryptionConfiguration;
  final metrics = this.metrics;
  final replicationTime = this.replicationTime;
  final storageClass = this.storageClass;
  final $children = <_s.XmlNode>[
    _s.encodeXmlStringValue('Bucket', bucket),
    if (account != null) _s.encodeXmlStringValue('Account', account),
    if (storageClass != null)
      _s.encodeXmlStringValue('StorageClass', storageClass.toValue()),
    if (accessControlTranslation != null)
      accessControlTranslation.toXml('AccessControlTranslation'),
    if (encryptionConfiguration != null)
      encryptionConfiguration.toXml('EncryptionConfiguration'),
    if (replicationTime != null) replicationTime.toXml('ReplicationTime'),
    if (metrics != null) metrics.toXml('Metrics'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}