{-# 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.SourceRegion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceRegion = SourceRegion'
{
SourceRegion -> Maybe Bool
supportsDBInstanceAutomatedBackupsReplication :: Prelude.Maybe Prelude.Bool,
SourceRegion -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
SourceRegion -> Maybe Text
regionName :: Prelude.Maybe Prelude.Text,
SourceRegion -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text
}
deriving (SourceRegion -> SourceRegion -> Bool
(SourceRegion -> SourceRegion -> Bool)
-> (SourceRegion -> SourceRegion -> Bool) -> Eq SourceRegion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceRegion -> SourceRegion -> Bool
$c/= :: SourceRegion -> SourceRegion -> Bool
== :: SourceRegion -> SourceRegion -> Bool
$c== :: SourceRegion -> SourceRegion -> Bool
Prelude.Eq, ReadPrec [SourceRegion]
ReadPrec SourceRegion
Int -> ReadS SourceRegion
ReadS [SourceRegion]
(Int -> ReadS SourceRegion)
-> ReadS [SourceRegion]
-> ReadPrec SourceRegion
-> ReadPrec [SourceRegion]
-> Read SourceRegion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceRegion]
$creadListPrec :: ReadPrec [SourceRegion]
readPrec :: ReadPrec SourceRegion
$creadPrec :: ReadPrec SourceRegion
readList :: ReadS [SourceRegion]
$creadList :: ReadS [SourceRegion]
readsPrec :: Int -> ReadS SourceRegion
$creadsPrec :: Int -> ReadS SourceRegion
Prelude.Read, Int -> SourceRegion -> ShowS
[SourceRegion] -> ShowS
SourceRegion -> String
(Int -> SourceRegion -> ShowS)
-> (SourceRegion -> String)
-> ([SourceRegion] -> ShowS)
-> Show SourceRegion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceRegion] -> ShowS
$cshowList :: [SourceRegion] -> ShowS
show :: SourceRegion -> String
$cshow :: SourceRegion -> String
showsPrec :: Int -> SourceRegion -> ShowS
$cshowsPrec :: Int -> SourceRegion -> ShowS
Prelude.Show, (forall x. SourceRegion -> Rep SourceRegion x)
-> (forall x. Rep SourceRegion x -> SourceRegion)
-> Generic SourceRegion
forall x. Rep SourceRegion x -> SourceRegion
forall x. SourceRegion -> Rep SourceRegion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceRegion x -> SourceRegion
$cfrom :: forall x. SourceRegion -> Rep SourceRegion x
Prelude.Generic)
newSourceRegion ::
SourceRegion
newSourceRegion :: SourceRegion
newSourceRegion =
SourceRegion' :: Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Text -> SourceRegion
SourceRegion'
{ $sel:supportsDBInstanceAutomatedBackupsReplication:SourceRegion' :: Maybe Bool
supportsDBInstanceAutomatedBackupsReplication =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:status:SourceRegion' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:regionName:SourceRegion' :: Maybe Text
regionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:SourceRegion' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sourceRegion_supportsDBInstanceAutomatedBackupsReplication :: Lens.Lens' SourceRegion (Prelude.Maybe Prelude.Bool)
sourceRegion_supportsDBInstanceAutomatedBackupsReplication :: (Maybe Bool -> f (Maybe Bool)) -> SourceRegion -> f SourceRegion
sourceRegion_supportsDBInstanceAutomatedBackupsReplication = (SourceRegion -> Maybe Bool)
-> (SourceRegion -> Maybe Bool -> SourceRegion)
-> Lens SourceRegion SourceRegion (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRegion' {Maybe Bool
supportsDBInstanceAutomatedBackupsReplication :: Maybe Bool
$sel:supportsDBInstanceAutomatedBackupsReplication:SourceRegion' :: SourceRegion -> Maybe Bool
supportsDBInstanceAutomatedBackupsReplication} -> Maybe Bool
supportsDBInstanceAutomatedBackupsReplication) (\s :: SourceRegion
s@SourceRegion' {} Maybe Bool
a -> SourceRegion
s {$sel:supportsDBInstanceAutomatedBackupsReplication:SourceRegion' :: Maybe Bool
supportsDBInstanceAutomatedBackupsReplication = Maybe Bool
a} :: SourceRegion)
sourceRegion_status :: Lens.Lens' SourceRegion (Prelude.Maybe Prelude.Text)
sourceRegion_status :: (Maybe Text -> f (Maybe Text)) -> SourceRegion -> f SourceRegion
sourceRegion_status = (SourceRegion -> Maybe Text)
-> (SourceRegion -> Maybe Text -> SourceRegion)
-> Lens SourceRegion SourceRegion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRegion' {Maybe Text
status :: Maybe Text
$sel:status:SourceRegion' :: SourceRegion -> Maybe Text
status} -> Maybe Text
status) (\s :: SourceRegion
s@SourceRegion' {} Maybe Text
a -> SourceRegion
s {$sel:status:SourceRegion' :: Maybe Text
status = Maybe Text
a} :: SourceRegion)
sourceRegion_regionName :: Lens.Lens' SourceRegion (Prelude.Maybe Prelude.Text)
sourceRegion_regionName :: (Maybe Text -> f (Maybe Text)) -> SourceRegion -> f SourceRegion
sourceRegion_regionName = (SourceRegion -> Maybe Text)
-> (SourceRegion -> Maybe Text -> SourceRegion)
-> Lens SourceRegion SourceRegion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRegion' {Maybe Text
regionName :: Maybe Text
$sel:regionName:SourceRegion' :: SourceRegion -> Maybe Text
regionName} -> Maybe Text
regionName) (\s :: SourceRegion
s@SourceRegion' {} Maybe Text
a -> SourceRegion
s {$sel:regionName:SourceRegion' :: Maybe Text
regionName = Maybe Text
a} :: SourceRegion)
sourceRegion_endpoint :: Lens.Lens' SourceRegion (Prelude.Maybe Prelude.Text)
sourceRegion_endpoint :: (Maybe Text -> f (Maybe Text)) -> SourceRegion -> f SourceRegion
sourceRegion_endpoint = (SourceRegion -> Maybe Text)
-> (SourceRegion -> Maybe Text -> SourceRegion)
-> Lens SourceRegion SourceRegion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRegion' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:SourceRegion' :: SourceRegion -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: SourceRegion
s@SourceRegion' {} Maybe Text
a -> SourceRegion
s {$sel:endpoint:SourceRegion' :: Maybe Text
endpoint = Maybe Text
a} :: SourceRegion)
instance Core.FromXML SourceRegion where
parseXML :: [Node] -> Either String SourceRegion
parseXML [Node]
x =
Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Text -> SourceRegion
SourceRegion'
(Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Text -> SourceRegion)
-> Either String (Maybe Bool)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Text -> SourceRegion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
[Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SupportsDBInstanceAutomatedBackupsReplication"
)
Either
String (Maybe Text -> Maybe Text -> Maybe Text -> SourceRegion)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> SourceRegion)
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
"Status")
Either String (Maybe Text -> Maybe Text -> SourceRegion)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> SourceRegion)
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
"RegionName")
Either String (Maybe Text -> SourceRegion)
-> Either String (Maybe Text) -> Either String SourceRegion
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
"Endpoint")
instance Prelude.Hashable SourceRegion
instance Prelude.NFData SourceRegion