{-# 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.RDS.DeleteDBSnapshot
(
deleteDBSnapshot
, DeleteDBSnapshot
, ddbsDBSnapshotIdentifier
, deleteDBSnapshotResponse
, DeleteDBSnapshotResponse
, ddbsrsDBSnapshot
, ddbsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteDBSnapshot = DeleteDBSnapshot'
{ _ddbsDBSnapshotIdentifier :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDBSnapshot
:: Text
-> DeleteDBSnapshot
deleteDBSnapshot pDBSnapshotIdentifier_ =
DeleteDBSnapshot' {_ddbsDBSnapshotIdentifier = pDBSnapshotIdentifier_}
ddbsDBSnapshotIdentifier :: Lens' DeleteDBSnapshot Text
ddbsDBSnapshotIdentifier = lens _ddbsDBSnapshotIdentifier (\ s a -> s{_ddbsDBSnapshotIdentifier = a})
instance AWSRequest DeleteDBSnapshot where
type Rs DeleteDBSnapshot = DeleteDBSnapshotResponse
request = postQuery rds
response
= receiveXMLWrapper "DeleteDBSnapshotResult"
(\ s h x ->
DeleteDBSnapshotResponse' <$>
(x .@? "DBSnapshot") <*> (pure (fromEnum s)))
instance Hashable DeleteDBSnapshot where
instance NFData DeleteDBSnapshot where
instance ToHeaders DeleteDBSnapshot where
toHeaders = const mempty
instance ToPath DeleteDBSnapshot where
toPath = const "/"
instance ToQuery DeleteDBSnapshot where
toQuery DeleteDBSnapshot'{..}
= mconcat
["Action" =: ("DeleteDBSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBSnapshotIdentifier" =: _ddbsDBSnapshotIdentifier]
data DeleteDBSnapshotResponse = DeleteDBSnapshotResponse'
{ _ddbsrsDBSnapshot :: !(Maybe DBSnapshot)
, _ddbsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDBSnapshotResponse
:: Int
-> DeleteDBSnapshotResponse
deleteDBSnapshotResponse pResponseStatus_ =
DeleteDBSnapshotResponse'
{_ddbsrsDBSnapshot = Nothing, _ddbsrsResponseStatus = pResponseStatus_}
ddbsrsDBSnapshot :: Lens' DeleteDBSnapshotResponse (Maybe DBSnapshot)
ddbsrsDBSnapshot = lens _ddbsrsDBSnapshot (\ s a -> s{_ddbsrsDBSnapshot = a})
ddbsrsResponseStatus :: Lens' DeleteDBSnapshotResponse Int
ddbsrsResponseStatus = lens _ddbsrsResponseStatus (\ s a -> s{_ddbsrsResponseStatus = a})
instance NFData DeleteDBSnapshotResponse where