{-# 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.BatchImportFindings
-- 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)
--
-- Imports security findings generated from an integrated product into
-- Security Hub. This action is requested by the integrated product to
-- import its findings into Security Hub.
--
-- The maximum allowed size for a finding is 240 Kb. An error is returned
-- for any finding larger than 240 Kb.
--
-- After a finding is created, @BatchImportFindings@ cannot be used to
-- update the following finding fields and objects, which Security Hub
-- customers use to manage their investigation workflow.
--
-- -   @Note@
--
-- -   @UserDefinedFields@
--
-- -   @VerificationState@
--
-- -   @Workflow@
--
-- Finding providers also should not use @BatchImportFindings@ to update
-- the following attributes.
--
-- -   @Confidence@
--
-- -   @Criticality@
--
-- -   @RelatedFindings@
--
-- -   @Severity@
--
-- -   @Types@
--
-- Instead, finding providers use @FindingProviderFields@ to provide values
-- for these attributes.
module Amazonka.SecurityHub.BatchImportFindings
  ( -- * Creating a Request
    BatchImportFindings (..),
    newBatchImportFindings,

    -- * Request Lenses
    batchImportFindings_findings,

    -- * Destructuring the Response
    BatchImportFindingsResponse (..),
    newBatchImportFindingsResponse,

    -- * Response Lenses
    batchImportFindingsResponse_failedFindings,
    batchImportFindingsResponse_httpStatus,
    batchImportFindingsResponse_failedCount,
    batchImportFindingsResponse_successCount,
  )
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:/ 'newBatchImportFindings' smart constructor.
data BatchImportFindings = BatchImportFindings'
  { -- | A list of findings to import. To successfully import a finding, it must
    -- follow the
    -- <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html Amazon Web Services Security Finding Format>.
    -- Maximum of 100 findings per request.
    BatchImportFindings -> NonEmpty AwsSecurityFinding
findings :: Prelude.NonEmpty AwsSecurityFinding
  }
  deriving (BatchImportFindings -> BatchImportFindings -> Bool
(BatchImportFindings -> BatchImportFindings -> Bool)
-> (BatchImportFindings -> BatchImportFindings -> Bool)
-> Eq BatchImportFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchImportFindings -> BatchImportFindings -> Bool
$c/= :: BatchImportFindings -> BatchImportFindings -> Bool
== :: BatchImportFindings -> BatchImportFindings -> Bool
$c== :: BatchImportFindings -> BatchImportFindings -> Bool
Prelude.Eq, ReadPrec [BatchImportFindings]
ReadPrec BatchImportFindings
Int -> ReadS BatchImportFindings
ReadS [BatchImportFindings]
(Int -> ReadS BatchImportFindings)
-> ReadS [BatchImportFindings]
-> ReadPrec BatchImportFindings
-> ReadPrec [BatchImportFindings]
-> Read BatchImportFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchImportFindings]
$creadListPrec :: ReadPrec [BatchImportFindings]
readPrec :: ReadPrec BatchImportFindings
$creadPrec :: ReadPrec BatchImportFindings
readList :: ReadS [BatchImportFindings]
$creadList :: ReadS [BatchImportFindings]
readsPrec :: Int -> ReadS BatchImportFindings
$creadsPrec :: Int -> ReadS BatchImportFindings
Prelude.Read, Int -> BatchImportFindings -> ShowS
[BatchImportFindings] -> ShowS
BatchImportFindings -> String
(Int -> BatchImportFindings -> ShowS)
-> (BatchImportFindings -> String)
-> ([BatchImportFindings] -> ShowS)
-> Show BatchImportFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchImportFindings] -> ShowS
$cshowList :: [BatchImportFindings] -> ShowS
show :: BatchImportFindings -> String
$cshow :: BatchImportFindings -> String
showsPrec :: Int -> BatchImportFindings -> ShowS
$cshowsPrec :: Int -> BatchImportFindings -> ShowS
Prelude.Show, (forall x. BatchImportFindings -> Rep BatchImportFindings x)
-> (forall x. Rep BatchImportFindings x -> BatchImportFindings)
-> Generic BatchImportFindings
forall x. Rep BatchImportFindings x -> BatchImportFindings
forall x. BatchImportFindings -> Rep BatchImportFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchImportFindings x -> BatchImportFindings
$cfrom :: forall x. BatchImportFindings -> Rep BatchImportFindings x
Prelude.Generic)

