{-# 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.CreateSqlInjectionMatchSet
(
createSqlInjectionMatchSet
, CreateSqlInjectionMatchSet
, csimsName
, csimsChangeToken
, createSqlInjectionMatchSetResponse
, CreateSqlInjectionMatchSetResponse
, csimsrsSqlInjectionMatchSet
, csimsrsChangeToken
, csimsrsResponseStatus
) 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 CreateSqlInjectionMatchSet = CreateSqlInjectionMatchSet'
{ _csimsName :: !Text
, _csimsChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSqlInjectionMatchSet
:: Text
-> Text
-> CreateSqlInjectionMatchSet
createSqlInjectionMatchSet pName_ pChangeToken_ =
CreateSqlInjectionMatchSet'
{_csimsName = pName_, _csimsChangeToken = pChangeToken_}
csimsName :: Lens' CreateSqlInjectionMatchSet Text
csimsName = lens _csimsName (\ s a -> s{_csimsName = a})
csimsChangeToken :: Lens' CreateSqlInjectionMatchSet Text
csimsChangeToken = lens _csimsChangeToken (\ s a -> s{_csimsChangeToken = a})
instance AWSRequest CreateSqlInjectionMatchSet where
type Rs CreateSqlInjectionMatchSet =
CreateSqlInjectionMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
CreateSqlInjectionMatchSetResponse' <$>
(x .?> "SqlInjectionMatchSet") <*>
(x .?> "ChangeToken")
<*> (pure (fromEnum s)))
instance Hashable CreateSqlInjectionMatchSet where
instance NFData CreateSqlInjectionMatchSet where
instance ToHeaders CreateSqlInjectionMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.CreateSqlInjectionMatchSet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateSqlInjectionMatchSet where
toJSON CreateSqlInjectionMatchSet'{..}
= object
(catMaybes
[Just ("Name" .= _csimsName),
Just ("ChangeToken" .= _csimsChangeToken)])
instance ToPath CreateSqlInjectionMatchSet where
toPath = const "/"
instance ToQuery CreateSqlInjectionMatchSet where
toQuery = const mempty
data CreateSqlInjectionMatchSetResponse = CreateSqlInjectionMatchSetResponse'
{ _csimsrsSqlInjectionMatchSet :: !(Maybe SqlInjectionMatchSet)
, _csimsrsChangeToken :: !(Maybe Text)
, _csimsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSqlInjectionMatchSetResponse
:: Int
-> CreateSqlInjectionMatchSetResponse
createSqlInjectionMatchSetResponse pResponseStatus_ =
CreateSqlInjectionMatchSetResponse'
{ _csimsrsSqlInjectionMatchSet = Nothing
, _csimsrsChangeToken = Nothing
, _csimsrsResponseStatus = pResponseStatus_
}
csimsrsSqlInjectionMatchSet :: Lens' CreateSqlInjectionMatchSetResponse (Maybe SqlInjectionMatchSet)
csimsrsSqlInjectionMatchSet = lens _csimsrsSqlInjectionMatchSet (\ s a -> s{_csimsrsSqlInjectionMatchSet = a})
csimsrsChangeToken :: Lens' CreateSqlInjectionMatchSetResponse (Maybe Text)
csimsrsChangeToken = lens _csimsrsChangeToken (\ s a -> s{_csimsrsChangeToken = a})
csimsrsResponseStatus :: Lens' CreateSqlInjectionMatchSetResponse Int
csimsrsResponseStatus = lens _csimsrsResponseStatus (\ s a -> s{_csimsrsResponseStatus = a})
instance NFData CreateSqlInjectionMatchSetResponse
where