{-# 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.ELB.Types.LoadBalancerAttributes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The attributes for a load balancer.
--
-- /See:/ 'newLoadBalancerAttributes' smart constructor.
data LoadBalancerAttributes = LoadBalancerAttributes'
  { -- | If enabled, the load balancer routes the request traffic evenly across
    -- all instances regardless of the Availability Zones.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html Configure Cross-Zone Load Balancing>
    -- in the /Classic Load Balancers Guide/.
    LoadBalancerAttributes -> Maybe CrossZoneLoadBalancing
crossZoneLoadBalancing :: Prelude.Maybe CrossZoneLoadBalancing,
    -- | If enabled, the load balancer captures detailed information of all
    -- requests and delivers the information to the Amazon S3 bucket that you
    -- specify.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html Enable Access Logs>
    -- in the /Classic Load Balancers Guide/.
    LoadBalancerAttributes -> Maybe AccessLog
accessLog :: Prelude.Maybe AccessLog,
    -- | Any additional attributes.
    LoadBalancerAttributes -> Maybe [AdditionalAttribute]
additionalAttributes :: Prelude.Maybe [AdditionalAttribute],
    -- | If enabled, the load balancer allows the connections to remain idle (no
    -- data is sent over the connection) for the specified duration.
    --
    -- By default, Elastic Load Balancing maintains a 60-second idle connection
    -- timeout for both front-end and back-end connections of your load
    -- balancer. For more information, see
    -- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html Configure Idle Connection Timeout>
    -- in the /Classic Load Balancers Guide/.
    LoadBalancerAttributes -> Maybe ConnectionSettings
connectionSettings :: Prelude.Maybe ConnectionSettings,
    -- | If enabled, the load balancer allows existing requests to complete
    -- before the load balancer shifts traffic away from a deregistered or
    -- unhealthy instance.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html Configure Connection Draining>
    -- in the /Classic Load Balancers Guide/.
    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)

-- |
-- Create a value of 'LoadBalancerAttributes' 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:
--
-- 'crossZoneLoadBalancing', 'loadBalancerAttributes_crossZoneLoadBalancing' - If enabled, the load balancer routes the request traffic evenly across
-- all instances regardless of the Availability Zones.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html Configure Cross-Zone Load Balancing>
-- in the /Classic Load Balancers Guide/.
--
-- 'accessLog', 'loadBalancerAttributes_accessLog' - If enabled, the load balancer captures detailed information of all
-- requests and delivers the information to the Amazon S3 bucket that you
-- specify.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html Enable Access Logs>
-- in the /Classic Load Balancers Guide/.
--
-- 'additionalAttributes', 'loadBalancerAttributes_additionalAttributes' - Any additional attributes.
--
-- 'connectionSettings', 'loadBalancerAttributes_connectionSettings' - If enabled, the load balancer allows the connections to remain idle (no
-- data is sent over the connection) for the specified duration.
--
-- By default, Elastic Load Balancing maintains a 60-second idle connection
-- timeout for both front-end and back-end connections of your load
-- balancer. For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html Configure Idle Connection Timeout>
-- in the /Classic Load Balancers Guide/.
--
-- 'connectionDraining', 'loadBalancerAttributes_connectionDraining' - If enabled, the load balancer allows existing requests to complete
-- before the load balancer shifts traffic away from a deregistered or
-- unhealthy instance.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html Configure Connection Draining>
-- in the /Classic Load Balancers Guide/.
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
    }

-- | If enabled, the load balancer routes the request traffic evenly across
-- all instances regardless of the Availability Zones.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html Configure Cross-Zone Load Balancing>
-- in the /Classic Load Balancers Guide/.
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)

-- | If enabled, the load balancer captures detailed information of all
-- requests and delivers the information to the Amazon S3 bucket that you
-- specify.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html Enable Access Logs>
-- in the /Classic Load Balancers Guide/.
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)

-- | Any additional attributes.
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

-- | If enabled, the load balancer allows the connections to remain idle (no
-- data is sent over the connection) for the specified duration.
--
-- By default, Elastic Load Balancing maintains a 60-second idle connection
-- timeout for both front-end and back-end connections of your load
-- balancer. For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html Configure Idle Connection Timeout>
-- in the /Classic Load Balancers Guide/.
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)

-- | If enabled, the load balancer allows existing requests to complete
-- before the load balancer shifts traffic away from a deregistered or
-- unhealthy instance.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html Configure Connection Draining>
-- in the /Classic Load Balancers Guide/.
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
      ]