{-# 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.ReportJob where
import Amazonka.Backup.Types.ReportDestination
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReportJob = ReportJob'
{
ReportJob -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
ReportJob -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
ReportJob -> Maybe Text
reportPlanArn :: Prelude.Maybe Prelude.Text,
ReportJob -> Maybe POSIX
completionTime :: Prelude.Maybe Core.POSIX,
ReportJob -> Maybe Text
reportJobId :: Prelude.Maybe Prelude.Text,
ReportJob -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
ReportJob -> Maybe ReportDestination
reportDestination :: Prelude.Maybe ReportDestination,
ReportJob -> Maybe Text
reportTemplate :: Prelude.Maybe Prelude.Text
}
deriving (ReportJob -> ReportJob -> Bool
(ReportJob -> ReportJob -> Bool)
-> (ReportJob -> ReportJob -> Bool) -> Eq ReportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportJob -> ReportJob -> Bool
$c/= :: ReportJob -> ReportJob -> Bool
== :: ReportJob -> ReportJob -> Bool
$c== :: ReportJob -> ReportJob -> Bool
Prelude.Eq, ReadPrec [ReportJob]
ReadPrec ReportJob
Int -> ReadS ReportJob
ReadS [ReportJob]
(Int -> ReadS ReportJob)
-> ReadS [ReportJob]
-> ReadPrec ReportJob
-> ReadPrec [ReportJob]
-> Read ReportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportJob]
$creadListPrec :: ReadPrec [ReportJob]
readPrec :: ReadPrec ReportJob
$creadPrec :: ReadPrec ReportJob
readList :: ReadS [ReportJob]
$creadList :: ReadS [ReportJob]
readsPrec :: Int -> ReadS ReportJob
$creadsPrec :: Int -> ReadS ReportJob
Prelude.Read, Int -> ReportJob -> ShowS
[ReportJob] -> ShowS
ReportJob -> String
(Int -> ReportJob -> ShowS)
-> (ReportJob -> String)
-> ([ReportJob] -> ShowS)
-> Show ReportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportJob] -> ShowS
$cshowList :: [ReportJob] -> ShowS
show :: ReportJob -> String
$cshow :: ReportJob -> String
showsPrec :: Int -> ReportJob -> ShowS
$cshowsPrec :: Int -> ReportJob -> ShowS
Prelude.Show, (forall x. ReportJob -> Rep ReportJob x)
-> (forall x. Rep ReportJob x -> ReportJob) -> Generic ReportJob
forall x. Rep ReportJob x -> ReportJob
forall x. ReportJob -> Rep ReportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReportJob x -> ReportJob
$cfrom :: forall x. ReportJob -> Rep ReportJob x
Prelude.Generic)
newReportJob ::
ReportJob
newReportJob :: ReportJob
newReportJob =
ReportJob' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob
ReportJob'
{ $sel:creationTime:ReportJob' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:ReportJob' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reportPlanArn:ReportJob' :: Maybe Text
reportPlanArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:completionTime:ReportJob' :: Maybe POSIX
completionTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:reportJobId:ReportJob' :: Maybe Text
reportJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:ReportJob' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reportDestination:ReportJob' :: Maybe ReportDestination
reportDestination = Maybe ReportDestination
forall a. Maybe a
Prelude.Nothing,
$sel:reportTemplate:ReportJob' :: Maybe Text
reportTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
reportJob_creationTime :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.UTCTime)
reportJob_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ReportJob -> f ReportJob
reportJob_creationTime = (ReportJob -> Maybe POSIX)
-> (ReportJob -> Maybe POSIX -> ReportJob)
-> Lens ReportJob ReportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ReportJob' :: ReportJob -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ReportJob
s@ReportJob' {} Maybe POSIX
a -> ReportJob
s {$sel:creationTime:ReportJob' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ReportJob) ((Maybe POSIX -> f (Maybe POSIX)) -> ReportJob -> f ReportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReportJob
-> f ReportJob
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
reportJob_status :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.Text)
reportJob_status :: (Maybe Text -> f (Maybe Text)) -> ReportJob -> f ReportJob
reportJob_status = (ReportJob -> Maybe Text)
-> (ReportJob -> Maybe Text -> ReportJob)
-> Lens ReportJob ReportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe Text
status :: Maybe Text
$sel:status:ReportJob' :: ReportJob -> Maybe Text
status} -> Maybe Text
status) (\s :: ReportJob
s@ReportJob' {} Maybe Text
a -> ReportJob
s {$sel:status:ReportJob' :: Maybe Text
status = Maybe Text
a} :: ReportJob)
reportJob_reportPlanArn :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.Text)
reportJob_reportPlanArn :: (Maybe Text -> f (Maybe Text)) -> ReportJob -> f ReportJob
reportJob_reportPlanArn = (ReportJob -> Maybe Text)
-> (ReportJob -> Maybe Text -> ReportJob)
-> Lens ReportJob ReportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe Text
reportPlanArn :: Maybe Text
$sel:reportPlanArn:ReportJob' :: ReportJob -> Maybe Text
reportPlanArn} -> Maybe Text
reportPlanArn) (\s :: ReportJob
s@ReportJob' {} Maybe Text
a -> ReportJob
s {$sel:reportPlanArn:ReportJob' :: Maybe Text
reportPlanArn = Maybe Text
a} :: ReportJob)
reportJob_completionTime :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.UTCTime)
reportJob_completionTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ReportJob -> f ReportJob
reportJob_completionTime = (ReportJob -> Maybe POSIX)
-> (ReportJob -> Maybe POSIX -> ReportJob)
-> Lens ReportJob ReportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe POSIX
completionTime :: Maybe POSIX
$sel:completionTime:ReportJob' :: ReportJob -> Maybe POSIX
completionTime} -> Maybe POSIX
completionTime) (\s :: ReportJob
s@ReportJob' {} Maybe POSIX
a -> ReportJob
s {$sel:completionTime:ReportJob' :: Maybe POSIX
completionTime = Maybe POSIX
a} :: ReportJob) ((Maybe POSIX -> f (Maybe POSIX)) -> ReportJob -> f ReportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReportJob
-> f ReportJob
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
reportJob_reportJobId :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.Text)
reportJob_reportJobId :: (Maybe Text -> f (Maybe Text)) -> ReportJob -> f ReportJob
reportJob_reportJobId = (ReportJob -> Maybe Text)
-> (ReportJob -> Maybe Text -> ReportJob)
-> Lens ReportJob ReportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe Text
reportJobId :: Maybe Text
$sel:reportJobId:ReportJob' :: ReportJob -> Maybe Text
reportJobId} -> Maybe Text
reportJobId) (\s :: ReportJob
s@ReportJob' {} Maybe Text
a -> ReportJob
s {$sel:reportJobId:ReportJob' :: Maybe Text
reportJobId = Maybe Text
a} :: ReportJob)
reportJob_statusMessage :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.Text)
reportJob_statusMessage :: (Maybe Text -> f (Maybe Text)) -> ReportJob -> f ReportJob
reportJob_statusMessage = (ReportJob -> Maybe Text)
-> (ReportJob -> Maybe Text -> ReportJob)
-> Lens ReportJob ReportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ReportJob' :: ReportJob -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ReportJob
s@ReportJob' {} Maybe Text
a -> ReportJob
s {$sel:statusMessage:ReportJob' :: Maybe Text
statusMessage = Maybe Text
a} :: ReportJob)
reportJob_reportDestination :: Lens.Lens' ReportJob (Prelude.Maybe ReportDestination)
reportJob_reportDestination :: (Maybe ReportDestination -> f (Maybe ReportDestination))
-> ReportJob -> f ReportJob
reportJob_reportDestination = (ReportJob -> Maybe ReportDestination)
-> (ReportJob -> Maybe ReportDestination -> ReportJob)
-> Lens
ReportJob
ReportJob
(Maybe ReportDestination)
(Maybe ReportDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe ReportDestination
reportDestination :: Maybe ReportDestination
$sel:reportDestination:ReportJob' :: ReportJob -> Maybe ReportDestination
reportDestination} -> Maybe ReportDestination
reportDestination) (\s :: ReportJob
s@ReportJob' {} Maybe ReportDestination
a -> ReportJob
s {$sel:reportDestination:ReportJob' :: Maybe ReportDestination
reportDestination = Maybe ReportDestination
a} :: ReportJob)
reportJob_reportTemplate :: Lens.Lens' ReportJob (Prelude.Maybe Prelude.Text)
reportJob_reportTemplate :: (Maybe Text -> f (Maybe Text)) -> ReportJob -> f ReportJob
reportJob_reportTemplate = (ReportJob -> Maybe Text)
-> (ReportJob -> Maybe Text -> ReportJob)
-> Lens ReportJob ReportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportJob' {Maybe Text
reportTemplate :: Maybe Text
$sel:reportTemplate:ReportJob' :: ReportJob -> Maybe Text
reportTemplate} -> Maybe Text
reportTemplate) (\s :: ReportJob
s@ReportJob' {} Maybe Text
a -> ReportJob
s {$sel:reportTemplate:ReportJob' :: Maybe Text
reportTemplate = Maybe Text
a} :: ReportJob)
instance Core.FromJSON ReportJob where
parseJSON :: Value -> Parser ReportJob
parseJSON =
String -> (Object -> Parser ReportJob) -> Value -> Parser ReportJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReportJob"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob
ReportJob'
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
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
"CreationTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
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
"Status")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
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
"ReportPlanArn")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
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
"CompletionTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ReportDestination
-> Maybe Text
-> ReportJob)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe ReportDestination -> Maybe Text -> ReportJob)
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
"ReportJobId")
Parser
(Maybe Text -> Maybe ReportDestination -> Maybe Text -> ReportJob)
-> Parser (Maybe Text)
-> Parser (Maybe ReportDestination -> Maybe Text -> ReportJob)
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
"StatusMessage")
Parser (Maybe ReportDestination -> Maybe Text -> ReportJob)
-> Parser (Maybe ReportDestination)
-> Parser (Maybe Text -> ReportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReportDestination)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReportDestination")
Parser (Maybe Text -> ReportJob)
-> Parser (Maybe Text) -> Parser ReportJob
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
"ReportTemplate")
)
instance Prelude.Hashable ReportJob
instance Prelude.NFData ReportJob