{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFront.Types.CachePolicyConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFront.Types.CachePolicyConfig where

import Amazonka.CloudFront.Types.ParametersInCacheKeyAndForwardedToOrigin
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A cache policy configuration.
--
-- This configuration determines the following:
--
-- -   The values that CloudFront includes in the cache key. These values
--     can include HTTP headers, cookies, and URL query strings. CloudFront
--     uses the cache key to find an object in its cache that it can return
--     to the viewer.
--
-- -   The default, minimum, and maximum time to live (TTL) values that you
--     want objects to stay in the CloudFront cache.
--
-- The headers, cookies, and query strings that are included in the cache
-- key are automatically included in requests that CloudFront sends to the
-- origin. CloudFront sends a request when it can\'t find a valid object in
-- its cache that matches the request\'s cache key. If you want to send
-- values to the origin but /not/ include them in the cache key, use
-- @OriginRequestPolicy@.
--
-- /See:/ 'newCachePolicyConfig' smart constructor.
data CachePolicyConfig = CachePolicyConfig'
  { -- | A comment to describe the cache policy. The comment cannot be longer
    -- than 128 characters.
    CachePolicyConfig -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The default amount of time, in seconds, that you want objects to stay in
    -- the CloudFront cache before CloudFront sends another request to the
    -- origin to see if the object has been updated. CloudFront uses this value
    -- as the object\'s time to live (TTL) only when the origin does /not/ send
    -- @Cache-Control@ or @Expires@ headers with the object. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
    -- in the /Amazon CloudFront Developer Guide/.
    --
    -- The default value for this field is 86400 seconds (one day). If the
    -- value of @MinTTL@ is more than 86400 seconds, then the default value for
    -- this field is the same as the value of @MinTTL@.
    CachePolicyConfig -> Maybe Integer
defaultTTL :: Prelude.Maybe Prelude.Integer,
    -- | The maximum amount of time, in seconds, that objects stay in the
    -- CloudFront cache before CloudFront sends another request to the origin
    -- to see if the object has been updated. CloudFront uses this value only
    -- when the origin sends @Cache-Control@ or @Expires@ headers with the
    -- object. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
    -- in the /Amazon CloudFront Developer Guide/.
    --
    -- The default value for this field is 31536000 seconds (one year). If the
    -- value of @MinTTL@ or @DefaultTTL@ is more than 31536000 seconds, then
    -- the default value for this field is the same as the value of
    -- @DefaultTTL@.
    CachePolicyConfig -> Maybe Integer
maxTTL :: Prelude.Maybe Prelude.Integer,
    -- | The HTTP headers, cookies, and URL query strings to include in the cache
    -- key. The values included in the cache key are automatically included in
    -- requests that CloudFront sends to the origin.
    CachePolicyConfig -> Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin :: Prelude.Maybe ParametersInCacheKeyAndForwardedToOrigin,
    -- | A unique name to identify the cache policy.
    CachePolicyConfig -> Text
name :: Prelude.Text,
    -- | The minimum amount of time, in seconds, that you want objects to stay in
    -- the CloudFront cache before CloudFront sends another request to the
    -- origin to see if the object has been updated. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
    -- in the /Amazon CloudFront Developer Guide/.
    CachePolicyConfig -> Integer
minTTL :: Prelude.Integer
  }
  deriving (CachePolicyConfig -> CachePolicyConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CachePolicyConfig -> CachePolicyConfig -> Bool
$c/= :: CachePolicyConfig -> CachePolicyConfig -> Bool
== :: CachePolicyConfig -> CachePolicyConfig -> Bool
$c== :: CachePolicyConfig -> CachePolicyConfig -> Bool
Prelude.Eq, ReadPrec [CachePolicyConfig]
ReadPrec CachePolicyConfig
Int -> ReadS CachePolicyConfig
ReadS [CachePolicyConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CachePolicyConfig]
$creadListPrec :: ReadPrec [CachePolicyConfig]
readPrec :: ReadPrec CachePolicyConfig
$creadPrec :: ReadPrec CachePolicyConfig
readList :: ReadS [CachePolicyConfig]
$creadList :: ReadS [CachePolicyConfig]
readsPrec :: Int -> ReadS CachePolicyConfig
$creadsPrec :: Int -> ReadS CachePolicyConfig
Prelude.Read, Int -> CachePolicyConfig -> ShowS
[CachePolicyConfig] -> ShowS
CachePolicyConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CachePolicyConfig] -> ShowS
$cshowList :: [CachePolicyConfig] -> ShowS
show :: CachePolicyConfig -> String
$cshow :: CachePolicyConfig -> String
showsPrec :: Int -> CachePolicyConfig -> ShowS
$cshowsPrec :: Int -> CachePolicyConfig -> ShowS
Prelude.Show, forall x. Rep CachePolicyConfig x -> CachePolicyConfig
forall x. CachePolicyConfig -> Rep CachePolicyConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CachePolicyConfig x -> CachePolicyConfig
$cfrom :: forall x. CachePolicyConfig -> Rep CachePolicyConfig x
Prelude.Generic)

