DefaultCacheBehavior.fromXml constructor

DefaultCacheBehavior.fromXml(
  1. XmlElement elem
)

Implementation

factory DefaultCacheBehavior.fromXml(_s.XmlElement elem) {
  return DefaultCacheBehavior(
    forwardedValues:
        ForwardedValues.fromXml(_s.extractXmlChild(elem, 'ForwardedValues')!),
    minTTL: _s.extractXmlIntValue(elem, 'MinTTL')!,
    targetOriginId: _s.extractXmlStringValue(elem, 'TargetOriginId')!,
    trustedSigners:
        TrustedSigners.fromXml(_s.extractXmlChild(elem, 'TrustedSigners')!),
    viewerProtocolPolicy: _s
        .extractXmlStringValue(elem, 'ViewerProtocolPolicy')!
        .toViewerProtocolPolicy(),
    allowedMethods: _s
        .extractXmlChild(elem, 'AllowedMethods')
        ?.let((e) => AllowedMethods.fromXml(e)),
    compress: _s.extractXmlBoolValue(elem, 'Compress'),
    defaultTTL: _s.extractXmlIntValue(elem, 'DefaultTTL'),
    fieldLevelEncryptionId:
        _s.extractXmlStringValue(elem, 'FieldLevelEncryptionId'),
    lambdaFunctionAssociations: _s
        .extractXmlChild(elem, 'LambdaFunctionAssociations')
        ?.let((e) => LambdaFunctionAssociations.fromXml(e)),
    maxTTL: _s.extractXmlIntValue(elem, 'MaxTTL'),
    smoothStreaming: _s.extractXmlBoolValue(elem, 'SmoothStreaming'),
  );
}