-- |
-- Create a value of 'BatchImportFindings' 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:
--
-- 'findings', 'batchImportFindings_findings' - A list of findings to import. To successfully import a finding, it must
-- follow the
-- <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html Amazon Web Services Security Finding Format>.
-- Maximum of 100 findings per request.
newBatchImportFindings ::
  -- | 'findings'
  Prelude.NonEmpty AwsSecurityFinding ->
  BatchImportFindings
newBatchImportFindings :: NonEmpty AwsSecurityFinding -> BatchImportFindings
newBatchImportFindings NonEmpty AwsSecurityFinding
pFindings_ =
  BatchImportFindings' :: NonEmpty AwsSecurityFinding -> BatchImportFindings
BatchImportFindings'
    { $sel:findings:BatchImportFindings' :: NonEmpty AwsSecurityFinding
findings =
        Tagged
  (NonEmpty AwsSecurityFinding)
  (Identity (NonEmpty AwsSecurityFinding))
-> Tagged
     (NonEmpty AwsSecurityFinding)
     (Identity (NonEmpty AwsSecurityFinding))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty AwsSecurityFinding)
   (Identity (NonEmpty AwsSecurityFinding))
 -> Tagged
      (NonEmpty AwsSecurityFinding)
      (Identity (NonEmpty AwsSecurityFinding)))
-> NonEmpty AwsSecurityFinding -> NonEmpty AwsSecurityFinding
forall t b. AReview t b -> b -> t
Lens.# NonEmpty AwsSecurityFinding
pFindings_
    }

-- | A list of findings to import. To successfully import a finding, it must
-- follow the
-- <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html Amazon Web Services Security Finding Format>.
-- Maximum of 100 findings per request.
batchImportFindings_findings :: Lens.Lens' BatchImportFindings (Prelude.NonEmpty AwsSecurityFinding)
batchImportFindings_findings :: (NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding))
-> BatchImportFindings -> f BatchImportFindings
batchImportFindings_findings = (BatchImportFindings -> NonEmpty AwsSecurityFinding)
-> (BatchImportFindings
    -> NonEmpty AwsSecurityFinding -> BatchImportFindings)
-> Lens
     BatchImportFindings
     BatchImportFindings
     (NonEmpty AwsSecurityFinding)
     (NonEmpty AwsSecurityFinding)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportFindings' {NonEmpty AwsSecurityFinding
findings :: NonEmpty AwsSecurityFinding
$sel:findings:BatchImportFindings' :: BatchImportFindings -> NonEmpty AwsSecurityFinding
findings} -> NonEmpty AwsSecurityFinding
findings) (\s :: BatchImportFindings
s@BatchImportFindings' {} NonEmpty AwsSecurityFinding
a -> BatchImportFindings
s {$sel:findings:BatchImportFindings' :: NonEmpty AwsSecurityFinding
findings = NonEmpty AwsSecurityFinding
a} :: BatchImportFindings) ((NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding))
 -> BatchImportFindings -> f BatchImportFindings)
-> ((NonEmpty AwsSecurityFinding
     -> f (NonEmpty AwsSecurityFinding))
    -> NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding))
-> (NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding))
-> BatchImportFindings
-> f BatchImportFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding))
-> NonEmpty AwsSecurityFinding -> f (NonEmpty AwsSecurityFinding)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest BatchImportFindings where
  type
    AWSResponse BatchImportFindings =
      BatchImportFindingsResponse
  request :: BatchImportFindings -> Request BatchImportFindings
