{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.SecurityHub.BatchUpdateFindings
-- 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)
--
-- Used by Security Hub customers to update information about their
-- investigation into a finding. Requested by administrator accounts or
-- member accounts. Administrator accounts can update findings for their
-- account and their member accounts. Member accounts can update findings
-- for their account.
--
-- Updates from @BatchUpdateFindings@ do not affect the value of
-- @UpdatedAt@ for a finding.
--
-- Administrator and member accounts can use @BatchUpdateFindings@ to
-- update the following finding fields and objects.
--
-- -   @Confidence@
--
-- -   @Criticality@
--
-- -   @Note@
--
-- -   @RelatedFindings@
--
-- -   @Severity@
--
-- -   @Types@
--
-- -   @UserDefinedFields@
--
-- -   @VerificationState@
--
-- -   @Workflow@
--
-- You can configure IAM policies to restrict access to fields and field
-- values. For example, you might not want member accounts to be able to
-- suppress findings or change the finding severity. See
-- <https://docs.aws.amazon.com/securityhub/latest/userguide/finding-update-batchupdatefindings.html#batchupdatefindings-configure-access Configuring access to BatchUpdateFindings>
-- in the /Security Hub User Guide/.
module Amazonka.SecurityHub.BatchUpdateFindings
  ( -- * Creating a Request
    BatchUpdateFindings (..),
    newBatchUpdateFindings,

    -- * Request Lenses
    batchUpdateFindings_criticality,
    batchUpdateFindings_note,
    batchUpdateFindings_severity,
    batchUpdateFindings_types,
    batchUpdateFindings_relatedFindings,
    batchUpdateFindings_confidence,
    batchUpdateFindings_workflow,
    batchUpdateFindings_verificationState,
    batchUpdateFindings_userDefinedFields,
    batchUpdateFindings_findingIdentifiers,

    -- * Destructuring the Response
    BatchUpdateFindingsResponse (..),
    newBatchUpdateFindingsResponse,

    -- * Response Lenses
    batchUpdateFindingsResponse_httpStatus,
    batchUpdateFindingsResponse_processedFindings,
    batchUpdateFindingsResponse_unprocessedFindings,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecurityHub.Types

-- | /See:/ 'newBatchUpdateFindings' smart constructor.
data BatchUpdateFindings = BatchUpdateFindings'
  { -- | The updated value for the level of importance assigned to the resources
    -- associated with the findings.
    --
    -- A score of 0 means that the underlying resources have no criticality,
    -- and a score of 100 is reserved for the most critical resources.
    BatchUpdateFindings -> Maybe Natural
criticality :: Prelude.Maybe Prelude.Natural,
    BatchUpdateFindings -> Maybe NoteUpdate
note :: Prelude.Maybe NoteUpdate,
    -- | Used to update the finding severity.
    BatchUpdateFindings -> Maybe SeverityUpdate
severity :: Prelude.Maybe SeverityUpdate,
    -- | One or more finding types in the format of
    -- namespace\/category\/classifier that classify a finding.
    --
    -- Valid namespace values are as follows.
    --
    -- -   Software and Configuration Checks
    --
    -- -   TTPs
    --
    -- -   Effects
    --
    -- -   Unusual Behaviors
    --
    -- -   Sensitive Data Identifications
    BatchUpdateFindings -> Maybe [Text]
types :: Prelude.Maybe [Prelude.Text],
    -- | A list of findings that are related to the updated findings.
    BatchUpdateFindings -> Maybe [RelatedFinding]
relatedFindings :: Prelude.Maybe [RelatedFinding],
    -- | The updated value for the finding confidence. Confidence is defined as
    -- the likelihood that a finding accurately identifies the behavior or
    -- issue that it was intended to identify.
    --
    -- Confidence is scored on a 0-100 basis using a ratio scale, where 0 means
    -- zero percent confidence and 100 means 100 percent confidence.
    BatchUpdateFindings -> Maybe Natural
confidence :: Prelude.Maybe Prelude.Natural,
    -- | Used to update the workflow status of a finding.
    --
    -- The workflow status indicates the progress of the investigation into the
    -- finding.
    BatchUpdateFindings -> Maybe WorkflowUpdate
workflow :: Prelude.Maybe WorkflowUpdate,
    -- | Indicates the veracity of a finding.
    --
    -- The available values for @VerificationState@ are as follows.
    --
    -- -   @UNKNOWN@ – The default disposition of a security finding
    --
    -- -   @TRUE_POSITIVE@ – The security finding is confirmed
    --
    -- -   @FALSE_POSITIVE@ – The security finding was determined to be a false
    --     alarm
    --
    -- -   @BENIGN_POSITIVE@ – A special case of @TRUE_POSITIVE@ where the
    --     finding doesn\'t pose any threat, is expected, or both
    BatchUpdateFindings -> Maybe VerificationState
verificationState :: Prelude.Maybe VerificationState,
    -- | A list of name\/value string pairs associated with the finding. These
    -- are custom, user-defined fields added to a finding.
    BatchUpdateFindings -> Maybe (HashMap Text Text)
userDefinedFields :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The list of findings to update. @BatchUpdateFindings@ can be used to
    -- update up to 100 findings at a time.
    --
    -- For each finding, the list provides the finding identifier and the ARN
    -- of the finding provider.
    BatchUpdateFindings -> [AwsSecurityFindingIdentifier]
findingIdentifiers :: [AwsSecurityFindingIdentifier]
  }
  deriving (BatchUpdateFindings -> BatchUpdateFindings -> Bool
(BatchUpdateFindings -> BatchUpdateFindings -> Bool)
-> (BatchUpdateFindings -> BatchUpdateFindings -> Bool)
-> Eq BatchUpdateFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateFindings -> BatchUpdateFindings -> Bool
$c/= :: BatchUpdateFindings -> BatchUpdateFindings -> Bool
== :: BatchUpdateFindings -> BatchUpdateFindings -> Bool
$c== :: BatchUpdateFindings -> BatchUpdateFindings -> Bool
Prelude.Eq, ReadPrec [BatchUpdateFindings]
ReadPrec BatchUpdateFindings
Int -> ReadS BatchUpdateFindings
ReadS [BatchUpdateFindings]
(Int -> ReadS BatchUpdateFindings)
-> ReadS [BatchUpdateFindings]
-> ReadPrec BatchUpdateFindings
-> ReadPrec [BatchUpdateFindings]
-> Read BatchUpdateFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateFindings]
$creadListPrec :: ReadPrec [BatchUpdateFindings]
readPrec :: ReadPrec BatchUpdateFindings
$creadPrec :: ReadPrec BatchUpdateFindings
readList :: ReadS [BatchUpdateFindings]
$creadList :: ReadS [BatchUpdateFindings]
readsPrec :: Int -> ReadS BatchUpdateFindings
$creadsPrec :: Int -> ReadS BatchUpdateFindings
Prelude.Read, Int -> BatchUpdateFindings -> ShowS
[BatchUpdateFindings] -> ShowS
BatchUpdateFindings -> String
(Int -> BatchUpdateFindings -> ShowS)
-> (BatchUpdateFindings -> String)
-> ([BatchUpdateFindings] -> ShowS)
-> Show BatchUpdateFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateFindings] -> ShowS
$cshowList :: [BatchUpdateFindings] -> ShowS
show :: BatchUpdateFindings -> String
$cshow :: BatchUpdateFindings -> String
showsPrec :: Int -> BatchUpdateFindings -> ShowS
$cshowsPrec :: Int -> BatchUpdateFindings -> ShowS
Prelude.Show, (forall x. BatchUpdateFindings -> Rep BatchUpdateFindings x)
-> (forall x. Rep BatchUpdateFindings x -> BatchUpdateFindings)
-> Generic BatchUpdateFindings
forall x. Rep BatchUpdateFindings x -> BatchUpdateFindings
forall x. BatchUpdateFindings -> Rep BatchUpdateFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchUpdateFindings x -> BatchUpdateFindings
$cfrom :: forall x. BatchUpdateFindings -> Rep BatchUpdateFindings x
Prelude.Generic)

