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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An error entity for the @BatchDeleteDelegationByAssessment@ API. This is
-- used to provide more meaningful errors than a simple string message.
--
-- /See:/ 'newBatchDeleteDelegationByAssessmentError' smart constructor.
data BatchDeleteDelegationByAssessmentError = BatchDeleteDelegationByAssessmentError'
  { -- | The identifier for the specified delegation.
    BatchDeleteDelegationByAssessmentError -> Maybe Text
delegationId :: Prelude.Maybe Prelude.Text,
    -- | The error code returned by the @BatchDeleteDelegationByAssessment@ API.
    BatchDeleteDelegationByAssessmentError -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The error message returned by the @BatchDeleteDelegationByAssessment@
    -- API.
    BatchDeleteDelegationByAssessmentError -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchDeleteDelegationByAssessmentError
-> BatchDeleteDelegationByAssessmentError -> Bool
(BatchDeleteDelegationByAssessmentError
 -> BatchDeleteDelegationByAssessmentError -> Bool)
-> (BatchDeleteDelegationByAssessmentError
    -> BatchDeleteDelegationByAssessmentError -> Bool)
-> Eq BatchDeleteDelegationByAssessmentError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteDelegationByAssessmentError
-> BatchDeleteDelegationByAssessmentError -> Bool
$c/= :: BatchDeleteDelegationByAssessmentError
-> BatchDeleteDelegationByAssessmentError -> Bool
== :: BatchDeleteDelegationByAssessmentError
-> BatchDeleteDelegationByAssessmentError -> Bool
$c== :: BatchDeleteDelegationByAssessmentError
-> BatchDeleteDelegationByAssessmentError -> Bool
Prelude.Eq, ReadPrec [BatchDeleteDelegationByAssessmentError]
ReadPrec BatchDeleteDelegationByAssessmentError
Int -> ReadS BatchDeleteDelegationByAssessmentError
ReadS [BatchDeleteDelegationByAssessmentError]
(Int -> ReadS BatchDeleteDelegationByAssessmentError)
-> ReadS [BatchDeleteDelegationByAssessmentError]
-> ReadPrec BatchDeleteDelegationByAssessmentError
-> ReadPrec [BatchDeleteDelegationByAssessmentError]
-> Read BatchDeleteDelegationByAssessmentError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteDelegationByAssessmentError]
$creadListPrec :: ReadPrec [BatchDeleteDelegationByAssessmentError]
readPrec :: ReadPrec BatchDeleteDelegationByAssessmentError
$creadPrec :: ReadPrec BatchDeleteDelegationByAssessmentError
readList :: ReadS [BatchDeleteDelegationByAssessmentError]
$creadList :: ReadS [BatchDeleteDelegationByAssessmentError]
readsPrec :: Int -> ReadS BatchDeleteDelegationByAssessmentError
$creadsPrec :: Int -> ReadS BatchDeleteDelegationByAssessmentError
Prelude.Read, Int -> BatchDeleteDelegationByAssessmentError -> ShowS
[BatchDeleteDelegationByAssessmentError] -> ShowS
BatchDeleteDelegationByAssessmentError -> String
(Int -> BatchDeleteDelegationByAssessmentError -> ShowS)
-> (BatchDeleteDelegationByAssessmentError -> String)
-> ([BatchDeleteDelegationByAssessmentError] -> ShowS)
-> Show BatchDeleteDelegationByAssessmentError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteDelegationByAssessmentError] -> ShowS
$cshowList :: [BatchDeleteDelegationByAssessmentError] -> ShowS
show :: BatchDeleteDelegationByAssessmentError -> String
$cshow :: BatchDeleteDelegationByAssessmentError -> String
showsPrec :: Int -> BatchDeleteDelegationByAssessmentError -> ShowS
$cshowsPrec :: Int -> BatchDeleteDelegationByAssessmentError -> ShowS
Prelude.Show, (forall x.
 BatchDeleteDelegationByAssessmentError
 -> Rep BatchDeleteDelegationByAssessmentError x)
-> (forall x.
    Rep BatchDeleteDelegationByAssessmentError x
    -> BatchDeleteDelegationByAssessmentError)
