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