{-# 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.AuditManager.BatchImportEvidenceToAssessmentControl
-- 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)
--
-- Uploads one or more pieces of evidence to the specified control in the
-- assessment in Audit Manager.
module Amazonka.AuditManager.BatchImportEvidenceToAssessmentControl
  ( -- * Creating a Request
    BatchImportEvidenceToAssessmentControl (..),
    newBatchImportEvidenceToAssessmentControl,

    -- * Request Lenses
    batchImportEvidenceToAssessmentControl_assessmentId,
    batchImportEvidenceToAssessmentControl_controlSetId,
    batchImportEvidenceToAssessmentControl_controlId,
    batchImportEvidenceToAssessmentControl_manualEvidence,

    -- * Destructuring the Response
    BatchImportEvidenceToAssessmentControlResponse (..),
    newBatchImportEvidenceToAssessmentControlResponse,

    -- * Response Lenses
    batchImportEvidenceToAssessmentControlResponse_errors,
    batchImportEvidenceToAssessmentControlResponse_httpStatus,
  )
where

import Amazonka.AuditManager.Types
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

-- | /See:/ 'newBatchImportEvidenceToAssessmentControl' smart constructor.
data BatchImportEvidenceToAssessmentControl = BatchImportEvidenceToAssessmentControl'
  { -- | The identifier for the specified assessment.
    BatchImportEvidenceToAssessmentControl -> Text
assessmentId :: Prelude.Text,
    -- | The identifier for the specified control set.
    BatchImportEvidenceToAssessmentControl -> Text
controlSetId :: Prelude.Text,
    -- | The identifier for the specified control.
    BatchImportEvidenceToAssessmentControl -> Text
controlId :: Prelude.Text,
    -- | The list of manual evidence objects.
    BatchImportEvidenceToAssessmentControl -> NonEmpty ManualEvidence
manualEvidence :: Prelude.NonEmpty ManualEvidence
  }
  deriving (BatchImportEvidenceToAssessmentControl
-> BatchImportEvidenceToAssessmentControl -> Bool
(BatchImportEvidenceToAssessmentControl
 -> BatchImportEvidenceToAssessmentControl -> Bool)
-> (BatchImportEvidenceToAssessmentControl
    -> BatchImportEvidenceToAssessmentControl -> Bool)
-> Eq BatchImportEvidenceToAssessmentControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchImportEvidenceToAssessmentControl
-> BatchImportEvidenceToAssessmentControl -> Bool
$c/= :: BatchImportEvidenceToAssessmentControl
-> BatchImportEvidenceToAssessmentControl -> Bool
== :: BatchImportEvidenceToAssessmentControl
-> BatchImportEvidenceToAssessmentControl -> Bool
$c== :: BatchImportEvidenceToAssessmentControl
-> BatchImportEvidenceToAssessmentControl -> Bool
Prelude.Eq, ReadPrec [BatchImportEvidenceToAssessmentControl]
ReadPrec BatchImportEvidenceToAssessmentControl
Int -> ReadS BatchImportEvidenceToAssessmentControl
ReadS [BatchImportEvidenceToAssessmentControl]
(Int -> ReadS BatchImportEvidenceToAssessmentControl)
-> ReadS [BatchImportEvidenceToAssessmentControl]
-> ReadPrec BatchImportEvidenceToAssessmentControl
-> ReadPrec [BatchImportEvidenceToAssessmentControl]
-> Read BatchImportEvidenceToAssessmentControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControl]
$creadListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControl]
readPrec :: ReadPrec BatchImportEvidenceToAssessmentControl
$creadPrec :: ReadPrec BatchImportEvidenceToAssessmentControl
readList :: ReadS [BatchImportEvidenceToAssessmentControl]
$creadList :: ReadS [BatchImportEvidenceToAssessmentControl]
readsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControl
$creadsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControl
Prelude.Read, Int -> BatchImportEvidenceToAssessmentControl -> ShowS
[BatchImportEvidenceToAssessmentControl] -> ShowS
BatchImportEvidenceToAssessmentControl -> String
(Int -> BatchImportEvidenceToAssessmentControl -> ShowS)
-> (BatchImportEvidenceToAssessmentControl -> String)
-> ([BatchImportEvidenceToAssessmentControl] -> ShowS)
-> Show BatchImportEvidenceToAssessmentControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchImportEvidenceToAssessmentControl] -> ShowS
$cshowList :: [BatchImportEvidenceToAssessmentControl] -> ShowS
show :: BatchImportEvidenceToAssessmentControl -> String
$cshow :: BatchImportEvidenceToAssessmentControl -> String
showsPrec :: Int -> BatchImportEvidenceToAssessmentControl -> ShowS
$cshowsPrec :: Int -> BatchImportEvidenceToAssessmentControl -> ShowS
Prelude.Show, (forall x.
 BatchImportEvidenceToAssessmentControl
 -> Rep BatchImportEvidenceToAssessmentControl x)
