module Network.AWS.RDS.DescribeDBSubnetGroups
(
DescribeDBSubnetGroups
, describeDBSubnetGroups
, ddbsgDBSubnetGroupName
, ddbsgFilters
, ddbsgMarker
, ddbsgMaxRecords
, DescribeDBSubnetGroupsResponse
, describeDBSubnetGroupsResponse
, ddbsgrDBSubnetGroups
, ddbsgrMarker
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data DescribeDBSubnetGroups = DescribeDBSubnetGroups
{ _ddbsgDBSubnetGroupName :: Maybe Text
, _ddbsgFilters :: List "Filter" Filter
, _ddbsgMarker :: Maybe Text
, _ddbsgMaxRecords :: Maybe Int
} deriving (Eq, Show)
describeDBSubnetGroups :: DescribeDBSubnetGroups
describeDBSubnetGroups = DescribeDBSubnetGroups
{ _ddbsgDBSubnetGroupName = Nothing
, _ddbsgFilters = mempty
, _ddbsgMaxRecords = Nothing
, _ddbsgMarker = Nothing
}
ddbsgDBSubnetGroupName :: Lens' DescribeDBSubnetGroups (Maybe Text)
ddbsgDBSubnetGroupName =
lens _ddbsgDBSubnetGroupName (\s a -> s { _ddbsgDBSubnetGroupName = a })
ddbsgFilters :: Lens' DescribeDBSubnetGroups [Filter]
ddbsgFilters = lens _ddbsgFilters (\s a -> s { _ddbsgFilters = a }) . _List
ddbsgMarker :: Lens' DescribeDBSubnetGroups (Maybe Text)
ddbsgMarker = lens _ddbsgMarker (\s a -> s { _ddbsgMarker = a })
ddbsgMaxRecords :: Lens' DescribeDBSubnetGroups (Maybe Int)
ddbsgMaxRecords = lens _ddbsgMaxRecords (\s a -> s { _ddbsgMaxRecords = a })
data DescribeDBSubnetGroupsResponse = DescribeDBSubnetGroupsResponse
{ _ddbsgrDBSubnetGroups :: List "DBSubnetGroup" DBSubnetGroup
, _ddbsgrMarker :: Maybe Text
} deriving (Eq, Show)
describeDBSubnetGroupsResponse :: DescribeDBSubnetGroupsResponse
describeDBSubnetGroupsResponse = DescribeDBSubnetGroupsResponse
{ _ddbsgrMarker = Nothing
, _ddbsgrDBSubnetGroups = mempty
}
ddbsgrDBSubnetGroups :: Lens' DescribeDBSubnetGroupsResponse [DBSubnetGroup]
ddbsgrDBSubnetGroups =
lens _ddbsgrDBSubnetGroups (\s a -> s { _ddbsgrDBSubnetGroups = a })
. _List
ddbsgrMarker :: Lens' DescribeDBSubnetGroupsResponse (Maybe Text)
ddbsgrMarker = lens _ddbsgrMarker (\s a -> s { _ddbsgrMarker = a })
instance ToPath DescribeDBSubnetGroups where
toPath = const "/"
instance ToQuery DescribeDBSubnetGroups where
toQuery DescribeDBSubnetGroups{..} = mconcat
[ "DBSubnetGroupName" =? _ddbsgDBSubnetGroupName
, "Filters" =? _ddbsgFilters
, "Marker" =? _ddbsgMarker
, "MaxRecords" =? _ddbsgMaxRecords
]
instance ToHeaders DescribeDBSubnetGroups
instance AWSRequest DescribeDBSubnetGroups where
type Sv DescribeDBSubnetGroups = RDS
type Rs DescribeDBSubnetGroups = DescribeDBSubnetGroupsResponse
request = post "DescribeDBSubnetGroups"
response = xmlResponse
instance FromXML DescribeDBSubnetGroupsResponse where
parseXML = withElement "DescribeDBSubnetGroupsResult" $ \x -> DescribeDBSubnetGroupsResponse
<$> x .@ "DBSubnetGroups"
<*> x .@? "Marker"
instance AWSPager DescribeDBSubnetGroups where
page rq rs
| stop (rq ^. ddbsgMarker) = Nothing
| otherwise = (\x -> rq & ddbsgMarker ?~ x)
<$> (rs ^. ddbsgrMarker)