request = Service -> BatchImportFindings -> Request BatchImportFindings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchImportFindings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchImportFindings)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchImportFindings))
-> Logger
-> Service
-> Proxy BatchImportFindings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchImportFindings)))
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 ->
          Maybe [ImportFindingsError]
-> Int -> Int -> Int -> BatchImportFindingsResponse
BatchImportFindingsResponse'
            (Maybe [ImportFindingsError]
 -> Int -> Int -> Int -> BatchImportFindingsResponse)
-> Either String (Maybe [ImportFindingsError])
-> Either String (Int -> Int -> Int -> BatchImportFindingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Key -> Either String (Maybe (Maybe [ImportFindingsError]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"FailedFindings" Either String (Maybe (Maybe [ImportFindingsError]))
-> Maybe [ImportFindingsError]
-> Either String (Maybe [ImportFindingsError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ImportFindingsError]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> Int -> Int -> BatchImportFindingsResponse)
-> Either String Int
-> Either String (Int -> Int -> BatchImportFindingsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> Int -> BatchImportFindingsResponse)
-> Either String Int
-> Either String (Int -> BatchImportFindingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Key -> Either String Int
forall a. FromJSON a => Object -> Key -> Either String a
Core..:> Key
"FailedCount")
            Either String (Int -> BatchImportFindingsResponse)
-> Either String Int -> Either String BatchImportFindingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Key -> Either String Int
forall a. FromJSON a => Object -> Key -> Either String a
Core..:> Key
"SuccessCount")
      )

instance Prelude.Hashable BatchImportFindings

instance Prelude.NFData BatchImportFindings

instance Core.ToHeaders BatchImportFindings where
  toHeaders :: BatchImportFindings -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchImportFindings -> 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 BatchImportFindings where
  toJSON :: BatchImportFindings -> Value
toJSON BatchImportFindings' {NonEmpty AwsSecurityFinding
findings :: NonEmpty AwsSecurityFinding
$sel:findings:BatchImportFindings' :: BatchImportFindings -> NonEmpty AwsSecurityFinding
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"Findings" Key -> NonEmpty AwsSecurityFinding -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= NonEmpty AwsSecurityFinding
findings)]
      )

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

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

-- | /See:/ 'newBatchImportFindingsResponse' smart constructor.
data BatchImportFindingsResponse = BatchImportFindingsResponse'
  { -- | The list of findings that failed to import.
    BatchImportFindingsResponse -> Maybe [ImportFindingsError]
failedFindings :: Prelude.Maybe [ImportFindingsError],
    -- | The response's http status code.
    BatchImportFindingsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The number of findings that failed to import.
    BatchImportFindingsResponse -> Int
failedCount :: Prelude.Int,
    -- | The number of findings that were successfully imported.
    BatchImportFindingsResponse -> Int
successCount :: Prelude.Int
  }
  deriving (BatchImportFindingsResponse -> BatchImportFindingsResponse -> Bool
(BatchImportFindingsResponse
 -> BatchImportFindingsResponse -> Bool)
-> (BatchImportFindingsResponse
    -> BatchImportFindingsResponse -> Bool)
-> Eq BatchImportFindingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchImportFindingsResponse -> BatchImportFindingsResponse -> Bool
$c/= :: BatchImportFindingsResponse -> BatchImportFindingsResponse -> Bool
== :: BatchImportFindingsResponse -> BatchImportFindingsResponse -> Bool
$c== :: BatchImportFindingsResponse -> BatchImportFindingsResponse -> Bool
Prelude.Eq, ReadPrec [BatchImportFindingsResponse]
ReadPrec BatchImportFindingsResponse
Int -> ReadS BatchImportFindingsResponse
ReadS [BatchImportFindingsResponse]
(Int -> ReadS BatchImportFindingsResponse)
-> ReadS [BatchImportFindingsResponse]
-> ReadPrec BatchImportFindingsResponse
-> ReadPrec [BatchImportFindingsResponse]
-> Read BatchImportFindingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchImportFindingsResponse]
$creadListPrec :: ReadPrec [BatchImportFindingsResponse]
readPrec :: ReadPrec BatchImportFindingsResponse
$creadPrec :: ReadPrec BatchImportFindingsResponse
readList :: ReadS [BatchImportFindingsResponse]
$creadList :: ReadS [BatchImportFindingsResponse]
readsPrec :: Int -> ReadS BatchImportFindingsResponse
$creadsPrec :: Int -> ReadS BatchImportFindingsResponse
Prelude.Read, Int -> BatchImportFindingsResponse -> ShowS
[BatchImportFindingsResponse] -> ShowS
BatchImportFindingsResponse -> String
(Int -> BatchImportFindingsResponse -> ShowS)
-> (BatchImportFindingsResponse -> String)
-> ([BatchImportFindingsResponse] -> ShowS)
-> Show BatchImportFindingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchImportFindingsResponse] -> ShowS
$cshowList :: [BatchImportFindingsResponse] -> ShowS
show :: BatchImportFindingsResponse -> String
$cshow :: BatchImportFindingsResponse -> String
showsPrec :: Int -> BatchImportFindingsResponse -> ShowS
$cshowsPrec :: Int -> BatchImportFindingsResponse -> ShowS
Prelude.Show, (forall x.
 BatchImportFindingsResponse -> Rep BatchImportFindingsResponse x)
