toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final domainName = this.domainName;
  final id = this.id;
  final customHeaders = this.customHeaders;
  final customOriginConfig = this.customOriginConfig;
  final originPath = this.originPath;
  final s3OriginConfig = this.s3OriginConfig;
  final $children = <_s.XmlNode>[
    _s.encodeXmlStringValue('Id', id),
    _s.encodeXmlStringValue('DomainName', domainName),
    if (originPath != null) _s.encodeXmlStringValue('OriginPath', originPath),
    if (customHeaders != null) customHeaders.toXml('CustomHeaders'),
    if (s3OriginConfig != null) s3OriginConfig.toXml('S3OriginConfig'),
    if (customOriginConfig != null)
      customOriginConfig.toXml('CustomOriginConfig'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}