-- |
-- Create a value of 'BatchUpdateFindings' 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:
--
-- 'criticality', 'batchUpdateFindings_criticality' - The updated value for the level of importance assigned to the resources
-- associated with the findings.
--
-- A score of 0 means that the underlying resources have no criticality,
-- and a score of 100 is reserved for the most critical resources.
--
-- 'note', 'batchUpdateFindings_note' - Undocumented member.
--
-- 'severity', 'batchUpdateFindings_severity' - Used to update the finding severity.
--
-- 'types', 'batchUpdateFindings_types' - One or more finding types in the format of
-- namespace\/category\/classifier that classify a finding.
--
-- Valid namespace values are as follows.
--
-- -   Software and Configuration Checks
--
-- -   TTPs
--
-- -   Effects
--
-- -   Unusual Behaviors
--
-- -   Sensitive Data Identifications
--
-- 'relatedFindings', 'batchUpdateFindings_relatedFindings' - A list of findings that are related to the updated findings.
--
-- 'confidence', 'batchUpdateFindings_confidence' - The updated value for the finding confidence. Confidence is defined as
-- the likelihood that a finding accurately identifies the behavior or
-- issue that it was intended to identify.
--
-- Confidence is scored on a 0-100 basis using a ratio scale, where 0 means
-- zero percent confidence and 100 means 100 percent confidence.
--
-- 'workflow', 'batchUpdateFindings_workflow' - Used to update the workflow status of a finding.
--
-- The workflow status indicates the progress of the investigation into the
-- finding.
--
-- 'verificationState', 'batchUpdateFindings_verificationState' - Indicates the veracity of a finding.
--
-- The available values for @VerificationState@ are as follows.
--
-- -   @UNKNOWN@ – The default disposition of a security finding
--
-- -   @TRUE_POSITIVE@ – The security finding is confirmed
--
-- -   @FALSE_POSITIVE@ – The security finding was determined to be a false
--     alarm
--
-- -   @BENIGN_POSITIVE@ – A special case of @TRUE_POSITIVE@ where the
--     finding doesn\'t pose any threat, is expected, or both
--
-- 'userDefinedFields', 'batchUpdateFindings_userDefinedFields' - A list of name\/value string pairs associated with the finding. These
-- are custom, user-defined fields added to a finding.
--
-- 'findingIdentifiers', 'batchUpdateFindings_findingIdentifiers' - The list of findings to update. @BatchUpdateFindings@ can be used to
-- update up to 100 findings at a time.
--
-- For each finding, the list provides the finding identifier and the ARN
-- of the finding provider.
newBatchUpdateFindings ::
  BatchUpdateFindings
