{-# 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.Finding
-- 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.Finding where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.ClassificationDetails
import Amazonka.MacieV2.Types.FindingCategory
import Amazonka.MacieV2.Types.FindingType
import Amazonka.MacieV2.Types.PolicyDetails
import Amazonka.MacieV2.Types.ResourcesAffected
import Amazonka.MacieV2.Types.Severity
import qualified Amazonka.Prelude as Prelude

-- | Provides the details of a finding.
--
-- /See:/ 'newFinding' smart constructor.
data Finding = Finding'
  { -- | The details of a sensitive data finding. This value is null for a policy
    -- finding.
    Finding -> Maybe ClassificationDetails
classificationDetails :: Prelude.Maybe ClassificationDetails,
    -- | The details of a policy finding. This value is null for a sensitive data
    -- finding.
    Finding -> Maybe PolicyDetails
policyDetails :: Prelude.Maybe PolicyDetails,
    -- | The date and time, in UTC and extended ISO 8601 format, when the finding
    -- was created.
    Finding -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The category of the finding. Possible values are: CLASSIFICATION, for a
    -- sensitive data finding; and, POLICY, for a policy finding.
    Finding -> Maybe FindingCategory
category :: Prelude.Maybe FindingCategory,
    -- | The severity level and score for the finding.
    Finding -> Maybe Severity
severity :: Prelude.Maybe Severity,
    -- | The total number of occurrences of the finding. For sensitive data
    -- findings, this value is always 1. All sensitive data findings are
    -- considered new (unique) because they derive from individual
    -- classification jobs.
    Finding -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
    -- | The version of the schema that was used to define the data structures in
    -- the finding.
    Finding -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
    -- | The resources that the finding applies to.
    Finding -> Maybe ResourcesAffected
resourcesAffected :: Prelude.Maybe ResourcesAffected,
    -- | The unique identifier for the Amazon Web Services account that the
    -- finding applies to. This is typically the account that owns the affected
    -- resource.
    Finding -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services partition that Amazon Macie created the finding
    -- in.
    Finding -> Maybe Text
partition :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the finding. This is a random string that
    -- Amazon Macie generates and assigns to a finding when it creates the
    -- finding.
    Finding -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region that Amazon Macie created the finding in.
    Finding -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in UTC and extended ISO 8601 format, when the finding
    -- was last updated. For sensitive data findings, this value is the same as
    -- the value for the createdAt property. All sensitive data findings are
    -- considered new (unique) because they derive from individual
    -- classification jobs.
    Finding -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The brief description of the finding.
    Finding -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The type of the finding.
    Finding -> Maybe FindingType
type' :: Prelude.Maybe FindingType,
    -- | Specifies whether the finding is archived (suppressed).
    Finding -> Maybe Bool
archived :: Prelude.Maybe Prelude.Bool,
    -- | The description of the finding.
    Finding -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the finding is a sample finding. A /sample finding/ is
    -- a finding that uses example data to demonstrate what a finding might
    -- contain.
    Finding -> Maybe Bool
sample :: Prelude.Maybe Prelude.Bool
  }
  deriving (Finding -> Finding -> Bool
(Finding -> Finding -> Bool)
-> (Finding -> Finding -> Bool) -> Eq Finding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Finding -> Finding -> Bool
$c/= :: Finding -> Finding -> Bool
== :: Finding -> Finding -> Bool
$c== :: Finding -> Finding -> Bool
Prelude.Eq, ReadPrec [Finding]
ReadPrec Finding
Int -> ReadS Finding
ReadS [Finding]
(Int -> ReadS Finding)
-> ReadS [Finding]
-> ReadPrec Finding
-> ReadPrec [Finding]
-> Read Finding
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Finding]
$creadListPrec :: ReadPrec [Finding]
readPrec :: ReadPrec Finding
$creadPrec :: ReadPrec Finding
readList :: ReadS [Finding]
$creadList :: ReadS [Finding]
readsPrec :: Int -> ReadS Finding
$creadsPrec :: Int -> ReadS Finding
Prelude.Read, Int -> Finding -> ShowS
[Finding] -> ShowS
Finding -> String
(Int -> Finding -> ShowS)
-> (Finding -> String) -> ([Finding] -> ShowS) -> Show Finding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Finding] -> ShowS
$cshowList :: [Finding] -> ShowS
show :: Finding -> String
$cshow :: Finding -> String
showsPrec :: Int -> Finding -> ShowS
$cshowsPrec :: Int -> Finding -> ShowS
Prelude.Show, (forall x. Finding -> Rep Finding x)
-> (forall x. Rep Finding x -> Finding) -> Generic Finding
forall x. Rep Finding x -> Finding
forall x. Finding -> Rep Finding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Finding x -> Finding
$cfrom :: forall x. Finding -> Rep Finding x
Prelude.Generic)

