{-# 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.FailoverState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.FailoverStatus
data FailoverState = FailoverState'
{
FailoverState -> Maybe FailoverStatus
status :: Prelude.Maybe FailoverStatus,
FailoverState -> Maybe Text
toDbClusterArn :: Prelude.Maybe Prelude.Text,
FailoverState -> Maybe Text
fromDbClusterArn :: Prelude.Maybe Prelude.Text
}
deriving (FailoverState -> FailoverState -> Bool
(FailoverState -> FailoverState -> Bool)
-> (FailoverState -> FailoverState -> Bool) -> Eq FailoverState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailoverState -> FailoverState -> Bool
$c/= :: FailoverState -> FailoverState -> Bool
== :: FailoverState -> FailoverState -> Bool
$c== :: FailoverState -> FailoverState -> Bool
Prelude.Eq, ReadPrec [FailoverState]
ReadPrec FailoverState
Int -> ReadS FailoverState
ReadS [FailoverState]
(Int -> ReadS FailoverState)
-> ReadS [FailoverState]
-> ReadPrec FailoverState
-> ReadPrec [FailoverState]
-> Read FailoverState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailoverState]
$creadListPrec :: ReadPrec [FailoverState]
readPrec :: ReadPrec FailoverState
$creadPrec :: ReadPrec FailoverState
readList :: ReadS [FailoverState]
$creadList :: ReadS [FailoverState]
readsPrec :: Int -> ReadS FailoverState
$creadsPrec :: Int -> ReadS FailoverState
Prelude.Read, Int -> FailoverState -> ShowS
[FailoverState] -> ShowS
FailoverState -> String
(Int -> FailoverState -> ShowS)
-> (FailoverState -> String)
-> ([FailoverState] -> ShowS)
-> Show FailoverState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailoverState] -> ShowS
$cshowList :: [FailoverState] -> ShowS
show :: FailoverState -> String
$cshow :: FailoverState -> String
showsPrec :: Int -> FailoverState -> ShowS
$cshowsPrec :: Int -> FailoverState -> ShowS
Prelude.Show, (forall x. FailoverState -> Rep FailoverState x)
-> (forall x. Rep FailoverState x -> FailoverState)
-> Generic FailoverState
forall x. Rep FailoverState x -> FailoverState
forall x. FailoverState -> Rep FailoverState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailoverState x -> FailoverState
$cfrom :: forall x. FailoverState -> Rep FailoverState x
Prelude.Generic)
newFailoverState ::
FailoverState
newFailoverState :: FailoverState
newFailoverState =
FailoverState' :: Maybe FailoverStatus -> Maybe Text -> Maybe Text -> FailoverState
FailoverState'
{ $sel:status:FailoverState' :: Maybe FailoverStatus
status = Maybe FailoverStatus
forall a. Maybe a
Prelude.Nothing,
$sel:toDbClusterArn:FailoverState' :: Maybe Text
toDbClusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fromDbClusterArn:FailoverState' :: Maybe Text
fromDbClusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
failoverState_status :: Lens.Lens' FailoverState (Prelude.Maybe FailoverStatus)
failoverState_status :: (Maybe FailoverStatus -> f (Maybe FailoverStatus))
-> FailoverState -> f FailoverState
failoverState_status = (FailoverState -> Maybe FailoverStatus)
-> (FailoverState -> Maybe FailoverStatus -> FailoverState)
-> Lens
FailoverState
FailoverState
(Maybe FailoverStatus)
(Maybe FailoverStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailoverState' {Maybe FailoverStatus
status :: Maybe FailoverStatus
$sel:status:FailoverState' :: FailoverState -> Maybe FailoverStatus
status} -> Maybe FailoverStatus
status) (\s :: FailoverState
s@FailoverState' {} Maybe FailoverStatus
a -> FailoverState
s {$sel:status:FailoverState' :: Maybe FailoverStatus
status = Maybe FailoverStatus
a} :: FailoverState)
failoverState_toDbClusterArn :: Lens.Lens' FailoverState (Prelude.Maybe Prelude.Text)
failoverState_toDbClusterArn :: (Maybe Text -> f (Maybe Text)) -> FailoverState -> f FailoverState
failoverState_toDbClusterArn = (FailoverState -> Maybe Text)
-> (FailoverState -> Maybe Text -> FailoverState)
-> Lens FailoverState FailoverState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailoverState' {Maybe Text
toDbClusterArn :: Maybe Text
$sel:toDbClusterArn:FailoverState' :: FailoverState -> Maybe Text
toDbClusterArn} -> Maybe Text
toDbClusterArn) (\s :: FailoverState
s@FailoverState' {} Maybe Text
a -> FailoverState
s {$sel:toDbClusterArn:FailoverState' :: Maybe Text
toDbClusterArn = Maybe Text
a} :: FailoverState)
failoverState_fromDbClusterArn :: Lens.Lens' FailoverState (Prelude.Maybe Prelude.Text)
failoverState_fromDbClusterArn :: (Maybe Text -> f (Maybe Text)) -> FailoverState -> f FailoverState
failoverState_fromDbClusterArn = (FailoverState -> Maybe Text)
-> (FailoverState -> Maybe Text -> FailoverState)
-> Lens FailoverState FailoverState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailoverState' {Maybe Text
fromDbClusterArn :: Maybe Text
$sel:fromDbClusterArn:FailoverState' :: FailoverState -> Maybe Text
fromDbClusterArn} -> Maybe Text
fromDbClusterArn) (\s :: FailoverState
s@FailoverState' {} Maybe Text
a -> FailoverState
s {$sel:fromDbClusterArn:FailoverState' :: Maybe Text
fromDbClusterArn = Maybe Text
a} :: FailoverState)
instance Core.FromXML FailoverState where
parseXML :: [Node] -> Either String FailoverState
parseXML [Node]
x =
Maybe FailoverStatus -> Maybe Text -> Maybe Text -> FailoverState
FailoverState'
(Maybe FailoverStatus -> Maybe Text -> Maybe Text -> FailoverState)
-> Either String (Maybe FailoverStatus)
-> Either String (Maybe Text -> Maybe Text -> FailoverState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe FailoverStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
Either String (Maybe Text -> Maybe Text -> FailoverState)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> FailoverState)
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
"ToDbClusterArn")
Either String (Maybe Text -> FailoverState)
-> Either String (Maybe Text) -> Either String FailoverState
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
"FromDbClusterArn")
instance Prelude.Hashable FailoverState
instance Prelude.NFData FailoverState