{-# 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.ListByteMatchSets
(
listByteMatchSets
, ListByteMatchSets
, lbmsNextMarker
, lbmsLimit
, listByteMatchSetsResponse
, ListByteMatchSetsResponse
, lbmsrsByteMatchSets
, lbmsrsNextMarker
, lbmsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WAF.Types
import Network.AWS.WAF.Types.Product
data ListByteMatchSets = ListByteMatchSets'
{ _lbmsNextMarker :: !(Maybe Text)
, _lbmsLimit :: !Nat
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listByteMatchSets
:: Natural
-> ListByteMatchSets
listByteMatchSets pLimit_ =
ListByteMatchSets'
{ _lbmsNextMarker = Nothing
, _lbmsLimit = _Nat # pLimit_
}
lbmsNextMarker :: Lens' ListByteMatchSets (Maybe Text)
lbmsNextMarker = lens _lbmsNextMarker (\ s a -> s{_lbmsNextMarker = a});
lbmsLimit :: Lens' ListByteMatchSets Natural
lbmsLimit = lens _lbmsLimit (\ s a -> s{_lbmsLimit = a}) . _Nat;
instance AWSRequest ListByteMatchSets where
type Rs ListByteMatchSets = ListByteMatchSetsResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
ListByteMatchSetsResponse' <$>
(x .?> "ByteMatchSets" .!@ mempty) <*>
(x .?> "NextMarker")
<*> (pure (fromEnum s)))
instance Hashable ListByteMatchSets
instance NFData ListByteMatchSets
instance ToHeaders ListByteMatchSets where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.ListByteMatchSets" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListByteMatchSets where
toJSON ListByteMatchSets'{..}
= object
(catMaybes
[("NextMarker" .=) <$> _lbmsNextMarker,
Just ("Limit" .= _lbmsLimit)])
instance ToPath ListByteMatchSets where
toPath = const "/"
instance ToQuery ListByteMatchSets where
toQuery = const mempty
data ListByteMatchSetsResponse = ListByteMatchSetsResponse'
{ _lbmsrsByteMatchSets :: !(Maybe [ByteMatchSetSummary])
, _lbmsrsNextMarker :: !(Maybe Text)
, _lbmsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listByteMatchSetsResponse
:: Int
-> ListByteMatchSetsResponse
listByteMatchSetsResponse pResponseStatus_ =
ListByteMatchSetsResponse'
{ _lbmsrsByteMatchSets = Nothing
, _lbmsrsNextMarker = Nothing
, _lbmsrsResponseStatus = pResponseStatus_
}
lbmsrsByteMatchSets :: Lens' ListByteMatchSetsResponse [ByteMatchSetSummary]
lbmsrsByteMatchSets = lens _lbmsrsByteMatchSets (\ s a -> s{_lbmsrsByteMatchSets = a}) . _Default . _Coerce;
lbmsrsNextMarker :: Lens' ListByteMatchSetsResponse (Maybe Text)
lbmsrsNextMarker = lens _lbmsrsNextMarker (\ s a -> s{_lbmsrsNextMarker = a});
lbmsrsResponseStatus :: Lens' ListByteMatchSetsResponse Int
lbmsrsResponseStatus = lens _lbmsrsResponseStatus (\ s a -> s{_lbmsrsResponseStatus = a});
instance NFData ListByteMatchSetsResponse