-- |
-- Create a value of 'Finding' 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:
--
-- 'classificationDetails', 'finding_classificationDetails' - The details of a sensitive data finding. This value is null for a policy
-- finding.
--
-- 'policyDetails', 'finding_policyDetails' - The details of a policy finding. This value is null for a sensitive data
-- finding.
--
-- 'createdAt', 'finding_createdAt' - The date and time, in UTC and extended ISO 8601 format, when the finding
-- was created.
--
-- 'category', 'finding_category' - The category of the finding. Possible values are: CLASSIFICATION, for a
-- sensitive data finding; and, POLICY, for a policy finding.
--
-- 'severity', 'finding_severity' - The severity level and score for the finding.
--
-- 'count', 'finding_count' - The total number of occurrences of the finding. For sensitive data
-- findings, this value is always 1. All sensitive data findings are
-- considered new (unique) because they derive from individual
-- classification jobs.
--
-- 'schemaVersion', 'finding_schemaVersion' - The version of the schema that was used to define the data structures in
-- the finding.
--
-- 'resourcesAffected', 'finding_resourcesAffected' - The resources that the finding applies to.
--
-- 'accountId', 'finding_accountId' - The unique identifier for the Amazon Web Services account that the
-- finding applies to. This is typically the account that owns the affected
-- resource.
--
-- 'partition', 'finding_partition' - The Amazon Web Services partition that Amazon Macie created the finding
-- in.
--
-- 'id', 'finding_id' - The unique identifier for the finding. This is a random string that
-- Amazon Macie generates and assigns to a finding when it creates the
-- finding.
--
-- 'region', 'finding_region' - The Amazon Web Services Region that Amazon Macie created the finding in.
--
-- 'updatedAt', 'finding_updatedAt' - The date and time, in UTC and extended ISO 8601 format, when the finding
-- was last updated. For sensitive data findings, this value is the same as
-- the value for the createdAt property. All sensitive data findings are
-- considered new (unique) because they derive from individual
-- classification jobs.
--
-- 'title', 'finding_title' - The brief description of the finding.
--
-- 'type'', 'finding_type' - The type of the finding.
--
-- 'archived', 'finding_archived' - Specifies whether the finding is archived (suppressed).
--
-- 'description', 'finding_description' - The description of the finding.
--
-- 'sample', 'finding_sample' - Specifies whether the finding is a sample finding. A /sample finding/ is
-- a finding that uses example data to demonstrate what a finding might
-- contain.
newFinding ::
  Finding
newFinding :: Finding
newFinding =
  Finding' :: Maybe ClassificationDetails
-> Maybe PolicyDetails
-> Maybe POSIX
-> Maybe FindingCategory
-> Maybe Severity
-> Maybe Integer
-> Maybe Text
-> Maybe ResourcesAffected
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe FindingType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Finding
Finding'
    { $sel:classificationDetails:Finding' :: Maybe ClassificationDetails
classificationDetails = Maybe ClassificationDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:policyDetails:Finding' :: Maybe PolicyDetails
policyDetails = Maybe PolicyDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Finding' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:category:Finding' :: Maybe FindingCategory
category = Maybe FindingCategory
forall a. Maybe a
Prelude.Nothing,
      $sel:severity:Finding' :: Maybe Severity
severity = Maybe Severity
forall a. Maybe a
Prelude.Nothing,
      $sel:count:Finding' :: Maybe Integer
count = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersion:Finding' :: Maybe Text
schemaVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourcesAffected:Finding' :: Maybe ResourcesAffected
resourcesAffected = Maybe ResourcesAffected
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:Finding' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:partition:Finding' :: Maybe Text
partition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Finding' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Finding' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:Finding' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:title:Finding' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Finding' :: Maybe FindingType
type' = Maybe FindingType
forall a. Maybe a
Prelude.Nothing,
      $sel:archived:Finding' :: Maybe Bool
archived = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Finding' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sample:Finding' :: Maybe Bool
sample = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The details of a sensitive data finding. This value is null for a policy
-- finding.
finding_classificationDetails :: Lens.Lens' Finding (Prelude.Maybe ClassificationDetails)
finding_classificationDetails :: (Maybe ClassificationDetails -> f (Maybe ClassificationDetails))
-> Finding -> f Finding
finding_classificationDetails = (Finding -> Maybe ClassificationDetails)
-> (Finding -> Maybe ClassificationDetails -> Finding)
-> Lens
     Finding
     Finding
     (Maybe ClassificationDetails)
     (Maybe ClassificationDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe ClassificationDetails
classificationDetails :: Maybe ClassificationDetails
$sel:classificationDetails:Finding' :: Finding -> Maybe ClassificationDetails
classificationDetails} -> Maybe ClassificationDetails
classificationDetails) (\s :: Finding
s@Finding' {} Maybe ClassificationDetails
a -> Finding
s {$sel:classificationDetails:Finding' :: Maybe ClassificationDetails
classificationDetails = Maybe ClassificationDetails
a} :: Finding)

