{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.Types.JobSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.JobSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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

-- | Provides information about a classification job, including the current
-- status of the job.
--
-- /See:/ 'newJobSummary' smart constructor.
data JobSummary = JobSummary'
  { -- | Specifies whether any account- or bucket-level access errors occurred
    -- when the job ran. For a recurring job, this value indicates the error
    -- status of the job\'s most recent run.
    JobSummary -> Maybe LastRunErrorStatus
lastRunErrorStatus :: Prelude.Maybe LastRunErrorStatus,
    -- | The schedule for running the job. Possible values are:
    --
    -- -   ONE_TIME - The job runs only once.
    --
    -- -   SCHEDULED - The job runs on a daily, weekly, or monthly basis.
    JobSummary -> Maybe JobType
jobType :: Prelude.Maybe JobType,
    -- | The unique identifier for the job.
    JobSummary -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in UTC and extended ISO 8601 format, when the job was
    -- created.
    JobSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | If the current status of the job is USER_PAUSED, specifies when the job
    -- was paused and when the job or job run will expire and be cancelled if
    -- it isn\'t resumed. This value is present only if the value for jobStatus
    -- is USER_PAUSED.
    JobSummary -> Maybe UserPausedDetails
userPausedDetails :: Prelude.Maybe UserPausedDetails,
    -- | The property- and tag-based conditions that determine which S3 buckets
    -- are included or excluded from the job\'s analysis. Each time the job
    -- runs, the job uses these criteria to determine which buckets to analyze.
    -- A job\'s definition can contain a bucketCriteria object or a
    -- bucketDefinitions array, not both.
    JobSummary -> Maybe S3BucketCriteriaForJob
bucketCriteria :: Prelude.Maybe S3BucketCriteriaForJob,
    -- | The custom name of the job.
    JobSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An array of objects, one for each Amazon Web Services account that owns
    -- specific S3 buckets for the job to analyze. Each object specifies the
    -- account ID for an account and one or more buckets to analyze for that
    -- account. A job\'s definition can contain a bucketDefinitions array or a
    -- bucketCriteria object, not both.
    JobSummary -> Maybe [S3BucketDefinitionForJob]
bucketDefinitions :: Prelude.Maybe [S3BucketDefinitionForJob],
    -- | The current status of the job. Possible values are:
    --
    -- -   CANCELLED - You cancelled the job or, if it\'s a one-time job, you
    --     paused the job and didn\'t resume it within 30 days.
    --
    -- -   COMPLETE - For a one-time job, Amazon Macie finished processing the
    --     data specified for the job. This value doesn\'t apply to recurring
    --     jobs.
    --
    -- -   IDLE - For a recurring job, the previous scheduled run is complete
    --     and the next scheduled run is pending. This value doesn\'t apply to
    --     one-time jobs.
    --
    -- -   PAUSED - Macie started running the job but additional processing
    --     would exceed the monthly sensitive data discovery quota for your
    --     account or one or more member accounts that the job analyzes data
    --     for.
    --
    -- -   RUNNING - For a one-time job, the job is in progress. For a
    --     recurring job, a scheduled run is in progress.
    --
    -- -   USER_PAUSED - You paused the job. If you paused the job while it had
    --     a status of RUNNING and you don\'t resume it within 30 days of
    --     pausing it, the job or job run will expire and be cancelled,
    --     depending on the job\'s type. To check the expiration date, refer to
    --     the UserPausedDetails.jobExpiresAt property.
    JobSummary -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus
  }
  deriving (JobSummary -> JobSummary -> Bool
(JobSummary -> JobSummary -> Bool)
-> (JobSummary -> JobSummary -> Bool) -> Eq JobSummary
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]
(Int -> ReadS JobSummary)
-> ReadS [JobSummary]
-> ReadPrec JobSummary
-> ReadPrec [JobSummary]
-> Read 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
(Int -> JobSummary -> ShowS)
-> (JobSummary -> String)
-> ([JobSummary] -> ShowS)
-> Show JobSummary
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. JobSummary -> Rep JobSummary x)
-> (forall x. Rep JobSummary x -> JobSummary) -> Generic JobSummary
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)