newBatchUpdateFindings :: BatchUpdateFindings
newBatchUpdateFindings =
  BatchUpdateFindings' :: Maybe Natural
-> Maybe NoteUpdate
-> Maybe SeverityUpdate
-> Maybe [Text]
-> Maybe [RelatedFinding]
-> Maybe Natural
-> Maybe WorkflowUpdate
-> Maybe VerificationState
-> Maybe (HashMap Text Text)
-> [AwsSecurityFindingIdentifier]
-> BatchUpdateFindings
BatchUpdateFindings'
    { $sel:criticality:BatchUpdateFindings' :: Maybe Natural
criticality = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:note:BatchUpdateFindings' :: Maybe NoteUpdate
note = Maybe NoteUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:severity:BatchUpdateFindings' :: Maybe SeverityUpdate
severity = Maybe SeverityUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:types:BatchUpdateFindings' :: Maybe [Text]
types = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:relatedFindings:BatchUpdateFindings' :: Maybe [RelatedFinding]
relatedFindings = Maybe [RelatedFinding]
forall a. Maybe a
Prelude.Nothing,
      $sel:confidence:BatchUpdateFindings' :: Maybe Natural
confidence = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:workflow:BatchUpdateFindings' :: Maybe WorkflowUpdate
workflow = Maybe WorkflowUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationState:BatchUpdateFindings' :: Maybe VerificationState
verificationState = Maybe VerificationState
forall a. Maybe a
Prelude.Nothing,
      $sel:userDefinedFields:BatchUpdateFindings' :: Maybe (HashMap Text Text)
userDefinedFields = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:findingIdentifiers:BatchUpdateFindings' :: [AwsSecurityFindingIdentifier]
findingIdentifiers = [AwsSecurityFindingIdentifier]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The updated value for the level of importance assigned to the resources
-- associated with the findings.
--
-- A score of 0 means that the underlying resources have no criticality,
-- and a score of 100 is reserved for the most critical resources.
batchUpdateFindings_criticality :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe Prelude.Natural)
batchUpdateFindings_criticality :: (Maybe Natural -> f (Maybe Natural))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_criticality = (BatchUpdateFindings -> Maybe Natural)
-> (BatchUpdateFindings -> Maybe Natural -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe Natural
criticality :: Maybe Natural
$sel:criticality:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe Natural
criticality} -> Maybe Natural
criticality) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe Natural
a -> BatchUpdateFindings
s {$sel:criticality:BatchUpdateFindings' :: Maybe Natural
criticality = Maybe Natural
a} :: BatchUpdateFindings)

-- | Undocumented member.
batchUpdateFindings_note :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe NoteUpdate)
batchUpdateFindings_note :: (Maybe NoteUpdate -> f (Maybe NoteUpdate))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_note = (BatchUpdateFindings -> Maybe NoteUpdate)
-> (BatchUpdateFindings -> Maybe NoteUpdate -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe NoteUpdate)
     (Maybe NoteUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe NoteUpdate
note :: Maybe NoteUpdate
$sel:note:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe NoteUpdate
note} -> Maybe NoteUpdate
note) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe NoteUpdate
a -> BatchUpdateFindings
s {$sel:note:BatchUpdateFindings' :: Maybe NoteUpdate
note = Maybe NoteUpdate
a} :: BatchUpdateFindings)

-- | Used to update the finding severity.
batchUpdateFindings_severity :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe SeverityUpdate)
batchUpdateFindings_severity :: (Maybe SeverityUpdate -> f (Maybe SeverityUpdate))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_severity = (BatchUpdateFindings -> Maybe SeverityUpdate)
-> (BatchUpdateFindings
    -> Maybe SeverityUpdate -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe SeverityUpdate)
     (Maybe SeverityUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe SeverityUpdate
severity :: Maybe SeverityUpdate
$sel:severity:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe SeverityUpdate
severity} -> Maybe SeverityUpdate
severity) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe SeverityUpdate
a -> BatchUpdateFindings
s {$sel:severity:BatchUpdateFindings' :: Maybe SeverityUpdate
severity = Maybe SeverityUpdate
a} :: BatchUpdateFindings)

