module Network.AWS.StorageGateway.RetrieveTapeRecoveryPoint
(
retrieveTapeRecoveryPoint
, RetrieveTapeRecoveryPoint
, rtrpTapeARN
, rtrpGatewayARN
, retrieveTapeRecoveryPointResponse
, RetrieveTapeRecoveryPointResponse
, rtrprsTapeARN
, rtrprsStatus
) 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 RetrieveTapeRecoveryPoint = RetrieveTapeRecoveryPoint'
{ _rtrpTapeARN :: !Text
, _rtrpGatewayARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveTapeRecoveryPoint
:: Text
-> Text
-> RetrieveTapeRecoveryPoint
retrieveTapeRecoveryPoint pTapeARN_ pGatewayARN_ =
RetrieveTapeRecoveryPoint'
{ _rtrpTapeARN = pTapeARN_
, _rtrpGatewayARN = pGatewayARN_
}
rtrpTapeARN :: Lens' RetrieveTapeRecoveryPoint Text
rtrpTapeARN = lens _rtrpTapeARN (\ s a -> s{_rtrpTapeARN = a});
rtrpGatewayARN :: Lens' RetrieveTapeRecoveryPoint Text
rtrpGatewayARN = lens _rtrpGatewayARN (\ s a -> s{_rtrpGatewayARN = a});
instance AWSRequest RetrieveTapeRecoveryPoint where
type Sv RetrieveTapeRecoveryPoint = StorageGateway
type Rs RetrieveTapeRecoveryPoint =
RetrieveTapeRecoveryPointResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
RetrieveTapeRecoveryPointResponse' <$>
(x .?> "TapeARN") <*> (pure (fromEnum s)))
instance ToHeaders RetrieveTapeRecoveryPoint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.RetrieveTapeRecoveryPoint"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RetrieveTapeRecoveryPoint where
toJSON RetrieveTapeRecoveryPoint'{..}
= object
["TapeARN" .= _rtrpTapeARN,
"GatewayARN" .= _rtrpGatewayARN]
instance ToPath RetrieveTapeRecoveryPoint where
toPath = const "/"
instance ToQuery RetrieveTapeRecoveryPoint where
toQuery = const mempty
data RetrieveTapeRecoveryPointResponse = RetrieveTapeRecoveryPointResponse'
{ _rtrprsTapeARN :: !(Maybe Text)
, _rtrprsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveTapeRecoveryPointResponse
:: Int
-> RetrieveTapeRecoveryPointResponse
retrieveTapeRecoveryPointResponse pStatus_ =
RetrieveTapeRecoveryPointResponse'
{ _rtrprsTapeARN = Nothing
, _rtrprsStatus = pStatus_
}
rtrprsTapeARN :: Lens' RetrieveTapeRecoveryPointResponse (Maybe Text)
rtrprsTapeARN = lens _rtrprsTapeARN (\ s a -> s{_rtrprsTapeARN = a});
rtrprsStatus :: Lens' RetrieveTapeRecoveryPointResponse Int
rtrprsStatus = lens _rtrprsStatus (\ s a -> s{_rtrprsStatus = a});