module Network.AWS.ElastiCache.CreateCacheParameterGroup
(
CreateCacheParameterGroup
, createCacheParameterGroup
, ccpgCacheParameterGroupFamily
, ccpgCacheParameterGroupName
, ccpgDescription
, CreateCacheParameterGroupResponse
, createCacheParameterGroupResponse
, ccpgrCacheParameterGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data CreateCacheParameterGroup = CreateCacheParameterGroup
{ _ccpgCacheParameterGroupFamily :: Text
, _ccpgCacheParameterGroupName :: Text
, _ccpgDescription :: Text
} deriving (Eq, Ord, Read, Show)
createCacheParameterGroup :: Text
-> Text
-> Text
-> CreateCacheParameterGroup
createCacheParameterGroup p1 p2 p3 = CreateCacheParameterGroup
{ _ccpgCacheParameterGroupName = p1
, _ccpgCacheParameterGroupFamily = p2
, _ccpgDescription = p3
}
ccpgCacheParameterGroupFamily :: Lens' CreateCacheParameterGroup Text
ccpgCacheParameterGroupFamily =
lens _ccpgCacheParameterGroupFamily
(\s a -> s { _ccpgCacheParameterGroupFamily = a })
ccpgCacheParameterGroupName :: Lens' CreateCacheParameterGroup Text
ccpgCacheParameterGroupName =
lens _ccpgCacheParameterGroupName
(\s a -> s { _ccpgCacheParameterGroupName = a })
ccpgDescription :: Lens' CreateCacheParameterGroup Text
ccpgDescription = lens _ccpgDescription (\s a -> s { _ccpgDescription = a })
newtype CreateCacheParameterGroupResponse = CreateCacheParameterGroupResponse
{ _ccpgrCacheParameterGroup :: Maybe CacheParameterGroup
} deriving (Eq, Read, Show)
createCacheParameterGroupResponse :: CreateCacheParameterGroupResponse
createCacheParameterGroupResponse = CreateCacheParameterGroupResponse
{ _ccpgrCacheParameterGroup = Nothing
}
ccpgrCacheParameterGroup :: Lens' CreateCacheParameterGroupResponse (Maybe CacheParameterGroup)
ccpgrCacheParameterGroup =
lens _ccpgrCacheParameterGroup
(\s a -> s { _ccpgrCacheParameterGroup = a })
instance ToPath CreateCacheParameterGroup where
toPath = const "/"
instance ToQuery CreateCacheParameterGroup where
toQuery CreateCacheParameterGroup{..} = mconcat
[ "CacheParameterGroupFamily" =? _ccpgCacheParameterGroupFamily
, "CacheParameterGroupName" =? _ccpgCacheParameterGroupName
, "Description" =? _ccpgDescription
]
instance ToHeaders CreateCacheParameterGroup
instance AWSRequest CreateCacheParameterGroup where
type Sv CreateCacheParameterGroup = ElastiCache
type Rs CreateCacheParameterGroup = CreateCacheParameterGroupResponse
request = post "CreateCacheParameterGroup"
response = xmlResponse
instance FromXML CreateCacheParameterGroupResponse where
parseXML = withElement "CreateCacheParameterGroupResult" $ \x -> CreateCacheParameterGroupResponse
<$> x .@? "CacheParameterGroup"