{-# 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.ElasticBeanstalk.Types.LoadBalancer
-- 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.ElasticBeanstalk.Types.LoadBalancer where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a LoadBalancer.
--
-- /See:/ 'newLoadBalancer' smart constructor.
data LoadBalancer = LoadBalancer'
  { -- | The name of the LoadBalancer.
    LoadBalancer -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (LoadBalancer -> LoadBalancer -> Bool
(LoadBalancer -> LoadBalancer -> Bool)
-> (LoadBalancer -> LoadBalancer -> Bool) -> Eq LoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancer -> LoadBalancer -> Bool
$c/= :: LoadBalancer -> LoadBalancer -> Bool
== :: LoadBalancer -> LoadBalancer -> Bool
$c== :: LoadBalancer -> LoadBalancer -> Bool
Prelude.Eq, ReadPrec [LoadBalancer]
ReadPrec LoadBalancer
Int -> ReadS LoadBalancer
ReadS [LoadBalancer]
(Int -> ReadS LoadBalancer)
-> ReadS [LoadBalancer]
-> ReadPrec LoadBalancer
-> ReadPrec [LoadBalancer]
-> Read LoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancer]
$creadListPrec :: ReadPrec [LoadBalancer]
readPrec :: ReadPrec LoadBalancer
$creadPrec :: ReadPrec LoadBalancer
readList :: ReadS [LoadBalancer]
$creadList :: ReadS [LoadBalancer]
readsPrec :: Int -> ReadS LoadBalancer
$creadsPrec :: Int -> ReadS LoadBalancer
Prelude.Read, Int -> LoadBalancer -> ShowS
[LoadBalancer] -> ShowS
LoadBalancer -> String
(Int -> LoadBalancer -> ShowS)
-> (LoadBalancer -> String)
-> ([LoadBalancer] -> ShowS)
-> Show LoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancer] -> ShowS
$cshowList :: [LoadBalancer] -> ShowS
show :: LoadBalancer -> String
$cshow :: LoadBalancer -> String
showsPrec :: Int -> LoadBalancer -> ShowS
$cshowsPrec :: Int -> LoadBalancer -> ShowS
Prelude.Show, (forall x. LoadBalancer -> Rep LoadBalancer x)
-> (forall x. Rep LoadBalancer x -> LoadBalancer)
-> Generic LoadBalancer
forall x. Rep LoadBalancer x -> LoadBalancer
forall x. LoadBalancer -> Rep LoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoadBalancer x -> LoadBalancer
$cfrom :: forall x. LoadBalancer -> Rep LoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'LoadBalancer' 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:
--
-- 'name', 'loadBalancer_name' - The name of the LoadBalancer.
newLoadBalancer ::
  LoadBalancer
newLoadBalancer :: LoadBalancer
newLoadBalancer =
  LoadBalancer' :: Maybe Text -> LoadBalancer
LoadBalancer' {$sel:name:LoadBalancer' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the LoadBalancer.
loadBalancer_name :: Lens.Lens' LoadBalancer (Prelude.Maybe Prelude.Text)
loadBalancer_name :: (Maybe Text -> f (Maybe Text)) -> LoadBalancer -> f LoadBalancer
loadBalancer_name = (LoadBalancer -> Maybe Text)
-> (LoadBalancer -> Maybe Text -> LoadBalancer)
-> Lens LoadBalancer LoadBalancer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancer' {Maybe Text
name :: Maybe Text
$sel:name:LoadBalancer' :: LoadBalancer -> Maybe Text
name} -> Maybe Text
name) (\s :: LoadBalancer
s@LoadBalancer' {} Maybe Text
a -> LoadBalancer
s {$sel:name:LoadBalancer' :: Maybe Text
name = Maybe Text
a} :: LoadBalancer)

instance Core.FromXML LoadBalancer where
  parseXML :: [Node] -> Either String LoadBalancer
parseXML [Node]
x =
    Maybe Text -> LoadBalancer
LoadBalancer' (Maybe Text -> LoadBalancer)
-> Either String (Maybe Text) -> Either String LoadBalancer
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
"Name")

instance Prelude.Hashable LoadBalancer

instance Prelude.NFData LoadBalancer