-- | The details of a policy finding. This value is null for a sensitive data
-- finding.
finding_policyDetails :: Lens.Lens' Finding (Prelude.Maybe PolicyDetails)
finding_policyDetails :: (Maybe PolicyDetails -> f (Maybe PolicyDetails))
-> Finding -> f Finding
finding_policyDetails = (Finding -> Maybe PolicyDetails)
-> (Finding -> Maybe PolicyDetails -> Finding)
-> Lens Finding Finding (Maybe PolicyDetails) (Maybe PolicyDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe PolicyDetails
policyDetails :: Maybe PolicyDetails
$sel:policyDetails:Finding' :: Finding -> Maybe PolicyDetails
policyDetails} -> Maybe PolicyDetails
policyDetails) (\s :: Finding
s@Finding' {} Maybe PolicyDetails
a -> Finding
s {$sel:policyDetails:Finding' :: Maybe PolicyDetails
policyDetails = Maybe PolicyDetails
a} :: Finding)

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

-- | The category of the finding. Possible values are: CLASSIFICATION, for a
-- sensitive data finding; and, POLICY, for a policy finding.
finding_category :: Lens.Lens' Finding (Prelude.Maybe FindingCategory)
finding_category :: (Maybe FindingCategory -> f (Maybe FindingCategory))
-> Finding -> f Finding
finding_category = (Finding -> Maybe FindingCategory)
-> (Finding -> Maybe FindingCategory -> Finding)
-> Lens
     Finding Finding (Maybe FindingCategory) (Maybe FindingCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe FindingCategory
category :: Maybe FindingCategory
$sel:category:Finding' :: Finding -> Maybe FindingCategory
category} -> Maybe FindingCategory
category) (\s :: Finding
s@Finding' {} Maybe FindingCategory
a -> Finding
s {$sel:category:Finding' :: Maybe FindingCategory
category = Maybe FindingCategory
a} :: Finding)

-- | The severity level and score for the finding.
finding_severity :: Lens.Lens' Finding (Prelude.Maybe Severity)
finding_severity :: (Maybe Severity -> f (Maybe Severity)) -> Finding -> f Finding
finding_severity = (Finding -> Maybe Severity)
-> (Finding -> Maybe Severity -> Finding)
-> Lens Finding Finding (Maybe Severity) (Maybe Severity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Severity
severity :: Maybe Severity
$sel:severity:Finding' :: Finding -> Maybe Severity
severity} -> Maybe Severity
severity) (\s :: Finding
s@Finding' {} Maybe Severity
a -> Finding
s {$sel:severity:Finding' :: Maybe Severity
severity = Maybe Severity
a} :: Finding)

-- | The total number of occurrences of the finding. For sensitive data
-- findings, this value is always 1. All sensitive data findings are
-- considered new (unique) because they derive from individual
-- classification jobs.
finding_count :: Lens.Lens' Finding (Prelude.Maybe Prelude.Integer)
finding_count :: (Maybe Integer -> f (Maybe Integer)) -> Finding -> f Finding
finding_count = (Finding -> Maybe Integer)
-> (Finding -> Maybe Integer -> Finding)
-> Lens Finding Finding (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Integer
count :: Maybe Integer
$sel:count:Finding' :: Finding -> Maybe Integer
count} -> Maybe Integer
count) (\s :: Finding
s@Finding' {} Maybe Integer
a -> Finding
s {$sel:count:Finding' :: Maybe Integer
count = Maybe Integer
a} :: Finding)

-- | The version of the schema that was used to define the data structures in
-- the finding.
finding_schemaVersion :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_schemaVersion :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_schemaVersion = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:Finding' :: Finding -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:schemaVersion:Finding' :: Maybe Text
schemaVersion = Maybe Text
a} :: Finding)

