{-# 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.DeleteTable
(
deleteTable
, DeleteTable
, dtTableName
, deleteTableResponse
, DeleteTableResponse
, dtrsTableDescription
, dtrsResponseStatus
) 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 DeleteTable = DeleteTable'
{ _dtTableName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteTable
:: Text
-> DeleteTable
deleteTable pTableName_ = DeleteTable' {_dtTableName = pTableName_}
dtTableName :: Lens' DeleteTable Text
dtTableName = lens _dtTableName (\ s a -> s{_dtTableName = a})
instance AWSRequest DeleteTable where
type Rs DeleteTable = DeleteTableResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DeleteTableResponse' <$>
(x .?> "TableDescription") <*> (pure (fromEnum s)))
instance Hashable DeleteTable where
instance NFData DeleteTable where
instance ToHeaders DeleteTable where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DeleteTable" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DeleteTable where
toJSON DeleteTable'{..}
= object
(catMaybes [Just ("TableName" .= _dtTableName)])
instance ToPath DeleteTable where
toPath = const "/"
instance ToQuery DeleteTable where
toQuery = const mempty
data DeleteTableResponse = DeleteTableResponse'
{ _dtrsTableDescription :: !(Maybe TableDescription)
, _dtrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteTableResponse
:: Int
-> DeleteTableResponse
deleteTableResponse pResponseStatus_ =
DeleteTableResponse'
{_dtrsTableDescription = Nothing, _dtrsResponseStatus = pResponseStatus_}
dtrsTableDescription :: Lens' DeleteTableResponse (Maybe TableDescription)
dtrsTableDescription = lens _dtrsTableDescription (\ s a -> s{_dtrsTableDescription = a})
dtrsResponseStatus :: Lens' DeleteTableResponse Int
dtrsResponseStatus = lens _dtrsResponseStatus (\ s a -> s{_dtrsResponseStatus = a})
instance NFData DeleteTableResponse where