{-# 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.LoadBalancerAttributes where
import qualified Amazonka.Core as Core
import Amazonka.ELB.Internal
import Amazonka.ELB.Types.AccessLog
import Amazonka.ELB.Types.AdditionalAttribute
import Amazonka.ELB.Types.ConnectionDraining
import Amazonka.ELB.Types.ConnectionSettings
import Amazonka.ELB.Types.CrossZoneLoadBalancing
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LoadBalancerAttributes = LoadBalancerAttributes'
{
LoadBalancerAttributes -> Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing :: Prelude.Maybe CrossZoneLoadBalancing,
LoadBalancerAttributes -> Maybe AccessLog
accessLog :: Prelude.Maybe AccessLog,
LoadBalancerAttributes -> Maybe [AdditionalAttribute]
additionalAttributes :: Prelude.Maybe [AdditionalAttribute],
LoadBalancerAttributes -> Maybe ConnectionSettings
connectionSettings :: Prelude.Maybe ConnectionSettings,
LoadBalancerAttributes -> Maybe ConnectionDraining
connectionDraining :: Prelude.Maybe ConnectionDraining
}
deriving (LoadBalancerAttributes -> LoadBalancerAttributes -> Bool
(LoadBalancerAttributes -> LoadBalancerAttributes -> Bool)
-> (LoadBalancerAttributes -> LoadBalancerAttributes -> Bool)
-> Eq LoadBalancerAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancerAttributes -> LoadBalancerAttributes -> Bool
$c/= :: LoadBalancerAttributes -> LoadBalancerAttributes -> Bool
== :: LoadBalancerAttributes -> LoadBalancerAttributes -> Bool
$c== :: LoadBalancerAttributes -> LoadBalancerAttributes -> Bool
Prelude.Eq, ReadPrec [LoadBalancerAttributes]
ReadPrec LoadBalancerAttributes
Int -> ReadS LoadBalancerAttributes
ReadS [LoadBalancerAttributes]
(Int -> ReadS LoadBalancerAttributes)
-> ReadS [LoadBalancerAttributes]
-> ReadPrec LoadBalancerAttributes
-> ReadPrec [LoadBalancerAttributes]
-> Read LoadBalancerAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancerAttributes]
$creadListPrec :: ReadPrec [LoadBalancerAttributes]
readPrec :: ReadPrec LoadBalancerAttributes
$creadPrec :: ReadPrec LoadBalancerAttributes
readList :: ReadS [LoadBalancerAttributes]
$creadList :: ReadS [LoadBalancerAttributes]
readsPrec :: Int -> ReadS LoadBalancerAttributes
$creadsPrec :: Int -> ReadS LoadBalancerAttributes
Prelude.Read, Int -> LoadBalancerAttributes -> ShowS
[LoadBalancerAttributes] -> ShowS
LoadBalancerAttributes -> String
(Int -> LoadBalancerAttributes -> ShowS)
-> (LoadBalancerAttributes -> String)
-> ([LoadBalancerAttributes] -> ShowS)
-> Show LoadBalancerAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancerAttributes] -> ShowS
$cshowList :: [LoadBalancerAttributes] -> ShowS
show :: LoadBalancerAttributes -> String
$cshow :: LoadBalancerAttributes -> String
showsPrec :: Int -> LoadBalancerAttributes -> ShowS
$cshowsPrec :: Int -> LoadBalancerAttributes -> ShowS
Prelude.Show, (forall x. LoadBalancerAttributes -> Rep LoadBalancerAttributes x)
-> (forall x.
Rep LoadBalancerAttributes x -> LoadBalancerAttributes)
-> Generic LoadBalancerAttributes
forall x. Rep LoadBalancerAttributes x -> LoadBalancerAttributes
forall x. LoadBalancerAttributes -> Rep LoadBalancerAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoadBalancerAttributes x -> LoadBalancerAttributes
$cfrom :: forall x. LoadBalancerAttributes -> Rep LoadBalancerAttributes x
Prelude.Generic)
newLoadBalancerAttributes ::
LoadBalancerAttributes
newLoadBalancerAttributes :: LoadBalancerAttributes
newLoadBalancerAttributes =
LoadBalancerAttributes' :: Maybe CrossZoneLoadBalancing
-> Maybe AccessLog
-> Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes
LoadBalancerAttributes'
{ $sel:crossZoneLoadBalancing:LoadBalancerAttributes' :: Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing =
Maybe CrossZoneLoadBalancing
forall a. Maybe a
Prelude.Nothing,
$sel:accessLog:LoadBalancerAttributes' :: Maybe AccessLog
accessLog = Maybe AccessLog
forall a. Maybe a
Prelude.Nothing,
$sel:additionalAttributes:LoadBalancerAttributes' :: Maybe [AdditionalAttribute]
additionalAttributes = Maybe [AdditionalAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:connectionSettings:LoadBalancerAttributes' :: Maybe ConnectionSettings
connectionSettings = Maybe ConnectionSettings
forall a. Maybe a
Prelude.Nothing,
$sel:connectionDraining:LoadBalancerAttributes' :: Maybe ConnectionDraining
connectionDraining = Maybe ConnectionDraining
forall a. Maybe a
Prelude.Nothing
}
loadBalancerAttributes_crossZoneLoadBalancing :: Lens.Lens' LoadBalancerAttributes (Prelude.Maybe CrossZoneLoadBalancing)
loadBalancerAttributes_crossZoneLoadBalancing :: (Maybe CrossZoneLoadBalancing -> f (Maybe CrossZoneLoadBalancing))
-> LoadBalancerAttributes -> f LoadBalancerAttributes
loadBalancerAttributes_crossZoneLoadBalancing = (LoadBalancerAttributes -> Maybe CrossZoneLoadBalancing)
-> (LoadBalancerAttributes
-> Maybe CrossZoneLoadBalancing -> LoadBalancerAttributes)
-> Lens
LoadBalancerAttributes
LoadBalancerAttributes
(Maybe CrossZoneLoadBalancing)
(Maybe CrossZoneLoadBalancing)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerAttributes' {Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing :: Maybe CrossZoneLoadBalancing
$sel:crossZoneLoadBalancing:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing} -> Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing) (\s :: LoadBalancerAttributes
s@LoadBalancerAttributes' {} Maybe CrossZoneLoadBalancing
a -> LoadBalancerAttributes
s {$sel:crossZoneLoadBalancing:LoadBalancerAttributes' :: Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing = Maybe CrossZoneLoadBalancing
a} :: LoadBalancerAttributes)
loadBalancerAttributes_accessLog :: Lens.Lens' LoadBalancerAttributes (Prelude.Maybe AccessLog)
loadBalancerAttributes_accessLog :: (Maybe AccessLog -> f (Maybe AccessLog))
-> LoadBalancerAttributes -> f LoadBalancerAttributes
loadBalancerAttributes_accessLog = (LoadBalancerAttributes -> Maybe AccessLog)
-> (LoadBalancerAttributes
-> Maybe AccessLog -> LoadBalancerAttributes)
-> Lens
LoadBalancerAttributes
LoadBalancerAttributes
(Maybe AccessLog)
(Maybe AccessLog)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerAttributes' {Maybe AccessLog
accessLog :: Maybe AccessLog
$sel:accessLog:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe AccessLog
accessLog} -> Maybe AccessLog
accessLog) (\s :: LoadBalancerAttributes
s@LoadBalancerAttributes' {} Maybe AccessLog
a -> LoadBalancerAttributes
s {$sel:accessLog:LoadBalancerAttributes' :: Maybe AccessLog
accessLog = Maybe AccessLog
a} :: LoadBalancerAttributes)
loadBalancerAttributes_additionalAttributes :: Lens.Lens' LoadBalancerAttributes (Prelude.Maybe [AdditionalAttribute])
loadBalancerAttributes_additionalAttributes :: (Maybe [AdditionalAttribute] -> f (Maybe [AdditionalAttribute]))
-> LoadBalancerAttributes -> f LoadBalancerAttributes
loadBalancerAttributes_additionalAttributes = (LoadBalancerAttributes -> Maybe [AdditionalAttribute])
-> (LoadBalancerAttributes
-> Maybe [AdditionalAttribute] -> LoadBalancerAttributes)
-> Lens
LoadBalancerAttributes
LoadBalancerAttributes
(Maybe [AdditionalAttribute])
(Maybe [AdditionalAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerAttributes' {Maybe [AdditionalAttribute]
additionalAttributes :: Maybe [AdditionalAttribute]
$sel:additionalAttributes:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe [AdditionalAttribute]
additionalAttributes} -> Maybe [AdditionalAttribute]
additionalAttributes) (\s :: LoadBalancerAttributes
s@LoadBalancerAttributes' {} Maybe [AdditionalAttribute]
a -> LoadBalancerAttributes
s {$sel:additionalAttributes:LoadBalancerAttributes' :: Maybe [AdditionalAttribute]
additionalAttributes = Maybe [AdditionalAttribute]
a} :: LoadBalancerAttributes) ((Maybe [AdditionalAttribute] -> f (Maybe [AdditionalAttribute]))
-> LoadBalancerAttributes -> f LoadBalancerAttributes)
-> ((Maybe [AdditionalAttribute]
-> f (Maybe [AdditionalAttribute]))
-> Maybe [AdditionalAttribute] -> f (Maybe [AdditionalAttribute]))
-> (Maybe [AdditionalAttribute] -> f (Maybe [AdditionalAttribute]))
-> LoadBalancerAttributes
-> f LoadBalancerAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AdditionalAttribute]
[AdditionalAttribute]
[AdditionalAttribute]
[AdditionalAttribute]
-> Iso
(Maybe [AdditionalAttribute])
(Maybe [AdditionalAttribute])
(Maybe [AdditionalAttribute])
(Maybe [AdditionalAttribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AdditionalAttribute]
[AdditionalAttribute]
[AdditionalAttribute]
[AdditionalAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
loadBalancerAttributes_connectionSettings :: Lens.Lens' LoadBalancerAttributes (Prelude.Maybe ConnectionSettings)
loadBalancerAttributes_connectionSettings :: (Maybe ConnectionSettings -> f (Maybe ConnectionSettings))
-> LoadBalancerAttributes -> f LoadBalancerAttributes
loadBalancerAttributes_connectionSettings = (LoadBalancerAttributes -> Maybe ConnectionSettings)
-> (LoadBalancerAttributes
-> Maybe ConnectionSettings -> LoadBalancerAttributes)
-> Lens
LoadBalancerAttributes
LoadBalancerAttributes
(Maybe ConnectionSettings)
(Maybe ConnectionSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerAttributes' {Maybe ConnectionSettings
connectionSettings :: Maybe ConnectionSettings
$sel:connectionSettings:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe ConnectionSettings
connectionSettings} -> Maybe ConnectionSettings
connectionSettings) (\s :: LoadBalancerAttributes
s@LoadBalancerAttributes' {} Maybe ConnectionSettings
a -> LoadBalancerAttributes
s {$sel:connectionSettings:LoadBalancerAttributes' :: Maybe ConnectionSettings
connectionSettings = Maybe ConnectionSettings
a} :: LoadBalancerAttributes)
loadBalancerAttributes_connectionDraining :: Lens.Lens' LoadBalancerAttributes (Prelude.Maybe ConnectionDraining)
loadBalancerAttributes_connectionDraining :: (Maybe ConnectionDraining -> f (Maybe ConnectionDraining))
-> LoadBalancerAttributes -> f LoadBalancerAttributes
loadBalancerAttributes_connectionDraining = (LoadBalancerAttributes -> Maybe ConnectionDraining)
-> (LoadBalancerAttributes
-> Maybe ConnectionDraining -> LoadBalancerAttributes)
-> Lens
LoadBalancerAttributes
LoadBalancerAttributes
(Maybe ConnectionDraining)
(Maybe ConnectionDraining)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerAttributes' {Maybe ConnectionDraining
connectionDraining :: Maybe ConnectionDraining
$sel:connectionDraining:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe ConnectionDraining
connectionDraining} -> Maybe ConnectionDraining
connectionDraining) (\s :: LoadBalancerAttributes
s@LoadBalancerAttributes' {} Maybe ConnectionDraining
a -> LoadBalancerAttributes
s {$sel:connectionDraining:LoadBalancerAttributes' :: Maybe ConnectionDraining
connectionDraining = Maybe ConnectionDraining
a} :: LoadBalancerAttributes)
instance Core.FromXML LoadBalancerAttributes where
parseXML :: [Node] -> Either String LoadBalancerAttributes
parseXML [Node]
x =
Maybe CrossZoneLoadBalancing
-> Maybe AccessLog
-> Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes
LoadBalancerAttributes'
(Maybe CrossZoneLoadBalancing
-> Maybe AccessLog
-> Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes)
-> Either String (Maybe CrossZoneLoadBalancing)
-> Either
String
(Maybe AccessLog
-> Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe CrossZoneLoadBalancing)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CrossZoneLoadBalancing")
Either
String
(Maybe AccessLog
-> Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes)
-> Either String (Maybe AccessLog)
-> Either
String
(Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe AccessLog)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccessLog")
Either
String
(Maybe [AdditionalAttribute]
-> Maybe ConnectionSettings
-> Maybe ConnectionDraining
-> LoadBalancerAttributes)
-> Either String (Maybe [AdditionalAttribute])
-> Either
String
(Maybe ConnectionSettings
-> Maybe ConnectionDraining -> LoadBalancerAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AdditionalAttributes"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [AdditionalAttribute]))
-> Either String (Maybe [AdditionalAttribute])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AdditionalAttribute])
-> [Node] -> Either String (Maybe [AdditionalAttribute])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AdditionalAttribute]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe ConnectionSettings
-> Maybe ConnectionDraining -> LoadBalancerAttributes)
-> Either String (Maybe ConnectionSettings)
-> Either
String (Maybe ConnectionDraining -> LoadBalancerAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ConnectionSettings)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ConnectionSettings")
Either String (Maybe ConnectionDraining -> LoadBalancerAttributes)
-> Either String (Maybe ConnectionDraining)
-> Either String LoadBalancerAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ConnectionDraining)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ConnectionDraining")
instance Prelude.Hashable LoadBalancerAttributes
instance Prelude.NFData LoadBalancerAttributes
instance Core.ToQuery LoadBalancerAttributes where
toQuery :: LoadBalancerAttributes -> QueryString
toQuery LoadBalancerAttributes' {Maybe [AdditionalAttribute]
Maybe AccessLog
Maybe ConnectionDraining
Maybe ConnectionSettings
Maybe CrossZoneLoadBalancing
connectionDraining :: Maybe ConnectionDraining
connectionSettings :: Maybe ConnectionSettings
additionalAttributes :: Maybe [AdditionalAttribute]
accessLog :: Maybe AccessLog
crossZoneLoadBalancing :: Maybe CrossZoneLoadBalancing
$sel:connectionDraining:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe ConnectionDraining
$sel:connectionSettings:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe ConnectionSettings
$sel:additionalAttributes:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe [AdditionalAttribute]
$sel:accessLog:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe AccessLog
$sel:crossZoneLoadBalancing:LoadBalancerAttributes' :: LoadBalancerAttributes -> Maybe CrossZoneLoadBalancing
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"CrossZoneLoadBalancing"
ByteString -> Maybe CrossZoneLoadBalancing -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing,
ByteString
"AccessLog" ByteString -> Maybe AccessLog -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AccessLog
accessLog,
ByteString
"AdditionalAttributes"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [AdditionalAttribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([AdditionalAttribute] -> QueryString)
-> Maybe [AdditionalAttribute] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AdditionalAttribute]
additionalAttributes
),
ByteString
"ConnectionSettings" ByteString -> Maybe ConnectionSettings -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ConnectionSettings
connectionSettings,
ByteString
"ConnectionDraining" ByteString -> Maybe ConnectionDraining -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ConnectionDraining
connectionDraining
]