{-# 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.MacieV2.Types.JobDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.IsDefinedInJob
import Amazonka.MacieV2.Types.IsMonitoredByJob
import qualified Amazonka.Prelude as Prelude
data JobDetails = JobDetails'
{
JobDetails -> Maybe IsMonitoredByJob
isMonitoredByJob :: Prelude.Maybe IsMonitoredByJob,
JobDetails -> Maybe IsDefinedInJob
isDefinedInJob :: Prelude.Maybe IsDefinedInJob,
JobDetails -> Maybe Text
lastJobId :: Prelude.Maybe Prelude.Text,
JobDetails -> Maybe POSIX
lastJobRunTime :: Prelude.Maybe Core.POSIX
}
deriving (JobDetails -> JobDetails -> Bool
(JobDetails -> JobDetails -> Bool)
-> (JobDetails -> JobDetails -> Bool) -> Eq JobDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobDetails -> JobDetails -> Bool
$c/= :: JobDetails -> JobDetails -> Bool
== :: JobDetails -> JobDetails -> Bool
$c== :: JobDetails -> JobDetails -> Bool
Prelude.Eq, ReadPrec [JobDetails]
ReadPrec JobDetails
Int -> ReadS JobDetails
ReadS [JobDetails]
(Int -> ReadS JobDetails)
-> ReadS [JobDetails]
-> ReadPrec JobDetails
-> ReadPrec [JobDetails]
-> Read JobDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobDetails]
$creadListPrec :: ReadPrec [JobDetails]
readPrec :: ReadPrec JobDetails
$creadPrec :: ReadPrec JobDetails
readList :: ReadS [JobDetails]
$creadList :: ReadS [JobDetails]
readsPrec :: Int -> ReadS JobDetails
$creadsPrec :: Int -> ReadS JobDetails
Prelude.Read, Int -> JobDetails -> ShowS
[JobDetails] -> ShowS
JobDetails -> String
(Int -> JobDetails -> ShowS)
-> (JobDetails -> String)
-> ([JobDetails] -> ShowS)
-> Show JobDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobDetails] -> ShowS
$cshowList :: [JobDetails] -> ShowS
show :: JobDetails -> String
$cshow :: JobDetails -> String
showsPrec :: Int -> JobDetails -> ShowS
$cshowsPrec :: Int -> JobDetails -> ShowS
Prelude.Show, (forall x. JobDetails -> Rep JobDetails x)
-> (forall x. Rep JobDetails x -> JobDetails) -> Generic JobDetails
forall x. Rep JobDetails x -> JobDetails
forall x. JobDetails -> Rep JobDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobDetails x -> JobDetails
$cfrom :: forall x. JobDetails -> Rep JobDetails x
Prelude.Generic)
newJobDetails ::
JobDetails
newJobDetails :: JobDetails
newJobDetails =
JobDetails' :: Maybe IsMonitoredByJob
-> Maybe IsDefinedInJob -> Maybe Text -> Maybe POSIX -> JobDetails
JobDetails'
{ $sel:isMonitoredByJob:JobDetails' :: Maybe IsMonitoredByJob
isMonitoredByJob = Maybe IsMonitoredByJob
forall a. Maybe a
Prelude.Nothing,
$sel:isDefinedInJob:JobDetails' :: Maybe IsDefinedInJob
isDefinedInJob = Maybe IsDefinedInJob
forall a. Maybe a
Prelude.Nothing,
$sel:lastJobId:JobDetails' :: Maybe Text
lastJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastJobRunTime:JobDetails' :: Maybe POSIX
lastJobRunTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
jobDetails_isMonitoredByJob :: Lens.Lens' JobDetails (Prelude.Maybe IsMonitoredByJob)
jobDetails_isMonitoredByJob :: (Maybe IsMonitoredByJob -> f (Maybe IsMonitoredByJob))
-> JobDetails -> f JobDetails
jobDetails_isMonitoredByJob = (JobDetails -> Maybe IsMonitoredByJob)
-> (JobDetails -> Maybe IsMonitoredByJob -> JobDetails)
-> Lens
JobDetails
JobDetails
(Maybe IsMonitoredByJob)
(Maybe IsMonitoredByJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe IsMonitoredByJob
isMonitoredByJob :: Maybe IsMonitoredByJob
$sel:isMonitoredByJob:JobDetails' :: JobDetails -> Maybe IsMonitoredByJob
isMonitoredByJob} -> Maybe IsMonitoredByJob
isMonitoredByJob) (\s :: JobDetails
s@JobDetails' {} Maybe IsMonitoredByJob
a -> JobDetails
s {$sel:isMonitoredByJob:JobDetails' :: Maybe IsMonitoredByJob
isMonitoredByJob = Maybe IsMonitoredByJob
a} :: JobDetails)
jobDetails_isDefinedInJob :: Lens.Lens' JobDetails (Prelude.Maybe IsDefinedInJob)
jobDetails_isDefinedInJob :: (Maybe IsDefinedInJob -> f (Maybe IsDefinedInJob))
-> JobDetails -> f JobDetails
jobDetails_isDefinedInJob = (JobDetails -> Maybe IsDefinedInJob)
-> (JobDetails -> Maybe IsDefinedInJob -> JobDetails)
-> Lens
JobDetails JobDetails (Maybe IsDefinedInJob) (Maybe IsDefinedInJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe IsDefinedInJob
isDefinedInJob :: Maybe IsDefinedInJob
$sel:isDefinedInJob:JobDetails' :: JobDetails -> Maybe IsDefinedInJob
isDefinedInJob} -> Maybe IsDefinedInJob
isDefinedInJob) (\s :: JobDetails
s@JobDetails' {} Maybe IsDefinedInJob
a -> JobDetails
s {$sel:isDefinedInJob:JobDetails' :: Maybe IsDefinedInJob
isDefinedInJob = Maybe IsDefinedInJob
a} :: JobDetails)
jobDetails_lastJobId :: Lens.Lens' JobDetails (Prelude.Maybe Prelude.Text)
jobDetails_lastJobId :: (Maybe Text -> f (Maybe Text)) -> JobDetails -> f JobDetails
jobDetails_lastJobId = (JobDetails -> Maybe Text)
-> (JobDetails -> Maybe Text -> JobDetails)
-> Lens JobDetails JobDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe Text
lastJobId :: Maybe Text
$sel:lastJobId:JobDetails' :: JobDetails -> Maybe Text
lastJobId} -> Maybe Text
lastJobId) (\s :: JobDetails
s@JobDetails' {} Maybe Text
a -> JobDetails
s {$sel:lastJobId:JobDetails' :: Maybe Text
lastJobId = Maybe Text
a} :: JobDetails)
jobDetails_lastJobRunTime :: Lens.Lens' JobDetails (Prelude.Maybe Prelude.UTCTime)
jobDetails_lastJobRunTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobDetails -> f JobDetails
jobDetails_lastJobRunTime = (JobDetails -> Maybe POSIX)
-> (JobDetails -> Maybe POSIX -> JobDetails)
-> Lens JobDetails JobDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe POSIX
lastJobRunTime :: Maybe POSIX
$sel:lastJobRunTime:JobDetails' :: JobDetails -> Maybe POSIX
lastJobRunTime} -> Maybe POSIX
lastJobRunTime) (\s :: JobDetails
s@JobDetails' {} Maybe POSIX
a -> JobDetails
s {$sel:lastJobRunTime:JobDetails' :: Maybe POSIX
lastJobRunTime = Maybe POSIX
a} :: JobDetails) ((Maybe POSIX -> f (Maybe POSIX)) -> JobDetails -> f JobDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobDetails
-> f JobDetails
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 JobDetails where
parseJSON :: Value -> Parser JobDetails
parseJSON =
String
-> (Object -> Parser JobDetails) -> Value -> Parser JobDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobDetails"
( \Object
x ->
Maybe IsMonitoredByJob
-> Maybe IsDefinedInJob -> Maybe Text -> Maybe POSIX -> JobDetails
JobDetails'
(Maybe IsMonitoredByJob
-> Maybe IsDefinedInJob -> Maybe Text -> Maybe POSIX -> JobDetails)
-> Parser (Maybe IsMonitoredByJob)
-> Parser
(Maybe IsDefinedInJob -> Maybe Text -> Maybe POSIX -> JobDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe IsMonitoredByJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isMonitoredByJob")
Parser
(Maybe IsDefinedInJob -> Maybe Text -> Maybe POSIX -> JobDetails)
-> Parser (Maybe IsDefinedInJob)
-> Parser (Maybe Text -> Maybe POSIX -> JobDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IsDefinedInJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isDefinedInJob")
Parser (Maybe Text -> Maybe POSIX -> JobDetails)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> JobDetails)
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
"lastJobId")
Parser (Maybe POSIX -> JobDetails)
-> Parser (Maybe POSIX) -> Parser JobDetails
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
"lastJobRunTime")
)
instance Prelude.Hashable JobDetails
instance Prelude.NFData JobDetails