-- |
-- Create a value of 'CachePolicyConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'comment', 'cachePolicyConfig_comment' - A comment to describe the cache policy. The comment cannot be longer
-- than 128 characters.
--
-- 'defaultTTL', 'cachePolicyConfig_defaultTTL' - The default amount of time, in seconds, that you want objects to stay in
-- the CloudFront cache before CloudFront sends another request to the
-- origin to see if the object has been updated. CloudFront uses this value
-- as the object\'s time to live (TTL) only when the origin does /not/ send
-- @Cache-Control@ or @Expires@ headers with the object. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
--
-- The default value for this field is 86400 seconds (one day). If the
-- value of @MinTTL@ is more than 86400 seconds, then the default value for
-- this field is the same as the value of @MinTTL@.
--
-- 'maxTTL', 'cachePolicyConfig_maxTTL' - The maximum amount of time, in seconds, that objects stay in the
-- CloudFront cache before CloudFront sends another request to the origin
-- to see if the object has been updated. CloudFront uses this value only
-- when the origin sends @Cache-Control@ or @Expires@ headers with the
-- object. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
--
-- The default value for this field is 31536000 seconds (one year). If the
-- value of @MinTTL@ or @DefaultTTL@ is more than 31536000 seconds, then
-- the default value for this field is the same as the value of
-- @DefaultTTL@.
--
-- 'parametersInCacheKeyAndForwardedToOrigin', 'cachePolicyConfig_parametersInCacheKeyAndForwardedToOrigin' - The HTTP headers, cookies, and URL query strings to include in the cache
-- key. The values included in the cache key are automatically included in
-- requests that CloudFront sends to the origin.
--
-- 'name', 'cachePolicyConfig_name' - A unique name to identify the cache policy.
--
-- 'minTTL', 'cachePolicyConfig_minTTL' - The minimum amount of time, in seconds, that you want objects to stay in
-- the CloudFront cache before CloudFront sends another request to the
-- origin to see if the object has been updated. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
newCachePolicyConfig ::
  -- | 'name'
  Prelude.Text ->
  -- | 'minTTL'
  Prelude.Integer ->
  CachePolicyConfig
newCachePolicyConfig :: Text -> Integer -> CachePolicyConfig
newCachePolicyConfig Text
pName_ Integer
pMinTTL_ =
  CachePolicyConfig'
    { $sel:comment:CachePolicyConfig' :: Maybe Text
comment = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTTL:CachePolicyConfig' :: Maybe Integer
defaultTTL = forall a. Maybe a
Prelude.Nothing,
      $sel:maxTTL:CachePolicyConfig' :: Maybe Integer
maxTTL = forall a. Maybe a
Prelude.Nothing,
      $sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:CachePolicyConfig' :: Text
name = Text
pName_,
      $sel:minTTL:CachePolicyConfig' :: Integer
minTTL = Integer
pMinTTL_
    }

-- | A comment to describe the cache policy. The comment cannot be longer
-- than 128 characters.
cachePolicyConfig_comment :: Lens.Lens' CachePolicyConfig (Prelude.Maybe Prelude.Text)
cachePolicyConfig_comment :: Lens' CachePolicyConfig (Maybe Text)
cachePolicyConfig_comment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Maybe Text
comment :: Maybe Text
$sel:comment:CachePolicyConfig' :: CachePolicyConfig -> Maybe Text
comment} -> Maybe Text
comment) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Maybe Text
a -> CachePolicyConfig
s {$sel:comment:CachePolicyConfig' :: Maybe Text
comment = Maybe Text
a} :: CachePolicyConfig)

