{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.WAF.ListSqlInjectionMatchSets
(
listSqlInjectionMatchSets
, ListSqlInjectionMatchSets
, lsimsNextMarker
, lsimsLimit
, listSqlInjectionMatchSetsResponse
, ListSqlInjectionMatchSetsResponse
, lsimsrsNextMarker
, lsimsrsSqlInjectionMatchSets
, lsimsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WAF.Types
import Network.AWS.WAF.Types.Product
data ListSqlInjectionMatchSets = ListSqlInjectionMatchSets'
{ _lsimsNextMarker :: !(Maybe Text)
, _lsimsLimit :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listSqlInjectionMatchSets
:: ListSqlInjectionMatchSets
listSqlInjectionMatchSets =
ListSqlInjectionMatchSets' {_lsimsNextMarker = Nothing, _lsimsLimit = Nothing}
lsimsNextMarker :: Lens' ListSqlInjectionMatchSets (Maybe Text)
lsimsNextMarker = lens _lsimsNextMarker (\ s a -> s{_lsimsNextMarker = a})
lsimsLimit :: Lens' ListSqlInjectionMatchSets (Maybe Natural)
lsimsLimit = lens _lsimsLimit (\ s a -> s{_lsimsLimit = a}) . mapping _Nat
instance AWSPager ListSqlInjectionMatchSets where
page rq rs
| stop (rs ^. lsimsrsNextMarker) = Nothing
| stop (rs ^. lsimsrsSqlInjectionMatchSets) = Nothing
| otherwise =
Just $ rq &
lsimsNextMarker .~ rs ^. lsimsrsNextMarker
instance AWSRequest ListSqlInjectionMatchSets where
type Rs ListSqlInjectionMatchSets =
ListSqlInjectionMatchSetsResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
ListSqlInjectionMatchSetsResponse' <$>
(x .?> "NextMarker") <*>
(x .?> "SqlInjectionMatchSets" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListSqlInjectionMatchSets where
instance NFData ListSqlInjectionMatchSets where
instance ToHeaders ListSqlInjectionMatchSets where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.ListSqlInjectionMatchSets" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListSqlInjectionMatchSets where
toJSON ListSqlInjectionMatchSets'{..}
= object
(catMaybes
[("NextMarker" .=) <$> _lsimsNextMarker,
("Limit" .=) <$> _lsimsLimit])
instance ToPath ListSqlInjectionMatchSets where
toPath = const "/"
instance ToQuery ListSqlInjectionMatchSets where
toQuery = const mempty
data ListSqlInjectionMatchSetsResponse = ListSqlInjectionMatchSetsResponse'
{ _lsimsrsNextMarker :: !(Maybe Text)
, _lsimsrsSqlInjectionMatchSets :: !(Maybe [SqlInjectionMatchSetSummary])
, _lsimsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listSqlInjectionMatchSetsResponse
:: Int
-> ListSqlInjectionMatchSetsResponse
listSqlInjectionMatchSetsResponse pResponseStatus_ =
ListSqlInjectionMatchSetsResponse'
{ _lsimsrsNextMarker = Nothing
, _lsimsrsSqlInjectionMatchSets = Nothing
, _lsimsrsResponseStatus = pResponseStatus_
}
lsimsrsNextMarker :: Lens' ListSqlInjectionMatchSetsResponse (Maybe Text)
lsimsrsNextMarker = lens _lsimsrsNextMarker (\ s a -> s{_lsimsrsNextMarker = a})
lsimsrsSqlInjectionMatchSets :: Lens' ListSqlInjectionMatchSetsResponse [SqlInjectionMatchSetSummary]
lsimsrsSqlInjectionMatchSets = lens _lsimsrsSqlInjectionMatchSets (\ s a -> s{_lsimsrsSqlInjectionMatchSets = a}) . _Default . _Coerce
lsimsrsResponseStatus :: Lens' ListSqlInjectionMatchSetsResponse Int
lsimsrsResponseStatus = lens _lsimsrsResponseStatus (\ s a -> s{_lsimsrsResponseStatus = a})
instance NFData ListSqlInjectionMatchSetsResponse
where