{-# 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.CreateSnapshotFromVolumeRecoveryPoint
(
createSnapshotFromVolumeRecoveryPoint
, CreateSnapshotFromVolumeRecoveryPoint
, csfvrpVolumeARN
, csfvrpSnapshotDescription
, createSnapshotFromVolumeRecoveryPointResponse
, CreateSnapshotFromVolumeRecoveryPointResponse
, csfvrprsVolumeRecoveryPointTime
, csfvrprsVolumeARN
, csfvrprsSnapshotId
, csfvrprsResponseStatus
) 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
data CreateSnapshotFromVolumeRecoveryPoint = CreateSnapshotFromVolumeRecoveryPoint'
{ _csfvrpVolumeARN :: !Text
, _csfvrpSnapshotDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSnapshotFromVolumeRecoveryPoint
:: Text
-> Text
-> CreateSnapshotFromVolumeRecoveryPoint
createSnapshotFromVolumeRecoveryPoint pVolumeARN_ pSnapshotDescription_ =
CreateSnapshotFromVolumeRecoveryPoint'
{ _csfvrpVolumeARN = pVolumeARN_
, _csfvrpSnapshotDescription = pSnapshotDescription_
}
csfvrpVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpVolumeARN = lens _csfvrpVolumeARN (\ s a -> s{_csfvrpVolumeARN = a})
csfvrpSnapshotDescription :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpSnapshotDescription = lens _csfvrpSnapshotDescription (\ s a -> s{_csfvrpSnapshotDescription = a})
instance AWSRequest
CreateSnapshotFromVolumeRecoveryPoint
where
type Rs CreateSnapshotFromVolumeRecoveryPoint =
CreateSnapshotFromVolumeRecoveryPointResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
CreateSnapshotFromVolumeRecoveryPointResponse' <$>
(x .?> "VolumeRecoveryPointTime") <*>
(x .?> "VolumeARN")
<*> (x .?> "SnapshotId")
<*> (pure (fromEnum s)))
instance Hashable
CreateSnapshotFromVolumeRecoveryPoint
where
instance NFData CreateSnapshotFromVolumeRecoveryPoint
where
instance ToHeaders
CreateSnapshotFromVolumeRecoveryPoint
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateSnapshotFromVolumeRecoveryPoint
where
toJSON CreateSnapshotFromVolumeRecoveryPoint'{..}
= object
(catMaybes
[Just ("VolumeARN" .= _csfvrpVolumeARN),
Just
("SnapshotDescription" .=
_csfvrpSnapshotDescription)])
instance ToPath CreateSnapshotFromVolumeRecoveryPoint
where
toPath = const "/"
instance ToQuery
CreateSnapshotFromVolumeRecoveryPoint
where
toQuery = const mempty
data CreateSnapshotFromVolumeRecoveryPointResponse = CreateSnapshotFromVolumeRecoveryPointResponse'
{ _csfvrprsVolumeRecoveryPointTime :: !(Maybe Text)
, _csfvrprsVolumeARN :: !(Maybe Text)
, _csfvrprsSnapshotId :: !(Maybe Text)
, _csfvrprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSnapshotFromVolumeRecoveryPointResponse
:: Int
-> CreateSnapshotFromVolumeRecoveryPointResponse
createSnapshotFromVolumeRecoveryPointResponse pResponseStatus_ =
CreateSnapshotFromVolumeRecoveryPointResponse'
{ _csfvrprsVolumeRecoveryPointTime = Nothing
, _csfvrprsVolumeARN = Nothing
, _csfvrprsSnapshotId = Nothing
, _csfvrprsResponseStatus = pResponseStatus_
}
csfvrprsVolumeRecoveryPointTime :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsVolumeRecoveryPointTime = lens _csfvrprsVolumeRecoveryPointTime (\ s a -> s{_csfvrprsVolumeRecoveryPointTime = a})
csfvrprsVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsVolumeARN = lens _csfvrprsVolumeARN (\ s a -> s{_csfvrprsVolumeARN = a})
csfvrprsSnapshotId :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsSnapshotId = lens _csfvrprsSnapshotId (\ s a -> s{_csfvrprsSnapshotId = a})
csfvrprsResponseStatus :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse Int
csfvrprsResponseStatus = lens _csfvrprsResponseStatus (\ s a -> s{_csfvrprsResponseStatus = a})
instance NFData
CreateSnapshotFromVolumeRecoveryPointResponse
where