{-# 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.GetRateBasedRuleManagedKeys
(
getRateBasedRuleManagedKeys
, GetRateBasedRuleManagedKeys
, grbrmkNextMarker
, grbrmkRuleId
, getRateBasedRuleManagedKeysResponse
, GetRateBasedRuleManagedKeysResponse
, grbrmkrsNextMarker
, grbrmkrsManagedKeys
, grbrmkrsResponseStatus
) 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 GetRateBasedRuleManagedKeys = GetRateBasedRuleManagedKeys'
{ _grbrmkNextMarker :: !(Maybe Text)
, _grbrmkRuleId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRateBasedRuleManagedKeys
:: Text
-> GetRateBasedRuleManagedKeys
getRateBasedRuleManagedKeys pRuleId_ =
GetRateBasedRuleManagedKeys'
{_grbrmkNextMarker = Nothing, _grbrmkRuleId = pRuleId_}
grbrmkNextMarker :: Lens' GetRateBasedRuleManagedKeys (Maybe Text)
grbrmkNextMarker = lens _grbrmkNextMarker (\ s a -> s{_grbrmkNextMarker = a})
grbrmkRuleId :: Lens' GetRateBasedRuleManagedKeys Text
grbrmkRuleId = lens _grbrmkRuleId (\ s a -> s{_grbrmkRuleId = a})
instance AWSRequest GetRateBasedRuleManagedKeys where
type Rs GetRateBasedRuleManagedKeys =
GetRateBasedRuleManagedKeysResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetRateBasedRuleManagedKeysResponse' <$>
(x .?> "NextMarker") <*>
(x .?> "ManagedKeys" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable GetRateBasedRuleManagedKeys where
instance NFData GetRateBasedRuleManagedKeys where
instance ToHeaders GetRateBasedRuleManagedKeys where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetRateBasedRuleManagedKeys" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetRateBasedRuleManagedKeys where
toJSON GetRateBasedRuleManagedKeys'{..}
= object
(catMaybes
[("NextMarker" .=) <$> _grbrmkNextMarker,
Just ("RuleId" .= _grbrmkRuleId)])
instance ToPath GetRateBasedRuleManagedKeys where
toPath = const "/"
instance ToQuery GetRateBasedRuleManagedKeys where
toQuery = const mempty
data GetRateBasedRuleManagedKeysResponse = GetRateBasedRuleManagedKeysResponse'
{ _grbrmkrsNextMarker :: !(Maybe Text)
, _grbrmkrsManagedKeys :: !(Maybe [Text])
, _grbrmkrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRateBasedRuleManagedKeysResponse
:: Int
-> GetRateBasedRuleManagedKeysResponse
getRateBasedRuleManagedKeysResponse pResponseStatus_ =
GetRateBasedRuleManagedKeysResponse'
{ _grbrmkrsNextMarker = Nothing
, _grbrmkrsManagedKeys = Nothing
, _grbrmkrsResponseStatus = pResponseStatus_
}
grbrmkrsNextMarker :: Lens' GetRateBasedRuleManagedKeysResponse (Maybe Text)
grbrmkrsNextMarker = lens _grbrmkrsNextMarker (\ s a -> s{_grbrmkrsNextMarker = a})
grbrmkrsManagedKeys :: Lens' GetRateBasedRuleManagedKeysResponse [Text]
grbrmkrsManagedKeys = lens _grbrmkrsManagedKeys (\ s a -> s{_grbrmkrsManagedKeys = a}) . _Default . _Coerce
grbrmkrsResponseStatus :: Lens' GetRateBasedRuleManagedKeysResponse Int
grbrmkrsResponseStatus = lens _grbrmkrsResponseStatus (\ s a -> s{_grbrmkrsResponseStatus = a})
instance NFData GetRateBasedRuleManagedKeysResponse
where