-> (forall x.
    Rep BatchImportEvidenceToAssessmentControl x
    -> BatchImportEvidenceToAssessmentControl)
-> Generic BatchImportEvidenceToAssessmentControl
forall x.
Rep BatchImportEvidenceToAssessmentControl x
-> BatchImportEvidenceToAssessmentControl
forall x.
BatchImportEvidenceToAssessmentControl
-> Rep BatchImportEvidenceToAssessmentControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchImportEvidenceToAssessmentControl x
-> BatchImportEvidenceToAssessmentControl
$cfrom :: forall x.
BatchImportEvidenceToAssessmentControl
-> Rep BatchImportEvidenceToAssessmentControl x
Prelude.Generic)

-- |
-- Create a value of 'BatchImportEvidenceToAssessmentControl' 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:
--
-- 'assessmentId', 'batchImportEvidenceToAssessmentControl_assessmentId' - The identifier for the specified assessment.
--
-- 'controlSetId', 'batchImportEvidenceToAssessmentControl_controlSetId' - The identifier for the specified control set.
--
-- 'controlId', 'batchImportEvidenceToAssessmentControl_controlId' - The identifier for the specified control.
--
-- 'manualEvidence', 'batchImportEvidenceToAssessmentControl_manualEvidence' - The list of manual evidence objects.
newBatchImportEvidenceToAssessmentControl ::
  -- | 'assessmentId'
  Prelude.Text ->
  -- | 'controlSetId'
  Prelude.Text ->
  -- | 'controlId'
  Prelude.Text ->
  -- | 'manualEvidence'
  Prelude.NonEmpty ManualEvidence ->
  BatchImportEvidenceToAssessmentControl
newBatchImportEvidenceToAssessmentControl :: Text
-> Text
-> Text
-> NonEmpty ManualEvidence
-> BatchImportEvidenceToAssessmentControl
newBatchImportEvidenceToAssessmentControl
  Text
pAssessmentId_
  Text
pControlSetId_
  Text
pControlId_
  NonEmpty ManualEvidence
pManualEvidence_ =
    BatchImportEvidenceToAssessmentControl' :: Text
-> Text
-> Text
-> NonEmpty ManualEvidence
-> BatchImportEvidenceToAssessmentControl
BatchImportEvidenceToAssessmentControl'
      { $sel:assessmentId:BatchImportEvidenceToAssessmentControl' :: Text
assessmentId =
          Text
pAssessmentId_,
        $sel:controlSetId:BatchImportEvidenceToAssessmentControl' :: Text
controlSetId = Text
pControlSetId_,
        $sel:controlId:BatchImportEvidenceToAssessmentControl' :: Text
controlId = Text
pControlId_,
        $sel:manualEvidence:BatchImportEvidenceToAssessmentControl' :: NonEmpty ManualEvidence
manualEvidence =
          Tagged
  (NonEmpty ManualEvidence) (Identity (NonEmpty ManualEvidence))
-> Tagged
     (NonEmpty ManualEvidence) (Identity (NonEmpty ManualEvidence))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            (Tagged
   (NonEmpty ManualEvidence) (Identity (NonEmpty ManualEvidence))
 -> Tagged
      (NonEmpty ManualEvidence) (Identity (NonEmpty ManualEvidence)))
-> NonEmpty ManualEvidence -> NonEmpty ManualEvidence
forall t b. AReview t b -> b -> t
Lens.# NonEmpty ManualEvidence
pManualEvidence_
      }

