{-# 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.Config.Types.FailedDeleteRemediationExceptionsBatch
-- 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.Config.Types.FailedDeleteRemediationExceptionsBatch where

import Amazonka.Config.Types.RemediationExceptionResourceKey
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | List of each of the failed delete remediation exceptions with specific
-- reasons.
--
-- /See:/ 'newFailedDeleteRemediationExceptionsBatch' smart constructor.
data FailedDeleteRemediationExceptionsBatch = FailedDeleteRemediationExceptionsBatch'
  { -- | Returns a failure message for delete remediation exception. For example,
    -- Config creates an exception due to an internal error.
    FailedDeleteRemediationExceptionsBatch -> Maybe Text
failureMessage :: Prelude.Maybe Prelude.Text,
    -- | Returns remediation exception resource key object of the failed items.
    FailedDeleteRemediationExceptionsBatch
-> Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems :: Prelude.Maybe (Prelude.NonEmpty RemediationExceptionResourceKey)
  }
  deriving (FailedDeleteRemediationExceptionsBatch
-> FailedDeleteRemediationExceptionsBatch -> Bool
(FailedDeleteRemediationExceptionsBatch
 -> FailedDeleteRemediationExceptionsBatch -> Bool)
-> (FailedDeleteRemediationExceptionsBatch
    -> FailedDeleteRemediationExceptionsBatch -> Bool)
-> Eq FailedDeleteRemediationExceptionsBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedDeleteRemediationExceptionsBatch
-> FailedDeleteRemediationExceptionsBatch -> Bool
$c/= :: FailedDeleteRemediationExceptionsBatch
-> FailedDeleteRemediationExceptionsBatch -> Bool
== :: FailedDeleteRemediationExceptionsBatch
-> FailedDeleteRemediationExceptionsBatch -> Bool
$c== :: FailedDeleteRemediationExceptionsBatch
-> FailedDeleteRemediationExceptionsBatch -> Bool
Prelude.Eq, ReadPrec [FailedDeleteRemediationExceptionsBatch]
ReadPrec FailedDeleteRemediationExceptionsBatch
Int -> ReadS FailedDeleteRemediationExceptionsBatch
ReadS [FailedDeleteRemediationExceptionsBatch]
(Int -> ReadS FailedDeleteRemediationExceptionsBatch)
-> ReadS [FailedDeleteRemediationExceptionsBatch]
-> ReadPrec FailedDeleteRemediationExceptionsBatch
-> ReadPrec [FailedDeleteRemediationExceptionsBatch]
-> Read FailedDeleteRemediationExceptionsBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedDeleteRemediationExceptionsBatch]
$creadListPrec :: ReadPrec [FailedDeleteRemediationExceptionsBatch]
readPrec :: ReadPrec FailedDeleteRemediationExceptionsBatch
$creadPrec :: ReadPrec FailedDeleteRemediationExceptionsBatch
readList :: ReadS [FailedDeleteRemediationExceptionsBatch]
$creadList :: ReadS [FailedDeleteRemediationExceptionsBatch]
readsPrec :: Int -> ReadS FailedDeleteRemediationExceptionsBatch
$creadsPrec :: Int -> ReadS FailedDeleteRemediationExceptionsBatch
Prelude.Read, Int -> FailedDeleteRemediationExceptionsBatch -> ShowS
[FailedDeleteRemediationExceptionsBatch] -> ShowS
FailedDeleteRemediationExceptionsBatch -> String
(Int -> FailedDeleteRemediationExceptionsBatch -> ShowS)
-> (FailedDeleteRemediationExceptionsBatch -> String)
-> ([FailedDeleteRemediationExceptionsBatch] -> ShowS)
-> Show FailedDeleteRemediationExceptionsBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedDeleteRemediationExceptionsBatch] -> ShowS
$cshowList :: [FailedDeleteRemediationExceptionsBatch] -> ShowS
show :: FailedDeleteRemediationExceptionsBatch -> String
$cshow :: FailedDeleteRemediationExceptionsBatch -> String
showsPrec :: Int -> FailedDeleteRemediationExceptionsBatch -> ShowS
$cshowsPrec :: Int -> FailedDeleteRemediationExceptionsBatch -> ShowS
Prelude.Show, (forall x.
 FailedDeleteRemediationExceptionsBatch
 -> Rep FailedDeleteRemediationExceptionsBatch x)
