DistributionConfig.fromXml constructor

DistributionConfig.fromXml(
  1. XmlElement elem
)

Implementation

factory DistributionConfig.fromXml(_s.XmlElement elem) {
  return DistributionConfig(
    callerReference: _s.extractXmlStringValue(elem, 'CallerReference')!,
    comment: _s.extractXmlStringValue(elem, 'Comment')!,
    defaultCacheBehavior: DefaultCacheBehavior.fromXml(
        _s.extractXmlChild(elem, 'DefaultCacheBehavior')!),
    enabled: _s.extractXmlBoolValue(elem, 'Enabled')!,
    origins: Origins.fromXml(_s.extractXmlChild(elem, 'Origins')!),
    aliases:
        _s.extractXmlChild(elem, 'Aliases')?.let((e) => Aliases.fromXml(e)),
    cacheBehaviors: _s
        .extractXmlChild(elem, 'CacheBehaviors')
        ?.let((e) => CacheBehaviors.fromXml(e)),
    customErrorResponses: _s
        .extractXmlChild(elem, 'CustomErrorResponses')
        ?.let((e) => CustomErrorResponses.fromXml(e)),
    defaultRootObject: _s.extractXmlStringValue(elem, 'DefaultRootObject'),
    httpVersion:
        _s.extractXmlStringValue(elem, 'HttpVersion')?.toHttpVersion(),
    isIPV6Enabled: _s.extractXmlBoolValue(elem, 'IsIPV6Enabled'),
    logging: _s
        .extractXmlChild(elem, 'Logging')
        ?.let((e) => LoggingConfig.fromXml(e)),
    originGroups: _s
        .extractXmlChild(elem, 'OriginGroups')
        ?.let((e) => OriginGroups.fromXml(e)),
    priceClass: _s.extractXmlStringValue(elem, 'PriceClass')?.toPriceClass(),
    restrictions: _s
        .extractXmlChild(elem, 'Restrictions')
        ?.let((e) => Restrictions.fromXml(e)),
    viewerCertificate: _s
        .extractXmlChild(elem, 'ViewerCertificate')
        ?.let((e) => ViewerCertificate.fromXml(e)),
    webACLId: _s.extractXmlStringValue(elem, 'WebACLId'),
  );
}