{-# 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.DirectoryService.DeleteDirectory
(
deleteDirectory
, DeleteDirectory
, dddDirectoryId
, deleteDirectoryResponse
, DeleteDirectoryResponse
, delrsDirectoryId
, delrsResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteDirectory = DeleteDirectory'
{ _dddDirectoryId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDirectory
:: Text
-> DeleteDirectory
deleteDirectory pDirectoryId_ =
DeleteDirectory'
{ _dddDirectoryId = pDirectoryId_
}
dddDirectoryId :: Lens' DeleteDirectory Text
dddDirectoryId = lens _dddDirectoryId (\ s a -> s{_dddDirectoryId = a});
instance AWSRequest DeleteDirectory where
type Rs DeleteDirectory = DeleteDirectoryResponse
request = postJSON directoryService
response
= receiveJSON
(\ s h x ->
DeleteDirectoryResponse' <$>
(x .?> "DirectoryId") <*> (pure (fromEnum s)))
instance Hashable DeleteDirectory
instance NFData DeleteDirectory
instance ToHeaders DeleteDirectory where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.DeleteDirectory" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteDirectory where
toJSON DeleteDirectory'{..}
= object
(catMaybes [Just ("DirectoryId" .= _dddDirectoryId)])
instance ToPath DeleteDirectory where
toPath = const "/"
instance ToQuery DeleteDirectory where
toQuery = const mempty
data DeleteDirectoryResponse = DeleteDirectoryResponse'
{ _delrsDirectoryId :: !(Maybe Text)
, _delrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDirectoryResponse
:: Int
-> DeleteDirectoryResponse
deleteDirectoryResponse pResponseStatus_ =
DeleteDirectoryResponse'
{ _delrsDirectoryId = Nothing
, _delrsResponseStatus = pResponseStatus_
}
delrsDirectoryId :: Lens' DeleteDirectoryResponse (Maybe Text)
delrsDirectoryId = lens _delrsDirectoryId (\ s a -> s{_delrsDirectoryId = a});
delrsResponseStatus :: Lens' DeleteDirectoryResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});
instance NFData DeleteDirectoryResponse