{-# 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.SSMIncidents.Types.ReplicationSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.RegionInfo
import Amazonka.SSMIncidents.Types.ReplicationSetStatus
data ReplicationSet = ReplicationSet'
{
ReplicationSet -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ReplicationSet -> Text
createdBy :: Prelude.Text,
ReplicationSet -> POSIX
createdTime :: Core.POSIX,
ReplicationSet -> Bool
deletionProtected :: Prelude.Bool,
ReplicationSet -> Text
lastModifiedBy :: Prelude.Text,
ReplicationSet -> POSIX
lastModifiedTime :: Core.POSIX,
ReplicationSet -> HashMap Text RegionInfo
regionMap :: Prelude.HashMap Prelude.Text RegionInfo,
ReplicationSet -> ReplicationSetStatus
status :: ReplicationSetStatus
}
deriving (ReplicationSet -> ReplicationSet -> Bool
(ReplicationSet -> ReplicationSet -> Bool)
-> (ReplicationSet -> ReplicationSet -> Bool) -> Eq ReplicationSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationSet -> ReplicationSet -> Bool
$c/= :: ReplicationSet -> ReplicationSet -> Bool
== :: ReplicationSet -> ReplicationSet -> Bool
$c== :: ReplicationSet -> ReplicationSet -> Bool
Prelude.Eq, ReadPrec [ReplicationSet]
ReadPrec ReplicationSet
Int -> ReadS ReplicationSet
ReadS [ReplicationSet]
(Int -> ReadS ReplicationSet)
-> ReadS [ReplicationSet]
-> ReadPrec ReplicationSet
-> ReadPrec [ReplicationSet]
-> Read ReplicationSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationSet]
$creadListPrec :: ReadPrec [ReplicationSet]
readPrec :: ReadPrec ReplicationSet
$creadPrec :: ReadPrec ReplicationSet
readList :: ReadS [ReplicationSet]
$creadList :: ReadS [ReplicationSet]
readsPrec :: Int -> ReadS ReplicationSet
$creadsPrec :: Int -> ReadS ReplicationSet
Prelude.Read, Int -> ReplicationSet -> ShowS
[ReplicationSet] -> ShowS
ReplicationSet -> String
(Int -> ReplicationSet -> ShowS)
-> (ReplicationSet -> String)
-> ([ReplicationSet] -> ShowS)
-> Show ReplicationSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationSet] -> ShowS
$cshowList :: [ReplicationSet] -> ShowS
show :: ReplicationSet -> String
$cshow :: ReplicationSet -> String
showsPrec :: Int -> ReplicationSet -> ShowS
$cshowsPrec :: Int -> ReplicationSet -> ShowS
Prelude.Show, (forall x. ReplicationSet -> Rep ReplicationSet x)
-> (forall x. Rep ReplicationSet x -> ReplicationSet)
-> Generic ReplicationSet
forall x. Rep ReplicationSet x -> ReplicationSet
forall x. ReplicationSet -> Rep ReplicationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationSet x -> ReplicationSet
$cfrom :: forall x. ReplicationSet -> Rep ReplicationSet x
Prelude.Generic)
newReplicationSet ::
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Bool ->
Prelude.Text ->
Prelude.UTCTime ->
ReplicationSetStatus ->
ReplicationSet
newReplicationSet :: Text
-> UTCTime
-> Bool
-> Text
-> UTCTime
-> ReplicationSetStatus
-> ReplicationSet
newReplicationSet
Text
pCreatedBy_
UTCTime
pCreatedTime_
Bool
pDeletionProtected_
Text
pLastModifiedBy_
UTCTime
pLastModifiedTime_
ReplicationSetStatus
pStatus_ =
ReplicationSet' :: Maybe Text
-> Text
-> POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet
ReplicationSet'
{ $sel:arn:ReplicationSet' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdBy:ReplicationSet' :: Text
createdBy = Text
pCreatedBy_,
$sel:createdTime:ReplicationSet' :: POSIX
createdTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedTime_,
$sel:deletionProtected:ReplicationSet' :: Bool
deletionProtected = Bool
pDeletionProtected_,
$sel:lastModifiedBy:ReplicationSet' :: Text
lastModifiedBy = Text
pLastModifiedBy_,
$sel:lastModifiedTime:ReplicationSet' :: POSIX
lastModifiedTime =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_,
$sel:regionMap:ReplicationSet' :: HashMap Text RegionInfo
regionMap = HashMap Text RegionInfo
forall a. Monoid a => a
Prelude.mempty,
$sel:status:ReplicationSet' :: ReplicationSetStatus
status = ReplicationSetStatus
pStatus_
}
replicationSet_arn :: Lens.Lens' ReplicationSet (Prelude.Maybe Prelude.Text)
replicationSet_arn :: (Maybe Text -> f (Maybe Text))
-> ReplicationSet -> f ReplicationSet
replicationSet_arn = (ReplicationSet -> Maybe Text)
-> (ReplicationSet -> Maybe Text -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {Maybe Text
arn :: Maybe Text
$sel:arn:ReplicationSet' :: ReplicationSet -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ReplicationSet
s@ReplicationSet' {} Maybe Text
a -> ReplicationSet
s {$sel:arn:ReplicationSet' :: Maybe Text
arn = Maybe Text
a} :: ReplicationSet)
replicationSet_createdBy :: Lens.Lens' ReplicationSet Prelude.Text
replicationSet_createdBy :: (Text -> f Text) -> ReplicationSet -> f ReplicationSet
replicationSet_createdBy = (ReplicationSet -> Text)
-> (ReplicationSet -> Text -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {Text
createdBy :: Text
$sel:createdBy:ReplicationSet' :: ReplicationSet -> Text
createdBy} -> Text
createdBy) (\s :: ReplicationSet
s@ReplicationSet' {} Text
a -> ReplicationSet
s {$sel:createdBy:ReplicationSet' :: Text
createdBy = Text
a} :: ReplicationSet)
replicationSet_createdTime :: Lens.Lens' ReplicationSet Prelude.UTCTime
replicationSet_createdTime :: (UTCTime -> f UTCTime) -> ReplicationSet -> f ReplicationSet
replicationSet_createdTime = (ReplicationSet -> POSIX)
-> (ReplicationSet -> POSIX -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {POSIX
createdTime :: POSIX
$sel:createdTime:ReplicationSet' :: ReplicationSet -> POSIX
createdTime} -> POSIX
createdTime) (\s :: ReplicationSet
s@ReplicationSet' {} POSIX
a -> ReplicationSet
s {$sel:createdTime:ReplicationSet' :: POSIX
createdTime = POSIX
a} :: ReplicationSet) ((POSIX -> f POSIX) -> ReplicationSet -> f ReplicationSet)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ReplicationSet
-> f ReplicationSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
replicationSet_deletionProtected :: Lens.Lens' ReplicationSet Prelude.Bool
replicationSet_deletionProtected :: (Bool -> f Bool) -> ReplicationSet -> f ReplicationSet
replicationSet_deletionProtected = (ReplicationSet -> Bool)
-> (ReplicationSet -> Bool -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {Bool
deletionProtected :: Bool
$sel:deletionProtected:ReplicationSet' :: ReplicationSet -> Bool
deletionProtected} -> Bool
deletionProtected) (\s :: ReplicationSet
s@ReplicationSet' {} Bool
a -> ReplicationSet
s {$sel:deletionProtected:ReplicationSet' :: Bool
deletionProtected = Bool
a} :: ReplicationSet)
replicationSet_lastModifiedBy :: Lens.Lens' ReplicationSet Prelude.Text
replicationSet_lastModifiedBy :: (Text -> f Text) -> ReplicationSet -> f ReplicationSet
replicationSet_lastModifiedBy = (ReplicationSet -> Text)
-> (ReplicationSet -> Text -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {Text
lastModifiedBy :: Text
$sel:lastModifiedBy:ReplicationSet' :: ReplicationSet -> Text
lastModifiedBy} -> Text
lastModifiedBy) (\s :: ReplicationSet
s@ReplicationSet' {} Text
a -> ReplicationSet
s {$sel:lastModifiedBy:ReplicationSet' :: Text
lastModifiedBy = Text
a} :: ReplicationSet)
replicationSet_lastModifiedTime :: Lens.Lens' ReplicationSet Prelude.UTCTime
replicationSet_lastModifiedTime :: (UTCTime -> f UTCTime) -> ReplicationSet -> f ReplicationSet
replicationSet_lastModifiedTime = (ReplicationSet -> POSIX)
-> (ReplicationSet -> POSIX -> ReplicationSet)
-> Lens ReplicationSet ReplicationSet POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:ReplicationSet' :: ReplicationSet -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: ReplicationSet
s@ReplicationSet' {} POSIX
a -> ReplicationSet
s {$sel:lastModifiedTime:ReplicationSet' :: POSIX
lastModifiedTime = POSIX
a} :: ReplicationSet) ((POSIX -> f POSIX) -> ReplicationSet -> f ReplicationSet)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ReplicationSet
-> f ReplicationSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
replicationSet_regionMap :: Lens.Lens' ReplicationSet (Prelude.HashMap Prelude.Text RegionInfo)
replicationSet_regionMap :: (HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> ReplicationSet -> f ReplicationSet
replicationSet_regionMap = (ReplicationSet -> HashMap Text RegionInfo)
-> (ReplicationSet -> HashMap Text RegionInfo -> ReplicationSet)
-> Lens
ReplicationSet
ReplicationSet
(HashMap Text RegionInfo)
(HashMap Text RegionInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {HashMap Text RegionInfo
regionMap :: HashMap Text RegionInfo
$sel:regionMap:ReplicationSet' :: ReplicationSet -> HashMap Text RegionInfo
regionMap} -> HashMap Text RegionInfo
regionMap) (\s :: ReplicationSet
s@ReplicationSet' {} HashMap Text RegionInfo
a -> ReplicationSet
s {$sel:regionMap:ReplicationSet' :: HashMap Text RegionInfo
regionMap = HashMap Text RegionInfo
a} :: ReplicationSet) ((HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> ReplicationSet -> f ReplicationSet)
-> ((HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> (HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> ReplicationSet
-> f ReplicationSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text RegionInfo -> f (HashMap Text RegionInfo))
-> HashMap Text RegionInfo -> f (HashMap Text RegionInfo)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
replicationSet_status :: Lens.Lens' ReplicationSet ReplicationSetStatus
replicationSet_status :: (ReplicationSetStatus -> f ReplicationSetStatus)
-> ReplicationSet -> f ReplicationSet
replicationSet_status = (ReplicationSet -> ReplicationSetStatus)
-> (ReplicationSet -> ReplicationSetStatus -> ReplicationSet)
-> Lens
ReplicationSet
ReplicationSet
ReplicationSetStatus
ReplicationSetStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationSet' {ReplicationSetStatus
status :: ReplicationSetStatus
$sel:status:ReplicationSet' :: ReplicationSet -> ReplicationSetStatus
status} -> ReplicationSetStatus
status) (\s :: ReplicationSet
s@ReplicationSet' {} ReplicationSetStatus
a -> ReplicationSet
s {$sel:status:ReplicationSet' :: ReplicationSetStatus
status = ReplicationSetStatus
a} :: ReplicationSet)
instance Core.FromJSON ReplicationSet where
parseJSON :: Value -> Parser ReplicationSet
parseJSON =
String
-> (Object -> Parser ReplicationSet)
-> Value
-> Parser ReplicationSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReplicationSet"
( \Object
x ->
Maybe Text
-> Text
-> POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet
ReplicationSet'
(Maybe Text
-> Text
-> POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser (Maybe Text)
-> Parser
(Text
-> POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
Parser
(Text
-> POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser Text
-> Parser
(POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdBy")
Parser
(POSIX
-> Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser POSIX
-> Parser
(Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdTime")
Parser
(Bool
-> Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser Bool
-> Parser
(Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deletionProtected")
Parser
(Text
-> POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser Text
-> Parser
(POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastModifiedBy")
Parser
(POSIX
-> HashMap Text RegionInfo
-> ReplicationSetStatus
-> ReplicationSet)
-> Parser POSIX
-> Parser
(HashMap Text RegionInfo -> ReplicationSetStatus -> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastModifiedTime")
Parser
(HashMap Text RegionInfo -> ReplicationSetStatus -> ReplicationSet)
-> Parser (HashMap Text RegionInfo)
-> Parser (ReplicationSetStatus -> ReplicationSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (HashMap Text RegionInfo))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"regionMap" Parser (Maybe (HashMap Text RegionInfo))
-> HashMap Text RegionInfo -> Parser (HashMap Text RegionInfo)
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= HashMap Text RegionInfo
forall a. Monoid a => a
Prelude.mempty)
Parser (ReplicationSetStatus -> ReplicationSet)
-> Parser ReplicationSetStatus -> Parser ReplicationSet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ReplicationSetStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
)
instance Prelude.Hashable ReplicationSet
instance Prelude.NFData ReplicationSet