-- |
-- Create a value of 'JobSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastRunErrorStatus', 'jobSummary_lastRunErrorStatus' - Specifies whether any account- or bucket-level access errors occurred
-- when the job ran. For a recurring job, this value indicates the error
-- status of the job\'s most recent run.
--
-- 'jobType', 'jobSummary_jobType' - The schedule for running the job. Possible values are:
--
-- -   ONE_TIME - The job runs only once.
--
-- -   SCHEDULED - The job runs on a daily, weekly, or monthly basis.
--
-- 'jobId', 'jobSummary_jobId' - The unique identifier for the job.
--
-- 'createdAt', 'jobSummary_createdAt' - The date and time, in UTC and extended ISO 8601 format, when the job was
-- created.
--
-- 'userPausedDetails', 'jobSummary_userPausedDetails' - If the current status of the job is USER_PAUSED, specifies when the job
-- was paused and when the job or job run will expire and be cancelled if
-- it isn\'t resumed. This value is present only if the value for jobStatus
-- is USER_PAUSED.
--
-- 'bucketCriteria', 'jobSummary_bucketCriteria' - The property- and tag-based conditions that determine which S3 buckets
-- are included or excluded from the job\'s analysis. Each time the job
-- runs, the job uses these criteria to determine which buckets to analyze.
-- A job\'s definition can contain a bucketCriteria object or a
-- bucketDefinitions array, not both.
--
-- 'name', 'jobSummary_name' - The custom name of the job.
--
-- 'bucketDefinitions', 'jobSummary_bucketDefinitions' - An array of objects, one for each Amazon Web Services account that owns
-- specific S3 buckets for the job to analyze. Each object specifies the
-- account ID for an account and one or more buckets to analyze for that
-- account. A job\'s definition can contain a bucketDefinitions array or a
-- bucketCriteria object, not both.
--
-- 'jobStatus', 'jobSummary_jobStatus' - The current status of the job. Possible values are:
--
-- -   CANCELLED - You cancelled the job or, if it\'s a one-time job, you
--     paused the job and didn\'t resume it within 30 days.
--
-- -   COMPLETE - For a one-time job, Amazon Macie finished processing the
--     data specified for the job. This value doesn\'t apply to recurring
--     jobs.
--
-- -   IDLE - For a recurring job, the previous scheduled run is complete
--     and the next scheduled run is pending. This value doesn\'t apply to
--     one-time jobs.
--
-- -   PAUSED - Macie started running the job but additional processing
--     would exceed the monthly sensitive data discovery quota for your
--     account or one or more member accounts that the job analyzes data
--     for.
--
-- -   RUNNING - For a one-time job, the job is in progress. For a
--     recurring job, a scheduled run is in progress.
--
-- -   USER_PAUSED - You paused the job. If you paused the job while it had
--     a status of RUNNING and you don\'t resume it within 30 days of
--     pausing it, the job or job run will expire and be cancelled,
--     depending on the job\'s type. To check the expiration date, refer to
--     the UserPausedDetails.jobExpiresAt property.
newJobSummary ::
  JobSummary
newJobSummary :: JobSummary
newJobSummary =
  JobSummary' :: Maybe LastRunErrorStatus
