{-# 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.DynamoDB.Types.RestoreSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RestoreSummary = RestoreSummary'
{
RestoreSummary -> Maybe Text
sourceTableArn :: Prelude.Maybe Prelude.Text,
RestoreSummary -> Maybe Text
sourceBackupArn :: Prelude.Maybe Prelude.Text,
RestoreSummary -> POSIX
restoreDateTime :: Core.POSIX,
RestoreSummary -> Bool
restoreInProgress :: Prelude.Bool
}
deriving (RestoreSummary -> RestoreSummary -> Bool
(RestoreSummary -> RestoreSummary -> Bool)
-> (RestoreSummary -> RestoreSummary -> Bool) -> Eq RestoreSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreSummary -> RestoreSummary -> Bool
$c/= :: RestoreSummary -> RestoreSummary -> Bool
== :: RestoreSummary -> RestoreSummary -> Bool
$c== :: RestoreSummary -> RestoreSummary -> Bool
Prelude.Eq, ReadPrec [RestoreSummary]
ReadPrec RestoreSummary
Int -> ReadS RestoreSummary
ReadS [RestoreSummary]
(Int -> ReadS RestoreSummary)
-> ReadS [RestoreSummary]
-> ReadPrec RestoreSummary
-> ReadPrec [RestoreSummary]
-> Read RestoreSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreSummary]
$creadListPrec :: ReadPrec [RestoreSummary]
readPrec :: ReadPrec RestoreSummary
$creadPrec :: ReadPrec RestoreSummary
readList :: ReadS [RestoreSummary]
$creadList :: ReadS [RestoreSummary]
readsPrec :: Int -> ReadS RestoreSummary
$creadsPrec :: Int -> ReadS RestoreSummary
Prelude.Read, Int -> RestoreSummary -> ShowS
[RestoreSummary] -> ShowS
RestoreSummary -> String
(Int -> RestoreSummary -> ShowS)
-> (RestoreSummary -> String)
-> ([RestoreSummary] -> ShowS)
-> Show RestoreSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreSummary] -> ShowS
$cshowList :: [RestoreSummary] -> ShowS
show :: RestoreSummary -> String
$cshow :: RestoreSummary -> String
showsPrec :: Int -> RestoreSummary -> ShowS
$cshowsPrec :: Int -> RestoreSummary -> ShowS
Prelude.Show, (forall x. RestoreSummary -> Rep RestoreSummary x)
-> (forall x. Rep RestoreSummary x -> RestoreSummary)
-> Generic RestoreSummary
forall x. Rep RestoreSummary x -> RestoreSummary
forall x. RestoreSummary -> Rep RestoreSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreSummary x -> RestoreSummary
$cfrom :: forall x. RestoreSummary -> Rep RestoreSummary x
Prelude.Generic)
newRestoreSummary ::
Prelude.UTCTime ->
Prelude.Bool ->
RestoreSummary
newRestoreSummary :: UTCTime -> Bool -> RestoreSummary
newRestoreSummary
UTCTime
pRestoreDateTime_
Bool
pRestoreInProgress_ =
RestoreSummary' :: Maybe Text -> Maybe Text -> POSIX -> Bool -> RestoreSummary
RestoreSummary'
{ $sel:sourceTableArn:RestoreSummary' :: Maybe Text
sourceTableArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceBackupArn:RestoreSummary' :: Maybe Text
sourceBackupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:restoreDateTime:RestoreSummary' :: POSIX
restoreDateTime =
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
pRestoreDateTime_,
$sel:restoreInProgress:RestoreSummary' :: Bool
restoreInProgress = Bool
pRestoreInProgress_
}
restoreSummary_sourceTableArn :: Lens.Lens' RestoreSummary (Prelude.Maybe Prelude.Text)
restoreSummary_sourceTableArn :: (Maybe Text -> f (Maybe Text))
-> RestoreSummary -> f RestoreSummary
restoreSummary_sourceTableArn = (RestoreSummary -> Maybe Text)
-> (RestoreSummary -> Maybe Text -> RestoreSummary)
-> Lens RestoreSummary RestoreSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSummary' {Maybe Text
sourceTableArn :: Maybe Text
$sel:sourceTableArn:RestoreSummary' :: RestoreSummary -> Maybe Text
sourceTableArn} -> Maybe Text
sourceTableArn) (\s :: RestoreSummary
s@RestoreSummary' {} Maybe Text
a -> RestoreSummary
s {$sel:sourceTableArn:RestoreSummary' :: Maybe Text
sourceTableArn = Maybe Text
a} :: RestoreSummary)
restoreSummary_sourceBackupArn :: Lens.Lens' RestoreSummary (Prelude.Maybe Prelude.Text)
restoreSummary_sourceBackupArn :: (Maybe Text -> f (Maybe Text))
-> RestoreSummary -> f RestoreSummary
restoreSummary_sourceBackupArn = (RestoreSummary -> Maybe Text)
-> (RestoreSummary -> Maybe Text -> RestoreSummary)
-> Lens RestoreSummary RestoreSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSummary' {Maybe Text
sourceBackupArn :: Maybe Text
$sel:sourceBackupArn:RestoreSummary' :: RestoreSummary -> Maybe Text
sourceBackupArn} -> Maybe Text
sourceBackupArn) (\s :: RestoreSummary
s@RestoreSummary' {} Maybe Text
a -> RestoreSummary
s {$sel:sourceBackupArn:RestoreSummary' :: Maybe Text
sourceBackupArn = Maybe Text
a} :: RestoreSummary)
restoreSummary_restoreDateTime :: Lens.Lens' RestoreSummary Prelude.UTCTime
restoreSummary_restoreDateTime :: (UTCTime -> f UTCTime) -> RestoreSummary -> f RestoreSummary
restoreSummary_restoreDateTime = (RestoreSummary -> POSIX)
-> (RestoreSummary -> POSIX -> RestoreSummary)
-> Lens RestoreSummary RestoreSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSummary' {POSIX
restoreDateTime :: POSIX
$sel:restoreDateTime:RestoreSummary' :: RestoreSummary -> POSIX
restoreDateTime} -> POSIX
restoreDateTime) (\s :: RestoreSummary
s@RestoreSummary' {} POSIX
a -> RestoreSummary
s {$sel:restoreDateTime:RestoreSummary' :: POSIX
restoreDateTime = POSIX
a} :: RestoreSummary) ((POSIX -> f POSIX) -> RestoreSummary -> f RestoreSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> RestoreSummary
-> f RestoreSummary
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
restoreSummary_restoreInProgress :: Lens.Lens' RestoreSummary Prelude.Bool
restoreSummary_restoreInProgress :: (Bool -> f Bool) -> RestoreSummary -> f RestoreSummary
restoreSummary_restoreInProgress = (RestoreSummary -> Bool)
-> (RestoreSummary -> Bool -> RestoreSummary)
-> Lens RestoreSummary RestoreSummary Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSummary' {Bool
restoreInProgress :: Bool
$sel:restoreInProgress:RestoreSummary' :: RestoreSummary -> Bool
restoreInProgress} -> Bool
restoreInProgress) (\s :: RestoreSummary
s@RestoreSummary' {} Bool
a -> RestoreSummary
s {$sel:restoreInProgress:RestoreSummary' :: Bool
restoreInProgress = Bool
a} :: RestoreSummary)
instance Core.FromJSON RestoreSummary where
parseJSON :: Value -> Parser RestoreSummary
parseJSON =
String
-> (Object -> Parser RestoreSummary)
-> Value
-> Parser RestoreSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RestoreSummary"
( \Object
x ->
Maybe Text -> Maybe Text -> POSIX -> Bool -> RestoreSummary
RestoreSummary'
(Maybe Text -> Maybe Text -> POSIX -> Bool -> RestoreSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> POSIX -> Bool -> RestoreSummary)
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
"SourceTableArn")
Parser (Maybe Text -> POSIX -> Bool -> RestoreSummary)
-> Parser (Maybe Text) -> Parser (POSIX -> Bool -> RestoreSummary)
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
"SourceBackupArn")
Parser (POSIX -> Bool -> RestoreSummary)
-> Parser POSIX -> Parser (Bool -> RestoreSummary)
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
"RestoreDateTime")
Parser (Bool -> RestoreSummary)
-> Parser Bool -> Parser RestoreSummary
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
"RestoreInProgress")
)
instance Prelude.Hashable RestoreSummary
instance Prelude.NFData RestoreSummary