{-# 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.MacieV2.Types.ReplicationDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReplicationDetails = ReplicationDetails'
{
ReplicationDetails -> Maybe Bool
replicated :: Prelude.Maybe Prelude.Bool,
ReplicationDetails -> Maybe [Text]
replicationAccounts :: Prelude.Maybe [Prelude.Text],
ReplicationDetails -> Maybe Bool
replicatedExternally :: Prelude.Maybe Prelude.Bool
}
deriving (ReplicationDetails -> ReplicationDetails -> Bool
(ReplicationDetails -> ReplicationDetails -> Bool)
-> (ReplicationDetails -> ReplicationDetails -> Bool)
-> Eq ReplicationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationDetails -> ReplicationDetails -> Bool
$c/= :: ReplicationDetails -> ReplicationDetails -> Bool
== :: ReplicationDetails -> ReplicationDetails -> Bool
$c== :: ReplicationDetails -> ReplicationDetails -> Bool
Prelude.Eq, ReadPrec [ReplicationDetails]
ReadPrec ReplicationDetails
Int -> ReadS ReplicationDetails
ReadS [ReplicationDetails]
(Int -> ReadS ReplicationDetails)
-> ReadS [ReplicationDetails]
-> ReadPrec ReplicationDetails
-> ReadPrec [ReplicationDetails]
-> Read ReplicationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationDetails]
$creadListPrec :: ReadPrec [ReplicationDetails]
readPrec :: ReadPrec ReplicationDetails
$creadPrec :: ReadPrec ReplicationDetails
readList :: ReadS [ReplicationDetails]
$creadList :: ReadS [ReplicationDetails]
readsPrec :: Int -> ReadS ReplicationDetails
$creadsPrec :: Int -> ReadS ReplicationDetails
Prelude.Read, Int -> ReplicationDetails -> ShowS
[ReplicationDetails] -> ShowS
ReplicationDetails -> String
(Int -> ReplicationDetails -> ShowS)
-> (ReplicationDetails -> String)
-> ([ReplicationDetails] -> ShowS)
-> Show ReplicationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationDetails] -> ShowS
$cshowList :: [ReplicationDetails] -> ShowS
show :: ReplicationDetails -> String
$cshow :: ReplicationDetails -> String
showsPrec :: Int -> ReplicationDetails -> ShowS
$cshowsPrec :: Int -> ReplicationDetails -> ShowS
Prelude.Show, (forall x. ReplicationDetails -> Rep ReplicationDetails x)
-> (forall x. Rep ReplicationDetails x -> ReplicationDetails)
-> Generic ReplicationDetails
forall x. Rep ReplicationDetails x -> ReplicationDetails
forall x. ReplicationDetails -> Rep ReplicationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationDetails x -> ReplicationDetails
$cfrom :: forall x. ReplicationDetails -> Rep ReplicationDetails x
Prelude.Generic)
newReplicationDetails ::
ReplicationDetails
newReplicationDetails :: ReplicationDetails
newReplicationDetails =
ReplicationDetails' :: Maybe Bool -> Maybe [Text] -> Maybe Bool -> ReplicationDetails
ReplicationDetails'
{ $sel:replicated:ReplicationDetails' :: Maybe Bool
replicated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:replicationAccounts:ReplicationDetails' :: Maybe [Text]
replicationAccounts = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:replicatedExternally:ReplicationDetails' :: Maybe Bool
replicatedExternally = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
replicationDetails_replicated :: Lens.Lens' ReplicationDetails (Prelude.Maybe Prelude.Bool)
replicationDetails_replicated :: (Maybe Bool -> f (Maybe Bool))
-> ReplicationDetails -> f ReplicationDetails
replicationDetails_replicated = (ReplicationDetails -> Maybe Bool)
-> (ReplicationDetails -> Maybe Bool -> ReplicationDetails)
-> Lens
ReplicationDetails ReplicationDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationDetails' {Maybe Bool
replicated :: Maybe Bool
$sel:replicated:ReplicationDetails' :: ReplicationDetails -> Maybe Bool
replicated} -> Maybe Bool
replicated) (\s :: ReplicationDetails
s@ReplicationDetails' {} Maybe Bool
a -> ReplicationDetails
s {$sel:replicated:ReplicationDetails' :: Maybe Bool
replicated = Maybe Bool
a} :: ReplicationDetails)
replicationDetails_replicationAccounts :: Lens.Lens' ReplicationDetails (Prelude.Maybe [Prelude.Text])
replicationDetails_replicationAccounts :: (Maybe [Text] -> f (Maybe [Text]))
-> ReplicationDetails -> f ReplicationDetails
replicationDetails_replicationAccounts = (ReplicationDetails -> Maybe [Text])
-> (ReplicationDetails -> Maybe [Text] -> ReplicationDetails)
-> Lens
ReplicationDetails ReplicationDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationDetails' {Maybe [Text]
replicationAccounts :: Maybe [Text]
$sel:replicationAccounts:ReplicationDetails' :: ReplicationDetails -> Maybe [Text]
replicationAccounts} -> Maybe [Text]
replicationAccounts) (\s :: ReplicationDetails
s@ReplicationDetails' {} Maybe [Text]
a -> ReplicationDetails
s {$sel:replicationAccounts:ReplicationDetails' :: Maybe [Text]
replicationAccounts = Maybe [Text]
a} :: ReplicationDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> ReplicationDetails -> f ReplicationDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ReplicationDetails
-> f ReplicationDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
replicationDetails_replicatedExternally :: Lens.Lens' ReplicationDetails (Prelude.Maybe Prelude.Bool)
replicationDetails_replicatedExternally :: (Maybe Bool -> f (Maybe Bool))
-> ReplicationDetails -> f ReplicationDetails
replicationDetails_replicatedExternally = (ReplicationDetails -> Maybe Bool)
-> (ReplicationDetails -> Maybe Bool -> ReplicationDetails)
-> Lens
ReplicationDetails ReplicationDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationDetails' {Maybe Bool
replicatedExternally :: Maybe Bool
$sel:replicatedExternally:ReplicationDetails' :: ReplicationDetails -> Maybe Bool
replicatedExternally} -> Maybe Bool
replicatedExternally) (\s :: ReplicationDetails
s@ReplicationDetails' {} Maybe Bool
a -> ReplicationDetails
s {$sel:replicatedExternally:ReplicationDetails' :: Maybe Bool
replicatedExternally = Maybe Bool
a} :: ReplicationDetails)
instance Core.FromJSON ReplicationDetails where
parseJSON :: Value -> Parser ReplicationDetails
parseJSON =
String
-> (Object -> Parser ReplicationDetails)
-> Value
-> Parser ReplicationDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReplicationDetails"
( \Object
x ->
Maybe Bool -> Maybe [Text] -> Maybe Bool -> ReplicationDetails
ReplicationDetails'
(Maybe Bool -> Maybe [Text] -> Maybe Bool -> ReplicationDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe [Text] -> Maybe Bool -> ReplicationDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"replicated")
Parser (Maybe [Text] -> Maybe Bool -> ReplicationDetails)
-> Parser (Maybe [Text])
-> Parser (Maybe Bool -> ReplicationDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"replicationAccounts"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Bool -> ReplicationDetails)
-> Parser (Maybe Bool) -> Parser ReplicationDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"replicatedExternally")
)
instance Prelude.Hashable ReplicationDetails
instance Prelude.NFData ReplicationDetails