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

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

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

import Amazonka.AuditManager.Types.ManualEvidence
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An error entity for the @BatchImportEvidenceToAssessmentControl@ API.
-- This is used to provide more meaningful errors than a simple string
-- message.
--
-- /See:/ 'newBatchImportEvidenceToAssessmentControlError' smart constructor.
data BatchImportEvidenceToAssessmentControlError = BatchImportEvidenceToAssessmentControlError'
  { -- | The error code returned by the @BatchImportEvidenceToAssessmentControl@
    -- API.
    BatchImportEvidenceToAssessmentControlError -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The error message returned by the
    -- @BatchImportEvidenceToAssessmentControl@ API.
    BatchImportEvidenceToAssessmentControlError -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | Manual evidence that cannot be collected automatically by Audit Manager.
    BatchImportEvidenceToAssessmentControlError -> Maybe ManualEvidence
manualEvidence :: Prelude.Maybe ManualEvidence
  }
  deriving (BatchImportEvidenceToAssessmentControlError
-> BatchImportEvidenceToAssessmentControlError -> Bool
(BatchImportEvidenceToAssessmentControlError
 -> BatchImportEvidenceToAssessmentControlError -> Bool)
-> (BatchImportEvidenceToAssessmentControlError
    -> BatchImportEvidenceToAssessmentControlError -> Bool)
-> Eq BatchImportEvidenceToAssessmentControlError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchImportEvidenceToAssessmentControlError
-> BatchImportEvidenceToAssessmentControlError -> Bool
$c/= :: BatchImportEvidenceToAssessmentControlError
-> BatchImportEvidenceToAssessmentControlError -> Bool
== :: BatchImportEvidenceToAssessmentControlError
-> BatchImportEvidenceToAssessmentControlError -> Bool
$c== :: BatchImportEvidenceToAssessmentControlError
-> BatchImportEvidenceToAssessmentControlError -> Bool
Prelude.Eq, ReadPrec [BatchImportEvidenceToAssessmentControlError]
ReadPrec BatchImportEvidenceToAssessmentControlError
Int -> ReadS BatchImportEvidenceToAssessmentControlError
ReadS [BatchImportEvidenceToAssessmentControlError]
(Int -> ReadS BatchImportEvidenceToAssessmentControlError)
-> ReadS [BatchImportEvidenceToAssessmentControlError]
-> ReadPrec BatchImportEvidenceToAssessmentControlError
-> ReadPrec [BatchImportEvidenceToAssessmentControlError]
-> Read BatchImportEvidenceToAssessmentControlError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControlError]
$creadListPrec :: ReadPrec [BatchImportEvidenceToAssessmentControlError]
readPrec :: ReadPrec BatchImportEvidenceToAssessmentControlError
$creadPrec :: ReadPrec BatchImportEvidenceToAssessmentControlError
readList :: ReadS [BatchImportEvidenceToAssessmentControlError]
$creadList :: ReadS [BatchImportEvidenceToAssessmentControlError]
readsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControlError
$creadsPrec :: Int -> ReadS BatchImportEvidenceToAssessmentControlError
Prelude.Read, Int -> BatchImportEvidenceToAssessmentControlError -> ShowS
[BatchImportEvidenceToAssessmentControlError] -> ShowS
BatchImportEvidenceToAssessmentControlError -> String
(Int -> BatchImportEvidenceToAssessmentControlError -> ShowS)
-> (BatchImportEvidenceToAssessmentControlError -> String)
-> ([BatchImportEvidenceToAssessmentControlError] -> ShowS)
-> Show BatchImportEvidenceToAssessmentControlError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchImportEvidenceToAssessmentControlError] -> ShowS
$cshowList :: [BatchImportEvidenceToAssessmentControlError] -> ShowS
show :: BatchImportEvidenceToAssessmentControlError -> String
$cshow :: BatchImportEvidenceToAssessmentControlError -> String
showsPrec :: Int -> BatchImportEvidenceToAssessmentControlError -> ShowS
$cshowsPrec :: Int -> BatchImportEvidenceToAssessmentControlError -> ShowS
Prelude.Show, (forall x.
 BatchImportEvidenceToAssessmentControlError
 -> Rep BatchImportEvidenceToAssessmentControlError x)
