toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final arn = this.arn;
  final endPoints = this.endPoints;
  final fields = this.fields;
  final name = this.name;
  final samplingRate = this.samplingRate;
  final $children = <_s.XmlNode>[
    if (endPoints != null)
      _s.XmlElement(_s.XmlName('EndPoints'), [],
          endPoints.map((e) => e.toXml('member'))),
    if (fields != null)
      _s.XmlElement(_s.XmlName('Fields'), [],
          fields.map((e) => _s.encodeXmlStringValue('Field', e))),
    if (name != null) _s.encodeXmlStringValue('Name', name),
    if (arn != null) _s.encodeXmlStringValue('ARN', arn),
    if (samplingRate != null)
      _s.encodeXmlIntValue('SamplingRate', samplingRate),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}