module Network.AWS.ElastiCache.ModifyCacheSubnetGroup
(
modifyCacheSubnetGroup
, ModifyCacheSubnetGroup
, mcsgSubnetIds
, mcsgCacheSubnetGroupDescription
, mcsgCacheSubnetGroupName
, modifyCacheSubnetGroupResponse
, ModifyCacheSubnetGroupResponse
, mcsgrsCacheSubnetGroup
, mcsgrsStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifyCacheSubnetGroup = ModifyCacheSubnetGroup'
{ _mcsgSubnetIds :: !(Maybe [Text])
, _mcsgCacheSubnetGroupDescription :: !(Maybe Text)
, _mcsgCacheSubnetGroupName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyCacheSubnetGroup
:: Text
-> ModifyCacheSubnetGroup
modifyCacheSubnetGroup pCacheSubnetGroupName_ =
ModifyCacheSubnetGroup'
{ _mcsgSubnetIds = Nothing
, _mcsgCacheSubnetGroupDescription = Nothing
, _mcsgCacheSubnetGroupName = pCacheSubnetGroupName_
}
mcsgSubnetIds :: Lens' ModifyCacheSubnetGroup [Text]
mcsgSubnetIds = lens _mcsgSubnetIds (\ s a -> s{_mcsgSubnetIds = a}) . _Default . _Coerce;
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});
instance AWSRequest ModifyCacheSubnetGroup where
type Sv ModifyCacheSubnetGroup = ElastiCache
type Rs ModifyCacheSubnetGroup =
ModifyCacheSubnetGroupResponse
request = postQuery
response
= receiveXMLWrapper "ModifyCacheSubnetGroupResult"
(\ s h x ->
ModifyCacheSubnetGroupResponse' <$>
(x .@? "CacheSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders ModifyCacheSubnetGroup where
toHeaders = const mempty
instance ToPath ModifyCacheSubnetGroup where
toPath = const "/"
instance ToQuery ModifyCacheSubnetGroup where
toQuery ModifyCacheSubnetGroup'{..}
= mconcat
["Action" =:
("ModifyCacheSubnetGroup" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"SubnetIds" =:
toQuery
(toQueryList "SubnetIdentifier" <$> _mcsgSubnetIds),
"CacheSubnetGroupDescription" =:
_mcsgCacheSubnetGroupDescription,
"CacheSubnetGroupName" =: _mcsgCacheSubnetGroupName]
data ModifyCacheSubnetGroupResponse = ModifyCacheSubnetGroupResponse'
{ _mcsgrsCacheSubnetGroup :: !(Maybe CacheSubnetGroup)
, _mcsgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyCacheSubnetGroupResponse
:: Int
-> ModifyCacheSubnetGroupResponse
modifyCacheSubnetGroupResponse pStatus_ =
ModifyCacheSubnetGroupResponse'
{ _mcsgrsCacheSubnetGroup = Nothing
, _mcsgrsStatus = pStatus_
}
mcsgrsCacheSubnetGroup :: Lens' ModifyCacheSubnetGroupResponse (Maybe CacheSubnetGroup)
mcsgrsCacheSubnetGroup = lens _mcsgrsCacheSubnetGroup (\ s a -> s{_mcsgrsCacheSubnetGroup = a});
mcsgrsStatus :: Lens' ModifyCacheSubnetGroupResponse Int
mcsgrsStatus = lens _mcsgrsStatus (\ s a -> s{_mcsgrsStatus = a});