module Network.AWS.Redshift.DescribeEventCategories
(
DescribeEventCategories
, describeEventCategories
, decSourceType
, DescribeEventCategoriesResponse
, describeEventCategoriesResponse
, decrEventCategoriesMapList
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
newtype DescribeEventCategories = DescribeEventCategories
{ _decSourceType :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
describeEventCategories :: DescribeEventCategories
describeEventCategories = DescribeEventCategories
{ _decSourceType = Nothing
}
decSourceType :: Lens' DescribeEventCategories (Maybe Text)
decSourceType = lens _decSourceType (\s a -> s { _decSourceType = a })
newtype DescribeEventCategoriesResponse = DescribeEventCategoriesResponse
{ _decrEventCategoriesMapList :: List "member" EventCategoriesMap
} deriving (Eq, Read, Show, Monoid, Semigroup)
instance GHC.Exts.IsList DescribeEventCategoriesResponse where
type Item DescribeEventCategoriesResponse = EventCategoriesMap
fromList = DescribeEventCategoriesResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _decrEventCategoriesMapList
describeEventCategoriesResponse :: DescribeEventCategoriesResponse
describeEventCategoriesResponse = DescribeEventCategoriesResponse
{ _decrEventCategoriesMapList = mempty
}
decrEventCategoriesMapList :: Lens' DescribeEventCategoriesResponse [EventCategoriesMap]
decrEventCategoriesMapList =
lens _decrEventCategoriesMapList
(\s a -> s { _decrEventCategoriesMapList = a })
. _List
instance ToPath DescribeEventCategories where
toPath = const "/"
instance ToQuery DescribeEventCategories where
toQuery DescribeEventCategories{..} = mconcat
[ "SourceType" =? _decSourceType
]
instance ToHeaders DescribeEventCategories
instance AWSRequest DescribeEventCategories where
type Sv DescribeEventCategories = Redshift
type Rs DescribeEventCategories = DescribeEventCategoriesResponse
request = post "DescribeEventCategories"
response = xmlResponse
instance FromXML DescribeEventCategoriesResponse where
parseXML = withElement "DescribeEventCategoriesResult" $ \x -> DescribeEventCategoriesResponse
<$> x .@? "EventCategoriesMapList" .!@ mempty