{-# 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.JobSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.JobStatus
import Amazonka.MacieV2.Types.JobType
import Amazonka.MacieV2.Types.LastRunErrorStatus
import Amazonka.MacieV2.Types.S3BucketCriteriaForJob
import Amazonka.MacieV2.Types.S3BucketDefinitionForJob
import Amazonka.MacieV2.Types.UserPausedDetails
import qualified Amazonka.Prelude as Prelude
data JobSummary = JobSummary'
{
JobSummary -> Maybe S3BucketCriteriaForJob
bucketCriteria :: Prelude.Maybe S3BucketCriteriaForJob,
JobSummary -> Maybe [S3BucketDefinitionForJob]
bucketDefinitions :: Prelude.Maybe [S3BucketDefinitionForJob],
JobSummary -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
JobSummary -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
JobSummary -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
JobSummary -> Maybe JobType
jobType :: Prelude.Maybe JobType,
JobSummary -> Maybe LastRunErrorStatus
lastRunErrorStatus :: Prelude.Maybe LastRunErrorStatus,
JobSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
JobSummary -> Maybe UserPausedDetails
userPausedDetails :: Prelude.Maybe UserPausedDetails
}
deriving (JobSummary -> JobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobSummary -> JobSummary -> Bool
$c/= :: JobSummary -> JobSummary -> Bool
== :: JobSummary -> JobSummary -> Bool
$c== :: JobSummary -> JobSummary -> Bool
Prelude.Eq, ReadPrec [JobSummary]
ReadPrec JobSummary
Int -> ReadS JobSummary
ReadS [JobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobSummary]
$creadListPrec :: ReadPrec [JobSummary]
readPrec :: ReadPrec JobSummary
$creadPrec :: ReadPrec JobSummary
readList :: ReadS [JobSummary]
$creadList :: ReadS [JobSummary]
readsPrec :: Int -> ReadS JobSummary
$creadsPrec :: Int -> ReadS JobSummary
Prelude.Read, Int -> JobSummary -> ShowS
[JobSummary] -> ShowS
JobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobSummary] -> ShowS
$cshowList :: [JobSummary] -> ShowS
show :: JobSummary -> String
$cshow :: JobSummary -> String
showsPrec :: Int -> JobSummary -> ShowS
$cshowsPrec :: Int -> JobSummary -> ShowS
Prelude.Show, forall x. Rep JobSummary x -> JobSummary
forall x. JobSummary -> Rep JobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobSummary x -> JobSummary
$cfrom :: forall x. JobSummary -> Rep JobSummary x
Prelude.Generic)
newJobSummary ::
JobSummary
newJobSummary :: JobSummary
newJobSummary =
JobSummary'
{ $sel:bucketCriteria:JobSummary' :: Maybe S3BucketCriteriaForJob
bucketCriteria = forall a. Maybe a
Prelude.Nothing,
$sel:bucketDefinitions:JobSummary' :: Maybe [S3BucketDefinitionForJob]
bucketDefinitions = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:JobSummary' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:jobId:JobSummary' :: Maybe Text
jobId = forall a. Maybe a
Prelude.Nothing,
$sel:jobStatus:JobSummary' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
$sel:jobType:JobSummary' :: Maybe JobType
jobType = forall a. Maybe a
Prelude.Nothing,
$sel:lastRunErrorStatus:JobSummary' :: Maybe LastRunErrorStatus
lastRunErrorStatus = forall a. Maybe a
Prelude.Nothing,
$sel:name:JobSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:userPausedDetails:JobSummary' :: Maybe UserPausedDetails
userPausedDetails = forall a. Maybe a
Prelude.Nothing
}
jobSummary_bucketCriteria :: Lens.Lens' JobSummary (Prelude.Maybe S3BucketCriteriaForJob)
jobSummary_bucketCriteria :: Lens' JobSummary (Maybe S3BucketCriteriaForJob)
jobSummary_bucketCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe S3BucketCriteriaForJob
bucketCriteria :: Maybe S3BucketCriteriaForJob
$sel:bucketCriteria:JobSummary' :: JobSummary -> Maybe S3BucketCriteriaForJob
bucketCriteria} -> Maybe S3BucketCriteriaForJob
bucketCriteria) (\s :: JobSummary
s@JobSummary' {} Maybe S3BucketCriteriaForJob
a -> JobSummary
s {$sel:bucketCriteria:JobSummary' :: Maybe S3BucketCriteriaForJob
bucketCriteria = Maybe S3BucketCriteriaForJob
a} :: JobSummary)
jobSummary_bucketDefinitions :: Lens.Lens' JobSummary (Prelude.Maybe [S3BucketDefinitionForJob])
jobSummary_bucketDefinitions :: Lens' JobSummary (Maybe [S3BucketDefinitionForJob])
jobSummary_bucketDefinitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe [S3BucketDefinitionForJob]
bucketDefinitions :: Maybe [S3BucketDefinitionForJob]
$sel:bucketDefinitions:JobSummary' :: JobSummary -> Maybe [S3BucketDefinitionForJob]
bucketDefinitions} -> Maybe [S3BucketDefinitionForJob]
bucketDefinitions) (\s :: JobSummary
s@JobSummary' {} Maybe [S3BucketDefinitionForJob]
a -> JobSummary
s {$sel:bucketDefinitions:JobSummary' :: Maybe [S3BucketDefinitionForJob]
bucketDefinitions = Maybe [S3BucketDefinitionForJob]
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
jobSummary_createdAt :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.UTCTime)
jobSummary_createdAt :: Lens' JobSummary (Maybe UTCTime)
jobSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:JobSummary' :: JobSummary -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: JobSummary
s@JobSummary' {} Maybe ISO8601
a -> JobSummary
s {$sel:createdAt:JobSummary' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
jobSummary_jobId :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.Text)
jobSummary_jobId :: Lens' JobSummary (Maybe Text)
jobSummary_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe Text
jobId :: Maybe Text
$sel:jobId:JobSummary' :: JobSummary -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: JobSummary
s@JobSummary' {} Maybe Text
a -> JobSummary
s {$sel:jobId:JobSummary' :: Maybe Text
jobId = Maybe Text
a} :: JobSummary)
jobSummary_jobStatus :: Lens.Lens' JobSummary (Prelude.Maybe JobStatus)
jobSummary_jobStatus :: Lens' JobSummary (Maybe JobStatus)
jobSummary_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:JobSummary' :: JobSummary -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: JobSummary
s@JobSummary' {} Maybe JobStatus
a -> JobSummary
s {$sel:jobStatus:JobSummary' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: JobSummary)
jobSummary_jobType :: Lens.Lens' JobSummary (Prelude.Maybe JobType)
jobSummary_jobType :: Lens' JobSummary (Maybe JobType)
jobSummary_jobType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe JobType
jobType :: Maybe JobType
$sel:jobType:JobSummary' :: JobSummary -> Maybe JobType
jobType} -> Maybe JobType
jobType) (\s :: JobSummary
s@JobSummary' {} Maybe JobType
a -> JobSummary
s {$sel:jobType:JobSummary' :: Maybe JobType
jobType = Maybe JobType
a} :: JobSummary)
jobSummary_lastRunErrorStatus :: Lens.Lens' JobSummary (Prelude.Maybe LastRunErrorStatus)
jobSummary_lastRunErrorStatus :: Lens' JobSummary (Maybe LastRunErrorStatus)
jobSummary_lastRunErrorStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe LastRunErrorStatus
lastRunErrorStatus :: Maybe LastRunErrorStatus
$sel:lastRunErrorStatus:JobSummary' :: JobSummary -> Maybe LastRunErrorStatus
lastRunErrorStatus} -> Maybe LastRunErrorStatus
lastRunErrorStatus) (\s :: JobSummary
s@JobSummary' {} Maybe LastRunErrorStatus
a -> JobSummary
s {$sel:lastRunErrorStatus:JobSummary' :: Maybe LastRunErrorStatus
lastRunErrorStatus = Maybe LastRunErrorStatus
a} :: JobSummary)
jobSummary_name :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.Text)
jobSummary_name :: Lens' JobSummary (Maybe Text)
jobSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe Text
name :: Maybe Text
$sel:name:JobSummary' :: JobSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: JobSummary
s@JobSummary' {} Maybe Text
a -> JobSummary
s {$sel:name:JobSummary' :: Maybe Text
name = Maybe Text
a} :: JobSummary)
jobSummary_userPausedDetails :: Lens.Lens' JobSummary (Prelude.Maybe UserPausedDetails)
jobSummary_userPausedDetails :: Lens' JobSummary (Maybe UserPausedDetails)
jobSummary_userPausedDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe UserPausedDetails
userPausedDetails :: Maybe UserPausedDetails
$sel:userPausedDetails:JobSummary' :: JobSummary -> Maybe UserPausedDetails
userPausedDetails} -> Maybe UserPausedDetails
userPausedDetails) (\s :: JobSummary
s@JobSummary' {} Maybe UserPausedDetails
a -> JobSummary
s {$sel:userPausedDetails:JobSummary' :: Maybe UserPausedDetails
userPausedDetails = Maybe UserPausedDetails
a} :: JobSummary)
instance Data.FromJSON JobSummary where
parseJSON :: Value -> Parser JobSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JobSummary"
( \Object
x ->
Maybe S3BucketCriteriaForJob
-> Maybe [S3BucketDefinitionForJob]
-> Maybe ISO8601
-> Maybe Text
-> Maybe JobStatus
-> Maybe JobType
-> Maybe LastRunErrorStatus
-> Maybe Text
-> Maybe UserPausedDetails
-> JobSummary
JobSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bucketCriteria")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bucketDefinitions"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"jobId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"jobStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"jobType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastRunErrorStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"userPausedDetails")
)
instance Prelude.Hashable JobSummary where
hashWithSalt :: Int -> JobSummary -> Int
hashWithSalt Int
_salt JobSummary' {Maybe [S3BucketDefinitionForJob]
Maybe Text
Maybe ISO8601
Maybe JobStatus
Maybe JobType
Maybe LastRunErrorStatus
Maybe S3BucketCriteriaForJob
Maybe UserPausedDetails
userPausedDetails :: Maybe UserPausedDetails
name :: Maybe Text
lastRunErrorStatus :: Maybe LastRunErrorStatus
jobType :: Maybe JobType
jobStatus :: Maybe JobStatus
jobId :: Maybe Text
createdAt :: Maybe ISO8601
bucketDefinitions :: Maybe [S3BucketDefinitionForJob]
bucketCriteria :: Maybe S3BucketCriteriaForJob
$sel:userPausedDetails:JobSummary' :: JobSummary -> Maybe UserPausedDetails
$sel:name:JobSummary' :: JobSummary -> Maybe Text
$sel:lastRunErrorStatus:JobSummary' :: JobSummary -> Maybe LastRunErrorStatus
$sel:jobType:JobSummary' :: JobSummary -> Maybe JobType
$sel:jobStatus:JobSummary' :: JobSummary -> Maybe JobStatus
$sel:jobId:JobSummary' :: JobSummary -> Maybe Text
$sel:createdAt:JobSummary' :: JobSummary -> Maybe ISO8601
$sel:bucketDefinitions:JobSummary' :: JobSummary -> Maybe [S3BucketDefinitionForJob]
$sel:bucketCriteria:JobSummary' :: JobSummary -> Maybe S3BucketCriteriaForJob
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3BucketCriteriaForJob
bucketCriteria
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [S3BucketDefinitionForJob]
bucketDefinitions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobStatus
jobStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobType
jobType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LastRunErrorStatus
lastRunErrorStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserPausedDetails
userPausedDetails
instance Prelude.NFData JobSummary where
rnf :: JobSummary -> ()
rnf JobSummary' {Maybe [S3BucketDefinitionForJob]
Maybe Text
Maybe ISO8601
Maybe JobStatus
Maybe JobType
Maybe LastRunErrorStatus
Maybe S3BucketCriteriaForJob
Maybe UserPausedDetails
userPausedDetails :: Maybe UserPausedDetails
name :: Maybe Text
lastRunErrorStatus :: Maybe LastRunErrorStatus
jobType :: Maybe JobType
jobStatus :: Maybe JobStatus
jobId :: Maybe Text
createdAt :: Maybe ISO8601
bucketDefinitions :: Maybe [S3BucketDefinitionForJob]
bucketCriteria :: Maybe S3BucketCriteriaForJob
$sel:userPausedDetails:JobSummary' :: JobSummary -> Maybe UserPausedDetails
$sel:name:JobSummary' :: JobSummary -> Maybe Text
$sel:lastRunErrorStatus:JobSummary' :: JobSummary -> Maybe LastRunErrorStatus
$sel:jobType:JobSummary' :: JobSummary -> Maybe JobType
$sel:jobStatus:JobSummary' :: JobSummary -> Maybe JobStatus
$sel:jobId:JobSummary' :: JobSummary -> Maybe Text
$sel:createdAt:JobSummary' :: JobSummary -> Maybe ISO8601
$sel:bucketDefinitions:JobSummary' :: JobSummary -> Maybe [S3BucketDefinitionForJob]
$sel:bucketCriteria:JobSummary' :: JobSummary -> Maybe S3BucketCriteriaForJob
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe S3BucketCriteriaForJob
bucketCriteria
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [S3BucketDefinitionForJob]
bucketDefinitions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobStatus
jobStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobType
jobType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LastRunErrorStatus
lastRunErrorStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserPausedDetails
userPausedDetails