{-# 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.GetIPSet
(
getIPSet
, GetIPSet
, gisIPSetId
, getIPSetResponse
, GetIPSetResponse
, gisrsIPSet
, gisrsResponseStatus
) 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
newtype GetIPSet = GetIPSet'
{ _gisIPSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIPSet
:: Text
-> GetIPSet
getIPSet pIPSetId_ = GetIPSet' {_gisIPSetId = pIPSetId_}
gisIPSetId :: Lens' GetIPSet Text
gisIPSetId = lens _gisIPSetId (\ s a -> s{_gisIPSetId = a})
instance AWSRequest GetIPSet where
type Rs GetIPSet = GetIPSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetIPSetResponse' <$>
(x .?> "IPSet") <*> (pure (fromEnum s)))
instance Hashable GetIPSet where
instance NFData GetIPSet where
instance ToHeaders GetIPSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetIPSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetIPSet where
toJSON GetIPSet'{..}
= object
(catMaybes [Just ("IPSetId" .= _gisIPSetId)])
instance ToPath GetIPSet where
toPath = const "/"
instance ToQuery GetIPSet where
toQuery = const mempty
data GetIPSetResponse = GetIPSetResponse'
{ _gisrsIPSet :: !(Maybe IPSet)
, _gisrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIPSetResponse
:: Int
-> GetIPSetResponse
getIPSetResponse pResponseStatus_ =
GetIPSetResponse'
{_gisrsIPSet = Nothing, _gisrsResponseStatus = pResponseStatus_}
gisrsIPSet :: Lens' GetIPSetResponse (Maybe IPSet)
gisrsIPSet = lens _gisrsIPSet (\ s a -> s{_gisrsIPSet = a})
gisrsResponseStatus :: Lens' GetIPSetResponse Int
gisrsResponseStatus = lens _gisrsResponseStatus (\ s a -> s{_gisrsResponseStatus = a})
instance NFData GetIPSetResponse where