-> (forall x.
    Rep BatchImportEvidenceToAssessmentControlError x
    -> BatchImportEvidenceToAssessmentControlError)
-> Generic BatchImportEvidenceToAssessmentControlError
forall x.
Rep BatchImportEvidenceToAssessmentControlError x
-> BatchImportEvidenceToAssessmentControlError
forall x.
BatchImportEvidenceToAssessmentControlError
-> Rep BatchImportEvidenceToAssessmentControlError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchImportEvidenceToAssessmentControlError x
-> BatchImportEvidenceToAssessmentControlError
$cfrom :: forall x.
BatchImportEvidenceToAssessmentControlError
-> Rep BatchImportEvidenceToAssessmentControlError x
Prelude.Generic)

-- |
-- Create a value of 'BatchImportEvidenceToAssessmentControlError' 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:
--
-- 'errorCode', 'batchImportEvidenceToAssessmentControlError_errorCode' - The error code returned by the @BatchImportEvidenceToAssessmentControl@
-- API.
--
-- 'errorMessage', 'batchImportEvidenceToAssessmentControlError_errorMessage' - The error message returned by the
-- @BatchImportEvidenceToAssessmentControl@ API.
--
-- 'manualEvidence', 'batchImportEvidenceToAssessmentControlError_manualEvidence' - Manual evidence that cannot be collected automatically by Audit Manager.
newBatchImportEvidenceToAssessmentControlError ::
  BatchImportEvidenceToAssessmentControlError
newBatchImportEvidenceToAssessmentControlError :: BatchImportEvidenceToAssessmentControlError
newBatchImportEvidenceToAssessmentControlError =
  BatchImportEvidenceToAssessmentControlError' :: Maybe Text
-> Maybe Text
-> Maybe ManualEvidence
-> BatchImportEvidenceToAssessmentControlError
BatchImportEvidenceToAssessmentControlError'
    { $sel:errorCode:BatchImportEvidenceToAssessmentControlError' :: Maybe Text
errorCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:BatchImportEvidenceToAssessmentControlError' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:manualEvidence:BatchImportEvidenceToAssessmentControlError' :: Maybe ManualEvidence
manualEvidence =
        Maybe ManualEvidence
forall a. Maybe a
Prelude.Nothing
    }

-- | The error code returned by the @BatchImportEvidenceToAssessmentControl@
-- API.
batchImportEvidenceToAssessmentControlError_errorCode :: Lens.Lens' BatchImportEvidenceToAssessmentControlError (Prelude.Maybe Prelude.Text)
batchImportEvidenceToAssessmentControlError_errorCode :: (Maybe Text -> f (Maybe Text))
-> BatchImportEvidenceToAssessmentControlError
-> f BatchImportEvidenceToAssessmentControlError
batchImportEvidenceToAssessmentControlError_errorCode = (BatchImportEvidenceToAssessmentControlError -> Maybe Text)
-> (BatchImportEvidenceToAssessmentControlError
    -> Maybe Text -> BatchImportEvidenceToAssessmentControlError)
-> Lens
     BatchImportEvidenceToAssessmentControlError
     BatchImportEvidenceToAssessmentControlError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControlError' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:BatchImportEvidenceToAssessmentControlError' :: BatchImportEvidenceToAssessmentControlError -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: BatchImportEvidenceToAssessmentControlError
s@BatchImportEvidenceToAssessmentControlError' {} Maybe Text
a -> BatchImportEvidenceToAssessmentControlError
s {$sel:errorCode:BatchImportEvidenceToAssessmentControlError' :: Maybe Text
errorCode = Maybe Text
a} :: BatchImportEvidenceToAssessmentControlError)

-- | The error message returned by the
-- @BatchImportEvidenceToAssessmentControl@ API.
batchImportEvidenceToAssessmentControlError_errorMessage :: Lens.Lens' BatchImportEvidenceToAssessmentControlError (Prelude.Maybe Prelude.Text)
batchImportEvidenceToAssessmentControlError_errorMessage :: (Maybe Text -> f (Maybe Text))
-> BatchImportEvidenceToAssessmentControlError
-> f BatchImportEvidenceToAssessmentControlError
batchImportEvidenceToAssessmentControlError_errorMessage = (BatchImportEvidenceToAssessmentControlError -> Maybe Text)
-> (BatchImportEvidenceToAssessmentControlError
    -> Maybe Text -> BatchImportEvidenceToAssessmentControlError)