-- | One or more finding types in the format of
-- namespace\/category\/classifier that classify a finding.
--
-- Valid namespace values are as follows.
--
-- -   Software and Configuration Checks
--
-- -   TTPs
--
-- -   Effects
--
-- -   Unusual Behaviors
--
-- -   Sensitive Data Identifications
batchUpdateFindings_types :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe [Prelude.Text])
batchUpdateFindings_types :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_types = (BatchUpdateFindings -> Maybe [Text])
-> (BatchUpdateFindings -> Maybe [Text] -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe [Text]
types :: Maybe [Text]
$sel:types:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe [Text]
types} -> Maybe [Text]
types) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe [Text]
a -> BatchUpdateFindings
s {$sel:types:BatchUpdateFindings' :: Maybe [Text]
types = Maybe [Text]
a} :: BatchUpdateFindings) ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchUpdateFindings -> f BatchUpdateFindings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchUpdateFindings
-> f BatchUpdateFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of findings that are related to the updated findings.
batchUpdateFindings_relatedFindings :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe [RelatedFinding])
batchUpdateFindings_relatedFindings :: (Maybe [RelatedFinding] -> f (Maybe [RelatedFinding]))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_relatedFindings = (BatchUpdateFindings -> Maybe [RelatedFinding])
-> (BatchUpdateFindings
    -> Maybe [RelatedFinding] -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe [RelatedFinding])
     (Maybe [RelatedFinding])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe [RelatedFinding]
relatedFindings :: Maybe [RelatedFinding]
$sel:relatedFindings:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe [RelatedFinding]
relatedFindings} -> Maybe [RelatedFinding]
relatedFindings) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe [RelatedFinding]
a -> BatchUpdateFindings
s {$sel:relatedFindings:BatchUpdateFindings' :: Maybe [RelatedFinding]
relatedFindings = Maybe [RelatedFinding]
a} :: BatchUpdateFindings) ((Maybe [RelatedFinding] -> f (Maybe [RelatedFinding]))
 -> BatchUpdateFindings -> f BatchUpdateFindings)
-> ((Maybe [RelatedFinding] -> f (Maybe [RelatedFinding]))
    -> Maybe [RelatedFinding] -> f (Maybe [RelatedFinding]))
-> (Maybe [RelatedFinding] -> f (Maybe [RelatedFinding]))
-> BatchUpdateFindings
-> f BatchUpdateFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RelatedFinding] [RelatedFinding] [RelatedFinding] [RelatedFinding]
-> Iso
     (Maybe [RelatedFinding])
     (Maybe [RelatedFinding])
     (Maybe [RelatedFinding])
     (Maybe [RelatedFinding])
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
  [RelatedFinding] [RelatedFinding] [RelatedFinding] [RelatedFinding]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The updated value for the finding confidence. Confidence is defined as
-- the likelihood that a finding accurately identifies the behavior or
-- issue that it was intended to identify.
--
-- Confidence is scored on a 0-100 basis using a ratio scale, where 0 means
-- zero percent confidence and 100 means 100 percent confidence.
batchUpdateFindings_confidence :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe Prelude.Natural)
batchUpdateFindings_confidence :: (Maybe Natural -> f (Maybe Natural))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_confidence = (BatchUpdateFindings -> Maybe Natural)
-> (BatchUpdateFindings -> Maybe Natural -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe Natural
confidence :: Maybe Natural
$sel:confidence:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe Natural
confidence} -> Maybe Natural
confidence) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe Natural
a -> BatchUpdateFindings
s {$sel:confidence:BatchUpdateFindings' :: Maybe Natural
confidence = Maybe Natural
a} :: BatchUpdateFindings)

-- | Used to update the workflow status of a finding.
--
-- The workflow status indicates the progress of the investigation into the
-- finding.
batchUpdateFindings_workflow :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe WorkflowUpdate)
batchUpdateFindings_workflow :: (Maybe WorkflowUpdate -> f (Maybe WorkflowUpdate))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_workflow = (BatchUpdateFindings -> Maybe WorkflowUpdate)
-> (BatchUpdateFindings
    -> Maybe WorkflowUpdate -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe WorkflowUpdate)
     (Maybe WorkflowUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe WorkflowUpdate
workflow :: Maybe WorkflowUpdate
$sel:workflow:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe WorkflowUpdate
workflow} -> Maybe WorkflowUpdate
workflow) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe WorkflowUpdate
a -> BatchUpdateFindings
s {$sel:workflow:BatchUpdateFindings' :: Maybe WorkflowUpdate
workflow = Maybe WorkflowUpdate
a} :: BatchUpdateFindings)

-- | Indicates the veracity of a finding.
--
-- The available values for @VerificationState@ are as follows.
--
-- -   @UNKNOWN@ – The default disposition of a security finding
--
-- -   @TRUE_POSITIVE@ – The security finding is confirmed
--
-- -   @FALSE_POSITIVE@ – The security finding was determined to be a false
--     alarm
--
-- -   @BENIGN_POSITIVE@ – A special case of @TRUE_POSITIVE@ where the
--     finding doesn\'t pose any threat, is expected, or both
batchUpdateFindings_verificationState :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe VerificationState)
batchUpdateFindings_verificationState :: (Maybe VerificationState -> f (Maybe VerificationState))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_verificationState = (BatchUpdateFindings -> Maybe VerificationState)
-> (BatchUpdateFindings
    -> Maybe VerificationState -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe VerificationState)
     (Maybe VerificationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe VerificationState
verificationState :: Maybe VerificationState
$sel:verificationState:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe VerificationState
verificationState} -> Maybe VerificationState
verificationState) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe VerificationState
a -> BatchUpdateFindings
s {$sel:verificationState:BatchUpdateFindings' :: Maybe VerificationState
verificationState = Maybe VerificationState
a} :: BatchUpdateFindings)

