{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types.AttributeValue
import Amazonka.DynamoDB.Types.PointInTimeRecoveryStatus
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data PointInTimeRecoveryDescription = PointInTimeRecoveryDescription'
{
PointInTimeRecoveryDescription -> Maybe POSIX
earliestRestorableDateTime :: Prelude.Maybe Data.POSIX,
PointInTimeRecoveryDescription -> Maybe POSIX
latestRestorableDateTime :: Prelude.Maybe Data.POSIX,
PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus :: Prelude.Maybe PointInTimeRecoveryStatus
}
deriving (PointInTimeRecoveryDescription
-> PointInTimeRecoveryDescription -> Bool
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]
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
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.
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'
{ $sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
earliestRestorableDateTime =
forall a. Maybe a
Prelude.Nothing,
$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: Maybe POSIX
latestRestorableDateTime = forall a. Maybe a
Prelude.Nothing,
$sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus = forall a. Maybe a
Prelude.Nothing
}
pointInTimeRecoveryDescription_earliestRestorableDateTime :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe Prelude.UTCTime)
pointInTimeRecoveryDescription_earliestRestorableDateTime :: Lens' PointInTimeRecoveryDescription (Maybe UTCTime)
pointInTimeRecoveryDescription_earliestRestorableDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
pointInTimeRecoveryDescription_latestRestorableDateTime :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe Prelude.UTCTime)
pointInTimeRecoveryDescription_latestRestorableDateTime :: Lens' PointInTimeRecoveryDescription (Maybe UTCTime)
pointInTimeRecoveryDescription_latestRestorableDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
pointInTimeRecoveryDescription_pointInTimeRecoveryStatus :: Lens.Lens' PointInTimeRecoveryDescription (Prelude.Maybe PointInTimeRecoveryStatus)
pointInTimeRecoveryDescription_pointInTimeRecoveryStatus :: Lens'
PointInTimeRecoveryDescription (Maybe PointInTimeRecoveryStatus)
pointInTimeRecoveryDescription_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)
instance Data.FromJSON PointInTimeRecoveryDescription where
parseJSON :: Value -> Parser PointInTimeRecoveryDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PointInTimeRecoveryDescription"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe PointInTimeRecoveryStatus
-> PointInTimeRecoveryDescription
PointInTimeRecoveryDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EarliestRestorableDateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LatestRestorableDateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PointInTimeRecoveryStatus")
)
instance
Prelude.Hashable
PointInTimeRecoveryDescription
where
hashWithSalt :: Int -> PointInTimeRecoveryDescription -> Int
hashWithSalt
Int
_salt
PointInTimeRecoveryDescription' {Maybe POSIX
Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus :: Maybe PointInTimeRecoveryStatus
latestRestorableDateTime :: Maybe POSIX
earliestRestorableDateTime :: Maybe POSIX
$sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus
$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
$sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
earliestRestorableDateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
latestRestorableDateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus
instance
Prelude.NFData
PointInTimeRecoveryDescription
where
rnf :: PointInTimeRecoveryDescription -> ()
rnf PointInTimeRecoveryDescription' {Maybe POSIX
Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus :: Maybe PointInTimeRecoveryStatus
latestRestorableDateTime :: Maybe POSIX
earliestRestorableDateTime :: Maybe POSIX
$sel:pointInTimeRecoveryStatus:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe PointInTimeRecoveryStatus
$sel:latestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
$sel:earliestRestorableDateTime:PointInTimeRecoveryDescription' :: PointInTimeRecoveryDescription -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
earliestRestorableDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
latestRestorableDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PointInTimeRecoveryStatus
pointInTimeRecoveryStatus