module Network.AWS.RDS.CreateDBSecurityGroup
(
CreateDBSecurityGroup
, createDBSecurityGroup
, cdbsgDBSecurityGroupDescription
, cdbsgDBSecurityGroupName
, cdbsgTags
, CreateDBSecurityGroupResponse
, createDBSecurityGroupResponse
, cdbsgrDBSecurityGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data CreateDBSecurityGroup = CreateDBSecurityGroup
{ _cdbsgDBSecurityGroupDescription :: Text
, _cdbsgDBSecurityGroupName :: Text
, _cdbsgTags :: List "Tag" Tag
} deriving (Eq, Show)
createDBSecurityGroup :: Text
-> Text
-> CreateDBSecurityGroup
createDBSecurityGroup p1 p2 = CreateDBSecurityGroup
{ _cdbsgDBSecurityGroupName = p1
, _cdbsgDBSecurityGroupDescription = p2
, _cdbsgTags = mempty
}
cdbsgDBSecurityGroupDescription :: Lens' CreateDBSecurityGroup Text
cdbsgDBSecurityGroupDescription =
lens _cdbsgDBSecurityGroupDescription
(\s a -> s { _cdbsgDBSecurityGroupDescription = a })
cdbsgDBSecurityGroupName :: Lens' CreateDBSecurityGroup Text
cdbsgDBSecurityGroupName =
lens _cdbsgDBSecurityGroupName
(\s a -> s { _cdbsgDBSecurityGroupName = a })
cdbsgTags :: Lens' CreateDBSecurityGroup [Tag]
cdbsgTags = lens _cdbsgTags (\s a -> s { _cdbsgTags = a }) . _List
newtype CreateDBSecurityGroupResponse = CreateDBSecurityGroupResponse
{ _cdbsgrDBSecurityGroup :: Maybe DBSecurityGroup
} deriving (Eq, Show)
createDBSecurityGroupResponse :: CreateDBSecurityGroupResponse
createDBSecurityGroupResponse = CreateDBSecurityGroupResponse
{ _cdbsgrDBSecurityGroup = Nothing
}
cdbsgrDBSecurityGroup :: Lens' CreateDBSecurityGroupResponse (Maybe DBSecurityGroup)
cdbsgrDBSecurityGroup =
lens _cdbsgrDBSecurityGroup (\s a -> s { _cdbsgrDBSecurityGroup = a })
instance ToPath CreateDBSecurityGroup where
toPath = const "/"
instance ToQuery CreateDBSecurityGroup where
toQuery CreateDBSecurityGroup{..} = mconcat
[ "DBSecurityGroupDescription" =? _cdbsgDBSecurityGroupDescription
, "DBSecurityGroupName" =? _cdbsgDBSecurityGroupName
, "Tags" =? _cdbsgTags
]
instance ToHeaders CreateDBSecurityGroup
instance AWSRequest CreateDBSecurityGroup where
type Sv CreateDBSecurityGroup = RDS
type Rs CreateDBSecurityGroup = CreateDBSecurityGroupResponse
request = post "CreateDBSecurityGroup"
response = xmlResponse
instance FromXML CreateDBSecurityGroupResponse where
parseXML = withElement "CreateDBSecurityGroupResult" $ \x -> CreateDBSecurityGroupResponse
<$> x .@? "DBSecurityGroup"