-- | A list of name\/value string pairs associated with the finding. These
-- are custom, user-defined fields added to a finding.
batchUpdateFindings_userDefinedFields :: Lens.Lens' BatchUpdateFindings (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
batchUpdateFindings_userDefinedFields :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_userDefinedFields = (BatchUpdateFindings -> Maybe (HashMap Text Text))
-> (BatchUpdateFindings
    -> Maybe (HashMap Text Text) -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {Maybe (HashMap Text Text)
userDefinedFields :: Maybe (HashMap Text Text)
$sel:userDefinedFields:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe (HashMap Text Text)
userDefinedFields} -> Maybe (HashMap Text Text)
userDefinedFields) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} Maybe (HashMap Text Text)
a -> BatchUpdateFindings
s {$sel:userDefinedFields:BatchUpdateFindings' :: Maybe (HashMap Text Text)
userDefinedFields = Maybe (HashMap Text Text)
a} :: BatchUpdateFindings) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> BatchUpdateFindings -> f BatchUpdateFindings)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BatchUpdateFindings
-> f BatchUpdateFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of findings to update. @BatchUpdateFindings@ can be used to
-- update up to 100 findings at a time.
--
-- For each finding, the list provides the finding identifier and the ARN
-- of the finding provider.
batchUpdateFindings_findingIdentifiers :: Lens.Lens' BatchUpdateFindings [AwsSecurityFindingIdentifier]
batchUpdateFindings_findingIdentifiers :: ([AwsSecurityFindingIdentifier]
 -> f [AwsSecurityFindingIdentifier])
-> BatchUpdateFindings -> f BatchUpdateFindings
batchUpdateFindings_findingIdentifiers = (BatchUpdateFindings -> [AwsSecurityFindingIdentifier])
-> (BatchUpdateFindings
    -> [AwsSecurityFindingIdentifier] -> BatchUpdateFindings)
-> Lens
     BatchUpdateFindings
     BatchUpdateFindings
     [AwsSecurityFindingIdentifier]
     [AwsSecurityFindingIdentifier]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindings' {[AwsSecurityFindingIdentifier]
findingIdentifiers :: [AwsSecurityFindingIdentifier]
$sel:findingIdentifiers:BatchUpdateFindings' :: BatchUpdateFindings -> [AwsSecurityFindingIdentifier]
findingIdentifiers} -> [AwsSecurityFindingIdentifier]
findingIdentifiers) (\s :: BatchUpdateFindings
s@BatchUpdateFindings' {} [AwsSecurityFindingIdentifier]
a -> BatchUpdateFindings
s {$sel:findingIdentifiers:BatchUpdateFindings' :: [AwsSecurityFindingIdentifier]
findingIdentifiers = [AwsSecurityFindingIdentifier]
a} :: BatchUpdateFindings) (([AwsSecurityFindingIdentifier]
  -> f [AwsSecurityFindingIdentifier])
 -> BatchUpdateFindings -> f BatchUpdateFindings)
-> (([AwsSecurityFindingIdentifier]
     -> f [AwsSecurityFindingIdentifier])
    -> [AwsSecurityFindingIdentifier]
    -> f [AwsSecurityFindingIdentifier])
-> ([AwsSecurityFindingIdentifier]
    -> f [AwsSecurityFindingIdentifier])
-> BatchUpdateFindings
-> f BatchUpdateFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AwsSecurityFindingIdentifier]
 -> f [AwsSecurityFindingIdentifier])
-> [AwsSecurityFindingIdentifier]
-> f [AwsSecurityFindingIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest BatchUpdateFindings where
  type
    AWSResponse BatchUpdateFindings =
      BatchUpdateFindingsResponse
  request :: BatchUpdateFindings -> Request BatchUpdateFindings
request = Service -> BatchUpdateFindings -> Request BatchUpdateFindings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchUpdateFindings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchUpdateFindings)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchUpdateFindings))
-> Logger
-> Service
-> Proxy BatchUpdateFindings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchUpdateFindings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [AwsSecurityFindingIdentifier]
-> [BatchUpdateFindingsUnprocessedFinding]
-> BatchUpdateFindingsResponse
BatchUpdateFindingsResponse'
            (Int
 -> [AwsSecurityFindingIdentifier]
 -> [BatchUpdateFindingsUnprocessedFinding]
 -> BatchUpdateFindingsResponse)