-> Maybe JobType
-> Maybe Text
-> Maybe POSIX
-> Maybe UserPausedDetails
-> Maybe S3BucketCriteriaForJob
-> Maybe Text
-> Maybe [S3BucketDefinitionForJob]
-> Maybe JobStatus
-> JobSummary
JobSummary'
    { $sel:lastRunErrorStatus:JobSummary' :: Maybe LastRunErrorStatus
lastRunErrorStatus = Maybe LastRunErrorStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:jobType:JobSummary' :: Maybe JobType
jobType = Maybe JobType
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:JobSummary' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:JobSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:userPausedDetails:JobSummary' :: Maybe UserPausedDetails
userPausedDetails = Maybe UserPausedDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCriteria:JobSummary' :: Maybe S3BucketCriteriaForJob
bucketCriteria = Maybe S3BucketCriteriaForJob
forall a. Maybe a
Prelude.Nothing,
      $sel:name:JobSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketDefinitions:JobSummary' :: Maybe [S3BucketDefinitionForJob]
bucketDefinitions = Maybe [S3BucketDefinitionForJob]
forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:JobSummary' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether any account- or bucket-level access errors occurred
-- when the job ran. For a recurring job, this value indicates the error
-- status of the job\'s most recent run.
jobSummary_lastRunErrorStatus :: Lens.Lens' JobSummary (Prelude.Maybe LastRunErrorStatus)
jobSummary_lastRunErrorStatus :: (Maybe LastRunErrorStatus -> f (Maybe LastRunErrorStatus))
-> JobSummary -> f JobSummary
jobSummary_lastRunErrorStatus = (JobSummary -> Maybe LastRunErrorStatus)
-> (JobSummary -> Maybe LastRunErrorStatus -> JobSummary)
-> Lens
     JobSummary
     JobSummary
     (Maybe LastRunErrorStatus)
     (Maybe 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)

-- | The schedule for running the job. Possible values are:
--
-- -   ONE_TIME - The job runs only once.
--
-- -   SCHEDULED - The job runs on a daily, weekly, or monthly basis.
jobSummary_jobType :: Lens.Lens' JobSummary (Prelude.Maybe JobType)
jobSummary_jobType :: (Maybe JobType -> f (Maybe JobType)) -> JobSummary -> f JobSummary
jobSummary_jobType = (JobSummary -> Maybe JobType)
-> (JobSummary -> Maybe JobType -> JobSummary)
-> Lens JobSummary JobSummary (Maybe JobType) (Maybe 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)

-- | The unique identifier for the job.
jobSummary_jobId :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.Text)
jobSummary_jobId :: (Maybe Text -> f (Maybe Text)) -> JobSummary -> f JobSummary
jobSummary_jobId = (JobSummary -> Maybe Text)
-> (JobSummary -> Maybe Text -> JobSummary)
-> Lens JobSummary JobSummary (Maybe Text) (Maybe Text)
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)

-- | The date and time, in UTC and extended ISO 8601 format, when the job was
-- created.
jobSummary_createdAt :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.UTCTime)
jobSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobSummary -> f JobSummary
jobSummary_createdAt = (JobSummary -> Maybe POSIX)
-> (JobSummary -> Maybe POSIX -> JobSummary)
-> Lens JobSummary JobSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:JobSummary' :: JobSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: JobSummary
s@JobSummary' {} Maybe POSIX
a -> JobSummary
s {$sel:createdAt:JobSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: JobSummary) ((Maybe POSIX -> f (Maybe POSIX)) -> JobSummary -> f JobSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobSummary
-> f JobSummary
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

-- | If the current status of the job is USER_PAUSED, specifies when the job
-- was paused and when the job or job run will expire and be cancelled if
-- it isn\'t resumed. This value is present only if the value for jobStatus
-- is USER_PAUSED.
jobSummary_userPausedDetails :: Lens.Lens' JobSummary (Prelude.Maybe UserPausedDetails)
jobSummary_userPausedDetails :: (Maybe UserPausedDetails -> f (Maybe UserPausedDetails))
-> JobSummary -> f JobSummary
jobSummary_userPausedDetails = (JobSummary -> Maybe UserPausedDetails)
-> (JobSummary -> Maybe UserPausedDetails -> JobSummary)
-> Lens
     JobSummary
     JobSummary
     (Maybe UserPausedDetails)
     (Maybe 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)

-- | The property- and tag-based conditions that determine which S3 buckets
-- are included or excluded from the job\'s analysis. Each time the job
-- runs, the job uses these criteria to determine which buckets to analyze.
-- A job\'s definition can contain a bucketCriteria object or a
-- bucketDefinitions array, not both.
jobSummary_bucketCriteria :: Lens.Lens' JobSummary (Prelude.Maybe S3BucketCriteriaForJob)
jobSummary_bucketCriteria :: (Maybe S3BucketCriteriaForJob -> f (Maybe S3BucketCriteriaForJob))
-> JobSummary -> f JobSummary
jobSummary_bucketCriteria = (JobSummary -> Maybe S3BucketCriteriaForJob)
-> (JobSummary -> Maybe S3BucketCriteriaForJob -> JobSummary)
-> Lens
     JobSummary
     JobSummary
     (Maybe S3BucketCriteriaForJob)
     (Maybe S3BucketCriteriaForJob)
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)