-- | The identifier for the specified assessment.
batchImportEvidenceToAssessmentControl_assessmentId :: Lens.Lens' BatchImportEvidenceToAssessmentControl Prelude.Text
batchImportEvidenceToAssessmentControl_assessmentId :: (Text -> f Text)
-> BatchImportEvidenceToAssessmentControl
-> f BatchImportEvidenceToAssessmentControl
batchImportEvidenceToAssessmentControl_assessmentId = (BatchImportEvidenceToAssessmentControl -> Text)
-> (BatchImportEvidenceToAssessmentControl
    -> Text -> BatchImportEvidenceToAssessmentControl)
-> Lens
     BatchImportEvidenceToAssessmentControl
     BatchImportEvidenceToAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControl' {Text
assessmentId :: Text
$sel:assessmentId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
assessmentId} -> Text
assessmentId) (\s :: BatchImportEvidenceToAssessmentControl
s@BatchImportEvidenceToAssessmentControl' {} Text
a -> BatchImportEvidenceToAssessmentControl
s {$sel:assessmentId:BatchImportEvidenceToAssessmentControl' :: Text
assessmentId = Text
a} :: BatchImportEvidenceToAssessmentControl)

-- | The identifier for the specified control set.
batchImportEvidenceToAssessmentControl_controlSetId :: Lens.Lens' BatchImportEvidenceToAssessmentControl Prelude.Text
batchImportEvidenceToAssessmentControl_controlSetId :: (Text -> f Text)
-> BatchImportEvidenceToAssessmentControl
-> f BatchImportEvidenceToAssessmentControl
batchImportEvidenceToAssessmentControl_controlSetId = (BatchImportEvidenceToAssessmentControl -> Text)
-> (BatchImportEvidenceToAssessmentControl
    -> Text -> BatchImportEvidenceToAssessmentControl)
-> Lens
     BatchImportEvidenceToAssessmentControl
     BatchImportEvidenceToAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControl' {Text
controlSetId :: Text
$sel:controlSetId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
controlSetId} -> Text
controlSetId) (\s :: BatchImportEvidenceToAssessmentControl
s@BatchImportEvidenceToAssessmentControl' {} Text
a -> BatchImportEvidenceToAssessmentControl
s {$sel:controlSetId:BatchImportEvidenceToAssessmentControl' :: Text
controlSetId = Text
a} :: BatchImportEvidenceToAssessmentControl)

-- | The identifier for the specified control.
batchImportEvidenceToAssessmentControl_controlId :: Lens.Lens' BatchImportEvidenceToAssessmentControl Prelude.Text
batchImportEvidenceToAssessmentControl_controlId :: (Text -> f Text)
-> BatchImportEvidenceToAssessmentControl
-> f BatchImportEvidenceToAssessmentControl
batchImportEvidenceToAssessmentControl_controlId = (BatchImportEvidenceToAssessmentControl -> Text)
-> (BatchImportEvidenceToAssessmentControl
    -> Text -> BatchImportEvidenceToAssessmentControl)
-> Lens
     BatchImportEvidenceToAssessmentControl
     BatchImportEvidenceToAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControl' {Text
controlId :: Text
$sel:controlId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
controlId} -> Text
controlId) (\s :: BatchImportEvidenceToAssessmentControl
s@BatchImportEvidenceToAssessmentControl' {} Text
a -> BatchImportEvidenceToAssessmentControl
s {$sel:controlId:BatchImportEvidenceToAssessmentControl' :: Text
controlId = Text
a} :: BatchImportEvidenceToAssessmentControl)