-> Either String Int
-> Either
     String
     ([AwsSecurityFindingIdentifier]
      -> [BatchUpdateFindingsUnprocessedFinding]
      -> BatchUpdateFindingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([AwsSecurityFindingIdentifier]
   -> [BatchUpdateFindingsUnprocessedFinding]
   -> BatchUpdateFindingsResponse)
-> Either String [AwsSecurityFindingIdentifier]
-> Either
     String
     ([BatchUpdateFindingsUnprocessedFinding]
      -> BatchUpdateFindingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe [AwsSecurityFindingIdentifier])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProcessedFindings"
                            Either String (Maybe [AwsSecurityFindingIdentifier])
-> [AwsSecurityFindingIdentifier]
-> Either String [AwsSecurityFindingIdentifier]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AwsSecurityFindingIdentifier]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  ([BatchUpdateFindingsUnprocessedFinding]
   -> BatchUpdateFindingsResponse)
-> Either String [BatchUpdateFindingsUnprocessedFinding]
-> Either String BatchUpdateFindingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe [BatchUpdateFindingsUnprocessedFinding])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UnprocessedFindings"
                            Either String (Maybe [BatchUpdateFindingsUnprocessedFinding])
-> [BatchUpdateFindingsUnprocessedFinding]
-> Either String [BatchUpdateFindingsUnprocessedFinding]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BatchUpdateFindingsUnprocessedFinding]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable BatchUpdateFindings

instance Prelude.NFData BatchUpdateFindings

instance Core.ToHeaders BatchUpdateFindings where
  toHeaders :: BatchUpdateFindings -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchUpdateFindings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON BatchUpdateFindings where
  toJSON :: BatchUpdateFindings -> Value
