{-# 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.BackupDetails where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.BackupStatus
import Amazonka.DynamoDB.Types.BackupType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BackupDetails = BackupDetails'
{
BackupDetails -> Maybe POSIX
backupExpiryDateTime :: Prelude.Maybe Core.POSIX,
BackupDetails -> Maybe Natural
backupSizeBytes :: Prelude.Maybe Prelude.Natural,
BackupDetails -> Text
backupArn :: Prelude.Text,
BackupDetails -> Text
backupName :: Prelude.Text,
BackupDetails -> BackupStatus
backupStatus :: BackupStatus,
BackupDetails -> BackupType
backupType :: BackupType,
BackupDetails -> POSIX
backupCreationDateTime :: Core.POSIX
}
deriving (BackupDetails -> BackupDetails -> Bool
(BackupDetails -> BackupDetails -> Bool)
-> (BackupDetails -> BackupDetails -> Bool) -> Eq BackupDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupDetails -> BackupDetails -> Bool
$c/= :: BackupDetails -> BackupDetails -> Bool
== :: BackupDetails -> BackupDetails -> Bool
$c== :: BackupDetails -> BackupDetails -> Bool
Prelude.Eq, ReadPrec [BackupDetails]
ReadPrec BackupDetails
Int -> ReadS BackupDetails
ReadS [BackupDetails]
(Int -> ReadS BackupDetails)
-> ReadS [BackupDetails]
-> ReadPrec BackupDetails
-> ReadPrec [BackupDetails]
-> Read BackupDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackupDetails]
$creadListPrec :: ReadPrec [BackupDetails]
readPrec :: ReadPrec BackupDetails
$creadPrec :: ReadPrec BackupDetails
readList :: ReadS [BackupDetails]
$creadList :: ReadS [BackupDetails]
readsPrec :: Int -> ReadS BackupDetails
$creadsPrec :: Int -> ReadS BackupDetails
Prelude.Read, Int -> BackupDetails -> ShowS
[BackupDetails] -> ShowS
BackupDetails -> String
(Int -> BackupDetails -> ShowS)
-> (BackupDetails -> String)
-> ([BackupDetails] -> ShowS)
-> Show BackupDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupDetails] -> ShowS
$cshowList :: [BackupDetails] -> ShowS
show :: BackupDetails -> String
$cshow :: BackupDetails -> String
showsPrec :: Int -> BackupDetails -> ShowS
$cshowsPrec :: Int -> BackupDetails -> ShowS
Prelude.Show, (forall x. BackupDetails -> Rep BackupDetails x)
-> (forall x. Rep BackupDetails x -> BackupDetails)
-> Generic BackupDetails
forall x. Rep BackupDetails x -> BackupDetails
forall x. BackupDetails -> Rep BackupDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BackupDetails x -> BackupDetails
$cfrom :: forall x. BackupDetails -> Rep BackupDetails x
Prelude.Generic)
newBackupDetails ::
Prelude.Text ->
Prelude.Text ->
BackupStatus ->
BackupType ->
Prelude.UTCTime ->
BackupDetails
newBackupDetails :: Text
-> Text -> BackupStatus -> BackupType -> UTCTime -> BackupDetails
newBackupDetails
Text
pBackupArn_
Text
pBackupName_
BackupStatus
pBackupStatus_
BackupType
pBackupType_
UTCTime
pBackupCreationDateTime_ =
BackupDetails' :: Maybe POSIX
-> Maybe Natural
-> Text
-> Text
-> BackupStatus
-> BackupType
-> POSIX
-> BackupDetails
BackupDetails'
{ $sel:backupExpiryDateTime:BackupDetails' :: Maybe POSIX
backupExpiryDateTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:backupSizeBytes:BackupDetails' :: Maybe Natural
backupSizeBytes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:backupArn:BackupDetails' :: Text
backupArn = Text
pBackupArn_,
$sel:backupName:BackupDetails' :: Text
backupName = Text
pBackupName_,
$sel:backupStatus:BackupDetails' :: BackupStatus
backupStatus = BackupStatus
pBackupStatus_,
$sel:backupType:BackupDetails' :: BackupType
backupType = BackupType
pBackupType_,
$sel:backupCreationDateTime:BackupDetails' :: POSIX
backupCreationDateTime =
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
pBackupCreationDateTime_
}
backupDetails_backupExpiryDateTime :: Lens.Lens' BackupDetails (Prelude.Maybe Prelude.UTCTime)
backupDetails_backupExpiryDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupDetails -> f BackupDetails
backupDetails_backupExpiryDateTime = (BackupDetails -> Maybe POSIX)
-> (BackupDetails -> Maybe POSIX -> BackupDetails)
-> Lens BackupDetails BackupDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {Maybe POSIX
backupExpiryDateTime :: Maybe POSIX
$sel:backupExpiryDateTime:BackupDetails' :: BackupDetails -> Maybe POSIX
backupExpiryDateTime} -> Maybe POSIX
backupExpiryDateTime) (\s :: BackupDetails
s@BackupDetails' {} Maybe POSIX
a -> BackupDetails
s {$sel:backupExpiryDateTime:BackupDetails' :: Maybe POSIX
backupExpiryDateTime = Maybe POSIX
a} :: BackupDetails) ((Maybe POSIX -> f (Maybe POSIX))
-> BackupDetails -> f BackupDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupDetails
-> f BackupDetails
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
backupDetails_backupSizeBytes :: Lens.Lens' BackupDetails (Prelude.Maybe Prelude.Natural)
backupDetails_backupSizeBytes :: (Maybe Natural -> f (Maybe Natural))
-> BackupDetails -> f BackupDetails
backupDetails_backupSizeBytes = (BackupDetails -> Maybe Natural)
-> (BackupDetails -> Maybe Natural -> BackupDetails)
-> Lens BackupDetails BackupDetails (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {Maybe Natural
backupSizeBytes :: Maybe Natural
$sel:backupSizeBytes:BackupDetails' :: BackupDetails -> Maybe Natural
backupSizeBytes} -> Maybe Natural
backupSizeBytes) (\s :: BackupDetails
s@BackupDetails' {} Maybe Natural
a -> BackupDetails
s {$sel:backupSizeBytes:BackupDetails' :: Maybe Natural
backupSizeBytes = Maybe Natural
a} :: BackupDetails)
backupDetails_backupArn :: Lens.Lens' BackupDetails Prelude.Text
backupDetails_backupArn :: (Text -> f Text) -> BackupDetails -> f BackupDetails
backupDetails_backupArn = (BackupDetails -> Text)
-> (BackupDetails -> Text -> BackupDetails)
-> Lens BackupDetails BackupDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {Text
backupArn :: Text
$sel:backupArn:BackupDetails' :: BackupDetails -> Text
backupArn} -> Text
backupArn) (\s :: BackupDetails
s@BackupDetails' {} Text
a -> BackupDetails
s {$sel:backupArn:BackupDetails' :: Text
backupArn = Text
a} :: BackupDetails)
backupDetails_backupName :: Lens.Lens' BackupDetails Prelude.Text
backupDetails_backupName :: (Text -> f Text) -> BackupDetails -> f BackupDetails
backupDetails_backupName = (BackupDetails -> Text)
-> (BackupDetails -> Text -> BackupDetails)
-> Lens BackupDetails BackupDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {Text
backupName :: Text
$sel:backupName:BackupDetails' :: BackupDetails -> Text
backupName} -> Text
backupName) (\s :: BackupDetails
s@BackupDetails' {} Text
a -> BackupDetails
s {$sel:backupName:BackupDetails' :: Text
backupName = Text
a} :: BackupDetails)
backupDetails_backupStatus :: Lens.Lens' BackupDetails BackupStatus
backupDetails_backupStatus :: (BackupStatus -> f BackupStatus)
-> BackupDetails -> f BackupDetails
backupDetails_backupStatus = (BackupDetails -> BackupStatus)
-> (BackupDetails -> BackupStatus -> BackupDetails)
-> Lens BackupDetails BackupDetails BackupStatus BackupStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {BackupStatus
backupStatus :: BackupStatus
$sel:backupStatus:BackupDetails' :: BackupDetails -> BackupStatus
backupStatus} -> BackupStatus
backupStatus) (\s :: BackupDetails
s@BackupDetails' {} BackupStatus
a -> BackupDetails
s {$sel:backupStatus:BackupDetails' :: BackupStatus
backupStatus = BackupStatus
a} :: BackupDetails)
backupDetails_backupType :: Lens.Lens' BackupDetails BackupType
backupDetails_backupType :: (BackupType -> f BackupType) -> BackupDetails -> f BackupDetails
backupDetails_backupType = (BackupDetails -> BackupType)
-> (BackupDetails -> BackupType -> BackupDetails)
-> Lens BackupDetails BackupDetails BackupType BackupType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {BackupType
backupType :: BackupType
$sel:backupType:BackupDetails' :: BackupDetails -> BackupType
backupType} -> BackupType
backupType) (\s :: BackupDetails
s@BackupDetails' {} BackupType
a -> BackupDetails
s {$sel:backupType:BackupDetails' :: BackupType
backupType = BackupType
a} :: BackupDetails)
backupDetails_backupCreationDateTime :: Lens.Lens' BackupDetails Prelude.UTCTime
backupDetails_backupCreationDateTime :: (UTCTime -> f UTCTime) -> BackupDetails -> f BackupDetails
backupDetails_backupCreationDateTime = (BackupDetails -> POSIX)
-> (BackupDetails -> POSIX -> BackupDetails)
-> Lens BackupDetails BackupDetails POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupDetails' {POSIX
backupCreationDateTime :: POSIX
$sel:backupCreationDateTime:BackupDetails' :: BackupDetails -> POSIX
backupCreationDateTime} -> POSIX
backupCreationDateTime) (\s :: BackupDetails
s@BackupDetails' {} POSIX
a -> BackupDetails
s {$sel:backupCreationDateTime:BackupDetails' :: POSIX
backupCreationDateTime = POSIX
a} :: BackupDetails) ((POSIX -> f POSIX) -> BackupDetails -> f BackupDetails)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BackupDetails
-> f BackupDetails
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
instance Core.FromJSON BackupDetails where
parseJSON :: Value -> Parser BackupDetails
parseJSON =
String
-> (Object -> Parser BackupDetails)
-> Value
-> Parser BackupDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BackupDetails"
( \Object
x ->
Maybe POSIX
-> Maybe Natural
-> Text
-> Text
-> BackupStatus
-> BackupType
-> POSIX
-> BackupDetails
BackupDetails'
(Maybe POSIX
-> Maybe Natural
-> Text
-> Text
-> BackupStatus
-> BackupType
-> POSIX
-> BackupDetails)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Natural
-> Text
-> Text
-> BackupStatus
-> BackupType
-> POSIX
-> BackupDetails)
forall (f :: * -> *) a b. Functor 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
"BackupExpiryDateTime")
Parser
(Maybe Natural
-> Text
-> Text
-> BackupStatus
-> BackupType
-> POSIX
-> BackupDetails)
-> Parser (Maybe Natural)
-> Parser
(Text
-> Text -> BackupStatus -> BackupType -> POSIX -> BackupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupSizeBytes")
Parser
(Text
-> Text -> BackupStatus -> BackupType -> POSIX -> BackupDetails)
-> Parser Text
-> Parser
(Text -> BackupStatus -> BackupType -> POSIX -> BackupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BackupArn")
Parser
(Text -> BackupStatus -> BackupType -> POSIX -> BackupDetails)
-> Parser Text
-> Parser (BackupStatus -> BackupType -> POSIX -> BackupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BackupName")
Parser (BackupStatus -> BackupType -> POSIX -> BackupDetails)
-> Parser BackupStatus
-> Parser (BackupType -> POSIX -> BackupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser BackupStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BackupStatus")
Parser (BackupType -> POSIX -> BackupDetails)
-> Parser BackupType -> Parser (POSIX -> BackupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser BackupType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BackupType")
Parser (POSIX -> BackupDetails)
-> Parser POSIX -> Parser BackupDetails
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
"BackupCreationDateTime")
)
instance Prelude.Hashable BackupDetails
instance Prelude.NFData BackupDetails