{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.RDS.CreateDBSecurityGroup
(
createDBSecurityGroup
, CreateDBSecurityGroup
, cdsgTags
, cdsgDBSecurityGroupName
, cdsgDBSecurityGroupDescription
, createDBSecurityGroupResponse
, CreateDBSecurityGroupResponse
, cdbsgrsDBSecurityGroup
, cdbsgrsResponseStatus
) where
import Network.AWS.Lens
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 Rs CreateDBSecurityGroup =
CreateDBSecurityGroupResponse
request = postQuery rds
response
= receiveXMLWrapper "CreateDBSecurityGroupResult"
(\ s h x ->
CreateDBSecurityGroupResponse' <$>
(x .@? "DBSecurityGroup") <*> (pure (fromEnum s)))
instance Hashable CreateDBSecurityGroup where
instance NFData CreateDBSecurityGroup where
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)
, _cdbsgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createDBSecurityGroupResponse
:: Int
-> CreateDBSecurityGroupResponse
createDBSecurityGroupResponse pResponseStatus_ =
CreateDBSecurityGroupResponse'
{ _cdbsgrsDBSecurityGroup = Nothing
, _cdbsgrsResponseStatus = pResponseStatus_
}
cdbsgrsDBSecurityGroup :: Lens' CreateDBSecurityGroupResponse (Maybe DBSecurityGroup)
cdbsgrsDBSecurityGroup = lens _cdbsgrsDBSecurityGroup (\ s a -> s{_cdbsgrsDBSecurityGroup = a})
cdbsgrsResponseStatus :: Lens' CreateDBSecurityGroupResponse Int
cdbsgrsResponseStatus = lens _cdbsgrsResponseStatus (\ s a -> s{_cdbsgrsResponseStatus = a})
instance NFData CreateDBSecurityGroupResponse where