{-# 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.RefreshCache
(
refreshCache
, RefreshCache
, rcFileShareARN
, refreshCacheResponse
, RefreshCacheResponse
, rcrsFileShareARN
, 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 RefreshCache = RefreshCache'
{ _rcFileShareARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
refreshCache
:: Text
-> RefreshCache
refreshCache pFileShareARN_ = RefreshCache' {_rcFileShareARN = pFileShareARN_}
rcFileShareARN :: Lens' RefreshCache Text
rcFileShareARN = lens _rcFileShareARN (\ s a -> s{_rcFileShareARN = a})
instance AWSRequest RefreshCache where
type Rs RefreshCache = RefreshCacheResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
RefreshCacheResponse' <$>
(x .?> "FileShareARN") <*> (pure (fromEnum s)))
instance Hashable RefreshCache where
instance NFData RefreshCache where
instance ToHeaders RefreshCache where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.RefreshCache" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RefreshCache where
toJSON RefreshCache'{..}
= object
(catMaybes
[Just ("FileShareARN" .= _rcFileShareARN)])
instance ToPath RefreshCache where
toPath = const "/"
instance ToQuery RefreshCache where
toQuery = const mempty
data RefreshCacheResponse = RefreshCacheResponse'
{ _rcrsFileShareARN :: !(Maybe Text)
, _rcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
refreshCacheResponse
:: Int
-> RefreshCacheResponse
refreshCacheResponse pResponseStatus_ =
RefreshCacheResponse'
{_rcrsFileShareARN = Nothing, _rcrsResponseStatus = pResponseStatus_}
rcrsFileShareARN :: Lens' RefreshCacheResponse (Maybe Text)
rcrsFileShareARN = lens _rcrsFileShareARN (\ s a -> s{_rcrsFileShareARN = a})
rcrsResponseStatus :: Lens' RefreshCacheResponse Int
rcrsResponseStatus = lens _rcrsResponseStatus (\ s a -> s{_rcrsResponseStatus = a})
instance NFData RefreshCacheResponse where