module Network.AWS.DirectoryService.DeleteDirectory
    (
    
      deleteDirectory
    , DeleteDirectory
    
    , dDirectoryId
    
    , deleteDirectoryResponse
    , DeleteDirectoryResponse
    
    , drsDirectoryId
    , drsResponseStatus
    ) where
import           Network.AWS.DirectoryService.Types
import           Network.AWS.DirectoryService.Types.Product
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
newtype DeleteDirectory = DeleteDirectory'
    { _dDirectoryId :: Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDirectory
    :: Text 
    -> DeleteDirectory
deleteDirectory pDirectoryId_ =
    DeleteDirectory'
    { _dDirectoryId = pDirectoryId_
    }
dDirectoryId :: Lens' DeleteDirectory Text
dDirectoryId = lens _dDirectoryId (\ s a -> s{_dDirectoryId = a});
instance AWSRequest DeleteDirectory where
        type Rs DeleteDirectory = DeleteDirectoryResponse
        request = postJSON directoryService
        response
          = receiveJSON
              (\ s h x ->
                 DeleteDirectoryResponse' <$>
                   (x .?> "DirectoryId") <*> (pure (fromEnum s)))
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" .= _dDirectoryId)])
instance ToPath DeleteDirectory where
        toPath = const "/"
instance ToQuery DeleteDirectory where
        toQuery = const mempty
data DeleteDirectoryResponse = DeleteDirectoryResponse'
    { _drsDirectoryId    :: !(Maybe Text)
    , _drsResponseStatus :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDirectoryResponse
    :: Int 
    -> DeleteDirectoryResponse
deleteDirectoryResponse pResponseStatus_ =
    DeleteDirectoryResponse'
    { _drsDirectoryId = Nothing
    , _drsResponseStatus = pResponseStatus_
    }
drsDirectoryId :: Lens' DeleteDirectoryResponse (Maybe Text)
drsDirectoryId = lens _drsDirectoryId (\ s a -> s{_drsDirectoryId = a});
drsResponseStatus :: Lens' DeleteDirectoryResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});