module Network.AWS.ElastiCache.CreateCacheSubnetGroup
(
CreateCacheSubnetGroup
, createCacheSubnetGroup
, ccsgCacheSubnetGroupDescription
, ccsgCacheSubnetGroupName
, ccsgSubnetIds
, CreateCacheSubnetGroupResponse
, createCacheSubnetGroupResponse
, ccsgrCacheSubnetGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data CreateCacheSubnetGroup = CreateCacheSubnetGroup
{ _ccsgCacheSubnetGroupDescription :: Text
, _ccsgCacheSubnetGroupName :: Text
, _ccsgSubnetIds :: List "member" Text
} deriving (Eq, Ord, Show)
createCacheSubnetGroup :: Text
-> Text
-> CreateCacheSubnetGroup
createCacheSubnetGroup p1 p2 = CreateCacheSubnetGroup
{ _ccsgCacheSubnetGroupName = p1
, _ccsgCacheSubnetGroupDescription = p2
, _ccsgSubnetIds = mempty
}
ccsgCacheSubnetGroupDescription :: Lens' CreateCacheSubnetGroup Text
ccsgCacheSubnetGroupDescription =
lens _ccsgCacheSubnetGroupDescription
(\s a -> s { _ccsgCacheSubnetGroupDescription = a })
ccsgCacheSubnetGroupName :: Lens' CreateCacheSubnetGroup Text
ccsgCacheSubnetGroupName =
lens _ccsgCacheSubnetGroupName
(\s a -> s { _ccsgCacheSubnetGroupName = a })
ccsgSubnetIds :: Lens' CreateCacheSubnetGroup [Text]
ccsgSubnetIds = lens _ccsgSubnetIds (\s a -> s { _ccsgSubnetIds = a }) . _List
newtype CreateCacheSubnetGroupResponse = CreateCacheSubnetGroupResponse
{ _ccsgrCacheSubnetGroup :: Maybe CacheSubnetGroup
} deriving (Eq, Show)
createCacheSubnetGroupResponse :: CreateCacheSubnetGroupResponse
createCacheSubnetGroupResponse = CreateCacheSubnetGroupResponse
{ _ccsgrCacheSubnetGroup = Nothing
}
ccsgrCacheSubnetGroup :: Lens' CreateCacheSubnetGroupResponse (Maybe CacheSubnetGroup)
ccsgrCacheSubnetGroup =
lens _ccsgrCacheSubnetGroup (\s a -> s { _ccsgrCacheSubnetGroup = a })
instance ToPath CreateCacheSubnetGroup where
toPath = const "/"
instance ToQuery CreateCacheSubnetGroup where
toQuery CreateCacheSubnetGroup{..} = mconcat
[ "CacheSubnetGroupDescription" =? _ccsgCacheSubnetGroupDescription
, "CacheSubnetGroupName" =? _ccsgCacheSubnetGroupName
, "SubnetIds" =? _ccsgSubnetIds
]
instance ToHeaders CreateCacheSubnetGroup
instance AWSRequest CreateCacheSubnetGroup where
type Sv CreateCacheSubnetGroup = ElastiCache
type Rs CreateCacheSubnetGroup = CreateCacheSubnetGroupResponse
request = post "CreateCacheSubnetGroup"
response = xmlResponse
instance FromXML CreateCacheSubnetGroupResponse where
parseXML = withElement "CreateCacheSubnetGroupResult" $ \x -> CreateCacheSubnetGroupResponse
<$> x .@? "CacheSubnetGroup"