module Network.AWS.StorageGateway.DeleteTape
(
deleteTape
, DeleteTape
, delGatewayARN
, delTapeARN
, deleteTapeResponse
, DeleteTapeResponse
, dtrsTapeARN
, dtrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
data DeleteTape = DeleteTape'
{ _delGatewayARN :: !Text
, _delTapeARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteTape
:: Text
-> Text
-> DeleteTape
deleteTape pGatewayARN_ pTapeARN_ =
DeleteTape'
{ _delGatewayARN = pGatewayARN_
, _delTapeARN = pTapeARN_
}
delGatewayARN :: Lens' DeleteTape Text
delGatewayARN = lens _delGatewayARN (\ s a -> s{_delGatewayARN = a});
delTapeARN :: Lens' DeleteTape Text
delTapeARN = lens _delTapeARN (\ s a -> s{_delTapeARN = a});
instance AWSRequest DeleteTape where
type Rs DeleteTape = DeleteTapeResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
DeleteTapeResponse' <$>
(x .?> "TapeARN") <*> (pure (fromEnum s)))
instance ToHeaders DeleteTape where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.DeleteTape" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteTape where
toJSON DeleteTape'{..}
= object
(catMaybes
[Just ("GatewayARN" .= _delGatewayARN),
Just ("TapeARN" .= _delTapeARN)])
instance ToPath DeleteTape where
toPath = const "/"
instance ToQuery DeleteTape where
toQuery = const mempty
data DeleteTapeResponse = DeleteTapeResponse'
{ _dtrsTapeARN :: !(Maybe Text)
, _dtrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteTapeResponse
:: Int
-> DeleteTapeResponse
deleteTapeResponse pResponseStatus_ =
DeleteTapeResponse'
{ _dtrsTapeARN = Nothing
, _dtrsResponseStatus = pResponseStatus_
}
dtrsTapeARN :: Lens' DeleteTapeResponse (Maybe Text)
dtrsTapeARN = lens _dtrsTapeARN (\ s a -> s{_dtrsTapeARN = a});
dtrsResponseStatus :: Lens' DeleteTapeResponse Int
dtrsResponseStatus = lens _dtrsResponseStatus (\ s a -> s{_dtrsResponseStatus = a});