{-# 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 #-}
module Amazonka.Config.Types.FailedRemediationBatch where
import Amazonka.Config.Types.RemediationConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FailedRemediationBatch = FailedRemediationBatch'
{
FailedRemediationBatch -> Maybe Text
failureMessage :: Prelude.Maybe Prelude.Text,
FailedRemediationBatch -> Maybe [RemediationConfiguration]
failedItems :: Prelude.Maybe [RemediationConfiguration]
}
deriving (FailedRemediationBatch -> FailedRemediationBatch -> Bool
(FailedRemediationBatch -> FailedRemediationBatch -> Bool)
-> (FailedRemediationBatch -> FailedRemediationBatch -> Bool)
-> Eq FailedRemediationBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedRemediationBatch -> FailedRemediationBatch -> Bool
$c/= :: FailedRemediationBatch -> FailedRemediationBatch -> Bool
== :: FailedRemediationBatch -> FailedRemediationBatch -> Bool
$c== :: FailedRemediationBatch -> FailedRemediationBatch -> Bool
Prelude.Eq, ReadPrec [FailedRemediationBatch]
ReadPrec FailedRemediationBatch
Int -> ReadS FailedRemediationBatch
ReadS [FailedRemediationBatch]
(Int -> ReadS FailedRemediationBatch)
-> ReadS [FailedRemediationBatch]
-> ReadPrec FailedRemediationBatch
-> ReadPrec [FailedRemediationBatch]
-> Read FailedRemediationBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedRemediationBatch]
$creadListPrec :: ReadPrec [FailedRemediationBatch]
readPrec :: ReadPrec FailedRemediationBatch
$creadPrec :: ReadPrec FailedRemediationBatch
readList :: ReadS [FailedRemediationBatch]
$creadList :: ReadS [FailedRemediationBatch]
readsPrec :: Int -> ReadS FailedRemediationBatch
$creadsPrec :: Int -> ReadS FailedRemediationBatch
Prelude.Read, Int -> FailedRemediationBatch -> ShowS
[FailedRemediationBatch] -> ShowS
FailedRemediationBatch -> String
(Int -> FailedRemediationBatch -> ShowS)
-> (FailedRemediationBatch -> String)
-> ([FailedRemediationBatch] -> ShowS)
-> Show FailedRemediationBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedRemediationBatch] -> ShowS
$cshowList :: [FailedRemediationBatch] -> ShowS
show :: FailedRemediationBatch -> String
$cshow :: FailedRemediationBatch -> String
showsPrec :: Int -> FailedRemediationBatch -> ShowS
$cshowsPrec :: Int -> FailedRemediationBatch -> ShowS
Prelude.Show, (forall x. FailedRemediationBatch -> Rep FailedRemediationBatch x)
-> (forall x.
Rep FailedRemediationBatch x -> FailedRemediationBatch)
-> Generic FailedRemediationBatch
forall x. Rep FailedRemediationBatch x -> FailedRemediationBatch
forall x. FailedRemediationBatch -> Rep FailedRemediationBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailedRemediationBatch x -> FailedRemediationBatch
$cfrom :: forall x. FailedRemediationBatch -> Rep FailedRemediationBatch x
Prelude.Generic)
newFailedRemediationBatch ::
FailedRemediationBatch
newFailedRemediationBatch :: FailedRemediationBatch
newFailedRemediationBatch =
FailedRemediationBatch' :: Maybe Text
-> Maybe [RemediationConfiguration] -> FailedRemediationBatch
FailedRemediationBatch'
{ $sel:failureMessage:FailedRemediationBatch' :: Maybe Text
failureMessage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failedItems:FailedRemediationBatch' :: Maybe [RemediationConfiguration]
failedItems = Maybe [RemediationConfiguration]
forall a. Maybe a
Prelude.Nothing
}
failedRemediationBatch_failureMessage :: Lens.Lens' FailedRemediationBatch (Prelude.Maybe Prelude.Text)
failedRemediationBatch_failureMessage :: (Maybe Text -> f (Maybe Text))
-> FailedRemediationBatch -> f FailedRemediationBatch
failedRemediationBatch_failureMessage = (FailedRemediationBatch -> Maybe Text)
-> (FailedRemediationBatch -> Maybe Text -> FailedRemediationBatch)
-> Lens
FailedRemediationBatch
FailedRemediationBatch
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedRemediationBatch' {Maybe Text
failureMessage :: Maybe Text
$sel:failureMessage:FailedRemediationBatch' :: FailedRemediationBatch -> Maybe Text
failureMessage} -> Maybe Text
failureMessage) (\s :: FailedRemediationBatch
s@FailedRemediationBatch' {} Maybe Text
a -> FailedRemediationBatch
s {$sel:failureMessage:FailedRemediationBatch' :: Maybe Text
failureMessage = Maybe Text
a} :: FailedRemediationBatch)
failedRemediationBatch_failedItems :: Lens.Lens' FailedRemediationBatch (Prelude.Maybe [RemediationConfiguration])
failedRemediationBatch_failedItems :: (Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> FailedRemediationBatch -> f FailedRemediationBatch
failedRemediationBatch_failedItems = (FailedRemediationBatch -> Maybe [RemediationConfiguration])
-> (FailedRemediationBatch
-> Maybe [RemediationConfiguration] -> FailedRemediationBatch)
-> Lens
FailedRemediationBatch
FailedRemediationBatch
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedRemediationBatch' {Maybe [RemediationConfiguration]
failedItems :: Maybe [RemediationConfiguration]
$sel:failedItems:FailedRemediationBatch' :: FailedRemediationBatch -> Maybe [RemediationConfiguration]
failedItems} -> Maybe [RemediationConfiguration]
failedItems) (\s :: FailedRemediationBatch
s@FailedRemediationBatch' {} Maybe [RemediationConfiguration]
a -> FailedRemediationBatch
s {$sel:failedItems:FailedRemediationBatch' :: Maybe [RemediationConfiguration]
failedItems = Maybe [RemediationConfiguration]
a} :: FailedRemediationBatch) ((Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> FailedRemediationBatch -> f FailedRemediationBatch)
-> ((Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> (Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> FailedRemediationBatch
-> f FailedRemediationBatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
-> Iso
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
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
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON FailedRemediationBatch where
parseJSON :: Value -> Parser FailedRemediationBatch
parseJSON =
String
-> (Object -> Parser FailedRemediationBatch)
-> Value
-> Parser FailedRemediationBatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FailedRemediationBatch"
( \Object
x ->
Maybe Text
-> Maybe [RemediationConfiguration] -> FailedRemediationBatch
FailedRemediationBatch'
(Maybe Text
-> Maybe [RemediationConfiguration] -> FailedRemediationBatch)
-> Parser (Maybe Text)
-> Parser
(Maybe [RemediationConfiguration] -> FailedRemediationBatch)
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 [RemediationConfiguration] -> FailedRemediationBatch)
-> Parser (Maybe [RemediationConfiguration])
-> Parser FailedRemediationBatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RemediationConfiguration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailedItems" Parser (Maybe (Maybe [RemediationConfiguration]))
-> Maybe [RemediationConfiguration]
-> Parser (Maybe [RemediationConfiguration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RemediationConfiguration]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable FailedRemediationBatch
instance Prelude.NFData FailedRemediationBatch