-- | The custom name of the job.
jobSummary_name :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.Text)
jobSummary_name :: (Maybe Text -> f (Maybe Text)) -> JobSummary -> f JobSummary
jobSummary_name = (JobSummary -> Maybe Text)
-> (JobSummary -> Maybe Text -> JobSummary)
-> Lens JobSummary JobSummary (Maybe Text) (Maybe Text)
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)

-- | An array of objects, one for each Amazon Web Services account that owns
-- specific S3 buckets for the job to analyze. Each object specifies the
-- account ID for an account and one or more buckets to analyze for that
-- account. A job\'s definition can contain a bucketDefinitions array or a
-- bucketCriteria object, not both.
jobSummary_bucketDefinitions :: Lens.Lens' JobSummary (Prelude.Maybe [S3BucketDefinitionForJob])
jobSummary_bucketDefinitions :: (Maybe [S3BucketDefinitionForJob]
 -> f (Maybe [S3BucketDefinitionForJob]))
-> JobSummary -> f JobSummary
jobSummary_bucketDefinitions = (JobSummary -> Maybe [S3BucketDefinitionForJob])
-> (JobSummary -> Maybe [S3BucketDefinitionForJob] -> JobSummary)
-> Lens
     JobSummary
     JobSummary
     (Maybe [S3BucketDefinitionForJob])
     (Maybe [S3BucketDefinitionForJob])
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) ((Maybe [S3BucketDefinitionForJob]
  -> f (Maybe [S3BucketDefinitionForJob]))
 -> JobSummary -> f JobSummary)
-> ((Maybe [S3BucketDefinitionForJob]
     -> f (Maybe [S3BucketDefinitionForJob]))
    -> Maybe [S3BucketDefinitionForJob]
    -> f (Maybe [S3BucketDefinitionForJob]))
-> (Maybe [S3BucketDefinitionForJob]
    -> f (Maybe [S3BucketDefinitionForJob]))
-> JobSummary
-> f JobSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
-> Iso
     (Maybe [S3BucketDefinitionForJob])
     (Maybe [S3BucketDefinitionForJob])
     (Maybe [S3BucketDefinitionForJob])
     (Maybe [S3BucketDefinitionForJob])
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
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
  [S3BucketDefinitionForJob]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The current status of the job. Possible values are:
--
-- -   CANCELLED - You cancelled the job or, if it\'s a one-time job, you
--     paused the job and didn\'t resume it within 30 days.
--
-- -   COMPLETE - For a one-time job, Amazon Macie finished processing the
--     data specified for the job. This value doesn\'t apply to recurring
--     jobs.
--
-- -   IDLE - For a recurring job, the previous scheduled run is complete
--     and the next scheduled run is pending. This value doesn\'t apply to
--     one-time jobs.
--
-- -   PAUSED - Macie started running the job but additional processing
--     would exceed the monthly sensitive data discovery quota for your
--     account or one or more member accounts that the job analyzes data
--     for.
--
-- -   RUNNING - For a one-time job, the job is in progress. For a
--     recurring job, a scheduled run is in progress.
--
-- -   USER_PAUSED - You paused the job. If you paused the job while it had
--     a status of RUNNING and you don\'t resume it within 30 days of
--     pausing it, the job or job run will expire and be cancelled,
--     depending on the job\'s type. To check the expiration date, refer to
--     the UserPausedDetails.jobExpiresAt property.
jobSummary_jobStatus :: Lens.Lens' JobSummary (Prelude.Maybe JobStatus)
jobSummary_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> JobSummary -> f JobSummary
jobSummary_jobStatus = (JobSummary -> Maybe JobStatus)
-> (JobSummary -> Maybe JobStatus -> JobSummary)
-> Lens JobSummary JobSummary (Maybe JobStatus) (Maybe 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)

