{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ElastiCache.BatchApplyUpdateAction
(
BatchApplyUpdateAction (..),
newBatchApplyUpdateAction,
batchApplyUpdateAction_cacheClusterIds,
batchApplyUpdateAction_replicationGroupIds,
batchApplyUpdateAction_serviceUpdateName,
UpdateActionResultsMessage (..),
newUpdateActionResultsMessage,
updateActionResultsMessage_unprocessedUpdateActions,
updateActionResultsMessage_processedUpdateActions,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data BatchApplyUpdateAction = BatchApplyUpdateAction'
{
BatchApplyUpdateAction -> Maybe [Text]
cacheClusterIds :: Prelude.Maybe [Prelude.Text],
BatchApplyUpdateAction -> Maybe [Text]
replicationGroupIds :: Prelude.Maybe [Prelude.Text],
BatchApplyUpdateAction -> Text
serviceUpdateName :: Prelude.Text
}
deriving (BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool
(BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool)
-> (BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool)
-> Eq BatchApplyUpdateAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool
$c/= :: BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool
== :: BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool
$c== :: BatchApplyUpdateAction -> BatchApplyUpdateAction -> Bool
Prelude.Eq, ReadPrec [BatchApplyUpdateAction]
ReadPrec BatchApplyUpdateAction
Int -> ReadS BatchApplyUpdateAction
ReadS [BatchApplyUpdateAction]
(Int -> ReadS BatchApplyUpdateAction)
-> ReadS [BatchApplyUpdateAction]
-> ReadPrec BatchApplyUpdateAction
-> ReadPrec [BatchApplyUpdateAction]
-> Read BatchApplyUpdateAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchApplyUpdateAction]
$creadListPrec :: ReadPrec [BatchApplyUpdateAction]
readPrec :: ReadPrec BatchApplyUpdateAction
$creadPrec :: ReadPrec BatchApplyUpdateAction
readList :: ReadS [BatchApplyUpdateAction]
$creadList :: ReadS [BatchApplyUpdateAction]
readsPrec :: Int -> ReadS BatchApplyUpdateAction
$creadsPrec :: Int -> ReadS BatchApplyUpdateAction
Prelude.Read, Int -> BatchApplyUpdateAction -> ShowS
[BatchApplyUpdateAction] -> ShowS
BatchApplyUpdateAction -> String
(Int -> BatchApplyUpdateAction -> ShowS)
-> (BatchApplyUpdateAction -> String)
-> ([BatchApplyUpdateAction] -> ShowS)
-> Show BatchApplyUpdateAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchApplyUpdateAction] -> ShowS
$cshowList :: [BatchApplyUpdateAction] -> ShowS
show :: BatchApplyUpdateAction -> String
$cshow :: BatchApplyUpdateAction -> String
showsPrec :: Int -> BatchApplyUpdateAction -> ShowS
$cshowsPrec :: Int -> BatchApplyUpdateAction -> ShowS
Prelude.Show, (forall x. BatchApplyUpdateAction -> Rep BatchApplyUpdateAction x)
-> (forall x.
Rep BatchApplyUpdateAction x -> BatchApplyUpdateAction)
-> Generic BatchApplyUpdateAction
forall x. Rep BatchApplyUpdateAction x -> BatchApplyUpdateAction
forall x. BatchApplyUpdateAction -> Rep BatchApplyUpdateAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchApplyUpdateAction x -> BatchApplyUpdateAction
$cfrom :: forall x. BatchApplyUpdateAction -> Rep BatchApplyUpdateAction x
Prelude.Generic)
newBatchApplyUpdateAction ::
Prelude.Text ->
BatchApplyUpdateAction
newBatchApplyUpdateAction :: Text -> BatchApplyUpdateAction
newBatchApplyUpdateAction Text
pServiceUpdateName_ =
BatchApplyUpdateAction' :: Maybe [Text] -> Maybe [Text] -> Text -> BatchApplyUpdateAction
BatchApplyUpdateAction'
{ $sel:cacheClusterIds:BatchApplyUpdateAction' :: Maybe [Text]
cacheClusterIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:replicationGroupIds:BatchApplyUpdateAction' :: Maybe [Text]
replicationGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:serviceUpdateName:BatchApplyUpdateAction' :: Text
serviceUpdateName = Text
pServiceUpdateName_
}
batchApplyUpdateAction_cacheClusterIds :: Lens.Lens' BatchApplyUpdateAction (Prelude.Maybe [Prelude.Text])
batchApplyUpdateAction_cacheClusterIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction -> f BatchApplyUpdateAction
batchApplyUpdateAction_cacheClusterIds = (BatchApplyUpdateAction -> Maybe [Text])
-> (BatchApplyUpdateAction
-> Maybe [Text] -> BatchApplyUpdateAction)
-> Lens
BatchApplyUpdateAction
BatchApplyUpdateAction
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchApplyUpdateAction' {Maybe [Text]
cacheClusterIds :: Maybe [Text]
$sel:cacheClusterIds:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Maybe [Text]
cacheClusterIds} -> Maybe [Text]
cacheClusterIds) (\s :: BatchApplyUpdateAction
s@BatchApplyUpdateAction' {} Maybe [Text]
a -> BatchApplyUpdateAction
s {$sel:cacheClusterIds:BatchApplyUpdateAction' :: Maybe [Text]
cacheClusterIds = Maybe [Text]
a} :: BatchApplyUpdateAction) ((Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction -> f BatchApplyUpdateAction)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction
-> f BatchApplyUpdateAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchApplyUpdateAction_replicationGroupIds :: Lens.Lens' BatchApplyUpdateAction (Prelude.Maybe [Prelude.Text])
batchApplyUpdateAction_replicationGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction -> f BatchApplyUpdateAction
batchApplyUpdateAction_replicationGroupIds = (BatchApplyUpdateAction -> Maybe [Text])
-> (BatchApplyUpdateAction
-> Maybe [Text] -> BatchApplyUpdateAction)
-> Lens
BatchApplyUpdateAction
BatchApplyUpdateAction
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchApplyUpdateAction' {Maybe [Text]
replicationGroupIds :: Maybe [Text]
$sel:replicationGroupIds:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Maybe [Text]
replicationGroupIds} -> Maybe [Text]
replicationGroupIds) (\s :: BatchApplyUpdateAction
s@BatchApplyUpdateAction' {} Maybe [Text]
a -> BatchApplyUpdateAction
s {$sel:replicationGroupIds:BatchApplyUpdateAction' :: Maybe [Text]
replicationGroupIds = Maybe [Text]
a} :: BatchApplyUpdateAction) ((Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction -> f BatchApplyUpdateAction)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchApplyUpdateAction
-> f BatchApplyUpdateAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchApplyUpdateAction_serviceUpdateName :: Lens.Lens' BatchApplyUpdateAction Prelude.Text
batchApplyUpdateAction_serviceUpdateName :: (Text -> f Text)
-> BatchApplyUpdateAction -> f BatchApplyUpdateAction
batchApplyUpdateAction_serviceUpdateName = (BatchApplyUpdateAction -> Text)
-> (BatchApplyUpdateAction -> Text -> BatchApplyUpdateAction)
-> Lens BatchApplyUpdateAction BatchApplyUpdateAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchApplyUpdateAction' {Text
serviceUpdateName :: Text
$sel:serviceUpdateName:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Text
serviceUpdateName} -> Text
serviceUpdateName) (\s :: BatchApplyUpdateAction
s@BatchApplyUpdateAction' {} Text
a -> BatchApplyUpdateAction
s {$sel:serviceUpdateName:BatchApplyUpdateAction' :: Text
serviceUpdateName = Text
a} :: BatchApplyUpdateAction)
instance Core.AWSRequest BatchApplyUpdateAction where
type
AWSResponse BatchApplyUpdateAction =
UpdateActionResultsMessage
request :: BatchApplyUpdateAction -> Request BatchApplyUpdateAction
request = Service -> BatchApplyUpdateAction -> Request BatchApplyUpdateAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy BatchApplyUpdateAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchApplyUpdateAction)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse BatchApplyUpdateAction))
-> Logger
-> Service
-> Proxy BatchApplyUpdateAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchApplyUpdateAction)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"BatchApplyUpdateActionResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String UpdateActionResultsMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable BatchApplyUpdateAction
instance Prelude.NFData BatchApplyUpdateAction
instance Core.ToHeaders BatchApplyUpdateAction where
toHeaders :: BatchApplyUpdateAction -> ResponseHeaders
toHeaders = ResponseHeaders -> BatchApplyUpdateAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath BatchApplyUpdateAction where
toPath :: BatchApplyUpdateAction -> ByteString
toPath = ByteString -> BatchApplyUpdateAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery BatchApplyUpdateAction where
toQuery :: BatchApplyUpdateAction -> QueryString
toQuery BatchApplyUpdateAction' {Maybe [Text]
Text
serviceUpdateName :: Text
replicationGroupIds :: Maybe [Text]
cacheClusterIds :: Maybe [Text]
$sel:serviceUpdateName:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Text
$sel:replicationGroupIds:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Maybe [Text]
$sel:cacheClusterIds:BatchApplyUpdateAction' :: BatchApplyUpdateAction -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"BatchApplyUpdateAction" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"CacheClusterIds"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cacheClusterIds
),
ByteString
"ReplicationGroupIds"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
replicationGroupIds
),
ByteString
"ServiceUpdateName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
serviceUpdateName
]