-- | The default amount of time, in seconds, that you want objects to stay in
-- the CloudFront cache before CloudFront sends another request to the
-- origin to see if the object has been updated. CloudFront uses this value
-- as the object\'s time to live (TTL) only when the origin does /not/ send
-- @Cache-Control@ or @Expires@ headers with the object. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
--
-- The default value for this field is 86400 seconds (one day). If the
-- value of @MinTTL@ is more than 86400 seconds, then the default value for
-- this field is the same as the value of @MinTTL@.
cachePolicyConfig_defaultTTL :: Lens.Lens' CachePolicyConfig (Prelude.Maybe Prelude.Integer)
cachePolicyConfig_defaultTTL :: Lens' CachePolicyConfig (Maybe Integer)
cachePolicyConfig_defaultTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Maybe Integer
defaultTTL :: Maybe Integer
$sel:defaultTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
defaultTTL} -> Maybe Integer
defaultTTL) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Maybe Integer
a -> CachePolicyConfig
s {$sel:defaultTTL:CachePolicyConfig' :: Maybe Integer
defaultTTL = Maybe Integer
a} :: CachePolicyConfig)

-- | The maximum amount of time, in seconds, that objects stay in the
-- CloudFront cache before CloudFront sends another request to the origin
-- to see if the object has been updated. CloudFront uses this value only
-- when the origin sends @Cache-Control@ or @Expires@ headers with the
-- object. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
--
-- The default value for this field is 31536000 seconds (one year). If the
-- value of @MinTTL@ or @DefaultTTL@ is more than 31536000 seconds, then
-- the default value for this field is the same as the value of
-- @DefaultTTL@.
cachePolicyConfig_maxTTL :: Lens.Lens' CachePolicyConfig (Prelude.Maybe Prelude.Integer)
cachePolicyConfig_maxTTL :: Lens' CachePolicyConfig (Maybe Integer)
cachePolicyConfig_maxTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Maybe Integer
maxTTL :: Maybe Integer
$sel:maxTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
maxTTL} -> Maybe Integer
maxTTL) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Maybe Integer
a -> CachePolicyConfig
s {$sel:maxTTL:CachePolicyConfig' :: Maybe Integer
maxTTL = Maybe Integer
a} :: CachePolicyConfig)

-- | The HTTP headers, cookies, and URL query strings to include in the cache
-- key. The values included in the cache key are automatically included in
-- requests that CloudFront sends to the origin.
cachePolicyConfig_parametersInCacheKeyAndForwardedToOrigin :: Lens.Lens' CachePolicyConfig (Prelude.Maybe ParametersInCacheKeyAndForwardedToOrigin)
cachePolicyConfig_parametersInCacheKeyAndForwardedToOrigin :: Lens'
  CachePolicyConfig (Maybe ParametersInCacheKeyAndForwardedToOrigin)
cachePolicyConfig_parametersInCacheKeyAndForwardedToOrigin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin :: Maybe ParametersInCacheKeyAndForwardedToOrigin
$sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: CachePolicyConfig -> Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin} -> Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Maybe ParametersInCacheKeyAndForwardedToOrigin
a -> CachePolicyConfig
s {$sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin = Maybe ParametersInCacheKeyAndForwardedToOrigin
a} :: CachePolicyConfig)

-- | A unique name to identify the cache policy.
cachePolicyConfig_name :: Lens.Lens' CachePolicyConfig Prelude.Text
cachePolicyConfig_name :: Lens' CachePolicyConfig Text
cachePolicyConfig_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Text
name :: Text
$sel:name:CachePolicyConfig' :: CachePolicyConfig -> Text
name} -> Text
name) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Text
a -> CachePolicyConfig
s {$sel:name:CachePolicyConfig' :: Text
name = Text
a} :: CachePolicyConfig)

-- | The minimum amount of time, in seconds, that you want objects to stay in
-- the CloudFront cache before CloudFront sends another request to the
-- origin to see if the object has been updated. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html Managing How Long Content Stays in an Edge Cache (Expiration)>
-- in the /Amazon CloudFront Developer Guide/.
cachePolicyConfig_minTTL :: Lens.Lens' CachePolicyConfig Prelude.Integer
cachePolicyConfig_minTTL :: Lens' CachePolicyConfig Integer
cachePolicyConfig_minTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyConfig' {Integer
minTTL :: Integer
$sel:minTTL:CachePolicyConfig' :: CachePolicyConfig -> Integer
minTTL} -> Integer
minTTL) (\s :: CachePolicyConfig
s@CachePolicyConfig' {} Integer
a -> CachePolicyConfig
s {$sel:minTTL:CachePolicyConfig' :: Integer
minTTL = Integer
a} :: CachePolicyConfig)