toJSON BatchUpdateFindings' {[AwsSecurityFindingIdentifier]
Maybe Natural
Maybe [Text]
Maybe [RelatedFinding]
Maybe (HashMap Text Text)
Maybe NoteUpdate
Maybe SeverityUpdate
Maybe VerificationState
Maybe WorkflowUpdate
findingIdentifiers :: [AwsSecurityFindingIdentifier]
userDefinedFields :: Maybe (HashMap Text Text)
verificationState :: Maybe VerificationState
workflow :: Maybe WorkflowUpdate
confidence :: Maybe Natural
relatedFindings :: Maybe [RelatedFinding]
types :: Maybe [Text]
severity :: Maybe SeverityUpdate
note :: Maybe NoteUpdate
criticality :: Maybe Natural
$sel:findingIdentifiers:BatchUpdateFindings' :: BatchUpdateFindings -> [AwsSecurityFindingIdentifier]
$sel:userDefinedFields:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe (HashMap Text Text)
$sel:verificationState:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe VerificationState
$sel:workflow:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe WorkflowUpdate
$sel:confidence:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe Natural
$sel:relatedFindings:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe [RelatedFinding]
$sel:types:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe [Text]
$sel:severity:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe SeverityUpdate
$sel:note:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe NoteUpdate
$sel:criticality:BatchUpdateFindings' :: BatchUpdateFindings -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Criticality" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
criticality,
            (Text
"Note" Text -> NoteUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NoteUpdate -> Pair) -> Maybe NoteUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NoteUpdate
note,
            (Text
"Severity" Text -> SeverityUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SeverityUpdate -> Pair) -> Maybe SeverityUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SeverityUpdate
severity,
            (Text
"Types" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
types,
            (Text
"RelatedFindings" Text -> [RelatedFinding] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([RelatedFinding] -> Pair) -> Maybe [RelatedFinding] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RelatedFinding]
relatedFindings,
            (Text
"Confidence" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
confidence,
            (Text
"Workflow" Text -> WorkflowUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (WorkflowUpdate -> Pair) -> Maybe WorkflowUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkflowUpdate
workflow,
            (Text
"VerificationState" Text -> VerificationState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VerificationState -> Pair)
-> Maybe VerificationState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VerificationState
verificationState,
            (Text
"UserDefinedFields" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
userDefinedFields,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FindingIdentifiers" Text -> [AwsSecurityFindingIdentifier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AwsSecurityFindingIdentifier]
findingIdentifiers)
          ]
      )

instance Core.ToPath BatchUpdateFindings where
  toPath :: BatchUpdateFindings -> ByteString
toPath = ByteString -> BatchUpdateFindings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/findings/batchupdate"

instance Core.ToQuery BatchUpdateFindings where
  toQuery :: BatchUpdateFindings -> QueryString
toQuery = QueryString -> BatchUpdateFindings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchUpdateFindingsResponse' smart constructor.
data BatchUpdateFindingsResponse = BatchUpdateFindingsResponse'
  { -- | The response's http status code.
    BatchUpdateFindingsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of findings that were updated successfully.
    BatchUpdateFindingsResponse -> [AwsSecurityFindingIdentifier]
processedFindings :: [AwsSecurityFindingIdentifier],
    -- | The list of findings that were not updated.
    BatchUpdateFindingsResponse
-> [BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings :: [BatchUpdateFindingsUnprocessedFinding]
  }
  deriving (BatchUpdateFindingsResponse -> BatchUpdateFindingsResponse -> Bool
(BatchUpdateFindingsResponse
 -> BatchUpdateFindingsResponse -> Bool)
-> (BatchUpdateFindingsResponse
    -> BatchUpdateFindingsResponse -> Bool)
-> Eq BatchUpdateFindingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateFindingsResponse -> BatchUpdateFindingsResponse -> Bool
$c/= :: BatchUpdateFindingsResponse -> BatchUpdateFindingsResponse -> Bool
== :: BatchUpdateFindingsResponse -> BatchUpdateFindingsResponse -> Bool
$c== :: BatchUpdateFindingsResponse -> BatchUpdateFindingsResponse -> Bool
Prelude.Eq, ReadPrec [BatchUpdateFindingsResponse]
ReadPrec BatchUpdateFindingsResponse
Int -> ReadS BatchUpdateFindingsResponse
ReadS [BatchUpdateFindingsResponse]
(Int -> ReadS BatchUpdateFindingsResponse)
-> ReadS [BatchUpdateFindingsResponse]
-> ReadPrec BatchUpdateFindingsResponse
-> ReadPrec [BatchUpdateFindingsResponse]
-> Read BatchUpdateFindingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateFindingsResponse]
$creadListPrec :: ReadPrec [BatchUpdateFindingsResponse]
readPrec :: ReadPrec BatchUpdateFindingsResponse
$creadPrec :: ReadPrec BatchUpdateFindingsResponse
readList :: ReadS [BatchUpdateFindingsResponse]
$creadList :: ReadS [BatchUpdateFindingsResponse]
readsPrec :: Int -> ReadS BatchUpdateFindingsResponse
$creadsPrec :: Int -> ReadS BatchUpdateFindingsResponse
Prelude.Read, Int -> BatchUpdateFindingsResponse -> ShowS
[BatchUpdateFindingsResponse] -> ShowS
BatchUpdateFindingsResponse -> String
(Int -> BatchUpdateFindingsResponse -> ShowS)
-> (BatchUpdateFindingsResponse -> String)
-> ([BatchUpdateFindingsResponse] -> ShowS)
-> Show BatchUpdateFindingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateFindingsResponse] -> ShowS
$cshowList :: [BatchUpdateFindingsResponse] -> ShowS
show :: BatchUpdateFindingsResponse -> String
$cshow :: BatchUpdateFindingsResponse -> String
showsPrec :: Int -> BatchUpdateFindingsResponse -> ShowS
$cshowsPrec :: Int -> BatchUpdateFindingsResponse -> ShowS
Prelude.Show, (forall x.
 BatchUpdateFindingsResponse -> Rep BatchUpdateFindingsResponse x)
-> (forall x.
    Rep BatchUpdateFindingsResponse x -> BatchUpdateFindingsResponse)
-> Generic BatchUpdateFindingsResponse
forall x.
Rep BatchUpdateFindingsResponse x -> BatchUpdateFindingsResponse
forall x.
BatchUpdateFindingsResponse -> Rep BatchUpdateFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchUpdateFindingsResponse x -> BatchUpdateFindingsResponse
$cfrom :: forall x.
BatchUpdateFindingsResponse -> Rep BatchUpdateFindingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchUpdateFindingsResponse' 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:
--
-- 'httpStatus', 'batchUpdateFindingsResponse_httpStatus' - The response's http status code.
--
-- 'processedFindings', 'batchUpdateFindingsResponse_processedFindings' - The list of findings that were updated successfully.
--
-- 'unprocessedFindings', 'batchUpdateFindingsResponse_unprocessedFindings' - The list of findings that were not updated.
newBatchUpdateFindingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchUpdateFindingsResponse
newBatchUpdateFindingsResponse :: Int -> BatchUpdateFindingsResponse
newBatchUpdateFindingsResponse Int
pHttpStatus_ =
  BatchUpdateFindingsResponse' :: Int
-> [AwsSecurityFindingIdentifier]
-> [BatchUpdateFindingsUnprocessedFinding]
-> BatchUpdateFindingsResponse
BatchUpdateFindingsResponse'
    { $sel:httpStatus:BatchUpdateFindingsResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:processedFindings:BatchUpdateFindingsResponse' :: [AwsSecurityFindingIdentifier]
processedFindings = [AwsSecurityFindingIdentifier]
forall a. Monoid a => a
Prelude.mempty,
      $sel:unprocessedFindings:BatchUpdateFindingsResponse' :: [BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings = [BatchUpdateFindingsUnprocessedFinding]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
batchUpdateFindingsResponse_httpStatus :: Lens.Lens' BatchUpdateFindingsResponse Prelude.Int
batchUpdateFindingsResponse_httpStatus :: (Int -> f Int)
-> BatchUpdateFindingsResponse -> f BatchUpdateFindingsResponse
batchUpdateFindingsResponse_httpStatus = (BatchUpdateFindingsResponse -> Int)
-> (BatchUpdateFindingsResponse
    -> Int -> BatchUpdateFindingsResponse)
-> Lens
     BatchUpdateFindingsResponse BatchUpdateFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchUpdateFindingsResponse' :: BatchUpdateFindingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchUpdateFindingsResponse
s@BatchUpdateFindingsResponse' {} Int
a -> BatchUpdateFindingsResponse
s {$sel:httpStatus:BatchUpdateFindingsResponse' :: Int
httpStatus = Int
a} :: BatchUpdateFindingsResponse)

-- | The list of findings that were updated successfully.
batchUpdateFindingsResponse_processedFindings :: Lens.Lens' BatchUpdateFindingsResponse [AwsSecurityFindingIdentifier]
batchUpdateFindingsResponse_processedFindings :: ([AwsSecurityFindingIdentifier]
 -> f [AwsSecurityFindingIdentifier])
-> BatchUpdateFindingsResponse -> f BatchUpdateFindingsResponse
batchUpdateFindingsResponse_processedFindings = (BatchUpdateFindingsResponse -> [AwsSecurityFindingIdentifier])
-> (BatchUpdateFindingsResponse
    -> [AwsSecurityFindingIdentifier] -> BatchUpdateFindingsResponse)
-> Lens
     BatchUpdateFindingsResponse
     BatchUpdateFindingsResponse
     [AwsSecurityFindingIdentifier]
     [AwsSecurityFindingIdentifier]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindingsResponse' {[AwsSecurityFindingIdentifier]
processedFindings :: [AwsSecurityFindingIdentifier]
$sel:processedFindings:BatchUpdateFindingsResponse' :: BatchUpdateFindingsResponse -> [AwsSecurityFindingIdentifier]
processedFindings} -> [AwsSecurityFindingIdentifier]
processedFindings) (\s :: BatchUpdateFindingsResponse
s@BatchUpdateFindingsResponse' {} [AwsSecurityFindingIdentifier]
a -> BatchUpdateFindingsResponse
s {$sel:processedFindings:BatchUpdateFindingsResponse' :: [AwsSecurityFindingIdentifier]
processedFindings = [AwsSecurityFindingIdentifier]
a} :: BatchUpdateFindingsResponse) (([AwsSecurityFindingIdentifier]
  -> f [AwsSecurityFindingIdentifier])
 -> BatchUpdateFindingsResponse -> f BatchUpdateFindingsResponse)
