{-# 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.Backup.Types.CalculatedLifecycle where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CalculatedLifecycle = CalculatedLifecycle'
{
CalculatedLifecycle -> Maybe POSIX
deleteAt :: Prelude.Maybe Core.POSIX,
CalculatedLifecycle -> Maybe POSIX
moveToColdStorageAt :: Prelude.Maybe Core.POSIX
}
deriving (CalculatedLifecycle -> CalculatedLifecycle -> Bool
(CalculatedLifecycle -> CalculatedLifecycle -> Bool)
-> (CalculatedLifecycle -> CalculatedLifecycle -> Bool)
-> Eq CalculatedLifecycle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CalculatedLifecycle -> CalculatedLifecycle -> Bool
$c/= :: CalculatedLifecycle -> CalculatedLifecycle -> Bool
== :: CalculatedLifecycle -> CalculatedLifecycle -> Bool
$c== :: CalculatedLifecycle -> CalculatedLifecycle -> Bool
Prelude.Eq, ReadPrec [CalculatedLifecycle]
ReadPrec CalculatedLifecycle
Int -> ReadS CalculatedLifecycle
ReadS [CalculatedLifecycle]
(Int -> ReadS CalculatedLifecycle)
-> ReadS [CalculatedLifecycle]
-> ReadPrec CalculatedLifecycle
-> ReadPrec [CalculatedLifecycle]
-> Read CalculatedLifecycle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CalculatedLifecycle]
$creadListPrec :: ReadPrec [CalculatedLifecycle]
readPrec :: ReadPrec CalculatedLifecycle
$creadPrec :: ReadPrec CalculatedLifecycle
readList :: ReadS [CalculatedLifecycle]
$creadList :: ReadS [CalculatedLifecycle]
readsPrec :: Int -> ReadS CalculatedLifecycle
$creadsPrec :: Int -> ReadS CalculatedLifecycle
Prelude.Read, Int -> CalculatedLifecycle -> ShowS
[CalculatedLifecycle] -> ShowS
CalculatedLifecycle -> String
(Int -> CalculatedLifecycle -> ShowS)
-> (CalculatedLifecycle -> String)
-> ([CalculatedLifecycle] -> ShowS)
-> Show CalculatedLifecycle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CalculatedLifecycle] -> ShowS
$cshowList :: [CalculatedLifecycle] -> ShowS
show :: CalculatedLifecycle -> String
$cshow :: CalculatedLifecycle -> String
showsPrec :: Int -> CalculatedLifecycle -> ShowS
$cshowsPrec :: Int -> CalculatedLifecycle -> ShowS
Prelude.Show, (forall x. CalculatedLifecycle -> Rep CalculatedLifecycle x)
-> (forall x. Rep CalculatedLifecycle x -> CalculatedLifecycle)
-> Generic CalculatedLifecycle
forall x. Rep CalculatedLifecycle x -> CalculatedLifecycle
forall x. CalculatedLifecycle -> Rep CalculatedLifecycle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CalculatedLifecycle x -> CalculatedLifecycle
$cfrom :: forall x. CalculatedLifecycle -> Rep CalculatedLifecycle x
Prelude.Generic)
newCalculatedLifecycle ::
CalculatedLifecycle
newCalculatedLifecycle :: CalculatedLifecycle
newCalculatedLifecycle =
CalculatedLifecycle' :: Maybe POSIX -> Maybe POSIX -> CalculatedLifecycle
CalculatedLifecycle'
{ $sel:deleteAt:CalculatedLifecycle' :: Maybe POSIX
deleteAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:moveToColdStorageAt:CalculatedLifecycle' :: Maybe POSIX
moveToColdStorageAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
calculatedLifecycle_deleteAt :: Lens.Lens' CalculatedLifecycle (Prelude.Maybe Prelude.UTCTime)
calculatedLifecycle_deleteAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CalculatedLifecycle -> f CalculatedLifecycle
calculatedLifecycle_deleteAt = (CalculatedLifecycle -> Maybe POSIX)
-> (CalculatedLifecycle -> Maybe POSIX -> CalculatedLifecycle)
-> Lens
CalculatedLifecycle CalculatedLifecycle (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculatedLifecycle' {Maybe POSIX
deleteAt :: Maybe POSIX
$sel:deleteAt:CalculatedLifecycle' :: CalculatedLifecycle -> Maybe POSIX
deleteAt} -> Maybe POSIX
deleteAt) (\s :: CalculatedLifecycle
s@CalculatedLifecycle' {} Maybe POSIX
a -> CalculatedLifecycle
s {$sel:deleteAt:CalculatedLifecycle' :: Maybe POSIX
deleteAt = Maybe POSIX
a} :: CalculatedLifecycle) ((Maybe POSIX -> f (Maybe POSIX))
-> CalculatedLifecycle -> f CalculatedLifecycle)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CalculatedLifecycle
-> f CalculatedLifecycle
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
calculatedLifecycle_moveToColdStorageAt :: Lens.Lens' CalculatedLifecycle (Prelude.Maybe Prelude.UTCTime)
calculatedLifecycle_moveToColdStorageAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CalculatedLifecycle -> f CalculatedLifecycle
calculatedLifecycle_moveToColdStorageAt = (CalculatedLifecycle -> Maybe POSIX)
-> (CalculatedLifecycle -> Maybe POSIX -> CalculatedLifecycle)
-> Lens
CalculatedLifecycle CalculatedLifecycle (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculatedLifecycle' {Maybe POSIX
moveToColdStorageAt :: Maybe POSIX
$sel:moveToColdStorageAt:CalculatedLifecycle' :: CalculatedLifecycle -> Maybe POSIX
moveToColdStorageAt} -> Maybe POSIX
moveToColdStorageAt) (\s :: CalculatedLifecycle
s@CalculatedLifecycle' {} Maybe POSIX
a -> CalculatedLifecycle
s {$sel:moveToColdStorageAt:CalculatedLifecycle' :: Maybe POSIX
moveToColdStorageAt = Maybe POSIX
a} :: CalculatedLifecycle) ((Maybe POSIX -> f (Maybe POSIX))
-> CalculatedLifecycle -> f CalculatedLifecycle)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CalculatedLifecycle
-> f CalculatedLifecycle
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 CalculatedLifecycle where
parseJSON :: Value -> Parser CalculatedLifecycle
parseJSON =
String
-> (Object -> Parser CalculatedLifecycle)
-> Value
-> Parser CalculatedLifecycle
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CalculatedLifecycle"
( \Object
x ->
Maybe POSIX -> Maybe POSIX -> CalculatedLifecycle
CalculatedLifecycle'
(Maybe POSIX -> Maybe POSIX -> CalculatedLifecycle)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> CalculatedLifecycle)
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
"DeleteAt")
Parser (Maybe POSIX -> CalculatedLifecycle)
-> Parser (Maybe POSIX) -> Parser CalculatedLifecycle
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
"MoveToColdStorageAt")
)
instance Prelude.Hashable CalculatedLifecycle
instance Prelude.NFData CalculatedLifecycle