module Network.AWS.RDS.CreateDBSecurityGroup
(
createDBSecurityGroup
, CreateDBSecurityGroup
, cdsgTags
, cdsgDBSecurityGroupName
, cdsgDBSecurityGroupDescription
, createDBSecurityGroupResponse
, CreateDBSecurityGroupResponse
, cdbsgrsDBSecurityGroup
, cdbsgrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateDBSecurityGroup = CreateDBSecurityGroup'
{ _cdsgTags :: !(Maybe [Tag])
, _cdsgDBSecurityGroupName :: !Text
, _cdsgDBSecurityGroupDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSecurityGroup
:: Text
-> Text
-> CreateDBSecurityGroup
createDBSecurityGroup pDBSecurityGroupName_ pDBSecurityGroupDescription_ =
CreateDBSecurityGroup'
{ _cdsgTags = Nothing
, _cdsgDBSecurityGroupName = pDBSecurityGroupName_
, _cdsgDBSecurityGroupDescription = pDBSecurityGroupDescription_
}
cdsgTags :: Lens' CreateDBSecurityGroup [Tag]
cdsgTags = lens _cdsgTags (\ s a -> s{_cdsgTags = a}) . _Default . _Coerce;
cdsgDBSecurityGroupName :: Lens' CreateDBSecurityGroup Text
cdsgDBSecurityGroupName = lens _cdsgDBSecurityGroupName (\ s a -> s{_cdsgDBSecurityGroupName = a});
cdsgDBSecurityGroupDescription :: Lens' CreateDBSecurityGroup Text
cdsgDBSecurityGroupDescription = lens _cdsgDBSecurityGroupDescription (\ s a -> s{_cdsgDBSecurityGroupDescription = a});
instance AWSRequest CreateDBSecurityGroup where
type Sv CreateDBSecurityGroup = RDS
type Rs CreateDBSecurityGroup =
CreateDBSecurityGroupResponse
request = postQuery
response
= receiveXMLWrapper "CreateDBSecurityGroupResult"
(\ s h x ->
CreateDBSecurityGroupResponse' <$>
(x .@? "DBSecurityGroup") <*> (pure (fromEnum s)))
instance ToHeaders CreateDBSecurityGroup where
toHeaders = const mempty
instance ToPath CreateDBSecurityGroup where
toPath = const "/"
instance ToQuery CreateDBSecurityGroup where
toQuery CreateDBSecurityGroup'{..}
= mconcat
["Action" =: ("CreateDBSecurityGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdsgTags),
"DBSecurityGroupName" =: _cdsgDBSecurityGroupName,
"DBSecurityGroupDescription" =:
_cdsgDBSecurityGroupDescription]
data CreateDBSecurityGroupResponse = CreateDBSecurityGroupResponse'
{ _cdbsgrsDBSecurityGroup :: !(Maybe DBSecurityGroup)
, _cdbsgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSecurityGroupResponse
:: Int
-> CreateDBSecurityGroupResponse
createDBSecurityGroupResponse pStatus_ =
CreateDBSecurityGroupResponse'
{ _cdbsgrsDBSecurityGroup = Nothing
, _cdbsgrsStatus = pStatus_
}
cdbsgrsDBSecurityGroup :: Lens' CreateDBSecurityGroupResponse (Maybe DBSecurityGroup)
cdbsgrsDBSecurityGroup = lens _cdbsgrsDBSecurityGroup (\ s a -> s{_cdbsgrsDBSecurityGroup = a});
cdbsgrsStatus :: Lens' CreateDBSecurityGroupResponse Int
cdbsgrsStatus = lens _cdbsgrsStatus (\ s a -> s{_cdbsgrsStatus = a});