{-# 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.ElastiCache.Types.UpdateActionResultsMessage where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.ProcessedUpdateAction
import Amazonka.ElastiCache.Types.UnprocessedUpdateAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpdateActionResultsMessage = UpdateActionResultsMessage'
{
UpdateActionResultsMessage -> Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions :: Prelude.Maybe [UnprocessedUpdateAction],
UpdateActionResultsMessage -> Maybe [ProcessedUpdateAction]
processedUpdateActions :: Prelude.Maybe [ProcessedUpdateAction]
}
deriving (UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool
(UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool)
-> (UpdateActionResultsMessage
-> UpdateActionResultsMessage -> Bool)
-> Eq UpdateActionResultsMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool
$c/= :: UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool
== :: UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool
$c== :: UpdateActionResultsMessage -> UpdateActionResultsMessage -> Bool
Prelude.Eq, ReadPrec [UpdateActionResultsMessage]
ReadPrec UpdateActionResultsMessage
Int -> ReadS UpdateActionResultsMessage
ReadS [UpdateActionResultsMessage]
(Int -> ReadS UpdateActionResultsMessage)
-> ReadS [UpdateActionResultsMessage]
-> ReadPrec UpdateActionResultsMessage
-> ReadPrec [UpdateActionResultsMessage]
-> Read UpdateActionResultsMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateActionResultsMessage]
$creadListPrec :: ReadPrec [UpdateActionResultsMessage]
readPrec :: ReadPrec UpdateActionResultsMessage
$creadPrec :: ReadPrec UpdateActionResultsMessage
readList :: ReadS [UpdateActionResultsMessage]
$creadList :: ReadS [UpdateActionResultsMessage]
readsPrec :: Int -> ReadS UpdateActionResultsMessage
$creadsPrec :: Int -> ReadS UpdateActionResultsMessage
Prelude.Read, Int -> UpdateActionResultsMessage -> ShowS
[UpdateActionResultsMessage] -> ShowS
UpdateActionResultsMessage -> String
(Int -> UpdateActionResultsMessage -> ShowS)
-> (UpdateActionResultsMessage -> String)
-> ([UpdateActionResultsMessage] -> ShowS)
-> Show UpdateActionResultsMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateActionResultsMessage] -> ShowS
$cshowList :: [UpdateActionResultsMessage] -> ShowS
show :: UpdateActionResultsMessage -> String
$cshow :: UpdateActionResultsMessage -> String
showsPrec :: Int -> UpdateActionResultsMessage -> ShowS
$cshowsPrec :: Int -> UpdateActionResultsMessage -> ShowS
Prelude.Show, (forall x.
UpdateActionResultsMessage -> Rep UpdateActionResultsMessage x)
-> (forall x.
Rep UpdateActionResultsMessage x -> UpdateActionResultsMessage)
-> Generic UpdateActionResultsMessage
forall x.
Rep UpdateActionResultsMessage x -> UpdateActionResultsMessage
forall x.
UpdateActionResultsMessage -> Rep UpdateActionResultsMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateActionResultsMessage x -> UpdateActionResultsMessage
$cfrom :: forall x.
UpdateActionResultsMessage -> Rep UpdateActionResultsMessage x
Prelude.Generic)
newUpdateActionResultsMessage ::
UpdateActionResultsMessage
newUpdateActionResultsMessage :: UpdateActionResultsMessage
newUpdateActionResultsMessage =
UpdateActionResultsMessage' :: Maybe [UnprocessedUpdateAction]
-> Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage
UpdateActionResultsMessage'
{ $sel:unprocessedUpdateActions:UpdateActionResultsMessage' :: Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions =
Maybe [UnprocessedUpdateAction]
forall a. Maybe a
Prelude.Nothing,
$sel:processedUpdateActions:UpdateActionResultsMessage' :: Maybe [ProcessedUpdateAction]
processedUpdateActions = Maybe [ProcessedUpdateAction]
forall a. Maybe a
Prelude.Nothing
}
updateActionResultsMessage_unprocessedUpdateActions :: Lens.Lens' UpdateActionResultsMessage (Prelude.Maybe [UnprocessedUpdateAction])
updateActionResultsMessage_unprocessedUpdateActions :: (Maybe [UnprocessedUpdateAction]
-> f (Maybe [UnprocessedUpdateAction]))
-> UpdateActionResultsMessage -> f UpdateActionResultsMessage
updateActionResultsMessage_unprocessedUpdateActions = (UpdateActionResultsMessage -> Maybe [UnprocessedUpdateAction])
-> (UpdateActionResultsMessage
-> Maybe [UnprocessedUpdateAction] -> UpdateActionResultsMessage)
-> Lens
UpdateActionResultsMessage
UpdateActionResultsMessage
(Maybe [UnprocessedUpdateAction])
(Maybe [UnprocessedUpdateAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateActionResultsMessage' {Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions :: Maybe [UnprocessedUpdateAction]
$sel:unprocessedUpdateActions:UpdateActionResultsMessage' :: UpdateActionResultsMessage -> Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions} -> Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions) (\s :: UpdateActionResultsMessage
s@UpdateActionResultsMessage' {} Maybe [UnprocessedUpdateAction]
a -> UpdateActionResultsMessage
s {$sel:unprocessedUpdateActions:UpdateActionResultsMessage' :: Maybe [UnprocessedUpdateAction]
unprocessedUpdateActions = Maybe [UnprocessedUpdateAction]
a} :: UpdateActionResultsMessage) ((Maybe [UnprocessedUpdateAction]
-> f (Maybe [UnprocessedUpdateAction]))
-> UpdateActionResultsMessage -> f UpdateActionResultsMessage)
-> ((Maybe [UnprocessedUpdateAction]
-> f (Maybe [UnprocessedUpdateAction]))
-> Maybe [UnprocessedUpdateAction]
-> f (Maybe [UnprocessedUpdateAction]))
-> (Maybe [UnprocessedUpdateAction]
-> f (Maybe [UnprocessedUpdateAction]))
-> UpdateActionResultsMessage
-> f UpdateActionResultsMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
-> Iso
(Maybe [UnprocessedUpdateAction])
(Maybe [UnprocessedUpdateAction])
(Maybe [UnprocessedUpdateAction])
(Maybe [UnprocessedUpdateAction])
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
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
[UnprocessedUpdateAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateActionResultsMessage_processedUpdateActions :: Lens.Lens' UpdateActionResultsMessage (Prelude.Maybe [ProcessedUpdateAction])
updateActionResultsMessage_processedUpdateActions :: (Maybe [ProcessedUpdateAction]
-> f (Maybe [ProcessedUpdateAction]))
-> UpdateActionResultsMessage -> f UpdateActionResultsMessage
updateActionResultsMessage_processedUpdateActions = (UpdateActionResultsMessage -> Maybe [ProcessedUpdateAction])
-> (UpdateActionResultsMessage
-> Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage)
-> Lens
UpdateActionResultsMessage
UpdateActionResultsMessage
(Maybe [ProcessedUpdateAction])
(Maybe [ProcessedUpdateAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateActionResultsMessage' {Maybe [ProcessedUpdateAction]
processedUpdateActions :: Maybe [ProcessedUpdateAction]
$sel:processedUpdateActions:UpdateActionResultsMessage' :: UpdateActionResultsMessage -> Maybe [ProcessedUpdateAction]
processedUpdateActions} -> Maybe [ProcessedUpdateAction]
processedUpdateActions) (\s :: UpdateActionResultsMessage
s@UpdateActionResultsMessage' {} Maybe [ProcessedUpdateAction]
a -> UpdateActionResultsMessage
s {$sel:processedUpdateActions:UpdateActionResultsMessage' :: Maybe [ProcessedUpdateAction]
processedUpdateActions = Maybe [ProcessedUpdateAction]
a} :: UpdateActionResultsMessage) ((Maybe [ProcessedUpdateAction]
-> f (Maybe [ProcessedUpdateAction]))
-> UpdateActionResultsMessage -> f UpdateActionResultsMessage)
-> ((Maybe [ProcessedUpdateAction]
-> f (Maybe [ProcessedUpdateAction]))
-> Maybe [ProcessedUpdateAction]
-> f (Maybe [ProcessedUpdateAction]))
-> (Maybe [ProcessedUpdateAction]
-> f (Maybe [ProcessedUpdateAction]))
-> UpdateActionResultsMessage
-> f UpdateActionResultsMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ProcessedUpdateAction]
[ProcessedUpdateAction]
[ProcessedUpdateAction]
[ProcessedUpdateAction]
-> Iso
(Maybe [ProcessedUpdateAction])
(Maybe [ProcessedUpdateAction])
(Maybe [ProcessedUpdateAction])
(Maybe [ProcessedUpdateAction])
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
[ProcessedUpdateAction]
[ProcessedUpdateAction]
[ProcessedUpdateAction]
[ProcessedUpdateAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML UpdateActionResultsMessage where
parseXML :: [Node] -> Either String UpdateActionResultsMessage
parseXML [Node]
x =
Maybe [UnprocessedUpdateAction]
-> Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage
UpdateActionResultsMessage'
(Maybe [UnprocessedUpdateAction]
-> Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage)
-> Either String (Maybe [UnprocessedUpdateAction])
-> Either
String
(Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UnprocessedUpdateActions"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [UnprocessedUpdateAction]))
-> Either String (Maybe [UnprocessedUpdateAction])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [UnprocessedUpdateAction])
-> [Node] -> Either String (Maybe [UnprocessedUpdateAction])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
(Text -> [Node] -> Either String [UnprocessedUpdateAction]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"UnprocessedUpdateAction")
)
Either
String
(Maybe [ProcessedUpdateAction] -> UpdateActionResultsMessage)
-> Either String (Maybe [ProcessedUpdateAction])
-> Either String UpdateActionResultsMessage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ProcessedUpdateActions"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [ProcessedUpdateAction]))
-> Either String (Maybe [ProcessedUpdateAction])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ProcessedUpdateAction])
-> [Node] -> Either String (Maybe [ProcessedUpdateAction])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ProcessedUpdateAction]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ProcessedUpdateAction")
)
instance Prelude.Hashable UpdateActionResultsMessage
instance Prelude.NFData UpdateActionResultsMessage