{-# 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.ModifyCacheParameterGroup
(
ModifyCacheParameterGroup (..),
newModifyCacheParameterGroup,
modifyCacheParameterGroup_cacheParameterGroupName,
modifyCacheParameterGroup_parameterNameValues,
CacheParameterGroupNameMessage (..),
newCacheParameterGroupNameMessage,
cacheParameterGroupNameMessage_cacheParameterGroupName,
)
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 ModifyCacheParameterGroup = ModifyCacheParameterGroup'
{
ModifyCacheParameterGroup -> Text
cacheParameterGroupName :: Prelude.Text,
ModifyCacheParameterGroup -> [ParameterNameValue]
parameterNameValues :: [ParameterNameValue]
}
deriving (ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool
(ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool)
-> (ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool)
-> Eq ModifyCacheParameterGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool
$c/= :: ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool
== :: ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool
$c== :: ModifyCacheParameterGroup -> ModifyCacheParameterGroup -> Bool
Prelude.Eq, ReadPrec [ModifyCacheParameterGroup]
ReadPrec ModifyCacheParameterGroup
Int -> ReadS ModifyCacheParameterGroup
ReadS [ModifyCacheParameterGroup]
(Int -> ReadS ModifyCacheParameterGroup)
-> ReadS [ModifyCacheParameterGroup]
-> ReadPrec ModifyCacheParameterGroup
-> ReadPrec [ModifyCacheParameterGroup]
-> Read ModifyCacheParameterGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCacheParameterGroup]
$creadListPrec :: ReadPrec [ModifyCacheParameterGroup]
readPrec :: ReadPrec ModifyCacheParameterGroup
$creadPrec :: ReadPrec ModifyCacheParameterGroup
readList :: ReadS [ModifyCacheParameterGroup]
$creadList :: ReadS [ModifyCacheParameterGroup]
readsPrec :: Int -> ReadS ModifyCacheParameterGroup
$creadsPrec :: Int -> ReadS ModifyCacheParameterGroup
Prelude.Read, Int -> ModifyCacheParameterGroup -> ShowS
[ModifyCacheParameterGroup] -> ShowS
ModifyCacheParameterGroup -> String
(Int -> ModifyCacheParameterGroup -> ShowS)
-> (ModifyCacheParameterGroup -> String)
-> ([ModifyCacheParameterGroup] -> ShowS)
-> Show ModifyCacheParameterGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCacheParameterGroup] -> ShowS
$cshowList :: [ModifyCacheParameterGroup] -> ShowS
show :: ModifyCacheParameterGroup -> String
$cshow :: ModifyCacheParameterGroup -> String
showsPrec :: Int -> ModifyCacheParameterGroup -> ShowS
$cshowsPrec :: Int -> ModifyCacheParameterGroup -> ShowS
Prelude.Show, (forall x.
ModifyCacheParameterGroup -> Rep ModifyCacheParameterGroup x)
-> (forall x.
Rep ModifyCacheParameterGroup x -> ModifyCacheParameterGroup)
-> Generic ModifyCacheParameterGroup
forall x.
Rep ModifyCacheParameterGroup x -> ModifyCacheParameterGroup
forall x.
ModifyCacheParameterGroup -> Rep ModifyCacheParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyCacheParameterGroup x -> ModifyCacheParameterGroup
$cfrom :: forall x.
ModifyCacheParameterGroup -> Rep ModifyCacheParameterGroup x
Prelude.Generic)
newModifyCacheParameterGroup ::
Prelude.Text ->
ModifyCacheParameterGroup
newModifyCacheParameterGroup :: Text -> ModifyCacheParameterGroup
newModifyCacheParameterGroup
Text
pCacheParameterGroupName_ =
ModifyCacheParameterGroup' :: Text -> [ParameterNameValue] -> ModifyCacheParameterGroup
ModifyCacheParameterGroup'
{ $sel:cacheParameterGroupName:ModifyCacheParameterGroup' :: Text
cacheParameterGroupName =
Text
pCacheParameterGroupName_,
$sel:parameterNameValues:ModifyCacheParameterGroup' :: [ParameterNameValue]
parameterNameValues = [ParameterNameValue]
forall a. Monoid a => a
Prelude.mempty
}
modifyCacheParameterGroup_cacheParameterGroupName :: Lens.Lens' ModifyCacheParameterGroup Prelude.Text
modifyCacheParameterGroup_cacheParameterGroupName :: (Text -> f Text)
-> ModifyCacheParameterGroup -> f ModifyCacheParameterGroup
modifyCacheParameterGroup_cacheParameterGroupName = (ModifyCacheParameterGroup -> Text)
-> (ModifyCacheParameterGroup -> Text -> ModifyCacheParameterGroup)
-> Lens
ModifyCacheParameterGroup ModifyCacheParameterGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheParameterGroup' {Text
cacheParameterGroupName :: Text
$sel:cacheParameterGroupName:ModifyCacheParameterGroup' :: ModifyCacheParameterGroup -> Text
cacheParameterGroupName} -> Text
cacheParameterGroupName) (\s :: ModifyCacheParameterGroup
s@ModifyCacheParameterGroup' {} Text
a -> ModifyCacheParameterGroup
s {$sel:cacheParameterGroupName:ModifyCacheParameterGroup' :: Text
cacheParameterGroupName = Text
a} :: ModifyCacheParameterGroup)
modifyCacheParameterGroup_parameterNameValues :: Lens.Lens' ModifyCacheParameterGroup [ParameterNameValue]
modifyCacheParameterGroup_parameterNameValues :: ([ParameterNameValue] -> f [ParameterNameValue])
-> ModifyCacheParameterGroup -> f ModifyCacheParameterGroup
modifyCacheParameterGroup_parameterNameValues = (ModifyCacheParameterGroup -> [ParameterNameValue])
-> (ModifyCacheParameterGroup
-> [ParameterNameValue] -> ModifyCacheParameterGroup)
-> Lens
ModifyCacheParameterGroup
ModifyCacheParameterGroup
[ParameterNameValue]
[ParameterNameValue]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheParameterGroup' {[ParameterNameValue]
parameterNameValues :: [ParameterNameValue]
$sel:parameterNameValues:ModifyCacheParameterGroup' :: ModifyCacheParameterGroup -> [ParameterNameValue]
parameterNameValues} -> [ParameterNameValue]
parameterNameValues) (\s :: ModifyCacheParameterGroup
s@ModifyCacheParameterGroup' {} [ParameterNameValue]
a -> ModifyCacheParameterGroup
s {$sel:parameterNameValues:ModifyCacheParameterGroup' :: [ParameterNameValue]
parameterNameValues = [ParameterNameValue]
a} :: ModifyCacheParameterGroup) (([ParameterNameValue] -> f [ParameterNameValue])
-> ModifyCacheParameterGroup -> f ModifyCacheParameterGroup)
-> (([ParameterNameValue] -> f [ParameterNameValue])
-> [ParameterNameValue] -> f [ParameterNameValue])
-> ([ParameterNameValue] -> f [ParameterNameValue])
-> ModifyCacheParameterGroup
-> f ModifyCacheParameterGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ParameterNameValue] -> f [ParameterNameValue])
-> [ParameterNameValue] -> f [ParameterNameValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ModifyCacheParameterGroup where
type
AWSResponse ModifyCacheParameterGroup =
CacheParameterGroupNameMessage
request :: ModifyCacheParameterGroup -> Request ModifyCacheParameterGroup
request = Service
-> ModifyCacheParameterGroup -> Request ModifyCacheParameterGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyCacheParameterGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyCacheParameterGroup)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifyCacheParameterGroup))
-> Logger
-> Service
-> Proxy ModifyCacheParameterGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyCacheParameterGroup)))
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
"ModifyCacheParameterGroupResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String CacheParameterGroupNameMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable ModifyCacheParameterGroup
instance Prelude.NFData ModifyCacheParameterGroup
instance Core.ToHeaders ModifyCacheParameterGroup where
toHeaders :: ModifyCacheParameterGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyCacheParameterGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifyCacheParameterGroup where
toPath :: ModifyCacheParameterGroup -> ByteString
toPath = ByteString -> ModifyCacheParameterGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyCacheParameterGroup where
toQuery :: ModifyCacheParameterGroup -> QueryString
toQuery ModifyCacheParameterGroup' {[ParameterNameValue]
Text
parameterNameValues :: [ParameterNameValue]
cacheParameterGroupName :: Text
$sel:parameterNameValues:ModifyCacheParameterGroup' :: ModifyCacheParameterGroup -> [ParameterNameValue]
$sel:cacheParameterGroupName:ModifyCacheParameterGroup' :: ModifyCacheParameterGroup -> 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
"ModifyCacheParameterGroup" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"CacheParameterGroupName"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheParameterGroupName,
ByteString
"ParameterNameValues"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [ParameterNameValue] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList
ByteString
"ParameterNameValue"
[ParameterNameValue]
parameterNameValues
]