-- | The list of manual evidence objects.
batchImportEvidenceToAssessmentControl_manualEvidence :: Lens.Lens' BatchImportEvidenceToAssessmentControl (Prelude.NonEmpty ManualEvidence)
batchImportEvidenceToAssessmentControl_manualEvidence :: (NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
-> BatchImportEvidenceToAssessmentControl
-> f BatchImportEvidenceToAssessmentControl
batchImportEvidenceToAssessmentControl_manualEvidence = (BatchImportEvidenceToAssessmentControl -> NonEmpty ManualEvidence)
-> (BatchImportEvidenceToAssessmentControl
    -> NonEmpty ManualEvidence
    -> BatchImportEvidenceToAssessmentControl)
-> Lens
     BatchImportEvidenceToAssessmentControl
     BatchImportEvidenceToAssessmentControl
     (NonEmpty ManualEvidence)
     (NonEmpty ManualEvidence)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControl' {NonEmpty ManualEvidence
manualEvidence :: NonEmpty ManualEvidence
$sel:manualEvidence:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> NonEmpty ManualEvidence
manualEvidence} -> NonEmpty ManualEvidence
manualEvidence) (\s :: BatchImportEvidenceToAssessmentControl
s@BatchImportEvidenceToAssessmentControl' {} NonEmpty ManualEvidence
a -> BatchImportEvidenceToAssessmentControl
s {$sel:manualEvidence:BatchImportEvidenceToAssessmentControl' :: NonEmpty ManualEvidence
manualEvidence = NonEmpty ManualEvidence
a} :: BatchImportEvidenceToAssessmentControl) ((NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
 -> BatchImportEvidenceToAssessmentControl
 -> f BatchImportEvidenceToAssessmentControl)
-> ((NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
    -> NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
-> (NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
-> BatchImportEvidenceToAssessmentControl
-> f BatchImportEvidenceToAssessmentControl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence))
-> NonEmpty ManualEvidence -> f (NonEmpty ManualEvidence)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.Hashable
    BatchImportEvidenceToAssessmentControl

instance
  Prelude.NFData
    BatchImportEvidenceToAssessmentControl

instance
  Core.ToHeaders
    BatchImportEvidenceToAssessmentControl
  where
  toHeaders :: BatchImportEvidenceToAssessmentControl -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> BatchImportEvidenceToAssessmentControl -> 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
    BatchImportEvidenceToAssessmentControl
  where
  toJSON :: BatchImportEvidenceToAssessmentControl -> Value
toJSON BatchImportEvidenceToAssessmentControl' {NonEmpty ManualEvidence
Text
manualEvidence :: NonEmpty ManualEvidence
controlId :: Text
controlSetId :: Text
assessmentId :: Text
$sel:manualEvidence:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> NonEmpty ManualEvidence
$sel:controlId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
$sel:controlSetId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
$sel:assessmentId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"manualEvidence" Text -> NonEmpty ManualEvidence -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty ManualEvidence
manualEvidence)
          ]
      )

instance
  Core.ToPath
    BatchImportEvidenceToAssessmentControl
  where
  toPath :: BatchImportEvidenceToAssessmentControl -> ByteString
toPath BatchImportEvidenceToAssessmentControl' {NonEmpty ManualEvidence
Text
manualEvidence :: NonEmpty ManualEvidence
controlId :: Text
controlSetId :: Text
assessmentId :: Text
$sel:manualEvidence:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> NonEmpty ManualEvidence
$sel:controlId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
$sel:controlSetId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
$sel:assessmentId:BatchImportEvidenceToAssessmentControl' :: BatchImportEvidenceToAssessmentControl -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assessments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assessmentId,
        ByteString
"/controlSets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlSetId,
        ByteString
"/controls/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlId,
        ByteString
"/evidence"
      ]

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

