{-# 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.ELB.Types.LBCookieStickinessPolicy where
import qualified Amazonka.Core as Core
import Amazonka.ELB.Internal
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LBCookieStickinessPolicy = LBCookieStickinessPolicy'
{
LBCookieStickinessPolicy -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text,
LBCookieStickinessPolicy -> Maybe Integer
cookieExpirationPeriod :: Prelude.Maybe Prelude.Integer
}
deriving (LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool
(LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool)
-> (LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool)
-> Eq LBCookieStickinessPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool
$c/= :: LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool
== :: LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool
$c== :: LBCookieStickinessPolicy -> LBCookieStickinessPolicy -> Bool
Prelude.Eq, ReadPrec [LBCookieStickinessPolicy]
ReadPrec LBCookieStickinessPolicy
Int -> ReadS LBCookieStickinessPolicy
ReadS [LBCookieStickinessPolicy]
(Int -> ReadS LBCookieStickinessPolicy)
-> ReadS [LBCookieStickinessPolicy]
-> ReadPrec LBCookieStickinessPolicy
-> ReadPrec [LBCookieStickinessPolicy]
-> Read LBCookieStickinessPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LBCookieStickinessPolicy]
$creadListPrec :: ReadPrec [LBCookieStickinessPolicy]
readPrec :: ReadPrec LBCookieStickinessPolicy
$creadPrec :: ReadPrec LBCookieStickinessPolicy
readList :: ReadS [LBCookieStickinessPolicy]
$creadList :: ReadS [LBCookieStickinessPolicy]
readsPrec :: Int -> ReadS LBCookieStickinessPolicy
$creadsPrec :: Int -> ReadS LBCookieStickinessPolicy
Prelude.Read, Int -> LBCookieStickinessPolicy -> ShowS
[LBCookieStickinessPolicy] -> ShowS
LBCookieStickinessPolicy -> String
(Int -> LBCookieStickinessPolicy -> ShowS)
-> (LBCookieStickinessPolicy -> String)
-> ([LBCookieStickinessPolicy] -> ShowS)
-> Show LBCookieStickinessPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LBCookieStickinessPolicy] -> ShowS
$cshowList :: [LBCookieStickinessPolicy] -> ShowS
show :: LBCookieStickinessPolicy -> String
$cshow :: LBCookieStickinessPolicy -> String
showsPrec :: Int -> LBCookieStickinessPolicy -> ShowS
$cshowsPrec :: Int -> LBCookieStickinessPolicy -> ShowS
Prelude.Show, (forall x.
LBCookieStickinessPolicy -> Rep LBCookieStickinessPolicy x)
-> (forall x.
Rep LBCookieStickinessPolicy x -> LBCookieStickinessPolicy)
-> Generic LBCookieStickinessPolicy
forall x.
Rep LBCookieStickinessPolicy x -> LBCookieStickinessPolicy
forall x.
LBCookieStickinessPolicy -> Rep LBCookieStickinessPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LBCookieStickinessPolicy x -> LBCookieStickinessPolicy
$cfrom :: forall x.
LBCookieStickinessPolicy -> Rep LBCookieStickinessPolicy x
Prelude.Generic)
newLBCookieStickinessPolicy ::
LBCookieStickinessPolicy
newLBCookieStickinessPolicy :: LBCookieStickinessPolicy
newLBCookieStickinessPolicy =
LBCookieStickinessPolicy' :: Maybe Text -> Maybe Integer -> LBCookieStickinessPolicy
LBCookieStickinessPolicy'
{ $sel:policyName:LBCookieStickinessPolicy' :: Maybe Text
policyName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cookieExpirationPeriod:LBCookieStickinessPolicy' :: Maybe Integer
cookieExpirationPeriod = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
lBCookieStickinessPolicy_policyName :: Lens.Lens' LBCookieStickinessPolicy (Prelude.Maybe Prelude.Text)
lBCookieStickinessPolicy_policyName :: (Maybe Text -> f (Maybe Text))
-> LBCookieStickinessPolicy -> f LBCookieStickinessPolicy
lBCookieStickinessPolicy_policyName = (LBCookieStickinessPolicy -> Maybe Text)
-> (LBCookieStickinessPolicy
-> Maybe Text -> LBCookieStickinessPolicy)
-> Lens
LBCookieStickinessPolicy
LBCookieStickinessPolicy
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LBCookieStickinessPolicy' {Maybe Text
policyName :: Maybe Text
$sel:policyName:LBCookieStickinessPolicy' :: LBCookieStickinessPolicy -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: LBCookieStickinessPolicy
s@LBCookieStickinessPolicy' {} Maybe Text
a -> LBCookieStickinessPolicy
s {$sel:policyName:LBCookieStickinessPolicy' :: Maybe Text
policyName = Maybe Text
a} :: LBCookieStickinessPolicy)
lBCookieStickinessPolicy_cookieExpirationPeriod :: Lens.Lens' LBCookieStickinessPolicy (Prelude.Maybe Prelude.Integer)
lBCookieStickinessPolicy_cookieExpirationPeriod :: (Maybe Integer -> f (Maybe Integer))
-> LBCookieStickinessPolicy -> f LBCookieStickinessPolicy
lBCookieStickinessPolicy_cookieExpirationPeriod = (LBCookieStickinessPolicy -> Maybe Integer)
-> (LBCookieStickinessPolicy
-> Maybe Integer -> LBCookieStickinessPolicy)
-> Lens
LBCookieStickinessPolicy
LBCookieStickinessPolicy
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LBCookieStickinessPolicy' {Maybe Integer
cookieExpirationPeriod :: Maybe Integer
$sel:cookieExpirationPeriod:LBCookieStickinessPolicy' :: LBCookieStickinessPolicy -> Maybe Integer
cookieExpirationPeriod} -> Maybe Integer
cookieExpirationPeriod) (\s :: LBCookieStickinessPolicy
s@LBCookieStickinessPolicy' {} Maybe Integer
a -> LBCookieStickinessPolicy
s {$sel:cookieExpirationPeriod:LBCookieStickinessPolicy' :: Maybe Integer
cookieExpirationPeriod = Maybe Integer
a} :: LBCookieStickinessPolicy)
instance Core.FromXML LBCookieStickinessPolicy where
parseXML :: [Node] -> Either String LBCookieStickinessPolicy
parseXML [Node]
x =
Maybe Text -> Maybe Integer -> LBCookieStickinessPolicy
LBCookieStickinessPolicy'
(Maybe Text -> Maybe Integer -> LBCookieStickinessPolicy)
-> Either String (Maybe Text)
-> Either String (Maybe Integer -> LBCookieStickinessPolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyName")
Either String (Maybe Integer -> LBCookieStickinessPolicy)
-> Either String (Maybe Integer)
-> Either String LBCookieStickinessPolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CookieExpirationPeriod")
instance Prelude.Hashable LBCookieStickinessPolicy
instance Prelude.NFData LBCookieStickinessPolicy