-> Lens
     BatchImportEvidenceToAssessmentControlError
     BatchImportEvidenceToAssessmentControlError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControlError' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:BatchImportEvidenceToAssessmentControlError' :: BatchImportEvidenceToAssessmentControlError -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: BatchImportEvidenceToAssessmentControlError
s@BatchImportEvidenceToAssessmentControlError' {} Maybe Text
a -> BatchImportEvidenceToAssessmentControlError
s {$sel:errorMessage:BatchImportEvidenceToAssessmentControlError' :: Maybe Text
errorMessage = Maybe Text
a} :: BatchImportEvidenceToAssessmentControlError)

-- | Manual evidence that cannot be collected automatically by Audit Manager.
batchImportEvidenceToAssessmentControlError_manualEvidence :: Lens.Lens' BatchImportEvidenceToAssessmentControlError (Prelude.Maybe ManualEvidence)
batchImportEvidenceToAssessmentControlError_manualEvidence :: (Maybe ManualEvidence -> f (Maybe ManualEvidence))
-> BatchImportEvidenceToAssessmentControlError
-> f BatchImportEvidenceToAssessmentControlError
batchImportEvidenceToAssessmentControlError_manualEvidence = (BatchImportEvidenceToAssessmentControlError
 -> Maybe ManualEvidence)
-> (BatchImportEvidenceToAssessmentControlError
    -> Maybe ManualEvidence
    -> BatchImportEvidenceToAssessmentControlError)
-> Lens
     BatchImportEvidenceToAssessmentControlError
     BatchImportEvidenceToAssessmentControlError
     (Maybe ManualEvidence)
     (Maybe ManualEvidence)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchImportEvidenceToAssessmentControlError' {Maybe ManualEvidence
manualEvidence :: Maybe ManualEvidence
$sel:manualEvidence:BatchImportEvidenceToAssessmentControlError' :: BatchImportEvidenceToAssessmentControlError -> Maybe ManualEvidence
manualEvidence} -> Maybe ManualEvidence
manualEvidence) (\s :: BatchImportEvidenceToAssessmentControlError
s@BatchImportEvidenceToAssessmentControlError' {} Maybe ManualEvidence
a -> BatchImportEvidenceToAssessmentControlError
s {$sel:manualEvidence:BatchImportEvidenceToAssessmentControlError' :: Maybe ManualEvidence
manualEvidence = Maybe ManualEvidence
a} :: BatchImportEvidenceToAssessmentControlError)

instance
  Core.FromJSON
    BatchImportEvidenceToAssessmentControlError
  where
  parseJSON :: Value -> Parser BatchImportEvidenceToAssessmentControlError
parseJSON =
    String
-> (Object -> Parser BatchImportEvidenceToAssessmentControlError)
-> Value
-> Parser BatchImportEvidenceToAssessmentControlError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchImportEvidenceToAssessmentControlError"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ManualEvidence
-> BatchImportEvidenceToAssessmentControlError
BatchImportEvidenceToAssessmentControlError'
            (Maybe Text
 -> Maybe Text
 -> Maybe ManualEvidence
 -> BatchImportEvidenceToAssessmentControlError)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ManualEvidence
      -> BatchImportEvidenceToAssessmentControlError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorCode")
              Parser
  (Maybe Text
   -> Maybe ManualEvidence
   -> BatchImportEvidenceToAssessmentControlError)
-> Parser (Maybe Text)
-> Parser
     (Maybe ManualEvidence
      -> BatchImportEvidenceToAssessmentControlError)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorMessage")
              Parser
  (Maybe ManualEvidence
   -> BatchImportEvidenceToAssessmentControlError)
-> Parser (Maybe ManualEvidence)
-> Parser BatchImportEvidenceToAssessmentControlError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ManualEvidence)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"manualEvidence")
      )

instance
  Prelude.Hashable
    BatchImportEvidenceToAssessmentControlError

instance
  Prelude.NFData
    BatchImportEvidenceToAssessmentControlError