{-# 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.ELBV2.Types.LoadBalancerState where
import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.LoadBalancerStateEnum
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LoadBalancerState = LoadBalancerState'
{
LoadBalancerState -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
LoadBalancerState -> Maybe LoadBalancerStateEnum
code :: Prelude.Maybe LoadBalancerStateEnum
}
deriving (LoadBalancerState -> LoadBalancerState -> Bool
(LoadBalancerState -> LoadBalancerState -> Bool)
-> (LoadBalancerState -> LoadBalancerState -> Bool)
-> Eq LoadBalancerState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancerState -> LoadBalancerState -> Bool
$c/= :: LoadBalancerState -> LoadBalancerState -> Bool
== :: LoadBalancerState -> LoadBalancerState -> Bool
$c== :: LoadBalancerState -> LoadBalancerState -> Bool
Prelude.Eq, ReadPrec [LoadBalancerState]
ReadPrec LoadBalancerState
Int -> ReadS LoadBalancerState
ReadS [LoadBalancerState]
(Int -> ReadS LoadBalancerState)
-> ReadS [LoadBalancerState]
-> ReadPrec LoadBalancerState
-> ReadPrec [LoadBalancerState]
-> Read LoadBalancerState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancerState]
$creadListPrec :: ReadPrec [LoadBalancerState]
readPrec :: ReadPrec LoadBalancerState
$creadPrec :: ReadPrec LoadBalancerState
readList :: ReadS [LoadBalancerState]
$creadList :: ReadS [LoadBalancerState]
readsPrec :: Int -> ReadS LoadBalancerState
$creadsPrec :: Int -> ReadS LoadBalancerState
Prelude.Read, Int -> LoadBalancerState -> ShowS
[LoadBalancerState] -> ShowS
LoadBalancerState -> String
(Int -> LoadBalancerState -> ShowS)
-> (LoadBalancerState -> String)
-> ([LoadBalancerState] -> ShowS)
-> Show LoadBalancerState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancerState] -> ShowS
$cshowList :: [LoadBalancerState] -> ShowS
show :: LoadBalancerState -> String
$cshow :: LoadBalancerState -> String
showsPrec :: Int -> LoadBalancerState -> ShowS
$cshowsPrec :: Int -> LoadBalancerState -> ShowS
Prelude.Show, (forall x. LoadBalancerState -> Rep LoadBalancerState x)
-> (forall x. Rep LoadBalancerState x -> LoadBalancerState)
-> Generic LoadBalancerState
forall x. Rep LoadBalancerState x -> LoadBalancerState
forall x. LoadBalancerState -> Rep LoadBalancerState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoadBalancerState x -> LoadBalancerState
$cfrom :: forall x. LoadBalancerState -> Rep LoadBalancerState x
Prelude.Generic)
newLoadBalancerState ::
LoadBalancerState
newLoadBalancerState :: LoadBalancerState
newLoadBalancerState =
LoadBalancerState' :: Maybe Text -> Maybe LoadBalancerStateEnum -> LoadBalancerState
LoadBalancerState'
{ $sel:reason:LoadBalancerState' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:code:LoadBalancerState' :: Maybe LoadBalancerStateEnum
code = Maybe LoadBalancerStateEnum
forall a. Maybe a
Prelude.Nothing
}
loadBalancerState_reason :: Lens.Lens' LoadBalancerState (Prelude.Maybe Prelude.Text)
loadBalancerState_reason :: (Maybe Text -> f (Maybe Text))
-> LoadBalancerState -> f LoadBalancerState
loadBalancerState_reason = (LoadBalancerState -> Maybe Text)
-> (LoadBalancerState -> Maybe Text -> LoadBalancerState)
-> Lens
LoadBalancerState LoadBalancerState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerState' {Maybe Text
reason :: Maybe Text
$sel:reason:LoadBalancerState' :: LoadBalancerState -> Maybe Text
reason} -> Maybe Text
reason) (\s :: LoadBalancerState
s@LoadBalancerState' {} Maybe Text
a -> LoadBalancerState
s {$sel:reason:LoadBalancerState' :: Maybe Text
reason = Maybe Text
a} :: LoadBalancerState)
loadBalancerState_code :: Lens.Lens' LoadBalancerState (Prelude.Maybe LoadBalancerStateEnum)
loadBalancerState_code :: (Maybe LoadBalancerStateEnum -> f (Maybe LoadBalancerStateEnum))
-> LoadBalancerState -> f LoadBalancerState
loadBalancerState_code = (LoadBalancerState -> Maybe LoadBalancerStateEnum)
-> (LoadBalancerState
-> Maybe LoadBalancerStateEnum -> LoadBalancerState)
-> Lens
LoadBalancerState
LoadBalancerState
(Maybe LoadBalancerStateEnum)
(Maybe LoadBalancerStateEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerState' {Maybe LoadBalancerStateEnum
code :: Maybe LoadBalancerStateEnum
$sel:code:LoadBalancerState' :: LoadBalancerState -> Maybe LoadBalancerStateEnum
code} -> Maybe LoadBalancerStateEnum
code) (\s :: LoadBalancerState
s@LoadBalancerState' {} Maybe LoadBalancerStateEnum
a -> LoadBalancerState
s {$sel:code:LoadBalancerState' :: Maybe LoadBalancerStateEnum
code = Maybe LoadBalancerStateEnum
a} :: LoadBalancerState)
instance Core.FromXML LoadBalancerState where
parseXML :: [Node] -> Either String LoadBalancerState
parseXML [Node]
x =
Maybe Text -> Maybe LoadBalancerStateEnum -> LoadBalancerState
LoadBalancerState'
(Maybe Text -> Maybe LoadBalancerStateEnum -> LoadBalancerState)
-> Either String (Maybe Text)
-> Either String (Maybe LoadBalancerStateEnum -> LoadBalancerState)
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
"Reason") Either String (Maybe LoadBalancerStateEnum -> LoadBalancerState)
-> Either String (Maybe LoadBalancerStateEnum)
-> Either String LoadBalancerState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LoadBalancerStateEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Code")
instance Prelude.Hashable LoadBalancerState
instance Prelude.NFData LoadBalancerState