-- | /See:/ 'newBatchImportEvidenceToAssessmentControlResponse' smart constructor.
data BatchImportEvidenceToAssessmentControlResponse = BatchImportEvidenceToAssessmentControlResponse'
  { -- | A list of errors returned by the
    -- @BatchImportEvidenceToAssessmentControl@ API.
    BatchImportEvidenceToAssessmentControlResponse
-> Maybe [BatchImportEvidenceToAssessmentControlError]
errors :: Prelude.Maybe [BatchImportEvidenceToAssessmentControlError],
    -- | The response's http status code.
    BatchImportEvidenceToAssessmentControlResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchImportEvidenceToAssessmentControlResponse
-> BatchImportEvidenceToAssessmentControlResponse -> Bool
(BatchImportEvidenceToAssessmentControlResponse
 -> BatchImportEvidenceToAssessmentControlResponse -> Bool)
-> (BatchImportEvidenceToAssessmentControlResponse
    -> BatchImportEvidenceToAssessmentControlResponse -> Bool)
-> Eq BatchImportEvidenceToAssessmentControlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchImportEvidenceToAssessmentControlResponse
-> BatchImportEvidenceToAssessmentControlResponse -> Bool
$c/= :: BatchImportEvidenceToAssessmentControlResponse
-> BatchImportEvidenceToAssessmentControlResponse -> Bool
== :: BatchImportEvidenceToAssessmentControlResponse
-> BatchImportEvidenceToAssessmentControlResponse -> Bool
$c== :: BatchImportEvidenceToAssessmentControlResponse
-> BatchImportEvidenceToAssessmentControlResponse -> Bool
Prelude.Eq, ReadPrec [BatchImportEvidenceToAssessmentControlResponse]
ReadPrec BatchImportEvidenceToAssessmentControlResponse
Int -> ReadS BatchImportEvidenceToAssessmentControlResponse
ReadS [BatchImportEvidenceToAssessmentControlResponse]
(Int -> ReadS BatchImportEvidenceToAssessmentControlResponse)
-> ReadS [BatchImportEvidenceToAssessmentControlResponse]
-> ReadPrec BatchImportEvidenceToAssessmentControlResponse
-> ReadPrec [BatchImportEvidenceToAssessmentControlResponse]
-> Read BatchImportEvidenceToAssessmentControlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControlResponse]
$creadListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControlResponse]
readPrec :: ReadPrec BatchImportEvidenceToAssessmentControlResponse
$creadPrec :: ReadPrec BatchImportEvidenceToAssessmentControlResponse
readList :: ReadS [BatchImportEvidenceToAssessmentControlResponse]
$creadList :: ReadS [BatchImportEvidenceToAssessmentControlResponse]
readsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControlResponse
$creadsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControlResponse
Prelude.Read, Int -> BatchImportEvidenceToAssessmentControlResponse -> ShowS
[BatchImportEvidenceToAssessmentControlResponse] -> ShowS
BatchImportEvidenceToAssessmentControlResponse -> String
(Int -> BatchImportEvidenceToAssessmentControlResponse -> ShowS)
-> (BatchImportEvidenceToAssessmentControlResponse -> String)
-> ([BatchImportEvidenceToAssessmentControlResponse] -> ShowS)
-> Show BatchImportEvidenceToAssessmentControlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchImportEvidenceToAssessmentControlResponse] -> ShowS
$cshowList :: [BatchImportEvidenceToAssessmentControlResponse] -> ShowS
show :: BatchImportEvidenceToAssessmentControlResponse -> String
$cshow :: BatchImportEvidenceToAssessmentControlResponse -> String
showsPrec :: Int -> BatchImportEvidenceToAssessmentControlResponse -> ShowS
$cshowsPrec :: Int -> BatchImportEvidenceToAssessmentControlResponse -> ShowS
Prelude.Show, (forall x.
 BatchImportEvidenceToAssessmentControlResponse
 -> Rep BatchImportEvidenceToAssessmentControlResponse x)
-> (forall x.
    Rep BatchImportEvidenceToAssessmentControlResponse x
    -> BatchImportEvidenceToAssessmentControlResponse)
-> Generic BatchImportEvidenceToAssessmentControlResponse
forall x.
Rep BatchImportEvidenceToAssessmentControlResponse x
-> BatchImportEvidenceToAssessmentControlResponse
forall x.
BatchImportEvidenceToAssessmentControlResponse
-> Rep BatchImportEvidenceToAssessmentControlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchImportEvidenceToAssessmentControlResponse x
-> BatchImportEvidenceToAssessmentControlResponse
$cfrom :: forall x.
BatchImportEvidenceToAssessmentControlResponse
-> Rep BatchImportEvidenceToAssessmentControlResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchImportEvidenceToAssessmentControlResponse' 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:
--
-- 'errors', 'batchImportEvidenceToAssessmentControlResponse_errors' - A list of errors returned by the
-- @BatchImportEvidenceToAssessmentControl@ API.
--
-- 'httpStatus', 'batchImportEvidenceToAssessmentControlResponse_httpStatus' - The response's http status code.
newBatchImportEvidenceToAssessmentControlResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchImportEvidenceToAssessmentControlResponse
newBatchImportEvidenceToAssessmentControlResponse :: Int -> BatchImportEvidenceToAssessmentControlResponse
newBatchImportEvidenceToAssessmentControlResponse
  Int
