{-# 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.GetByteMatchSet
(
getByteMatchSet
, GetByteMatchSet
, gbmsByteMatchSetId
, getByteMatchSetResponse
, GetByteMatchSetResponse
, gbmsrsByteMatchSet
, gbmsrsResponseStatus
) 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 GetByteMatchSet = GetByteMatchSet'
{ _gbmsByteMatchSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getByteMatchSet
:: Text
-> GetByteMatchSet
getByteMatchSet pByteMatchSetId_ =
GetByteMatchSet' {_gbmsByteMatchSetId = pByteMatchSetId_}
gbmsByteMatchSetId :: Lens' GetByteMatchSet Text
gbmsByteMatchSetId = lens _gbmsByteMatchSetId (\ s a -> s{_gbmsByteMatchSetId = a})
instance AWSRequest GetByteMatchSet where
type Rs GetByteMatchSet = GetByteMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetByteMatchSetResponse' <$>
(x .?> "ByteMatchSet") <*> (pure (fromEnum s)))
instance Hashable GetByteMatchSet where
instance NFData GetByteMatchSet where
instance ToHeaders GetByteMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetByteMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetByteMatchSet where
toJSON GetByteMatchSet'{..}
= object
(catMaybes
[Just ("ByteMatchSetId" .= _gbmsByteMatchSetId)])
instance ToPath GetByteMatchSet where
toPath = const "/"
instance ToQuery GetByteMatchSet where
toQuery = const mempty
data GetByteMatchSetResponse = GetByteMatchSetResponse'
{ _gbmsrsByteMatchSet :: !(Maybe ByteMatchSet)
, _gbmsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getByteMatchSetResponse
:: Int
-> GetByteMatchSetResponse
getByteMatchSetResponse pResponseStatus_ =
GetByteMatchSetResponse'
{_gbmsrsByteMatchSet = Nothing, _gbmsrsResponseStatus = pResponseStatus_}
gbmsrsByteMatchSet :: Lens' GetByteMatchSetResponse (Maybe ByteMatchSet)
gbmsrsByteMatchSet = lens _gbmsrsByteMatchSet (\ s a -> s{_gbmsrsByteMatchSet = a})
gbmsrsResponseStatus :: Lens' GetByteMatchSetResponse Int
gbmsrsResponseStatus = lens _gbmsrsResponseStatus (\ s a -> s{_gbmsrsResponseStatus = a})
instance NFData GetByteMatchSetResponse where