instance Data.FromXML CachePolicyConfig where
  parseXML :: [Node] -> Either String CachePolicyConfig
parseXML [Node]
x =
    Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe ParametersInCacheKeyAndForwardedToOrigin
-> Text
-> Integer
-> CachePolicyConfig
CachePolicyConfig'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Comment")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultTTL")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MaxTTL")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ParametersInCacheKeyAndForwardedToOrigin"
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Name")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"MinTTL")

instance Prelude.Hashable CachePolicyConfig where
  hashWithSalt :: Int -> CachePolicyConfig -> Int
hashWithSalt Int
_salt CachePolicyConfig' {Integer
Maybe Integer
Maybe Text
Maybe ParametersInCacheKeyAndForwardedToOrigin
Text
minTTL :: Integer
name :: Text
parametersInCacheKeyAndForwardedToOrigin :: Maybe ParametersInCacheKeyAndForwardedToOrigin
maxTTL :: Maybe Integer
defaultTTL :: Maybe Integer
comment :: Maybe Text
$sel:minTTL:CachePolicyConfig' :: CachePolicyConfig -> Integer
$sel:name:CachePolicyConfig' :: CachePolicyConfig -> Text
$sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: CachePolicyConfig -> Maybe ParametersInCacheKeyAndForwardedToOrigin
$sel:maxTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:defaultTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:comment:CachePolicyConfig' :: CachePolicyConfig -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
defaultTTL
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
maxTTL
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
minTTL

instance Prelude.NFData CachePolicyConfig where
  rnf :: CachePolicyConfig -> ()
rnf CachePolicyConfig' {Integer
Maybe Integer
Maybe Text
Maybe ParametersInCacheKeyAndForwardedToOrigin
Text
minTTL :: Integer
name :: Text
parametersInCacheKeyAndForwardedToOrigin :: Maybe ParametersInCacheKeyAndForwardedToOrigin
maxTTL :: Maybe Integer
defaultTTL :: Maybe Integer
comment :: Maybe Text
$sel:minTTL:CachePolicyConfig' :: CachePolicyConfig -> Integer
$sel:name:CachePolicyConfig' :: CachePolicyConfig -> Text
$sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: CachePolicyConfig -> Maybe ParametersInCacheKeyAndForwardedToOrigin
$sel:maxTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:defaultTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:comment:CachePolicyConfig' :: CachePolicyConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
defaultTTL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
maxTTL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
minTTL

instance Data.ToXML CachePolicyConfig where
  toXML :: CachePolicyConfig -> XML
toXML CachePolicyConfig' {Integer
Maybe Integer
Maybe Text
Maybe ParametersInCacheKeyAndForwardedToOrigin
Text
minTTL :: Integer
name :: Text
parametersInCacheKeyAndForwardedToOrigin :: Maybe ParametersInCacheKeyAndForwardedToOrigin
maxTTL :: Maybe Integer
defaultTTL :: Maybe Integer
comment :: Maybe Text
$sel:minTTL:CachePolicyConfig' :: CachePolicyConfig -> Integer
$sel:name:CachePolicyConfig' :: CachePolicyConfig -> Text
$sel:parametersInCacheKeyAndForwardedToOrigin:CachePolicyConfig' :: CachePolicyConfig -> Maybe ParametersInCacheKeyAndForwardedToOrigin
$sel:maxTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:defaultTTL:CachePolicyConfig' :: CachePolicyConfig -> Maybe Integer
$sel:comment:CachePolicyConfig' :: CachePolicyConfig -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"Comment" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
comment,
        Name
"DefaultTTL" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Integer
defaultTTL,
        Name
"MaxTTL" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Integer
maxTTL,
        Name
"ParametersInCacheKeyAndForwardedToOrigin"
          forall a. ToXML a => Name -> a -> XML
Data.@= Maybe ParametersInCacheKeyAndForwardedToOrigin
parametersInCacheKeyAndForwardedToOrigin,
        Name
"Name" forall a. ToXML a => Name -> a -> XML
Data.@= Text
name,
        Name
"MinTTL" forall a. ToXML a => Name -> a -> XML
Data.@= Integer
minTTL
      ]