{-# 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.MGN.Types.DataReplicationInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.DataReplicationError
import Amazonka.MGN.Types.DataReplicationInfoReplicatedDisk
import Amazonka.MGN.Types.DataReplicationInitiation
import Amazonka.MGN.Types.DataReplicationState
import qualified Amazonka.Prelude as Prelude
data DataReplicationInfo = DataReplicationInfo'
{
DataReplicationInfo -> Maybe DataReplicationInitiation
dataReplicationInitiation :: Prelude.Maybe DataReplicationInitiation,
DataReplicationInfo -> Maybe DataReplicationError
dataReplicationError :: Prelude.Maybe DataReplicationError,
DataReplicationInfo -> Maybe Text
lagDuration :: Prelude.Maybe Prelude.Text,
DataReplicationInfo -> Maybe DataReplicationState
dataReplicationState :: Prelude.Maybe DataReplicationState,
DataReplicationInfo -> Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks :: Prelude.Maybe [DataReplicationInfoReplicatedDisk],
DataReplicationInfo -> Maybe Text
etaDateTime :: Prelude.Maybe Prelude.Text
}
deriving (DataReplicationInfo -> DataReplicationInfo -> Bool
(DataReplicationInfo -> DataReplicationInfo -> Bool)
-> (DataReplicationInfo -> DataReplicationInfo -> Bool)
-> Eq DataReplicationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataReplicationInfo -> DataReplicationInfo -> Bool
$c/= :: DataReplicationInfo -> DataReplicationInfo -> Bool
== :: DataReplicationInfo -> DataReplicationInfo -> Bool
$c== :: DataReplicationInfo -> DataReplicationInfo -> Bool
Prelude.Eq, ReadPrec [DataReplicationInfo]
ReadPrec DataReplicationInfo
Int -> ReadS DataReplicationInfo
ReadS [DataReplicationInfo]
(Int -> ReadS DataReplicationInfo)
-> ReadS [DataReplicationInfo]
-> ReadPrec DataReplicationInfo
-> ReadPrec [DataReplicationInfo]
-> Read DataReplicationInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataReplicationInfo]
$creadListPrec :: ReadPrec [DataReplicationInfo]
readPrec :: ReadPrec DataReplicationInfo
$creadPrec :: ReadPrec DataReplicationInfo
readList :: ReadS [DataReplicationInfo]
$creadList :: ReadS [DataReplicationInfo]
readsPrec :: Int -> ReadS DataReplicationInfo
$creadsPrec :: Int -> ReadS DataReplicationInfo
Prelude.Read, Int -> DataReplicationInfo -> ShowS
[DataReplicationInfo] -> ShowS
DataReplicationInfo -> String
(Int -> DataReplicationInfo -> ShowS)
-> (DataReplicationInfo -> String)
-> ([DataReplicationInfo] -> ShowS)
-> Show DataReplicationInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataReplicationInfo] -> ShowS
$cshowList :: [DataReplicationInfo] -> ShowS
show :: DataReplicationInfo -> String
$cshow :: DataReplicationInfo -> String
showsPrec :: Int -> DataReplicationInfo -> ShowS
$cshowsPrec :: Int -> DataReplicationInfo -> ShowS
Prelude.Show, (forall x. DataReplicationInfo -> Rep DataReplicationInfo x)
-> (forall x. Rep DataReplicationInfo x -> DataReplicationInfo)
-> Generic DataReplicationInfo
forall x. Rep DataReplicationInfo x -> DataReplicationInfo
forall x. DataReplicationInfo -> Rep DataReplicationInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataReplicationInfo x -> DataReplicationInfo
$cfrom :: forall x. DataReplicationInfo -> Rep DataReplicationInfo x
Prelude.Generic)
newDataReplicationInfo ::
DataReplicationInfo
newDataReplicationInfo :: DataReplicationInfo
newDataReplicationInfo =
DataReplicationInfo' :: Maybe DataReplicationInitiation
-> Maybe DataReplicationError
-> Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo
DataReplicationInfo'
{ $sel:dataReplicationInitiation:DataReplicationInfo' :: Maybe DataReplicationInitiation
dataReplicationInitiation =
Maybe DataReplicationInitiation
forall a. Maybe a
Prelude.Nothing,
$sel:dataReplicationError:DataReplicationInfo' :: Maybe DataReplicationError
dataReplicationError = Maybe DataReplicationError
forall a. Maybe a
Prelude.Nothing,
$sel:lagDuration:DataReplicationInfo' :: Maybe Text
lagDuration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataReplicationState:DataReplicationInfo' :: Maybe DataReplicationState
dataReplicationState = Maybe DataReplicationState
forall a. Maybe a
Prelude.Nothing,
$sel:replicatedDisks:DataReplicationInfo' :: Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks = Maybe [DataReplicationInfoReplicatedDisk]
forall a. Maybe a
Prelude.Nothing,
$sel:etaDateTime:DataReplicationInfo' :: Maybe Text
etaDateTime = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dataReplicationInfo_dataReplicationInitiation :: Lens.Lens' DataReplicationInfo (Prelude.Maybe DataReplicationInitiation)
dataReplicationInfo_dataReplicationInitiation :: (Maybe DataReplicationInitiation
-> f (Maybe DataReplicationInitiation))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_dataReplicationInitiation = (DataReplicationInfo -> Maybe DataReplicationInitiation)
-> (DataReplicationInfo
-> Maybe DataReplicationInitiation -> DataReplicationInfo)
-> Lens
DataReplicationInfo
DataReplicationInfo
(Maybe DataReplicationInitiation)
(Maybe DataReplicationInitiation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe DataReplicationInitiation
dataReplicationInitiation :: Maybe DataReplicationInitiation
$sel:dataReplicationInitiation:DataReplicationInfo' :: DataReplicationInfo -> Maybe DataReplicationInitiation
dataReplicationInitiation} -> Maybe DataReplicationInitiation
dataReplicationInitiation) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe DataReplicationInitiation
a -> DataReplicationInfo
s {$sel:dataReplicationInitiation:DataReplicationInfo' :: Maybe DataReplicationInitiation
dataReplicationInitiation = Maybe DataReplicationInitiation
a} :: DataReplicationInfo)
dataReplicationInfo_dataReplicationError :: Lens.Lens' DataReplicationInfo (Prelude.Maybe DataReplicationError)
dataReplicationInfo_dataReplicationError :: (Maybe DataReplicationError -> f (Maybe DataReplicationError))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_dataReplicationError = (DataReplicationInfo -> Maybe DataReplicationError)
-> (DataReplicationInfo
-> Maybe DataReplicationError -> DataReplicationInfo)
-> Lens
DataReplicationInfo
DataReplicationInfo
(Maybe DataReplicationError)
(Maybe DataReplicationError)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe DataReplicationError
dataReplicationError :: Maybe DataReplicationError
$sel:dataReplicationError:DataReplicationInfo' :: DataReplicationInfo -> Maybe DataReplicationError
dataReplicationError} -> Maybe DataReplicationError
dataReplicationError) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe DataReplicationError
a -> DataReplicationInfo
s {$sel:dataReplicationError:DataReplicationInfo' :: Maybe DataReplicationError
dataReplicationError = Maybe DataReplicationError
a} :: DataReplicationInfo)
dataReplicationInfo_lagDuration :: Lens.Lens' DataReplicationInfo (Prelude.Maybe Prelude.Text)
dataReplicationInfo_lagDuration :: (Maybe Text -> f (Maybe Text))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_lagDuration = (DataReplicationInfo -> Maybe Text)
-> (DataReplicationInfo -> Maybe Text -> DataReplicationInfo)
-> Lens
DataReplicationInfo DataReplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe Text
lagDuration :: Maybe Text
$sel:lagDuration:DataReplicationInfo' :: DataReplicationInfo -> Maybe Text
lagDuration} -> Maybe Text
lagDuration) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe Text
a -> DataReplicationInfo
s {$sel:lagDuration:DataReplicationInfo' :: Maybe Text
lagDuration = Maybe Text
a} :: DataReplicationInfo)
dataReplicationInfo_dataReplicationState :: Lens.Lens' DataReplicationInfo (Prelude.Maybe DataReplicationState)
dataReplicationInfo_dataReplicationState :: (Maybe DataReplicationState -> f (Maybe DataReplicationState))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_dataReplicationState = (DataReplicationInfo -> Maybe DataReplicationState)
-> (DataReplicationInfo
-> Maybe DataReplicationState -> DataReplicationInfo)
-> Lens
DataReplicationInfo
DataReplicationInfo
(Maybe DataReplicationState)
(Maybe DataReplicationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe DataReplicationState
dataReplicationState :: Maybe DataReplicationState
$sel:dataReplicationState:DataReplicationInfo' :: DataReplicationInfo -> Maybe DataReplicationState
dataReplicationState} -> Maybe DataReplicationState
dataReplicationState) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe DataReplicationState
a -> DataReplicationInfo
s {$sel:dataReplicationState:DataReplicationInfo' :: Maybe DataReplicationState
dataReplicationState = Maybe DataReplicationState
a} :: DataReplicationInfo)
dataReplicationInfo_replicatedDisks :: Lens.Lens' DataReplicationInfo (Prelude.Maybe [DataReplicationInfoReplicatedDisk])
dataReplicationInfo_replicatedDisks :: (Maybe [DataReplicationInfoReplicatedDisk]
-> f (Maybe [DataReplicationInfoReplicatedDisk]))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_replicatedDisks = (DataReplicationInfo -> Maybe [DataReplicationInfoReplicatedDisk])
-> (DataReplicationInfo
-> Maybe [DataReplicationInfoReplicatedDisk]
-> DataReplicationInfo)
-> Lens
DataReplicationInfo
DataReplicationInfo
(Maybe [DataReplicationInfoReplicatedDisk])
(Maybe [DataReplicationInfoReplicatedDisk])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks :: Maybe [DataReplicationInfoReplicatedDisk]
$sel:replicatedDisks:DataReplicationInfo' :: DataReplicationInfo -> Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks} -> Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe [DataReplicationInfoReplicatedDisk]
a -> DataReplicationInfo
s {$sel:replicatedDisks:DataReplicationInfo' :: Maybe [DataReplicationInfoReplicatedDisk]
replicatedDisks = Maybe [DataReplicationInfoReplicatedDisk]
a} :: DataReplicationInfo) ((Maybe [DataReplicationInfoReplicatedDisk]
-> f (Maybe [DataReplicationInfoReplicatedDisk]))
-> DataReplicationInfo -> f DataReplicationInfo)
-> ((Maybe [DataReplicationInfoReplicatedDisk]
-> f (Maybe [DataReplicationInfoReplicatedDisk]))
-> Maybe [DataReplicationInfoReplicatedDisk]
-> f (Maybe [DataReplicationInfoReplicatedDisk]))
-> (Maybe [DataReplicationInfoReplicatedDisk]
-> f (Maybe [DataReplicationInfoReplicatedDisk]))
-> DataReplicationInfo
-> f DataReplicationInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
-> Iso
(Maybe [DataReplicationInfoReplicatedDisk])
(Maybe [DataReplicationInfoReplicatedDisk])
(Maybe [DataReplicationInfoReplicatedDisk])
(Maybe [DataReplicationInfoReplicatedDisk])
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
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
[DataReplicationInfoReplicatedDisk]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dataReplicationInfo_etaDateTime :: Lens.Lens' DataReplicationInfo (Prelude.Maybe Prelude.Text)
dataReplicationInfo_etaDateTime :: (Maybe Text -> f (Maybe Text))
-> DataReplicationInfo -> f DataReplicationInfo
dataReplicationInfo_etaDateTime = (DataReplicationInfo -> Maybe Text)
-> (DataReplicationInfo -> Maybe Text -> DataReplicationInfo)
-> Lens
DataReplicationInfo DataReplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInfo' {Maybe Text
etaDateTime :: Maybe Text
$sel:etaDateTime:DataReplicationInfo' :: DataReplicationInfo -> Maybe Text
etaDateTime} -> Maybe Text
etaDateTime) (\s :: DataReplicationInfo
s@DataReplicationInfo' {} Maybe Text
a -> DataReplicationInfo
s {$sel:etaDateTime:DataReplicationInfo' :: Maybe Text
etaDateTime = Maybe Text
a} :: DataReplicationInfo)
instance Core.FromJSON DataReplicationInfo where
parseJSON :: Value -> Parser DataReplicationInfo
parseJSON =
String
-> (Object -> Parser DataReplicationInfo)
-> Value
-> Parser DataReplicationInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DataReplicationInfo"
( \Object
x ->
Maybe DataReplicationInitiation
-> Maybe DataReplicationError
-> Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo
DataReplicationInfo'
(Maybe DataReplicationInitiation
-> Maybe DataReplicationError
-> Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
-> Parser (Maybe DataReplicationInitiation)
-> Parser
(Maybe DataReplicationError
-> Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DataReplicationInitiation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataReplicationInitiation")
Parser
(Maybe DataReplicationError
-> Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
-> Parser (Maybe DataReplicationError)
-> Parser
(Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataReplicationError)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataReplicationError")
Parser
(Maybe Text
-> Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
forall (f :: * -> *) a b. Applicative f => 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
"lagDuration")
Parser
(Maybe DataReplicationState
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text
-> DataReplicationInfo)
-> Parser (Maybe DataReplicationState)
-> Parser
(Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text -> DataReplicationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataReplicationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataReplicationState")
Parser
(Maybe [DataReplicationInfoReplicatedDisk]
-> Maybe Text -> DataReplicationInfo)
-> Parser (Maybe [DataReplicationInfoReplicatedDisk])
-> Parser (Maybe Text -> DataReplicationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [DataReplicationInfoReplicatedDisk]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"replicatedDisks"
Parser (Maybe (Maybe [DataReplicationInfoReplicatedDisk]))
-> Maybe [DataReplicationInfoReplicatedDisk]
-> Parser (Maybe [DataReplicationInfoReplicatedDisk])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DataReplicationInfoReplicatedDisk]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> DataReplicationInfo)
-> Parser (Maybe Text) -> Parser DataReplicationInfo
forall (f :: * -> *) a b. Applicative f => 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
"etaDateTime")
)
instance Prelude.Hashable DataReplicationInfo
instance Prelude.NFData DataReplicationInfo