module Network.AWS.RDS.DescribeOptionGroupOptions
(
DescribeOptionGroupOptions
, describeOptionGroupOptions
, dogoEngineName
, dogoFilters
, dogoMajorEngineVersion
, dogoMarker
, dogoMaxRecords
, DescribeOptionGroupOptionsResponse
, describeOptionGroupOptionsResponse
, dogorMarker
, dogorOptionGroupOptions
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.RDS.Types
import qualified GHC.Exts
data DescribeOptionGroupOptions = DescribeOptionGroupOptions
{ _dogoEngineName :: Text
, _dogoFilters :: List "member" Filter
, _dogoMajorEngineVersion :: Maybe Text
, _dogoMarker :: Maybe Text
, _dogoMaxRecords :: Maybe Int
} deriving (Eq, Show)
describeOptionGroupOptions :: Text
-> DescribeOptionGroupOptions
describeOptionGroupOptions p1 = DescribeOptionGroupOptions
{ _dogoEngineName = p1
, _dogoMajorEngineVersion = Nothing
, _dogoFilters = mempty
, _dogoMaxRecords = Nothing
, _dogoMarker = Nothing
}
dogoEngineName :: Lens' DescribeOptionGroupOptions Text
dogoEngineName = lens _dogoEngineName (\s a -> s { _dogoEngineName = a })
dogoFilters :: Lens' DescribeOptionGroupOptions [Filter]
dogoFilters = lens _dogoFilters (\s a -> s { _dogoFilters = a }) . _List
dogoMajorEngineVersion :: Lens' DescribeOptionGroupOptions (Maybe Text)
dogoMajorEngineVersion =
lens _dogoMajorEngineVersion (\s a -> s { _dogoMajorEngineVersion = a })
dogoMarker :: Lens' DescribeOptionGroupOptions (Maybe Text)
dogoMarker = lens _dogoMarker (\s a -> s { _dogoMarker = a })
dogoMaxRecords :: Lens' DescribeOptionGroupOptions (Maybe Int)
dogoMaxRecords = lens _dogoMaxRecords (\s a -> s { _dogoMaxRecords = a })
data DescribeOptionGroupOptionsResponse = DescribeOptionGroupOptionsResponse
{ _dogorMarker :: Maybe Text
, _dogorOptionGroupOptions :: List "member" OptionGroupOption
} deriving (Eq, Show)
describeOptionGroupOptionsResponse :: DescribeOptionGroupOptionsResponse
describeOptionGroupOptionsResponse = DescribeOptionGroupOptionsResponse
{ _dogorOptionGroupOptions = mempty
, _dogorMarker = Nothing
}
dogorMarker :: Lens' DescribeOptionGroupOptionsResponse (Maybe Text)
dogorMarker = lens _dogorMarker (\s a -> s { _dogorMarker = a })
dogorOptionGroupOptions :: Lens' DescribeOptionGroupOptionsResponse [OptionGroupOption]
dogorOptionGroupOptions =
lens _dogorOptionGroupOptions (\s a -> s { _dogorOptionGroupOptions = a })
. _List
instance ToPath DescribeOptionGroupOptions where
toPath = const "/"
instance ToQuery DescribeOptionGroupOptions where
toQuery DescribeOptionGroupOptions{..} = mconcat
[ "EngineName" =? _dogoEngineName
, "Filters" =? _dogoFilters
, "MajorEngineVersion" =? _dogoMajorEngineVersion
, "Marker" =? _dogoMarker
, "MaxRecords" =? _dogoMaxRecords
]
instance ToHeaders DescribeOptionGroupOptions
instance AWSRequest DescribeOptionGroupOptions where
type Sv DescribeOptionGroupOptions = RDS
type Rs DescribeOptionGroupOptions = DescribeOptionGroupOptionsResponse
request = post "DescribeOptionGroupOptions"
response = xmlResponse
instance FromXML DescribeOptionGroupOptionsResponse where
parseXML = withElement "DescribeOptionGroupOptionsResult" $ \x -> DescribeOptionGroupOptionsResponse
<$> x .@? "Marker"
<*> x .@? "OptionGroupOptions" .!@ mempty
instance AWSPager DescribeOptionGroupOptions where
page rq rs
| stop (rq ^. dogoMarker) = Nothing
| otherwise = (\x -> rq & dogoMarker ?~ x)
<$> (rs ^. dogorMarker)