module Network.AWS.StorageGateway.CreateSnapshotFromVolumeRecoveryPoint
(
CreateSnapshotFromVolumeRecoveryPoint
, createSnapshotFromVolumeRecoveryPoint
, csfvrpSnapshotDescription
, csfvrpVolumeARN
, CreateSnapshotFromVolumeRecoveryPointResponse
, createSnapshotFromVolumeRecoveryPointResponse
, csfvrprSnapshotId
, csfvrprVolumeARN
, csfvrprVolumeRecoveryPointTime
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.StorageGateway.Types
import qualified GHC.Exts
data CreateSnapshotFromVolumeRecoveryPoint = CreateSnapshotFromVolumeRecoveryPoint
{ _csfvrpSnapshotDescription :: Text
, _csfvrpVolumeARN :: Text
} deriving (Eq, Ord, Read, Show)
createSnapshotFromVolumeRecoveryPoint :: Text
-> Text
-> CreateSnapshotFromVolumeRecoveryPoint
createSnapshotFromVolumeRecoveryPoint p1 p2 = CreateSnapshotFromVolumeRecoveryPoint
{ _csfvrpVolumeARN = p1
, _csfvrpSnapshotDescription = p2
}
csfvrpSnapshotDescription :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpSnapshotDescription =
lens _csfvrpSnapshotDescription
(\s a -> s { _csfvrpSnapshotDescription = a })
csfvrpVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpVolumeARN = lens _csfvrpVolumeARN (\s a -> s { _csfvrpVolumeARN = a })
data CreateSnapshotFromVolumeRecoveryPointResponse = CreateSnapshotFromVolumeRecoveryPointResponse
{ _csfvrprSnapshotId :: Maybe Text
, _csfvrprVolumeARN :: Maybe Text
, _csfvrprVolumeRecoveryPointTime :: Maybe Text
} deriving (Eq, Ord, Read, Show)
createSnapshotFromVolumeRecoveryPointResponse :: CreateSnapshotFromVolumeRecoveryPointResponse
createSnapshotFromVolumeRecoveryPointResponse = CreateSnapshotFromVolumeRecoveryPointResponse
{ _csfvrprSnapshotId = Nothing
, _csfvrprVolumeARN = Nothing
, _csfvrprVolumeRecoveryPointTime = Nothing
}
csfvrprSnapshotId :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprSnapshotId =
lens _csfvrprSnapshotId (\s a -> s { _csfvrprSnapshotId = a })
csfvrprVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprVolumeARN = lens _csfvrprVolumeARN (\s a -> s { _csfvrprVolumeARN = a })
csfvrprVolumeRecoveryPointTime :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprVolumeRecoveryPointTime =
lens _csfvrprVolumeRecoveryPointTime
(\s a -> s { _csfvrprVolumeRecoveryPointTime = a })
instance ToPath CreateSnapshotFromVolumeRecoveryPoint where
toPath = const "/"
instance ToQuery CreateSnapshotFromVolumeRecoveryPoint where
toQuery = const mempty
instance ToHeaders CreateSnapshotFromVolumeRecoveryPoint
instance ToJSON CreateSnapshotFromVolumeRecoveryPoint where
toJSON CreateSnapshotFromVolumeRecoveryPoint{..} = object
[ "VolumeARN" .= _csfvrpVolumeARN
, "SnapshotDescription" .= _csfvrpSnapshotDescription
]
instance AWSRequest CreateSnapshotFromVolumeRecoveryPoint where
type Sv CreateSnapshotFromVolumeRecoveryPoint = StorageGateway
type Rs CreateSnapshotFromVolumeRecoveryPoint = CreateSnapshotFromVolumeRecoveryPointResponse
request = post "CreateSnapshotFromVolumeRecoveryPoint"
response = jsonResponse
instance FromJSON CreateSnapshotFromVolumeRecoveryPointResponse where
parseJSON = withObject "CreateSnapshotFromVolumeRecoveryPointResponse" $ \o -> CreateSnapshotFromVolumeRecoveryPointResponse
<$> o .:? "SnapshotId"
<*> o .:? "VolumeARN"
<*> o .:? "VolumeRecoveryPointTime"