-> (([AwsSecurityFindingIdentifier]
     -> f [AwsSecurityFindingIdentifier])
    -> [AwsSecurityFindingIdentifier]
    -> f [AwsSecurityFindingIdentifier])
-> ([AwsSecurityFindingIdentifier]
    -> f [AwsSecurityFindingIdentifier])
-> BatchUpdateFindingsResponse
-> f BatchUpdateFindingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AwsSecurityFindingIdentifier]
 -> f [AwsSecurityFindingIdentifier])
-> [AwsSecurityFindingIdentifier]
-> f [AwsSecurityFindingIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of findings that were not updated.
batchUpdateFindingsResponse_unprocessedFindings :: Lens.Lens' BatchUpdateFindingsResponse [BatchUpdateFindingsUnprocessedFinding]
batchUpdateFindingsResponse_unprocessedFindings :: ([BatchUpdateFindingsUnprocessedFinding]
 -> f [BatchUpdateFindingsUnprocessedFinding])
-> BatchUpdateFindingsResponse -> f BatchUpdateFindingsResponse
batchUpdateFindingsResponse_unprocessedFindings = (BatchUpdateFindingsResponse
 -> [BatchUpdateFindingsUnprocessedFinding])
-> (BatchUpdateFindingsResponse
    -> [BatchUpdateFindingsUnprocessedFinding]
    -> BatchUpdateFindingsResponse)
-> Lens
     BatchUpdateFindingsResponse
     BatchUpdateFindingsResponse
     [BatchUpdateFindingsUnprocessedFinding]
     [BatchUpdateFindingsUnprocessedFinding]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateFindingsResponse' {[BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings :: [BatchUpdateFindingsUnprocessedFinding]
$sel:unprocessedFindings:BatchUpdateFindingsResponse' :: BatchUpdateFindingsResponse
-> [BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings} -> [BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings) (\s :: BatchUpdateFindingsResponse
s@BatchUpdateFindingsResponse' {} [BatchUpdateFindingsUnprocessedFinding]
a -> BatchUpdateFindingsResponse
s {$sel:unprocessedFindings:BatchUpdateFindingsResponse' :: [BatchUpdateFindingsUnprocessedFinding]
unprocessedFindings = [BatchUpdateFindingsUnprocessedFinding]
a} :: BatchUpdateFindingsResponse) (([BatchUpdateFindingsUnprocessedFinding]
  -> f [BatchUpdateFindingsUnprocessedFinding])
 -> BatchUpdateFindingsResponse -> f BatchUpdateFindingsResponse)
-> (([BatchUpdateFindingsUnprocessedFinding]
     -> f [BatchUpdateFindingsUnprocessedFinding])
    -> [BatchUpdateFindingsUnprocessedFinding]
    -> f [BatchUpdateFindingsUnprocessedFinding])
-> ([BatchUpdateFindingsUnprocessedFinding]
    -> f [BatchUpdateFindingsUnprocessedFinding])
-> BatchUpdateFindingsResponse
-> f BatchUpdateFindingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchUpdateFindingsUnprocessedFinding]
 -> f [BatchUpdateFindingsUnprocessedFinding])
-> [BatchUpdateFindingsUnprocessedFinding]
-> f [BatchUpdateFindingsUnprocessedFinding]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData BatchUpdateFindingsResponse