{-# 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 #-}
module Amazonka.CloudFront.Types.SessionStickinessConfig where
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
data SessionStickinessConfig = SessionStickinessConfig'
{
SessionStickinessConfig -> Int
idleTTL :: Prelude.Int,
SessionStickinessConfig -> Int
maximumTTL :: Prelude.Int
}
deriving (SessionStickinessConfig -> SessionStickinessConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionStickinessConfig -> SessionStickinessConfig -> Bool
$c/= :: SessionStickinessConfig -> SessionStickinessConfig -> Bool
== :: SessionStickinessConfig -> SessionStickinessConfig -> Bool
$c== :: SessionStickinessConfig -> SessionStickinessConfig -> Bool
Prelude.Eq, ReadPrec [SessionStickinessConfig]
ReadPrec SessionStickinessConfig
Int -> ReadS SessionStickinessConfig
ReadS [SessionStickinessConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionStickinessConfig]
$creadListPrec :: ReadPrec [SessionStickinessConfig]
readPrec :: ReadPrec SessionStickinessConfig
$creadPrec :: ReadPrec SessionStickinessConfig
readList :: ReadS [SessionStickinessConfig]
$creadList :: ReadS [SessionStickinessConfig]
readsPrec :: Int -> ReadS SessionStickinessConfig
$creadsPrec :: Int -> ReadS SessionStickinessConfig
Prelude.Read, Int -> SessionStickinessConfig -> ShowS
[SessionStickinessConfig] -> ShowS
SessionStickinessConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionStickinessConfig] -> ShowS
$cshowList :: [SessionStickinessConfig] -> ShowS
show :: SessionStickinessConfig -> String
$cshow :: SessionStickinessConfig -> String
showsPrec :: Int -> SessionStickinessConfig -> ShowS
$cshowsPrec :: Int -> SessionStickinessConfig -> ShowS
Prelude.Show, forall x. Rep SessionStickinessConfig x -> SessionStickinessConfig
forall x. SessionStickinessConfig -> Rep SessionStickinessConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionStickinessConfig x -> SessionStickinessConfig
$cfrom :: forall x. SessionStickinessConfig -> Rep SessionStickinessConfig x
Prelude.Generic)
newSessionStickinessConfig ::
Prelude.Int ->
Prelude.Int ->
SessionStickinessConfig
newSessionStickinessConfig :: Int -> Int -> SessionStickinessConfig
newSessionStickinessConfig Int
pIdleTTL_ Int
pMaximumTTL_ =
SessionStickinessConfig'
{ $sel:idleTTL:SessionStickinessConfig' :: Int
idleTTL = Int
pIdleTTL_,
$sel:maximumTTL:SessionStickinessConfig' :: Int
maximumTTL = Int
pMaximumTTL_
}
sessionStickinessConfig_idleTTL :: Lens.Lens' SessionStickinessConfig Prelude.Int
sessionStickinessConfig_idleTTL :: Lens' SessionStickinessConfig Int
sessionStickinessConfig_idleTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionStickinessConfig' {Int
idleTTL :: Int
$sel:idleTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
idleTTL} -> Int
idleTTL) (\s :: SessionStickinessConfig
s@SessionStickinessConfig' {} Int
a -> SessionStickinessConfig
s {$sel:idleTTL:SessionStickinessConfig' :: Int
idleTTL = Int
a} :: SessionStickinessConfig)
sessionStickinessConfig_maximumTTL :: Lens.Lens' SessionStickinessConfig Prelude.Int
sessionStickinessConfig_maximumTTL :: Lens' SessionStickinessConfig Int
sessionStickinessConfig_maximumTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionStickinessConfig' {Int
maximumTTL :: Int
$sel:maximumTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
maximumTTL} -> Int
maximumTTL) (\s :: SessionStickinessConfig
s@SessionStickinessConfig' {} Int
a -> SessionStickinessConfig
s {$sel:maximumTTL:SessionStickinessConfig' :: Int
maximumTTL = Int
a} :: SessionStickinessConfig)
instance Data.FromXML SessionStickinessConfig where
parseXML :: [Node] -> Either String SessionStickinessConfig
parseXML [Node]
x =
Int -> Int -> SessionStickinessConfig
SessionStickinessConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"IdleTTL")
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
"MaximumTTL")
instance Prelude.Hashable SessionStickinessConfig where
hashWithSalt :: Int -> SessionStickinessConfig -> Int
hashWithSalt Int
_salt SessionStickinessConfig' {Int
maximumTTL :: Int
idleTTL :: Int
$sel:maximumTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
$sel:idleTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
idleTTL
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maximumTTL
instance Prelude.NFData SessionStickinessConfig where
rnf :: SessionStickinessConfig -> ()
rnf SessionStickinessConfig' {Int
maximumTTL :: Int
idleTTL :: Int
$sel:maximumTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
$sel:idleTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
idleTTL
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maximumTTL
instance Data.ToXML SessionStickinessConfig where
toXML :: SessionStickinessConfig -> XML
toXML SessionStickinessConfig' {Int
maximumTTL :: Int
idleTTL :: Int
$sel:maximumTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
$sel:idleTTL:SessionStickinessConfig' :: SessionStickinessConfig -> Int
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"IdleTTL" forall a. ToXML a => Name -> a -> XML
Data.@= Int
idleTTL,
Name
"MaximumTTL" forall a. ToXML a => Name -> a -> XML
Data.@= Int
maximumTTL
]