module Network.AWS.ElastiCache.DeleteSnapshot
(
deleteSnapshot
, DeleteSnapshot
, dSnapshotName
, deleteSnapshotResponse
, DeleteSnapshotResponse
, dsrsSnapshot
, dsrsStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteSnapshot = DeleteSnapshot'
{ _dSnapshotName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteSnapshot
:: Text
-> DeleteSnapshot
deleteSnapshot pSnapshotName_ =
DeleteSnapshot'
{ _dSnapshotName = pSnapshotName_
}
dSnapshotName :: Lens' DeleteSnapshot Text
dSnapshotName = lens _dSnapshotName (\ s a -> s{_dSnapshotName = a});
instance AWSRequest DeleteSnapshot where
type Rs DeleteSnapshot = DeleteSnapshotResponse
request = postQuery elastiCache
response
= receiveXMLWrapper "DeleteSnapshotResult"
(\ s h x ->
DeleteSnapshotResponse' <$>
(x .@? "Snapshot") <*> (pure (fromEnum s)))
instance ToHeaders DeleteSnapshot where
toHeaders = const mempty
instance ToPath DeleteSnapshot where
toPath = const "/"
instance ToQuery DeleteSnapshot where
toQuery DeleteSnapshot'{..}
= mconcat
["Action" =: ("DeleteSnapshot" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"SnapshotName" =: _dSnapshotName]
data DeleteSnapshotResponse = DeleteSnapshotResponse'
{ _dsrsSnapshot :: !(Maybe Snapshot)
, _dsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteSnapshotResponse
:: Int
-> DeleteSnapshotResponse
deleteSnapshotResponse pStatus_ =
DeleteSnapshotResponse'
{ _dsrsSnapshot = Nothing
, _dsrsStatus = pStatus_
}
dsrsSnapshot :: Lens' DeleteSnapshotResponse (Maybe Snapshot)
dsrsSnapshot = lens _dsrsSnapshot (\ s a -> s{_dsrsSnapshot = a});
dsrsStatus :: Lens' DeleteSnapshotResponse Int
dsrsStatus = lens _dsrsStatus (\ s a -> s{_dsrsStatus = a});