{-# 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.PointInTimeRecoveryDescription where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.PointInTimeRecoveryStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PointInTimeRecoveryDescription = PointInTimeRecoveryDescription'
{
PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus :: Prelude.Maybe PointInTimeRecoveryStatus,
PointInTimeRecoveryDescription -> Maybe POSIX
earliestRestorableDateTime :: Prelude.Maybe Core.POSIX,
PointInTimeRecoveryDescription -> Maybe POSIX
latestRestorableDateTime :: Prelude.Maybe Core.POSIX
}
deriving (PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
(PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool)
-> (PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool)
-> Eq PointInTimeRecoveryDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
$c/= :: PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
== :: PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
$c== :: PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
Prelude.Eq, ReadPrec [PointInTimeRecoveryDescription]
ReadPrec PointInTimeRecoveryDescription
Int -> ReadS PointInTimeRecoveryDescription
ReadS [PointInTimeRecoveryDescription]
(Int -> ReadS PointInTimeRecoveryDescription)
-> ReadS [PointInTimeRecoveryDescription]
-> ReadPrec PointInTimeRecoveryDescription
-> ReadPrec [PointInTimeRecoveryDescription]
-> Read PointInTimeRecoveryDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PointInTimeRecoveryDescription]
$creadListPrec :: ReadPrec [PointInTimeRecoveryDescription]
readPrec :: ReadPrec PointInTimeRecoveryDescription
$creadPrec :: ReadPrec PointInTimeRecoveryDescription
readList :: ReadS [PointInTimeRecoveryDescription]
$creadList :: ReadS [PointInTimeRecoveryDescription]
readsPrec :: Int -> ReadS PointInTimeRecoveryDescription
$creadsPrec :: Int -> ReadS PointInTimeRecoveryDescription
Prelude.Read, Int -> PointInTimeRecoveryDescription -> ShowS
[PointInTimeRecoveryDescription] -> ShowS
PointInTimeRecoveryDescription -> String
(Int -> PointInTimeRecoveryDescription -> ShowS)
-> (PointInTimeRecoveryDescription -> String)
-> ([PointInTimeRecoveryDescription] -> ShowS)
-> Show PointInTimeRecoveryDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PointInTimeRecoveryDescription] -> ShowS
$cshowList :: [PointInTimeRecoveryDescription] -> ShowS
show :: PointInTimeRecoveryDescription -> String
$cshow :: PointInTimeRecoveryDescription -> String
showsPrec :: Int -> PointInTimeRecoveryDescription -> ShowS
$cshowsPrec :: Int -> PointInTimeRecoveryDescription -> ShowS
Prelude.Show, (forall x.
PointInTimeRecoveryDescription
-> Rep PointInTimeRecoveryDescription x)
-> (forall x.
Rep PointInTimeRecoveryDescription x
-> PointInTimeRecoveryDescription)
-> Generic PointInTimeRecoveryDescription
forall x.
Rep PointInTimeRecoveryDescription x
-> PointInTimeRecoveryDescription
forall x.
PointInTimeRecoveryDescription
-> Rep PointInTimeRecoveryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PointInTimeRecoveryDescription x
-> PointInTimeRecoveryDescription
$cfrom :: forall x.
PointInTimeRecoveryDescription
-> Rep PointInTimeRecoveryDescription x
Prelude.Generic)
newPointInTimeRecoveryDescription ::
PointInTimeRecoveryDescription
newPointInTimeRecoveryDescription :: PointInTimeRecoveryDescription
newPointInTimeRecoveryDescription =
PointInTimeRecoveryDescription' :: Maybe PointInTimeRecoveryStatus
-> Maybe POSIX -> Maybe POSIX -> PointInTimeRecoveryDescription
PointInTimeRecoveryDescription'
{ $sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus =
Maybe PointInTimeRecoveryStatus
forall a. Maybe a
Prelude.Nothing,
$sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
earliestRestorableDateTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
latestRestorableDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
pointInTimeRecoveryDescription_pointInTimeRecoveryStatus :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe PointInTimeRecoveryStatus)
pointInTimeRecoveryDescription_pointInTimeRecoveryStatus :: (Maybe PointInTimeRecoveryStatus
-> f (Maybe PointInTimeRecoveryStatus))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription
pointInTimeRecoveryDescription_pointInTimeRecoveryStatus = (PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus)
-> (PointInTimeRecoveryDescription
-> Maybe PointInTimeRecoveryStatus
-> PointInTimeRecoveryDescription)
-> Lens
PointInTimeRecoveryDescription
PointInTimeRecoveryDescription
(Maybe PointInTimeRecoveryStatus)
(Maybe PointInTimeRecoveryStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PointInTimeRecoveryDescription' {Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus :: Maybe PointInTimeRecoveryStatus
$sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus} -> Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus) (\s :: PointInTimeRecoveryDescription
s@PointInTimeRecoveryDescription' {} Maybe PointInTimeRecoveryStatus
a -> PointInTimeRecoveryDescription
s {$sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus = Maybe PointInTimeRecoveryStatus
a} :: PointInTimeRecoveryDescription)
pointInTimeRecoveryDescription_earliestRestorableDateTime :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe Prelude.UTCTime)
pointInTimeRecoveryDescription_earliestRestorableDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription
pointInTimeRecoveryDescription_earliestRestorableDateTime = (PointInTimeRecoveryDescription -> Maybe POSIX)
-> (PointInTimeRecoveryDescription
-> Maybe POSIX -> PointInTimeRecoveryDescription)
-> Lens
PointInTimeRecoveryDescription
PointInTimeRecoveryDescription
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PointInTimeRecoveryDescription' {Maybe POSIX
earliestRestorableDateTime :: Maybe POSIX
$sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
earliestRestorableDateTime} -> Maybe POSIX
earliestRestorableDateTime) (\s :: PointInTimeRecoveryDescription
s@PointInTimeRecoveryDescription' {} Maybe POSIX
a -> PointInTimeRecoveryDescription
s {$sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
earliestRestorableDateTime = Maybe POSIX
a} :: PointInTimeRecoveryDescription) ((Maybe POSIX -> f (Maybe POSIX))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
pointInTimeRecoveryDescription_latestRestorableDateTime :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe Prelude.UTCTime)
pointInTimeRecoveryDescription_latestRestorableDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription
pointInTimeRecoveryDescription_latestRestorableDateTime = (PointInTimeRecoveryDescription -> Maybe POSIX)
-> (PointInTimeRecoveryDescription
-> Maybe POSIX -> PointInTimeRecoveryDescription)
-> Lens
PointInTimeRecoveryDescription
PointInTimeRecoveryDescription
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PointInTimeRecoveryDescription' {Maybe POSIX
latestRestorableDateTime :: Maybe POSIX
$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
latestRestorableDateTime} -> Maybe POSIX
latestRestorableDateTime) (\s :: PointInTimeRecoveryDescription
s@PointInTimeRecoveryDescription' {} Maybe POSIX
a -> PointInTimeRecoveryDescription
s {$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
latestRestorableDateTime = Maybe POSIX
a} :: PointInTimeRecoveryDescription) ((Maybe POSIX -> f (Maybe POSIX))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PointInTimeRecoveryDescription
-> f PointInTimeRecoveryDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON PointInTimeRecoveryDescription where
parseJSON :: Value -> Parser PointInTimeRecoveryDescription
parseJSON =
String
-> (Object -> Parser PointInTimeRecoveryDescription)
-> Value
-> Parser PointInTimeRecoveryDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PointInTimeRecoveryDescription"
( \Object
x ->
Maybe PointInTimeRecoveryStatus
-> Maybe POSIX -> Maybe POSIX -> PointInTimeRecoveryDescription
PointInTimeRecoveryDescription'
(Maybe PointInTimeRecoveryStatus
-> Maybe POSIX -> Maybe POSIX -> PointInTimeRecoveryDescription)
-> Parser (Maybe PointInTimeRecoveryStatus)
-> Parser
(Maybe POSIX -> Maybe POSIX -> PointInTimeRecoveryDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PointInTimeRecoveryStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PointInTimeRecoveryStatus")
Parser
(Maybe POSIX -> Maybe POSIX -> PointInTimeRecoveryDescription)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> PointInTimeRecoveryDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EarliestRestorableDateTime")
Parser (Maybe POSIX -> PointInTimeRecoveryDescription)
-> Parser (Maybe POSIX) -> Parser PointInTimeRecoveryDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LatestRestorableDateTime")
)
instance
Prelude.Hashable
PointInTimeRecoveryDescription
instance
Prelude.NFData
PointInTimeRecoveryDescription