instance Core.FromJSON JobSummary where
  parseJSON :: Value -> Parser JobSummary
parseJSON =
    String
-> (Object -> Parser JobSummary) -> Value -> Parser JobSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobSummary"
      ( \Object
x ->
          Maybe LastRunErrorStatus
-> Maybe JobType
-> Maybe Text
-> Maybe POSIX
-> Maybe UserPausedDetails
-> Maybe S3BucketCriteriaForJob
-> Maybe Text
-> Maybe [S3BucketDefinitionForJob]
-> Maybe JobStatus
-> JobSummary
JobSummary'
            (Maybe LastRunErrorStatus
 -> Maybe JobType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe UserPausedDetails
 -> Maybe S3BucketCriteriaForJob
 -> Maybe Text
 -> Maybe [S3BucketDefinitionForJob]
 -> Maybe JobStatus
 -> JobSummary)
-> Parser (Maybe LastRunErrorStatus)
-> Parser
     (Maybe JobType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe UserPausedDetails
      -> Maybe S3BucketCriteriaForJob
      -> Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LastRunErrorStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastRunErrorStatus")
            Parser
  (Maybe JobType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe UserPausedDetails
   -> Maybe S3BucketCriteriaForJob
   -> Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe JobType)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe UserPausedDetails
      -> Maybe S3BucketCriteriaForJob
      -> Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe UserPausedDetails
   -> Maybe S3BucketCriteriaForJob
   -> Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe UserPausedDetails
      -> Maybe S3BucketCriteriaForJob
      -> Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
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
"jobId")
            Parser
  (Maybe POSIX
   -> Maybe UserPausedDetails
   -> Maybe S3BucketCriteriaForJob
   -> Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe UserPausedDetails
      -> Maybe S3BucketCriteriaForJob
      -> Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
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
"createdAt")
            Parser
  (Maybe UserPausedDetails
   -> Maybe S3BucketCriteriaForJob
   -> Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe UserPausedDetails)
-> Parser
     (Maybe S3BucketCriteriaForJob
      -> Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserPausedDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userPausedDetails")
            Parser
  (Maybe S3BucketCriteriaForJob
   -> Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe S3BucketCriteriaForJob)
-> Parser
     (Maybe Text
      -> Maybe [S3BucketDefinitionForJob]
      -> Maybe JobStatus
      -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3BucketCriteriaForJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketCriteria")
            Parser
  (Maybe Text
   -> Maybe [S3BucketDefinitionForJob]
   -> Maybe JobStatus
   -> JobSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe [S3BucketDefinitionForJob] -> Maybe JobStatus -> JobSummary)
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
"name")
            Parser
  (Maybe [S3BucketDefinitionForJob] -> Maybe JobStatus -> JobSummary)
-> Parser (Maybe [S3BucketDefinitionForJob])
-> Parser (Maybe JobStatus -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [S3BucketDefinitionForJob]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketDefinitions"
                            Parser (Maybe (Maybe [S3BucketDefinitionForJob]))
-> Maybe [S3BucketDefinitionForJob]
-> Parser (Maybe [S3BucketDefinitionForJob])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [S3BucketDefinitionForJob]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe JobStatus -> JobSummary)
-> Parser (Maybe JobStatus) -> Parser JobSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobStatus")
      )

instance Prelude.Hashable JobSummary

instance Prelude.NFData JobSummary