-- | The resources that the finding applies to.
finding_resourcesAffected :: Lens.Lens' Finding (Prelude.Maybe ResourcesAffected)
finding_resourcesAffected :: (Maybe ResourcesAffected -> f (Maybe ResourcesAffected))
-> Finding -> f Finding
finding_resourcesAffected = (Finding -> Maybe ResourcesAffected)
-> (Finding -> Maybe ResourcesAffected -> Finding)
-> Lens
     Finding Finding (Maybe ResourcesAffected) (Maybe ResourcesAffected)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe ResourcesAffected
resourcesAffected :: Maybe ResourcesAffected
$sel:resourcesAffected:Finding' :: Finding -> Maybe ResourcesAffected
resourcesAffected} -> Maybe ResourcesAffected
resourcesAffected) (\s :: Finding
s@Finding' {} Maybe ResourcesAffected
a -> Finding
s {$sel:resourcesAffected:Finding' :: Maybe ResourcesAffected
resourcesAffected = Maybe ResourcesAffected
a} :: Finding)

-- | The unique identifier for the Amazon Web Services account that the
-- finding applies to. This is typically the account that owns the affected
-- resource.
finding_accountId :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_accountId :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_accountId = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
accountId :: Maybe Text
$sel:accountId:Finding' :: Finding -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:accountId:Finding' :: Maybe Text
accountId = Maybe Text
a} :: Finding)

-- | The Amazon Web Services partition that Amazon Macie created the finding
-- in.
finding_partition :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_partition :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_partition = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
partition :: Maybe Text
$sel:partition:Finding' :: Finding -> Maybe Text
partition} -> Maybe Text
partition) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:partition:Finding' :: Maybe Text
partition = Maybe Text
a} :: Finding)

-- | The unique identifier for the finding. This is a random string that
-- Amazon Macie generates and assigns to a finding when it creates the
-- finding.
finding_id :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_id :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_id = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
id :: Maybe Text
$sel:id:Finding' :: Finding -> Maybe Text
id} -> Maybe Text
id) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:id:Finding' :: Maybe Text
id = Maybe Text
a} :: Finding)

-- | The Amazon Web Services Region that Amazon Macie created the finding in.
finding_region :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_region :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_region = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
region :: Maybe Text
$sel:region:Finding' :: Finding -> Maybe Text
region} -> Maybe Text
region) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:region:Finding' :: Maybe Text
region = Maybe Text
a} :: Finding)

-- | The date and time, in UTC and extended ISO 8601 format, when the finding
-- was last updated. For sensitive data findings, this value is the same as
-- the value for the createdAt property. All sensitive data findings are
-- considered new (unique) because they derive from individual
-- classification jobs.
finding_updatedAt :: Lens.Lens' Finding (Prelude.Maybe Prelude.UTCTime)
finding_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Finding -> f Finding
finding_updatedAt = (Finding -> Maybe POSIX)
-> (Finding -> Maybe POSIX -> Finding)
-> Lens Finding Finding (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:Finding' :: Finding -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: Finding
s@Finding' {} Maybe POSIX
a -> Finding
s {$sel:updatedAt:Finding' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: Finding) ((Maybe POSIX -> f (Maybe POSIX)) -> Finding -> f Finding)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Finding
-> f Finding
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

-- | The brief description of the finding.
finding_title :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_title :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_title = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
title :: Maybe Text
$sel:title:Finding' :: Finding -> Maybe Text
title} -> Maybe Text
title) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:title:Finding' :: Maybe Text
title = Maybe Text
a} :: Finding)

-- | The type of the finding.
finding_type :: Lens.Lens' Finding (Prelude.Maybe FindingType)
finding_type :: (Maybe FindingType -> f (Maybe FindingType))
-> Finding -> f Finding
finding_type = (Finding -> Maybe FindingType)
-> (Finding -> Maybe FindingType -> Finding)
-> Lens Finding Finding (Maybe FindingType) (Maybe FindingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe FindingType
type' :: Maybe FindingType
$sel:type':Finding' :: Finding -> Maybe FindingType
type'} -> Maybe FindingType
type') (\s :: Finding
s@Finding' {} Maybe FindingType
a -> Finding
s {$sel:type':Finding' :: Maybe FindingType
type' = Maybe FindingType
a} :: Finding)

-- | Specifies whether the finding is archived (suppressed).
finding_archived :: Lens.Lens' Finding (Prelude.Maybe Prelude.Bool)
finding_archived :: (Maybe Bool -> f (Maybe Bool)) -> Finding -> f Finding
finding_archived = (Finding -> Maybe Bool)
-> (Finding -> Maybe Bool -> Finding)
-> Lens Finding Finding (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Bool
archived :: Maybe Bool
$sel:archived:Finding' :: Finding -> Maybe Bool
archived} -> Maybe Bool
archived) (\s :: Finding
s@Finding' {} Maybe Bool
a -> Finding
s {$sel:archived:Finding' :: Maybe Bool
archived = Maybe Bool
a} :: Finding)