-> (forall x.
    Rep BatchImportFindingsResponse x -> BatchImportFindingsResponse)
-> Generic BatchImportFindingsResponse
forall x.
Rep BatchImportFindingsResponse x -> BatchImportFindingsResponse
forall x.
BatchImportFindingsResponse -> Rep BatchImportFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchImportFindingsResponse x -> BatchImportFindingsResponse
$cfrom :: forall x.
BatchImportFindingsResponse -> Rep BatchImportFindingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchImportFindingsResponse' 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:
--
-- 'failedFindings', 'batchImportFindingsResponse_failedFindings' - The list of findings that failed to import.
--
-- 'httpStatus', 'batchImportFindingsResponse_httpStatus' - The response's http status code.
--
-- 'failedCount', 'batchImportFindingsResponse_failedCount' - The number of findings that failed to import.
--
-- 'successCount', 'batchImportFindingsResponse_successCount' - The number of findings that were successfully imported.
newBatchImportFindingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'failedCount'
  Prelude.Int ->
  -- | 'successCount'
  Prelude.Int ->
  BatchImportFindingsResponse
newBatchImportFindingsResponse :: Int -> Int -> Int -> BatchImportFindingsResponse
newBatchImportFindingsResponse
  Int
pHttpStatus_
  Int
pFailedCount_
  Int
pSuccessCount_ =
    BatchImportFindingsResponse' :: Maybe [ImportFindingsError]