-> (forall x.
    Rep FailedDeleteRemediationExceptionsBatch x
    -> FailedDeleteRemediationExceptionsBatch)
-> Generic FailedDeleteRemediationExceptionsBatch
forall x.
Rep FailedDeleteRemediationExceptionsBatch x
-> FailedDeleteRemediationExceptionsBatch
forall x.
FailedDeleteRemediationExceptionsBatch
-> Rep FailedDeleteRemediationExceptionsBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedDeleteRemediationExceptionsBatch x
-> FailedDeleteRemediationExceptionsBatch
$cfrom :: forall x.
FailedDeleteRemediationExceptionsBatch
-> Rep FailedDeleteRemediationExceptionsBatch x
Prelude.Generic)

-- |
-- Create a value of 'FailedDeleteRemediationExceptionsBatch' 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:
--
-- 'failureMessage', 'failedDeleteRemediationExceptionsBatch_failureMessage' - Returns a failure message for delete remediation exception. For example,
-- Config creates an exception due to an internal error.
--
-- 'failedItems', 'failedDeleteRemediationExceptionsBatch_failedItems' - Returns remediation exception resource key object of the failed items.
newFailedDeleteRemediationExceptionsBatch ::
  FailedDeleteRemediationExceptionsBatch
newFailedDeleteRemediationExceptionsBatch :: FailedDeleteRemediationExceptionsBatch
newFailedDeleteRemediationExceptionsBatch =
  FailedDeleteRemediationExceptionsBatch' :: Maybe Text
-> Maybe (NonEmpty RemediationExceptionResourceKey)
-> FailedDeleteRemediationExceptionsBatch
FailedDeleteRemediationExceptionsBatch'
    { $sel:failureMessage:FailedDeleteRemediationExceptionsBatch' :: Maybe Text
failureMessage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failedItems:FailedDeleteRemediationExceptionsBatch' :: Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems = Maybe (NonEmpty RemediationExceptionResourceKey)
forall a. Maybe a
Prelude.Nothing
    }

-- | Returns a failure message for delete remediation exception. For example,
-- Config creates an exception due to an internal error.
failedDeleteRemediationExceptionsBatch_failureMessage :: Lens.Lens' FailedDeleteRemediationExceptionsBatch (Prelude.Maybe Prelude.Text)
failedDeleteRemediationExceptionsBatch_failureMessage :: (Maybe Text -> f (Maybe Text))
-> FailedDeleteRemediationExceptionsBatch
-> f FailedDeleteRemediationExceptionsBatch
failedDeleteRemediationExceptionsBatch_failureMessage = (FailedDeleteRemediationExceptionsBatch -> Maybe Text)
-> (FailedDeleteRemediationExceptionsBatch
    -> Maybe Text -> FailedDeleteRemediationExceptionsBatch)
-> Lens
     FailedDeleteRemediationExceptionsBatch
     FailedDeleteRemediationExceptionsBatch
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedDeleteRemediationExceptionsBatch' {Maybe Text
failureMessage :: Maybe Text
$sel:failureMessage:FailedDeleteRemediationExceptionsBatch' :: FailedDeleteRemediationExceptionsBatch -> Maybe Text
failureMessage} -> Maybe Text
failureMessage) (\s :: FailedDeleteRemediationExceptionsBatch
s@FailedDeleteRemediationExceptionsBatch' {} Maybe Text
a -> FailedDeleteRemediationExceptionsBatch
s {$sel:failureMessage:FailedDeleteRemediationExceptionsBatch' :: Maybe Text
failureMessage = Maybe Text
a} :: FailedDeleteRemediationExceptionsBatch)

-- | Returns remediation exception resource key object of the failed items.
failedDeleteRemediationExceptionsBatch_failedItems :: Lens.Lens' FailedDeleteRemediationExceptionsBatch (Prelude.Maybe (Prelude.NonEmpty RemediationExceptionResourceKey))
failedDeleteRemediationExceptionsBatch_failedItems :: (Maybe (NonEmpty RemediationExceptionResourceKey)
 -> f (Maybe (NonEmpty RemediationExceptionResourceKey)))
