toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final minTTL = this.minTTL;
  final name = this.name;
  final comment = this.comment;
  final defaultTTL = this.defaultTTL;
  final maxTTL = this.maxTTL;
  final parametersInCacheKeyAndForwardedToOrigin =
      this.parametersInCacheKeyAndForwardedToOrigin;
  final $children = <_s.XmlNode>[
    if (comment != null) _s.encodeXmlStringValue('Comment', comment),
    _s.encodeXmlStringValue('Name', name),
    if (defaultTTL != null) _s.encodeXmlIntValue('DefaultTTL', defaultTTL),
    if (maxTTL != null) _s.encodeXmlIntValue('MaxTTL', maxTTL),
    _s.encodeXmlIntValue('MinTTL', minTTL),
    if (parametersInCacheKeyAndForwardedToOrigin != null)
      parametersInCacheKeyAndForwardedToOrigin
          .toXml('ParametersInCacheKeyAndForwardedToOrigin'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}