module Network.AWS.RDS.DescribeOptionGroups
(
DescribeOptionGroups
, describeOptionGroups
, dogEngineName
, dogFilters
, dogMajorEngineVersion
, dogMarker
, dogMaxRecords
, dogOptionGroupName
, DescribeOptionGroupsResponse
, describeOptionGroupsResponse
, dogrMarker
, dogrOptionGroupsList
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data DescribeOptionGroups = DescribeOptionGroups
{ _dogEngineName :: Maybe Text
, _dogFilters :: List "member" Filter
, _dogMajorEngineVersion :: Maybe Text
, _dogMarker :: Maybe Text
, _dogMaxRecords :: Maybe Int
, _dogOptionGroupName :: Maybe Text
} deriving (Eq, Read, Show)
describeOptionGroups :: DescribeOptionGroups
describeOptionGroups = DescribeOptionGroups
{ _dogOptionGroupName = Nothing
, _dogFilters = mempty
, _dogMarker = Nothing
, _dogMaxRecords = Nothing
, _dogEngineName = Nothing
, _dogMajorEngineVersion = Nothing
}
dogEngineName :: Lens' DescribeOptionGroups (Maybe Text)
dogEngineName = lens _dogEngineName (\s a -> s { _dogEngineName = a })
dogFilters :: Lens' DescribeOptionGroups [Filter]
dogFilters = lens _dogFilters (\s a -> s { _dogFilters = a }) . _List
dogMajorEngineVersion :: Lens' DescribeOptionGroups (Maybe Text)
dogMajorEngineVersion =
lens _dogMajorEngineVersion (\s a -> s { _dogMajorEngineVersion = a })
dogMarker :: Lens' DescribeOptionGroups (Maybe Text)
dogMarker = lens _dogMarker (\s a -> s { _dogMarker = a })
dogMaxRecords :: Lens' DescribeOptionGroups (Maybe Int)
dogMaxRecords = lens _dogMaxRecords (\s a -> s { _dogMaxRecords = a })
dogOptionGroupName :: Lens' DescribeOptionGroups (Maybe Text)
dogOptionGroupName =
lens _dogOptionGroupName (\s a -> s { _dogOptionGroupName = a })
data DescribeOptionGroupsResponse = DescribeOptionGroupsResponse
{ _dogrMarker :: Maybe Text
, _dogrOptionGroupsList :: List "member" OptionGroup
} deriving (Eq, Read, Show)
describeOptionGroupsResponse :: DescribeOptionGroupsResponse
describeOptionGroupsResponse = DescribeOptionGroupsResponse
{ _dogrOptionGroupsList = mempty
, _dogrMarker = Nothing
}
dogrMarker :: Lens' DescribeOptionGroupsResponse (Maybe Text)
dogrMarker = lens _dogrMarker (\s a -> s { _dogrMarker = a })
dogrOptionGroupsList :: Lens' DescribeOptionGroupsResponse [OptionGroup]
dogrOptionGroupsList =
lens _dogrOptionGroupsList (\s a -> s { _dogrOptionGroupsList = a })
. _List
instance ToPath DescribeOptionGroups where
toPath = const "/"
instance ToQuery DescribeOptionGroups where
toQuery DescribeOptionGroups{..} = mconcat
[ "EngineName" =? _dogEngineName
, "Filters" =? _dogFilters
, "MajorEngineVersion" =? _dogMajorEngineVersion
, "Marker" =? _dogMarker
, "MaxRecords" =? _dogMaxRecords
, "OptionGroupName" =? _dogOptionGroupName
]
instance ToHeaders DescribeOptionGroups
instance AWSRequest DescribeOptionGroups where
type Sv DescribeOptionGroups = RDS
type Rs DescribeOptionGroups = DescribeOptionGroupsResponse
request = post "DescribeOptionGroups"
response = xmlResponse
instance FromXML DescribeOptionGroupsResponse where
parseXML = withElement "DescribeOptionGroupsResult" $ \x -> DescribeOptionGroupsResponse
<$> x .@? "Marker"
<*> x .@? "OptionGroupsList" .!@ mempty
instance AWSPager DescribeOptionGroups where
page rq rs
| stop (rs ^. dogrMarker) = Nothing
| otherwise = (\x -> rq & dogMarker ?~ x)
<$> (rs ^. dogrMarker)