{-# 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.GetChangeToken
(
getChangeToken
, GetChangeToken
, getChangeTokenResponse
, GetChangeTokenResponse
, gctrsChangeToken
, gctrsResponseStatus
) 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 GetChangeToken =
GetChangeToken'
deriving (Eq, Read, Show, Data, Typeable, Generic)
getChangeToken
:: GetChangeToken
getChangeToken = GetChangeToken'
instance AWSRequest GetChangeToken where
type Rs GetChangeToken = GetChangeTokenResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetChangeTokenResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable GetChangeToken where
instance NFData GetChangeToken where
instance ToHeaders GetChangeToken where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetChangeToken" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetChangeToken where
toJSON = const (Object mempty)
instance ToPath GetChangeToken where
toPath = const "/"
instance ToQuery GetChangeToken where
toQuery = const mempty
data GetChangeTokenResponse = GetChangeTokenResponse'
{ _gctrsChangeToken :: !(Maybe Text)
, _gctrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getChangeTokenResponse
:: Int
-> GetChangeTokenResponse
getChangeTokenResponse pResponseStatus_ =
GetChangeTokenResponse'
{_gctrsChangeToken = Nothing, _gctrsResponseStatus = pResponseStatus_}
gctrsChangeToken :: Lens' GetChangeTokenResponse (Maybe Text)
gctrsChangeToken = lens _gctrsChangeToken (\ s a -> s{_gctrsChangeToken = a})
gctrsResponseStatus :: Lens' GetChangeTokenResponse Int
gctrsResponseStatus = lens _gctrsResponseStatus (\ s a -> s{_gctrsResponseStatus = a})
instance NFData GetChangeTokenResponse where