{-# 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.StorageGateway.ResetCache
(
resetCache
, ResetCache
, rcGatewayARN
, resetCacheResponse
, ResetCacheResponse
, rcrsGatewayARN
, rcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
newtype ResetCache = ResetCache'
{ _rcGatewayARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resetCache
:: Text
-> ResetCache
resetCache pGatewayARN_ =
ResetCache'
{ _rcGatewayARN = pGatewayARN_
}
rcGatewayARN :: Lens' ResetCache Text
rcGatewayARN = lens _rcGatewayARN (\ s a -> s{_rcGatewayARN = a});
instance AWSRequest ResetCache where
type Rs ResetCache = ResetCacheResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
ResetCacheResponse' <$>
(x .?> "GatewayARN") <*> (pure (fromEnum s)))
instance Hashable ResetCache
instance NFData ResetCache
instance ToHeaders ResetCache where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.ResetCache" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ResetCache where
toJSON ResetCache'{..}
= object
(catMaybes [Just ("GatewayARN" .= _rcGatewayARN)])
instance ToPath ResetCache where
toPath = const "/"
instance ToQuery ResetCache where
toQuery = const mempty
data ResetCacheResponse = ResetCacheResponse'
{ _rcrsGatewayARN :: !(Maybe Text)
, _rcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resetCacheResponse
:: Int
-> ResetCacheResponse
resetCacheResponse pResponseStatus_ =
ResetCacheResponse'
{ _rcrsGatewayARN = Nothing
, _rcrsResponseStatus = pResponseStatus_
}
rcrsGatewayARN :: Lens' ResetCacheResponse (Maybe Text)
rcrsGatewayARN = lens _rcrsGatewayARN (\ s a -> s{_rcrsGatewayARN = a});
rcrsResponseStatus :: Lens' ResetCacheResponse Int
rcrsResponseStatus = lens _rcrsResponseStatus (\ s a -> s{_rcrsResponseStatus = a});
instance NFData ResetCacheResponse