toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final destination = this.destination;
  final status = this.status;
  final deleteMarkerReplication = this.deleteMarkerReplication;
  final existingObjectReplication = this.existingObjectReplication;
  final filter = this.filter;
  final id = this.id;
  final prefix = this.prefix;
  final priority = this.priority;
  final sourceSelectionCriteria = this.sourceSelectionCriteria;
  final $children = <_s.XmlNode>[
    if (id != null) _s.encodeXmlStringValue('ID', id),
    if (priority != null) _s.encodeXmlIntValue('Priority', priority),
    if (prefix != null) _s.encodeXmlStringValue('Prefix', prefix),
    if (filter != null) filter.toXml('Filter'),
    _s.encodeXmlStringValue('Status', status.toValue()),
    if (sourceSelectionCriteria != null)
      sourceSelectionCriteria.toXml('SourceSelectionCriteria'),
    if (existingObjectReplication != null)
      existingObjectReplication.toXml('ExistingObjectReplication'),
    destination.toXml('Destination'),
    if (deleteMarkerReplication != null)
      deleteMarkerReplication.toXml('DeleteMarkerReplication'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}