module Network.AWS.RDS.DescribeEventCategories
(
describeEventCategories
, DescribeEventCategories
, decSourceType
, decFilters
, describeEventCategoriesResponse
, DescribeEventCategoriesResponse
, decrsEventCategoriesMapList
, decrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DescribeEventCategories = DescribeEventCategories'
{ _decSourceType :: !(Maybe Text)
, _decFilters :: !(Maybe [Filter])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeEventCategories
:: DescribeEventCategories
describeEventCategories =
DescribeEventCategories'
{ _decSourceType = Nothing
, _decFilters = Nothing
}
decSourceType :: Lens' DescribeEventCategories (Maybe Text)
decSourceType = lens _decSourceType (\ s a -> s{_decSourceType = a});
decFilters :: Lens' DescribeEventCategories [Filter]
decFilters = lens _decFilters (\ s a -> s{_decFilters = a}) . _Default . _Coerce;
instance AWSRequest DescribeEventCategories where
type Sv DescribeEventCategories = RDS
type Rs DescribeEventCategories =
DescribeEventCategoriesResponse
request = postQuery
response
= receiveXMLWrapper "DescribeEventCategoriesResult"
(\ s h x ->
DescribeEventCategoriesResponse' <$>
(x .@? "EventCategoriesMapList" .!@ mempty >>=
may (parseXMLList "EventCategoriesMap"))
<*> (pure (fromEnum s)))
instance ToHeaders DescribeEventCategories where
toHeaders = const mempty
instance ToPath DescribeEventCategories where
toPath = const "/"
instance ToQuery DescribeEventCategories where
toQuery DescribeEventCategories'{..}
= mconcat
["Action" =:
("DescribeEventCategories" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"SourceType" =: _decSourceType,
"Filters" =:
toQuery (toQueryList "Filter" <$> _decFilters)]
data DescribeEventCategoriesResponse = DescribeEventCategoriesResponse'
{ _decrsEventCategoriesMapList :: !(Maybe [EventCategoriesMap])
, _decrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeEventCategoriesResponse
:: Int
-> DescribeEventCategoriesResponse
describeEventCategoriesResponse pStatus_ =
DescribeEventCategoriesResponse'
{ _decrsEventCategoriesMapList = Nothing
, _decrsStatus = pStatus_
}
decrsEventCategoriesMapList :: Lens' DescribeEventCategoriesResponse [EventCategoriesMap]
decrsEventCategoriesMapList = lens _decrsEventCategoriesMapList (\ s a -> s{_decrsEventCategoriesMapList = a}) . _Default . _Coerce;
decrsStatus :: Lens' DescribeEventCategoriesResponse Int
decrsStatus = lens _decrsStatus (\ s a -> s{_decrsStatus = a});