pHttpStatus_ =
    BatchImportEvidenceToAssessmentControlResponse' :: Maybe [BatchImportEvidenceToAssessmentControlError]
-> Int -> BatchImportEvidenceToAssessmentControlResponse
BatchImportEvidenceToAssessmentControlResponse'
      { $sel:errors:BatchImportEvidenceToAssessmentControlResponse' :: Maybe [BatchImportEvidenceToAssessmentControlError]
errors =
          Maybe [BatchImportEvidenceToAssessmentControlError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchImportEvidenceToAssessmentControlResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of errors returned by the
-- @BatchImportEvidenceToAssessmentControl@ API.
batchImportEvidenceToAssessmentControlResponse_errors :: Lens.Lens' BatchImportEvidenceToAssessmentControlResponse (Prelude.Maybe [BatchImportEvidenceToAssessmentControlError])
batchImportEvidenceToAssessmentControlResponse_errors :: (Maybe [BatchImportEvidenceToAssessmentControlError]
 -> f (Maybe [BatchImportEvidenceToAssessmentControlError]))
-> BatchImportEvidenceToAssessmentControlResponse
-> f BatchImportEvidenceToAssessmentControlResponse
batchImportEvidenceToAssessmentControlResponse_errors = (BatchImportEvidenceToAssessmentControlResponse
 -> Maybe [BatchImportEvidenceToAssessmentControlError])
-> (BatchImportEvidenceToAssessmentControlResponse
    -> Maybe [BatchImportEvidenceToAssessmentControlError]
    -> BatchImportEvidenceToAssessmentControlResponse)
-> Lens
     BatchImportEvidenceToAssessmentControlResponse
     BatchImportEvidenceToAssessmentControlResponse
     (Maybe [BatchImportEvidenceToAssessmentControlError])
     (Maybe [BatchImportEvidenceToAssessmentControlError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControlResponse' {Maybe [BatchImportEvidenceToAssessmentControlError]
errors :: Maybe [BatchImportEvidenceToAssessmentControlError]
$sel:errors:BatchImportEvidenceToAssessmentControlResponse' :: BatchImportEvidenceToAssessmentControlResponse
-> Maybe [BatchImportEvidenceToAssessmentControlError]
errors} -> Maybe [BatchImportEvidenceToAssessmentControlError]
errors) (\s :: BatchImportEvidenceToAssessmentControlResponse
s@BatchImportEvidenceToAssessmentControlResponse' {} Maybe [BatchImportEvidenceToAssessmentControlError]
a -> BatchImportEvidenceToAssessmentControlResponse
s {$sel:errors:BatchImportEvidenceToAssessmentControlResponse' :: Maybe [BatchImportEvidenceToAssessmentControlError]
errors = Maybe [BatchImportEvidenceToAssessmentControlError]
a} :: BatchImportEvidenceToAssessmentControlResponse) ((Maybe [BatchImportEvidenceToAssessmentControlError]
  -> f (Maybe [BatchImportEvidenceToAssessmentControlError]))
 -> BatchImportEvidenceToAssessmentControlResponse
 -> f BatchImportEvidenceToAssessmentControlResponse)
-> ((Maybe [BatchImportEvidenceToAssessmentControlError]
     -> f (Maybe [BatchImportEvidenceToAssessmentControlError]))
    -> Maybe [BatchImportEvidenceToAssessmentControlError]
    -> f (Maybe [BatchImportEvidenceToAssessmentControlError]))
-> (Maybe [BatchImportEvidenceToAssessmentControlError]
    -> f (Maybe [BatchImportEvidenceToAssessmentControlError]))
-> BatchImportEvidenceToAssessmentControlResponse
-> f BatchImportEvidenceToAssessmentControlResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
-> Iso
     (Maybe [BatchImportEvidenceToAssessmentControlError])
     (Maybe [BatchImportEvidenceToAssessmentControlError])
     (Maybe [BatchImportEvidenceToAssessmentControlError])
     (Maybe [BatchImportEvidenceToAssessmentControlError])
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
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
  [BatchImportEvidenceToAssessmentControlError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    BatchImportEvidenceToAssessmentControlResponse