module Network.AWS.RDS.DescribeDBParameterGroups
(
DescribeDBParameterGroups
, describeDBParameterGroups
, ddbpgDBParameterGroupName
, ddbpgFilters
, ddbpgMarker
, ddbpgMaxRecords
, DescribeDBParameterGroupsResponse
, describeDBParameterGroupsResponse
, ddbpgrDBParameterGroups
, ddbpgrMarker
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data DescribeDBParameterGroups = DescribeDBParameterGroups
{ _ddbpgDBParameterGroupName :: Maybe Text
, _ddbpgFilters :: List "Filter" Filter
, _ddbpgMarker :: Maybe Text
, _ddbpgMaxRecords :: Maybe Int
} deriving (Eq, Show)
describeDBParameterGroups :: DescribeDBParameterGroups
describeDBParameterGroups = DescribeDBParameterGroups
{ _ddbpgDBParameterGroupName = Nothing
, _ddbpgFilters = mempty
, _ddbpgMaxRecords = Nothing
, _ddbpgMarker = Nothing
}
ddbpgDBParameterGroupName :: Lens' DescribeDBParameterGroups (Maybe Text)
ddbpgDBParameterGroupName =
lens _ddbpgDBParameterGroupName
(\s a -> s { _ddbpgDBParameterGroupName = a })
ddbpgFilters :: Lens' DescribeDBParameterGroups [Filter]
ddbpgFilters = lens _ddbpgFilters (\s a -> s { _ddbpgFilters = a }) . _List
ddbpgMarker :: Lens' DescribeDBParameterGroups (Maybe Text)
ddbpgMarker = lens _ddbpgMarker (\s a -> s { _ddbpgMarker = a })
ddbpgMaxRecords :: Lens' DescribeDBParameterGroups (Maybe Int)
ddbpgMaxRecords = lens _ddbpgMaxRecords (\s a -> s { _ddbpgMaxRecords = a })
data DescribeDBParameterGroupsResponse = DescribeDBParameterGroupsResponse
{ _ddbpgrDBParameterGroups :: List "DBParameterGroup" DBParameterGroup
, _ddbpgrMarker :: Maybe Text
} deriving (Eq, Show)
describeDBParameterGroupsResponse :: DescribeDBParameterGroupsResponse
describeDBParameterGroupsResponse = DescribeDBParameterGroupsResponse
{ _ddbpgrMarker = Nothing
, _ddbpgrDBParameterGroups = mempty
}
ddbpgrDBParameterGroups :: Lens' DescribeDBParameterGroupsResponse [DBParameterGroup]
ddbpgrDBParameterGroups =
lens _ddbpgrDBParameterGroups (\s a -> s { _ddbpgrDBParameterGroups = a })
. _List
ddbpgrMarker :: Lens' DescribeDBParameterGroupsResponse (Maybe Text)
ddbpgrMarker = lens _ddbpgrMarker (\s a -> s { _ddbpgrMarker = a })
instance ToPath DescribeDBParameterGroups where
toPath = const "/"
instance ToQuery DescribeDBParameterGroups where
toQuery DescribeDBParameterGroups{..} = mconcat
[ "DBParameterGroupName" =? _ddbpgDBParameterGroupName
, "Filters" =? _ddbpgFilters
, "Marker" =? _ddbpgMarker
, "MaxRecords" =? _ddbpgMaxRecords
]
instance ToHeaders DescribeDBParameterGroups
instance AWSRequest DescribeDBParameterGroups where
type Sv DescribeDBParameterGroups = RDS
type Rs DescribeDBParameterGroups = DescribeDBParameterGroupsResponse
request = post "DescribeDBParameterGroups"
response = xmlResponse
instance FromXML DescribeDBParameterGroupsResponse where
parseXML = withElement "DescribeDBParameterGroupsResult" $ \x -> DescribeDBParameterGroupsResponse
<$> x .@ "DBParameterGroups"
<*> x .@? "Marker"
instance AWSPager DescribeDBParameterGroups where
page rq rs
| stop (rq ^. ddbpgMarker) = Nothing
| otherwise = (\x -> rq & ddbpgMarker ?~ x)
<$> (rs ^. ddbpgrMarker)