-> Int -> Int -> Int -> BatchImportFindingsResponse
BatchImportFindingsResponse'
      { $sel:failedFindings:BatchImportFindingsResponse' :: Maybe [ImportFindingsError]
failedFindings =
          Maybe [ImportFindingsError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchImportFindingsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:failedCount:BatchImportFindingsResponse' :: Int
failedCount = Int
pFailedCount_,
        $sel:successCount:BatchImportFindingsResponse' :: Int
successCount = Int
pSuccessCount_
      }

-- | The list of findings that failed to import.
batchImportFindingsResponse_failedFindings :: Lens.Lens' BatchImportFindingsResponse (Prelude.Maybe [ImportFindingsError])
batchImportFindingsResponse_failedFindings :: (Maybe [ImportFindingsError] -> f (Maybe [ImportFindingsError]))
-> BatchImportFindingsResponse -> f BatchImportFindingsResponse
batchImportFindingsResponse_failedFindings = (BatchImportFindingsResponse -> Maybe [ImportFindingsError])
-> (BatchImportFindingsResponse
    -> Maybe [ImportFindingsError] -> BatchImportFindingsResponse)
-> Lens
     BatchImportFindingsResponse
     BatchImportFindingsResponse
     (Maybe [ImportFindingsError])
     (Maybe [ImportFindingsError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportFindingsResponse' {Maybe [ImportFindingsError]
failedFindings :: Maybe [ImportFindingsError]
$sel:failedFindings:BatchImportFindingsResponse' :: BatchImportFindingsResponse -> Maybe [ImportFindingsError]
failedFindings} -> Maybe [ImportFindingsError]
failedFindings) (\s :: BatchImportFindingsResponse
s@BatchImportFindingsResponse' {} Maybe [ImportFindingsError]
a -> BatchImportFindingsResponse
s {$sel:failedFindings:BatchImportFindingsResponse' :: Maybe [ImportFindingsError]
failedFindings = Maybe [ImportFindingsError]
a} :: BatchImportFindingsResponse) ((Maybe [ImportFindingsError] -> f (Maybe [ImportFindingsError]))
 -> BatchImportFindingsResponse -> f BatchImportFindingsResponse)
-> ((Maybe [ImportFindingsError]
     -> f (Maybe [ImportFindingsError]))
    -> Maybe [ImportFindingsError] -> f (Maybe [ImportFindingsError]))
-> (Maybe [ImportFindingsError] -> f (Maybe [ImportFindingsError]))
-> BatchImportFindingsResponse
-> f BatchImportFindingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ImportFindingsError]
  [ImportFindingsError]
  [ImportFindingsError]
  [ImportFindingsError]
-> Iso
     (Maybe [ImportFindingsError])
     (Maybe [ImportFindingsError])
     (Maybe [ImportFindingsError])
     (Maybe [ImportFindingsError])
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
  [ImportFindingsError]
  [ImportFindingsError]
  [ImportFindingsError]
  [ImportFindingsError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The number of findings that failed to import.
batchImportFindingsResponse_failedCount :: Lens.Lens' BatchImportFindingsResponse Prelude.Int
batchImportFindingsResponse_failedCount :: (Int -> f Int)
-> BatchImportFindingsResponse -> f BatchImportFindingsResponse
batchImportFindingsResponse_failedCount = (BatchImportFindingsResponse -> Int)
-> (BatchImportFindingsResponse
    -> Int -> BatchImportFindingsResponse)
-> Lens
     BatchImportFindingsResponse BatchImportFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportFindingsResponse' {Int
failedCount :: Int
$sel:failedCount:BatchImportFindingsResponse' :: BatchImportFindingsResponse -> Int
failedCount} -> Int
failedCount) (\s :: BatchImportFindingsResponse
s@BatchImportFindingsResponse' {} Int
a -> BatchImportFindingsResponse
s {$sel:failedCount:BatchImportFindingsResponse' :: Int
failedCount = Int
a} :: BatchImportFindingsResponse)

-- | The number of findings that were successfully imported.
batchImportFindingsResponse_successCount :: Lens.Lens' BatchImportFindingsResponse Prelude.Int
batchImportFindingsResponse_successCount :: (Int -> f Int)
-> BatchImportFindingsResponse -> f BatchImportFindingsResponse
batchImportFindingsResponse_successCount = (BatchImportFindingsResponse -> Int)
-> (BatchImportFindingsResponse
    -> Int -> BatchImportFindingsResponse)
-> Lens
     BatchImportFindingsResponse BatchImportFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportFindingsResponse' {Int
successCount :: Int
$sel:successCount:BatchImportFindingsResponse' :: BatchImportFindingsResponse -> Int
successCount} -> Int
successCount) (\s :: BatchImportFindingsResponse
s@BatchImportFindingsResponse' {} Int
a -> BatchImportFindingsResponse
s {$sel:successCount:BatchImportFindingsResponse' :: Int
successCount = Int
a} :: BatchImportFindingsResponse)

instance Prelude.NFData BatchImportFindingsResponse