{-# 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
, rrsGatewayARN
, rrsResponseStatus
) 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 where
instance NFData ResetCache where
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'
{ _rrsGatewayARN :: !(Maybe Text)
, _rrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resetCacheResponse
:: Int
-> ResetCacheResponse
resetCacheResponse pResponseStatus_ =
ResetCacheResponse'
{_rrsGatewayARN = Nothing, _rrsResponseStatus = pResponseStatus_}
rrsGatewayARN :: Lens' ResetCacheResponse (Maybe Text)
rrsGatewayARN = lens _rrsGatewayARN (\ s a -> s{_rrsGatewayARN = a})
rrsResponseStatus :: Lens' ResetCacheResponse Int
rrsResponseStatus = lens _rrsResponseStatus (\ s a -> s{_rrsResponseStatus = a})
instance NFData ResetCacheResponse where