module Network.AWS.ElastiCache.CreateCacheSecurityGroup
(
createCacheSecurityGroup
, CreateCacheSecurityGroup
, ccsgCacheSecurityGroupName
, ccsgDescription
, createCacheSecurityGroupResponse
, CreateCacheSecurityGroupResponse
, ccsgrsCacheSecurityGroup
, ccsgrsStatus
) 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 CreateCacheSecurityGroup = CreateCacheSecurityGroup'
{ _ccsgCacheSecurityGroupName :: !Text
, _ccsgDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCacheSecurityGroup
:: Text
-> Text
-> CreateCacheSecurityGroup
createCacheSecurityGroup pCacheSecurityGroupName_ pDescription_ =
CreateCacheSecurityGroup'
{ _ccsgCacheSecurityGroupName = pCacheSecurityGroupName_
, _ccsgDescription = pDescription_
}
ccsgCacheSecurityGroupName :: Lens' CreateCacheSecurityGroup Text
ccsgCacheSecurityGroupName = lens _ccsgCacheSecurityGroupName (\ s a -> s{_ccsgCacheSecurityGroupName = a});
ccsgDescription :: Lens' CreateCacheSecurityGroup Text
ccsgDescription = lens _ccsgDescription (\ s a -> s{_ccsgDescription = a});
instance AWSRequest CreateCacheSecurityGroup where
type Sv CreateCacheSecurityGroup = ElastiCache
type Rs CreateCacheSecurityGroup =
CreateCacheSecurityGroupResponse
request = postQuery
response
= receiveXMLWrapper "CreateCacheSecurityGroupResult"
(\ s h x ->
CreateCacheSecurityGroupResponse' <$>
(x .@? "CacheSecurityGroup") <*> (pure (fromEnum s)))
instance ToHeaders CreateCacheSecurityGroup where
toHeaders = const mempty
instance ToPath CreateCacheSecurityGroup where
toPath = const "/"
instance ToQuery CreateCacheSecurityGroup where
toQuery CreateCacheSecurityGroup'{..}
= mconcat
["Action" =:
("CreateCacheSecurityGroup" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"CacheSecurityGroupName" =:
_ccsgCacheSecurityGroupName,
"Description" =: _ccsgDescription]
data CreateCacheSecurityGroupResponse = CreateCacheSecurityGroupResponse'
{ _ccsgrsCacheSecurityGroup :: !(Maybe CacheSecurityGroup)
, _ccsgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCacheSecurityGroupResponse
:: Int
-> CreateCacheSecurityGroupResponse
createCacheSecurityGroupResponse pStatus_ =
CreateCacheSecurityGroupResponse'
{ _ccsgrsCacheSecurityGroup = Nothing
, _ccsgrsStatus = pStatus_
}
ccsgrsCacheSecurityGroup :: Lens' CreateCacheSecurityGroupResponse (Maybe CacheSecurityGroup)
ccsgrsCacheSecurityGroup = lens _ccsgrsCacheSecurityGroup (\ s a -> s{_ccsgrsCacheSecurityGroup = a});
ccsgrsStatus :: Lens' CreateCacheSecurityGroupResponse Int
ccsgrsStatus = lens _ccsgrsStatus (\ s a -> s{_ccsgrsStatus = a});