{-# 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.ProtectedResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProtectedResource = ProtectedResource'
{
ProtectedResource -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
ProtectedResource -> Maybe POSIX
lastBackupTime :: Prelude.Maybe Core.POSIX,
ProtectedResource -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text
}
deriving (ProtectedResource -> ProtectedResource -> Bool
(ProtectedResource -> ProtectedResource -> Bool)
-> (ProtectedResource -> ProtectedResource -> Bool)
-> Eq ProtectedResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtectedResource -> ProtectedResource -> Bool
$c/= :: ProtectedResource -> ProtectedResource -> Bool
== :: ProtectedResource -> ProtectedResource -> Bool
$c== :: ProtectedResource -> ProtectedResource -> Bool
Prelude.Eq, ReadPrec [ProtectedResource]
ReadPrec ProtectedResource
Int -> ReadS ProtectedResource
ReadS [ProtectedResource]
(Int -> ReadS ProtectedResource)
-> ReadS [ProtectedResource]
-> ReadPrec ProtectedResource
-> ReadPrec [ProtectedResource]
-> Read ProtectedResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtectedResource]
$creadListPrec :: ReadPrec [ProtectedResource]
readPrec :: ReadPrec ProtectedResource
$creadPrec :: ReadPrec ProtectedResource
readList :: ReadS [ProtectedResource]
$creadList :: ReadS [ProtectedResource]
readsPrec :: Int -> ReadS ProtectedResource
$creadsPrec :: Int -> ReadS ProtectedResource
Prelude.Read, Int -> ProtectedResource -> ShowS
[ProtectedResource] -> ShowS
ProtectedResource -> String
(Int -> ProtectedResource -> ShowS)
-> (ProtectedResource -> String)
-> ([ProtectedResource] -> ShowS)
-> Show ProtectedResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtectedResource] -> ShowS
$cshowList :: [ProtectedResource] -> ShowS
show :: ProtectedResource -> String
$cshow :: ProtectedResource -> String
showsPrec :: Int -> ProtectedResource -> ShowS
$cshowsPrec :: Int -> ProtectedResource -> ShowS
Prelude.Show, (forall x. ProtectedResource -> Rep ProtectedResource x)
-> (forall x. Rep ProtectedResource x -> ProtectedResource)
-> Generic ProtectedResource
forall x. Rep ProtectedResource x -> ProtectedResource
forall x. ProtectedResource -> Rep ProtectedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProtectedResource x -> ProtectedResource
$cfrom :: forall x. ProtectedResource -> Rep ProtectedResource x
Prelude.Generic)
newProtectedResource ::
ProtectedResource
newProtectedResource :: ProtectedResource
newProtectedResource =
ProtectedResource' :: Maybe Text -> Maybe POSIX -> Maybe Text -> ProtectedResource
ProtectedResource'
{ $sel:resourceType:ProtectedResource' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastBackupTime:ProtectedResource' :: Maybe POSIX
lastBackupTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:ProtectedResource' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
protectedResource_resourceType :: Lens.Lens' ProtectedResource (Prelude.Maybe Prelude.Text)
protectedResource_resourceType :: (Maybe Text -> f (Maybe Text))
-> ProtectedResource -> f ProtectedResource
protectedResource_resourceType = (ProtectedResource -> Maybe Text)
-> (ProtectedResource -> Maybe Text -> ProtectedResource)
-> Lens
ProtectedResource ProtectedResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectedResource' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ProtectedResource' :: ProtectedResource -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ProtectedResource
s@ProtectedResource' {} Maybe Text
a -> ProtectedResource
s {$sel:resourceType:ProtectedResource' :: Maybe Text
resourceType = Maybe Text
a} :: ProtectedResource)
protectedResource_lastBackupTime :: Lens.Lens' ProtectedResource (Prelude.Maybe Prelude.UTCTime)
protectedResource_lastBackupTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProtectedResource -> f ProtectedResource
protectedResource_lastBackupTime = (ProtectedResource -> Maybe POSIX)
-> (ProtectedResource -> Maybe POSIX -> ProtectedResource)
-> Lens
ProtectedResource ProtectedResource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectedResource' {Maybe POSIX
lastBackupTime :: Maybe POSIX
$sel:lastBackupTime:ProtectedResource' :: ProtectedResource -> Maybe POSIX
lastBackupTime} -> Maybe POSIX
lastBackupTime) (\s :: ProtectedResource
s@ProtectedResource' {} Maybe POSIX
a -> ProtectedResource
s {$sel:lastBackupTime:ProtectedResource' :: Maybe POSIX
lastBackupTime = Maybe POSIX
a} :: ProtectedResource) ((Maybe POSIX -> f (Maybe POSIX))
-> ProtectedResource -> f ProtectedResource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProtectedResource
-> f ProtectedResource
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
protectedResource_resourceArn :: Lens.Lens' ProtectedResource (Prelude.Maybe Prelude.Text)
protectedResource_resourceArn :: (Maybe Text -> f (Maybe Text))
-> ProtectedResource -> f ProtectedResource
protectedResource_resourceArn = (ProtectedResource -> Maybe Text)
-> (ProtectedResource -> Maybe Text -> ProtectedResource)
-> Lens
ProtectedResource ProtectedResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectedResource' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:ProtectedResource' :: ProtectedResource -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: ProtectedResource
s@ProtectedResource' {} Maybe Text
a -> ProtectedResource
s {$sel:resourceArn:ProtectedResource' :: Maybe Text
resourceArn = Maybe Text
a} :: ProtectedResource)
instance Core.FromJSON ProtectedResource where
parseJSON :: Value -> Parser ProtectedResource
parseJSON =
String
-> (Object -> Parser ProtectedResource)
-> Value
-> Parser ProtectedResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProtectedResource"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Text -> ProtectedResource
ProtectedResource'
(Maybe Text -> Maybe POSIX -> Maybe Text -> ProtectedResource)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> ProtectedResource)
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
"ResourceType")
Parser (Maybe POSIX -> Maybe Text -> ProtectedResource)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> ProtectedResource)
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
"LastBackupTime")
Parser (Maybe Text -> ProtectedResource)
-> Parser (Maybe Text) -> Parser ProtectedResource
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
"ResourceArn")
)
instance Prelude.Hashable ProtectedResource
instance Prelude.NFData ProtectedResource