-> Generic BatchDeleteDelegationByAssessmentError
forall x.
Rep BatchDeleteDelegationByAssessmentError x
-> BatchDeleteDelegationByAssessmentError
forall x.
BatchDeleteDelegationByAssessmentError
-> Rep BatchDeleteDelegationByAssessmentError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteDelegationByAssessmentError x
-> BatchDeleteDelegationByAssessmentError
$cfrom :: forall x.
BatchDeleteDelegationByAssessmentError
-> Rep BatchDeleteDelegationByAssessmentError x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteDelegationByAssessmentError' 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:
--
-- 'delegationId', 'batchDeleteDelegationByAssessmentError_delegationId' - The identifier for the specified delegation.
--
-- 'errorCode', 'batchDeleteDelegationByAssessmentError_errorCode' - The error code returned by the @BatchDeleteDelegationByAssessment@ API.
--
-- 'errorMessage', 'batchDeleteDelegationByAssessmentError_errorMessage' - The error message returned by the @BatchDeleteDelegationByAssessment@
-- API.
newBatchDeleteDelegationByAssessmentError ::
  BatchDeleteDelegationByAssessmentError
newBatchDeleteDelegationByAssessmentError :: BatchDeleteDelegationByAssessmentError
newBatchDeleteDelegationByAssessmentError =
  BatchDeleteDelegationByAssessmentError' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> BatchDeleteDelegationByAssessmentError
BatchDeleteDelegationByAssessmentError'
    { $sel:delegationId:BatchDeleteDelegationByAssessmentError' :: Maybe Text
delegationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:BatchDeleteDelegationByAssessmentError' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:BatchDeleteDelegationByAssessmentError' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier for the specified delegation.
batchDeleteDelegationByAssessmentError_delegationId :: Lens.Lens' BatchDeleteDelegationByAssessmentError (Prelude.Maybe Prelude.Text)
batchDeleteDelegationByAssessmentError_delegationId :: (Maybe Text -> f (Maybe Text))
-> BatchDeleteDelegationByAssessmentError
-> f BatchDeleteDelegationByAssessmentError
batchDeleteDelegationByAssessmentError_delegationId = (BatchDeleteDelegationByAssessmentError -> Maybe Text)
-> (BatchDeleteDelegationByAssessmentError
    -> Maybe Text -> BatchDeleteDelegationByAssessmentError)
-> Lens
     BatchDeleteDelegationByAssessmentError
     BatchDeleteDelegationByAssessmentError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteDelegationByAssessmentError' {Maybe Text
delegationId :: Maybe Text
$sel:delegationId:BatchDeleteDelegationByAssessmentError' :: BatchDeleteDelegationByAssessmentError -> Maybe Text
delegationId} -> Maybe Text
delegationId) (\s :: BatchDeleteDelegationByAssessmentError
s@BatchDeleteDelegationByAssessmentError' {} Maybe Text
a -> BatchDeleteDelegationByAssessmentError
s {$sel:delegationId:BatchDeleteDelegationByAssessmentError' :: Maybe Text
delegationId = Maybe Text
a} :: BatchDeleteDelegationByAssessmentError)

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

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

instance
  Core.FromJSON
    BatchDeleteDelegationByAssessmentError
  where
  parseJSON :: Value -> Parser BatchDeleteDelegationByAssessmentError
parseJSON =
    String
-> (Object -> Parser BatchDeleteDelegationByAssessmentError)
-> Value
-> Parser BatchDeleteDelegationByAssessmentError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchDeleteDelegationByAssessmentError"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> BatchDeleteDelegationByAssessmentError
BatchDeleteDelegationByAssessmentError'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> BatchDeleteDelegationByAssessmentError)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> BatchDeleteDelegationByAssessmentError)
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
"delegationId")
            Parser
  (Maybe Text
   -> Maybe Text -> BatchDeleteDelegationByAssessmentError)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> BatchDeleteDelegationByAssessmentError)
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
"errorCode")
            Parser (Maybe Text -> BatchDeleteDelegationByAssessmentError)
-> Parser (Maybe Text)
-> Parser BatchDeleteDelegationByAssessmentError
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")
      )

instance
  Prelude.Hashable
    BatchDeleteDelegationByAssessmentError

instance
  Prelude.NFData
    BatchDeleteDelegationByAssessmentError