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