-- | The description of the finding.
finding_description :: Lens.Lens' Finding (Prelude.Maybe Prelude.Text)
finding_description :: (Maybe Text -> f (Maybe Text)) -> Finding -> f Finding
finding_description = (Finding -> Maybe Text)
-> (Finding -> Maybe Text -> Finding)
-> Lens Finding Finding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Text
description :: Maybe Text
$sel:description:Finding' :: Finding -> Maybe Text
description} -> Maybe Text
description) (\s :: Finding
s@Finding' {} Maybe Text
a -> Finding
s {$sel:description:Finding' :: Maybe Text
description = Maybe Text
a} :: Finding)

-- | Specifies whether the finding is a sample finding. A /sample finding/ is
-- a finding that uses example data to demonstrate what a finding might
-- contain.
finding_sample :: Lens.Lens' Finding (Prelude.Maybe Prelude.Bool)
finding_sample :: (Maybe Bool -> f (Maybe Bool)) -> Finding -> f Finding
finding_sample = (Finding -> Maybe Bool)
-> (Finding -> Maybe Bool -> Finding)
-> Lens Finding Finding (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Finding' {Maybe Bool
sample :: Maybe Bool
$sel:sample:Finding' :: Finding -> Maybe Bool
sample} -> Maybe Bool
sample) (\s :: Finding
s@Finding' {} Maybe Bool
a -> Finding
s {$sel:sample:Finding' :: Maybe Bool
sample = Maybe Bool
a} :: Finding)

instance Core.FromJSON Finding where
  parseJSON :: Value -> Parser Finding
parseJSON =
    String -> (Object -> Parser Finding) -> Value -> Parser Finding
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Finding"
      ( \Object
x ->
          Maybe ClassificationDetails
-> Maybe PolicyDetails
-> Maybe POSIX
-> Maybe FindingCategory
-> Maybe Severity
-> Maybe Integer
-> Maybe Text
-> Maybe ResourcesAffected
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe FindingType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Finding
Finding'
            (Maybe ClassificationDetails
 -> Maybe PolicyDetails
 -> Maybe POSIX
 -> Maybe FindingCategory
 -> Maybe Severity
 -> Maybe Integer
 -> Maybe Text
 -> Maybe ResourcesAffected
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe FindingType
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Finding)
-> Parser (Maybe ClassificationDetails)
-> Parser
     (Maybe PolicyDetails
      -> Maybe POSIX
      -> Maybe FindingCategory
      -> Maybe Severity
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ClassificationDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"classificationDetails")
            Parser
  (Maybe PolicyDetails
   -> Maybe POSIX
   -> Maybe FindingCategory
   -> Maybe Severity
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe PolicyDetails)
-> Parser
     (Maybe POSIX
      -> Maybe FindingCategory
      -> Maybe Severity
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"policyDetails")
            Parser
  (Maybe POSIX
   -> Maybe FindingCategory
   -> Maybe Severity
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe FindingCategory
      -> Maybe Severity
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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 FindingCategory
   -> Maybe Severity
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe FindingCategory)
-> Parser
     (Maybe Severity
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FindingCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"category")
            Parser
  (Maybe Severity
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Severity)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Severity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"severity")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
            Parser
  (Maybe Text
   -> Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourcesAffected
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"schemaVersion")
            Parser
  (Maybe ResourcesAffected
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe ResourcesAffected)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourcesAffected)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourcesAffected")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"accountId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"partition")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"id")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"region")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe FindingType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Finding)
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
"updatedAt")
            Parser
  (Maybe Text
   -> Maybe FindingType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Finding)
-> Parser (Maybe Text)
-> Parser
     (Maybe FindingType
      -> Maybe Bool -> Maybe Text -> Maybe Bool -> Finding)
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
"title")
            Parser
  (Maybe FindingType
   -> Maybe Bool -> Maybe Text -> Maybe Bool -> Finding)
-> Parser (Maybe FindingType)
-> Parser (Maybe Bool -> Maybe Text -> Maybe Bool -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FindingType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Bool -> Maybe Text -> Maybe Bool -> Finding)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Bool -> Finding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"archived")
            Parser (Maybe Text -> Maybe Bool -> Finding)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> Finding)
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
"description")
            Parser (Maybe Bool -> Finding)
-> Parser (Maybe Bool) -> Parser Finding
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sample")
      )

instance Prelude.Hashable Finding

instance Prelude.NFData Finding