module Network.AWS.RDS.DescribeDBParameterGroups
(
describeDBParameterGroups
, DescribeDBParameterGroups
, ddpgFilters
, ddpgDBParameterGroupName
, ddpgMaxRecords
, ddpgMarker
, describeDBParameterGroupsResponse
, DescribeDBParameterGroupsResponse
, ddpgrsMarker
, ddpgrsDBParameterGroups
, ddpgrsStatus
) where
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DescribeDBParameterGroups = DescribeDBParameterGroups'
{ _ddpgFilters :: !(Maybe [Filter])
, _ddpgDBParameterGroupName :: !(Maybe Text)
, _ddpgMaxRecords :: !(Maybe Int)
, _ddpgMarker :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeDBParameterGroups
:: DescribeDBParameterGroups
describeDBParameterGroups =
DescribeDBParameterGroups'
{ _ddpgFilters = Nothing
, _ddpgDBParameterGroupName = Nothing
, _ddpgMaxRecords = Nothing
, _ddpgMarker = Nothing
}
ddpgFilters :: Lens' DescribeDBParameterGroups [Filter]
ddpgFilters = lens _ddpgFilters (\ s a -> s{_ddpgFilters = a}) . _Default . _Coerce;
ddpgDBParameterGroupName :: Lens' DescribeDBParameterGroups (Maybe Text)
ddpgDBParameterGroupName = lens _ddpgDBParameterGroupName (\ s a -> s{_ddpgDBParameterGroupName = a});
ddpgMaxRecords :: Lens' DescribeDBParameterGroups (Maybe Int)
ddpgMaxRecords = lens _ddpgMaxRecords (\ s a -> s{_ddpgMaxRecords = a});
ddpgMarker :: Lens' DescribeDBParameterGroups (Maybe Text)
ddpgMarker = lens _ddpgMarker (\ s a -> s{_ddpgMarker = a});
instance AWSPager DescribeDBParameterGroups where
page rq rs
| stop (rs ^. ddpgrsMarker) = Nothing
| stop (rs ^. ddpgrsDBParameterGroups) = Nothing
| otherwise =
Just $ rq & ddpgMarker .~ rs ^. ddpgrsMarker
instance AWSRequest DescribeDBParameterGroups where
type Sv DescribeDBParameterGroups = RDS
type Rs DescribeDBParameterGroups =
DescribeDBParameterGroupsResponse
request = postQuery
response
= receiveXMLWrapper "DescribeDBParameterGroupsResult"
(\ s h x ->
DescribeDBParameterGroupsResponse' <$>
(x .@? "Marker") <*>
(x .@? "DBParameterGroups" .!@ mempty >>=
may (parseXMLList "DBParameterGroup"))
<*> (pure (fromEnum s)))
instance ToHeaders DescribeDBParameterGroups where
toHeaders = const mempty
instance ToPath DescribeDBParameterGroups where
toPath = const "/"
instance ToQuery DescribeDBParameterGroups where
toQuery DescribeDBParameterGroups'{..}
= mconcat
["Action" =:
("DescribeDBParameterGroups" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Filters" =:
toQuery (toQueryList "Filter" <$> _ddpgFilters),
"DBParameterGroupName" =: _ddpgDBParameterGroupName,
"MaxRecords" =: _ddpgMaxRecords,
"Marker" =: _ddpgMarker]
data DescribeDBParameterGroupsResponse = DescribeDBParameterGroupsResponse'
{ _ddpgrsMarker :: !(Maybe Text)
, _ddpgrsDBParameterGroups :: !(Maybe [DBParameterGroup])
, _ddpgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeDBParameterGroupsResponse
:: Int
-> DescribeDBParameterGroupsResponse
describeDBParameterGroupsResponse pStatus_ =
DescribeDBParameterGroupsResponse'
{ _ddpgrsMarker = Nothing
, _ddpgrsDBParameterGroups = Nothing
, _ddpgrsStatus = pStatus_
}
ddpgrsMarker :: Lens' DescribeDBParameterGroupsResponse (Maybe Text)
ddpgrsMarker = lens _ddpgrsMarker (\ s a -> s{_ddpgrsMarker = a});
ddpgrsDBParameterGroups :: Lens' DescribeDBParameterGroupsResponse [DBParameterGroup]
ddpgrsDBParameterGroups = lens _ddpgrsDBParameterGroups (\ s a -> s{_ddpgrsDBParameterGroups = a}) . _Default . _Coerce;
ddpgrsStatus :: Lens' DescribeDBParameterGroupsResponse Int
ddpgrsStatus = lens _ddpgrsStatus (\ s a -> s{_ddpgrsStatus = a});