toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final forwardedValues = this.forwardedValues;
  final minTTL = this.minTTL;
  final targetOriginId = this.targetOriginId;
  final trustedSigners = this.trustedSigners;
  final viewerProtocolPolicy = this.viewerProtocolPolicy;
  final allowedMethods = this.allowedMethods;
  final compress = this.compress;
  final defaultTTL = this.defaultTTL;
  final lambdaFunctionAssociations = this.lambdaFunctionAssociations;
  final maxTTL = this.maxTTL;
  final smoothStreaming = this.smoothStreaming;
  final $children = <_s.XmlNode>[
    _s.encodeXmlStringValue('TargetOriginId', targetOriginId),
    forwardedValues.toXml('ForwardedValues'),
    trustedSigners.toXml('TrustedSigners'),
    _s.encodeXmlStringValue(
        'ViewerProtocolPolicy', viewerProtocolPolicy.toValue()),
    _s.encodeXmlIntValue('MinTTL', minTTL),
    if (allowedMethods != null) allowedMethods.toXml('AllowedMethods'),
    if (smoothStreaming != null)
      _s.encodeXmlBoolValue('SmoothStreaming', smoothStreaming),
    if (defaultTTL != null) _s.encodeXmlIntValue('DefaultTTL', defaultTTL),
    if (maxTTL != null) _s.encodeXmlIntValue('MaxTTL', maxTTL),
    if (compress != null) _s.encodeXmlBoolValue('Compress', compress),
    if (lambdaFunctionAssociations != null)
      lambdaFunctionAssociations.toXml('LambdaFunctionAssociations'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}