module Network.AWS.ElastiCache.CreateCacheSubnetGroup
(
createCacheSubnetGroup
, CreateCacheSubnetGroup
, ccsgCacheSubnetGroupName
, ccsgCacheSubnetGroupDescription
, ccsgSubnetIds
, createCacheSubnetGroupResponse
, CreateCacheSubnetGroupResponse
, crsCacheSubnetGroup
, crsStatus
) 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 CreateCacheSubnetGroup = CreateCacheSubnetGroup'
{ _ccsgCacheSubnetGroupName :: !Text
, _ccsgCacheSubnetGroupDescription :: !Text
, _ccsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCacheSubnetGroup
:: Text
-> Text
-> CreateCacheSubnetGroup
createCacheSubnetGroup pCacheSubnetGroupName_ pCacheSubnetGroupDescription_ =
CreateCacheSubnetGroup'
{ _ccsgCacheSubnetGroupName = pCacheSubnetGroupName_
, _ccsgCacheSubnetGroupDescription = pCacheSubnetGroupDescription_
, _ccsgSubnetIds = mempty
}
ccsgCacheSubnetGroupName :: Lens' CreateCacheSubnetGroup Text
ccsgCacheSubnetGroupName = lens _ccsgCacheSubnetGroupName (\ s a -> s{_ccsgCacheSubnetGroupName = a});
ccsgCacheSubnetGroupDescription :: Lens' CreateCacheSubnetGroup Text
ccsgCacheSubnetGroupDescription = lens _ccsgCacheSubnetGroupDescription (\ s a -> s{_ccsgCacheSubnetGroupDescription = a});
ccsgSubnetIds :: Lens' CreateCacheSubnetGroup [Text]
ccsgSubnetIds = lens _ccsgSubnetIds (\ s a -> s{_ccsgSubnetIds = a}) . _Coerce;
instance AWSRequest CreateCacheSubnetGroup where
type Sv CreateCacheSubnetGroup = ElastiCache
type Rs CreateCacheSubnetGroup =
CreateCacheSubnetGroupResponse
request = postQuery
response
= receiveXMLWrapper "CreateCacheSubnetGroupResult"
(\ s h x ->
CreateCacheSubnetGroupResponse' <$>
(x .@? "CacheSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders CreateCacheSubnetGroup where
toHeaders = const mempty
instance ToPath CreateCacheSubnetGroup where
toPath = const "/"
instance ToQuery CreateCacheSubnetGroup where
toQuery CreateCacheSubnetGroup'{..}
= mconcat
["Action" =:
("CreateCacheSubnetGroup" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"CacheSubnetGroupName" =: _ccsgCacheSubnetGroupName,
"CacheSubnetGroupDescription" =:
_ccsgCacheSubnetGroupDescription,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _ccsgSubnetIds]
data CreateCacheSubnetGroupResponse = CreateCacheSubnetGroupResponse'
{ _crsCacheSubnetGroup :: !(Maybe CacheSubnetGroup)
, _crsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCacheSubnetGroupResponse
:: Int
-> CreateCacheSubnetGroupResponse
createCacheSubnetGroupResponse pStatus_ =
CreateCacheSubnetGroupResponse'
{ _crsCacheSubnetGroup = Nothing
, _crsStatus = pStatus_
}
crsCacheSubnetGroup :: Lens' CreateCacheSubnetGroupResponse (Maybe CacheSubnetGroup)
crsCacheSubnetGroup = lens _crsCacheSubnetGroup (\ s a -> s{_crsCacheSubnetGroup = a});
crsStatus :: Lens' CreateCacheSubnetGroupResponse Int
crsStatus = lens _crsStatus (\ s a -> s{_crsStatus = a});