module Network.AWS.RDS.DescribeOptionGroups
(
describeOptionGroups
, DescribeOptionGroups
, dogFilters
, dogEngineName
, dogMajorEngineVersion
, dogMaxRecords
, dogMarker
, dogOptionGroupName
, describeOptionGroupsResponse
, DescribeOptionGroupsResponse
, dogrsMarker
, dogrsOptionGroupsList
, dogrsStatus
) 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 DescribeOptionGroups = DescribeOptionGroups'
{ _dogFilters :: !(Maybe [Filter])
, _dogEngineName :: !(Maybe Text)
, _dogMajorEngineVersion :: !(Maybe Text)
, _dogMaxRecords :: !(Maybe Int)
, _dogMarker :: !(Maybe Text)
, _dogOptionGroupName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeOptionGroups
:: DescribeOptionGroups
describeOptionGroups =
DescribeOptionGroups'
{ _dogFilters = Nothing
, _dogEngineName = Nothing
, _dogMajorEngineVersion = Nothing
, _dogMaxRecords = Nothing
, _dogMarker = Nothing
, _dogOptionGroupName = Nothing
}
dogFilters :: Lens' DescribeOptionGroups [Filter]
dogFilters = lens _dogFilters (\ s a -> s{_dogFilters = a}) . _Default . _Coerce;
dogEngineName :: Lens' DescribeOptionGroups (Maybe Text)
dogEngineName = lens _dogEngineName (\ s a -> s{_dogEngineName = a});
dogMajorEngineVersion :: Lens' DescribeOptionGroups (Maybe Text)
dogMajorEngineVersion = lens _dogMajorEngineVersion (\ s a -> s{_dogMajorEngineVersion = a});
dogMaxRecords :: Lens' DescribeOptionGroups (Maybe Int)
dogMaxRecords = lens _dogMaxRecords (\ s a -> s{_dogMaxRecords = a});
dogMarker :: Lens' DescribeOptionGroups (Maybe Text)
dogMarker = lens _dogMarker (\ s a -> s{_dogMarker = a});
dogOptionGroupName :: Lens' DescribeOptionGroups (Maybe Text)
dogOptionGroupName = lens _dogOptionGroupName (\ s a -> s{_dogOptionGroupName = a});
instance AWSPager DescribeOptionGroups where
page rq rs
| stop (rs ^. dogrsMarker) = Nothing
| stop (rs ^. dogrsOptionGroupsList) = Nothing
| otherwise =
Just $ rq & dogMarker .~ rs ^. dogrsMarker
instance AWSRequest DescribeOptionGroups where
type Sv DescribeOptionGroups = RDS
type Rs DescribeOptionGroups =
DescribeOptionGroupsResponse
request = postQuery
response
= receiveXMLWrapper "DescribeOptionGroupsResult"
(\ s h x ->
DescribeOptionGroupsResponse' <$>
(x .@? "Marker") <*>
(x .@? "OptionGroupsList" .!@ mempty >>=
may (parseXMLList "OptionGroup"))
<*> (pure (fromEnum s)))
instance ToHeaders DescribeOptionGroups where
toHeaders = const mempty
instance ToPath DescribeOptionGroups where
toPath = const "/"
instance ToQuery DescribeOptionGroups where
toQuery DescribeOptionGroups'{..}
= mconcat
["Action" =: ("DescribeOptionGroups" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Filters" =:
toQuery (toQueryList "Filter" <$> _dogFilters),
"EngineName" =: _dogEngineName,
"MajorEngineVersion" =: _dogMajorEngineVersion,
"MaxRecords" =: _dogMaxRecords,
"Marker" =: _dogMarker,
"OptionGroupName" =: _dogOptionGroupName]
data DescribeOptionGroupsResponse = DescribeOptionGroupsResponse'
{ _dogrsMarker :: !(Maybe Text)
, _dogrsOptionGroupsList :: !(Maybe [OptionGroup])
, _dogrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeOptionGroupsResponse
:: Int
-> DescribeOptionGroupsResponse
describeOptionGroupsResponse pStatus_ =
DescribeOptionGroupsResponse'
{ _dogrsMarker = Nothing
, _dogrsOptionGroupsList = Nothing
, _dogrsStatus = pStatus_
}
dogrsMarker :: Lens' DescribeOptionGroupsResponse (Maybe Text)
dogrsMarker = lens _dogrsMarker (\ s a -> s{_dogrsMarker = a});
dogrsOptionGroupsList :: Lens' DescribeOptionGroupsResponse [OptionGroup]
dogrsOptionGroupsList = lens _dogrsOptionGroupsList (\ s a -> s{_dogrsOptionGroupsList = a}) . _Default . _Coerce;
dogrsStatus :: Lens' DescribeOptionGroupsResponse Int
dogrsStatus = lens _dogrsStatus (\ s a -> s{_dogrsStatus = a});