module Network.AWS.RDS.DescribeDBSecurityGroups
(
DescribeDBSecurityGroups
, describeDBSecurityGroups
, ddbsg1DBSecurityGroupName
, ddbsg1Filters
, ddbsg1Marker
, ddbsg1MaxRecords
, DescribeDBSecurityGroupsResponse
, describeDBSecurityGroupsResponse
, ddbsgr1DBSecurityGroups
, ddbsgr1Marker
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data DescribeDBSecurityGroups = DescribeDBSecurityGroups
{ _ddbsg1DBSecurityGroupName :: Maybe Text
, _ddbsg1Filters :: List "member" Filter
, _ddbsg1Marker :: Maybe Text
, _ddbsg1MaxRecords :: Maybe Int
} deriving (Eq, Show)
describeDBSecurityGroups :: DescribeDBSecurityGroups
describeDBSecurityGroups = DescribeDBSecurityGroups
{ _ddbsg1DBSecurityGroupName = Nothing
, _ddbsg1Filters = mempty
, _ddbsg1MaxRecords = Nothing
, _ddbsg1Marker = Nothing
}
ddbsg1DBSecurityGroupName :: Lens' DescribeDBSecurityGroups (Maybe Text)
ddbsg1DBSecurityGroupName =
lens _ddbsg1DBSecurityGroupName
(\s a -> s { _ddbsg1DBSecurityGroupName = a })
ddbsg1Filters :: Lens' DescribeDBSecurityGroups [Filter]
ddbsg1Filters = lens _ddbsg1Filters (\s a -> s { _ddbsg1Filters = a }) . _List
ddbsg1Marker :: Lens' DescribeDBSecurityGroups (Maybe Text)
ddbsg1Marker = lens _ddbsg1Marker (\s a -> s { _ddbsg1Marker = a })
ddbsg1MaxRecords :: Lens' DescribeDBSecurityGroups (Maybe Int)
ddbsg1MaxRecords = lens _ddbsg1MaxRecords (\s a -> s { _ddbsg1MaxRecords = a })
data DescribeDBSecurityGroupsResponse = DescribeDBSecurityGroupsResponse
{ _ddbsgr1DBSecurityGroups :: List "member" DBSecurityGroup
, _ddbsgr1Marker :: Maybe Text
} deriving (Eq, Show)
describeDBSecurityGroupsResponse :: DescribeDBSecurityGroupsResponse
describeDBSecurityGroupsResponse = DescribeDBSecurityGroupsResponse
{ _ddbsgr1Marker = Nothing
, _ddbsgr1DBSecurityGroups = mempty
}
ddbsgr1DBSecurityGroups :: Lens' DescribeDBSecurityGroupsResponse [DBSecurityGroup]
ddbsgr1DBSecurityGroups =
lens _ddbsgr1DBSecurityGroups (\s a -> s { _ddbsgr1DBSecurityGroups = a })
. _List
ddbsgr1Marker :: Lens' DescribeDBSecurityGroupsResponse (Maybe Text)
ddbsgr1Marker = lens _ddbsgr1Marker (\s a -> s { _ddbsgr1Marker = a })
instance ToPath DescribeDBSecurityGroups where
toPath = const "/"
instance ToQuery DescribeDBSecurityGroups where
toQuery DescribeDBSecurityGroups{..} = mconcat
[ "DBSecurityGroupName" =? _ddbsg1DBSecurityGroupName
, "Filters" =? _ddbsg1Filters
, "Marker" =? _ddbsg1Marker
, "MaxRecords" =? _ddbsg1MaxRecords
]
instance ToHeaders DescribeDBSecurityGroups
instance AWSRequest DescribeDBSecurityGroups where
type Sv DescribeDBSecurityGroups = RDS
type Rs DescribeDBSecurityGroups = DescribeDBSecurityGroupsResponse
request = post "DescribeDBSecurityGroups"
response = xmlResponse
instance FromXML DescribeDBSecurityGroupsResponse where
parseXML = withElement "DescribeDBSecurityGroupsResult" $ \x -> DescribeDBSecurityGroupsResponse
<$> x .@? "DBSecurityGroups" .!@ mempty
<*> x .@? "Marker"
instance AWSPager DescribeDBSecurityGroups where
page rq rs
| stop (rq ^. ddbsg1Marker) = Nothing
| otherwise = (\x -> rq & ddbsg1Marker ?~ x)
<$> (rs ^. ddbsgr1Marker)