{-# 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.DynamoDB.DeleteBackup
(
deleteBackup
, DeleteBackup
, dbBackupARN
, deleteBackupResponse
, DeleteBackupResponse
, dbrsBackupDescription
, dbrsResponseStatus
) where
import Network.AWS.DynamoDB.Types
import Network.AWS.DynamoDB.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteBackup = DeleteBackup'
{ _dbBackupARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteBackup
:: Text
-> DeleteBackup
deleteBackup pBackupARN_ = DeleteBackup' {_dbBackupARN = pBackupARN_}
dbBackupARN :: Lens' DeleteBackup Text
dbBackupARN = lens _dbBackupARN (\ s a -> s{_dbBackupARN = a})
instance AWSRequest DeleteBackup where
type Rs DeleteBackup = DeleteBackupResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DeleteBackupResponse' <$>
(x .?> "BackupDescription") <*> (pure (fromEnum s)))
instance Hashable DeleteBackup where
instance NFData DeleteBackup where
instance ToHeaders DeleteBackup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DeleteBackup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DeleteBackup where
toJSON DeleteBackup'{..}
= object
(catMaybes [Just ("BackupArn" .= _dbBackupARN)])
instance ToPath DeleteBackup where
toPath = const "/"
instance ToQuery DeleteBackup where
toQuery = const mempty
data DeleteBackupResponse = DeleteBackupResponse'
{ _dbrsBackupDescription :: !(Maybe BackupDescription)
, _dbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteBackupResponse
:: Int
-> DeleteBackupResponse
deleteBackupResponse pResponseStatus_ =
DeleteBackupResponse'
{_dbrsBackupDescription = Nothing, _dbrsResponseStatus = pResponseStatus_}
dbrsBackupDescription :: Lens' DeleteBackupResponse (Maybe BackupDescription)
dbrsBackupDescription = lens _dbrsBackupDescription (\ s a -> s{_dbrsBackupDescription = a})
dbrsResponseStatus :: Lens' DeleteBackupResponse Int
dbrsResponseStatus = lens _dbrsResponseStatus (\ s a -> s{_dbrsResponseStatus = a})
instance NFData DeleteBackupResponse where