-> FailedDeleteRemediationExceptionsBatch
-> f FailedDeleteRemediationExceptionsBatch
failedDeleteRemediationExceptionsBatch_failedItems = (FailedDeleteRemediationExceptionsBatch
 -> Maybe (NonEmpty RemediationExceptionResourceKey))
-> (FailedDeleteRemediationExceptionsBatch
    -> Maybe (NonEmpty RemediationExceptionResourceKey)
    -> FailedDeleteRemediationExceptionsBatch)
-> Lens
     FailedDeleteRemediationExceptionsBatch
     FailedDeleteRemediationExceptionsBatch
     (Maybe (NonEmpty RemediationExceptionResourceKey))
     (Maybe (NonEmpty RemediationExceptionResourceKey))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedDeleteRemediationExceptionsBatch' {Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems :: Maybe (NonEmpty RemediationExceptionResourceKey)
$sel:failedItems:FailedDeleteRemediationExceptionsBatch' :: FailedDeleteRemediationExceptionsBatch
-> Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems} -> Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems) (\s :: FailedDeleteRemediationExceptionsBatch
s@FailedDeleteRemediationExceptionsBatch' {} Maybe (NonEmpty RemediationExceptionResourceKey)
a -> FailedDeleteRemediationExceptionsBatch
s {$sel:failedItems:FailedDeleteRemediationExceptionsBatch' :: Maybe (NonEmpty RemediationExceptionResourceKey)
failedItems = Maybe (NonEmpty RemediationExceptionResourceKey)
a} :: FailedDeleteRemediationExceptionsBatch) ((Maybe (NonEmpty RemediationExceptionResourceKey)
  -> f (Maybe (NonEmpty RemediationExceptionResourceKey)))
 -> FailedDeleteRemediationExceptionsBatch
 -> f FailedDeleteRemediationExceptionsBatch)
-> ((Maybe (NonEmpty RemediationExceptionResourceKey)
     -> f (Maybe (NonEmpty RemediationExceptionResourceKey)))
    -> Maybe (NonEmpty RemediationExceptionResourceKey)
    -> f (Maybe (NonEmpty RemediationExceptionResourceKey)))
-> (Maybe (NonEmpty RemediationExceptionResourceKey)
    -> f (Maybe (NonEmpty RemediationExceptionResourceKey)))
-> FailedDeleteRemediationExceptionsBatch
-> f FailedDeleteRemediationExceptionsBatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
-> Iso
     (Maybe (NonEmpty RemediationExceptionResourceKey))
     (Maybe (NonEmpty RemediationExceptionResourceKey))
     (Maybe (NonEmpty RemediationExceptionResourceKey))
     (Maybe (NonEmpty RemediationExceptionResourceKey))
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
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
  (NonEmpty RemediationExceptionResourceKey)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    FailedDeleteRemediationExceptionsBatch
  where
  parseJSON :: Value -> Parser FailedDeleteRemediationExceptionsBatch
parseJSON =
    String
-> (Object -> Parser FailedDeleteRemediationExceptionsBatch)
-> Value
-> Parser FailedDeleteRemediationExceptionsBatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FailedDeleteRemediationExceptionsBatch"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty RemediationExceptionResourceKey)
-> FailedDeleteRemediationExceptionsBatch
FailedDeleteRemediationExceptionsBatch'
            (Maybe Text
 -> Maybe (NonEmpty RemediationExceptionResourceKey)
 -> FailedDeleteRemediationExceptionsBatch)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty RemediationExceptionResourceKey)
      -> FailedDeleteRemediationExceptionsBatch)
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
"FailureMessage")
            Parser
  (Maybe (NonEmpty RemediationExceptionResourceKey)
   -> FailedDeleteRemediationExceptionsBatch)
-> Parser (Maybe (NonEmpty RemediationExceptionResourceKey))
-> Parser FailedDeleteRemediationExceptionsBatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (NonEmpty RemediationExceptionResourceKey))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailedItems")
      )

instance
  Prelude.Hashable
    FailedDeleteRemediationExceptionsBatch

instance
  Prelude.NFData
    FailedDeleteRemediationExceptionsBatch