module Network.AWS.ElastiCache.ModifyCacheSubnetGroup
(
ModifyCacheSubnetGroup
, modifyCacheSubnetGroup
, mcsgCacheSubnetGroupDescription
, mcsgCacheSubnetGroupName
, mcsgSubnetIds
, ModifyCacheSubnetGroupResponse
, modifyCacheSubnetGroupResponse
, mcsgrCacheSubnetGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data ModifyCacheSubnetGroup = ModifyCacheSubnetGroup
{ _mcsgCacheSubnetGroupDescription :: Maybe Text
, _mcsgCacheSubnetGroupName :: Text
, _mcsgSubnetIds :: List "member" Text
} deriving (Eq, Ord, Show)
modifyCacheSubnetGroup :: Text
-> ModifyCacheSubnetGroup
modifyCacheSubnetGroup p1 = ModifyCacheSubnetGroup
{ _mcsgCacheSubnetGroupName = p1
, _mcsgCacheSubnetGroupDescription = Nothing
, _mcsgSubnetIds = mempty
}
mcsgCacheSubnetGroupDescription :: Lens' ModifyCacheSubnetGroup (Maybe Text)
mcsgCacheSubnetGroupDescription =
lens _mcsgCacheSubnetGroupDescription
(\s a -> s { _mcsgCacheSubnetGroupDescription = a })
mcsgCacheSubnetGroupName :: Lens' ModifyCacheSubnetGroup Text
mcsgCacheSubnetGroupName =
lens _mcsgCacheSubnetGroupName
(\s a -> s { _mcsgCacheSubnetGroupName = a })
mcsgSubnetIds :: Lens' ModifyCacheSubnetGroup [Text]
mcsgSubnetIds = lens _mcsgSubnetIds (\s a -> s { _mcsgSubnetIds = a }) . _List
newtype ModifyCacheSubnetGroupResponse = ModifyCacheSubnetGroupResponse
{ _mcsgrCacheSubnetGroup :: Maybe CacheSubnetGroup
} deriving (Eq, Show)
modifyCacheSubnetGroupResponse :: ModifyCacheSubnetGroupResponse
modifyCacheSubnetGroupResponse = ModifyCacheSubnetGroupResponse
{ _mcsgrCacheSubnetGroup = Nothing
}
mcsgrCacheSubnetGroup :: Lens' ModifyCacheSubnetGroupResponse (Maybe CacheSubnetGroup)
mcsgrCacheSubnetGroup =
lens _mcsgrCacheSubnetGroup (\s a -> s { _mcsgrCacheSubnetGroup = a })
instance ToPath ModifyCacheSubnetGroup where
toPath = const "/"
instance ToQuery ModifyCacheSubnetGroup where
toQuery ModifyCacheSubnetGroup{..} = mconcat
[ "CacheSubnetGroupDescription" =? _mcsgCacheSubnetGroupDescription
, "CacheSubnetGroupName" =? _mcsgCacheSubnetGroupName
, "SubnetIds" =? _mcsgSubnetIds
]
instance ToHeaders ModifyCacheSubnetGroup
instance AWSRequest ModifyCacheSubnetGroup where
type Sv ModifyCacheSubnetGroup = ElastiCache
type Rs ModifyCacheSubnetGroup = ModifyCacheSubnetGroupResponse
request = post "ModifyCacheSubnetGroup"
response = xmlResponse
instance FromXML ModifyCacheSubnetGroupResponse where
parseXML = withElement "ModifyCacheSubnetGroupResult" $ \x -> ModifyCacheSubnetGroupResponse
<$> x .@? "CacheSubnetGroup"