getInboxContents :: ApiAction (Map Path RemoteFile)
getInboxContents = do
    (manager, aToken, _, mbox) <- ask
    inboxLink <- liftIO $ linkOrException "document_inbox" $ DP.mailboxLinks mbox
    documents <- liftResourceT $ getDocuments aToken manager inboxLink
    let inboxDocuments = filter DP.uploaded (DP.document documents)
    let dirPath = Path "./"
    let dir = Dir dirPath
    uploadLink <- liftIO $ linkOrException "upload_document_to_inbox" $ DP.mailboxLinks mbox
    let folder = DP.Folder "" "" [uploadLink { DP.rel = "upload_document" }] (Just $ DP.Documents inboxDocuments)
    let remoteDir = RemoteDir dir folder
    let files = map (mapFileToRemoteFile folder) inboxDocuments
    return $ Map.fromList $ (dirPath, remoteDir) : files
getInboxContents :: ApiAction (Map Path RemoteFile)
getInboxContents = do
    (manager, aToken, _, mbox) <- ask
    inboxLink <- liftIO $ linkOrException "document_inbox" $ DP.mailboxLinks mbox
    documents <- liftResourceT $ getDocuments aToken manager inboxLink
    let inboxDocuments = filter DP.uploaded (DP.document documents)
    let dirPath = Path "./"
    let dir = Dir dirPath
    uploadLink <- liftIO $ linkOrException "upload_document_to_inbox" $ DP.mailboxLinks mbox
    let folder = DP.Folder "" "" [uploadLink { DP.rel = "upload_document" }] (Just $ DP.Documents inboxDocuments)
    let remoteDir = RemoteDir dir folder
    let files = map (mapFileToRemoteFile folder) inboxDocuments
    return $ Map.fromList $ (dirPath, remoteDir) : files
getInboxContents = do
    (manager, aToken, _, mbox) <- ask
    inboxLink <- liftIO $ linkOrException "document_inbox" $ DP.mailboxLinks mbox
    documents <- liftResourceT $ getDocuments aToken manager inboxLink
    let inboxDocuments = filter DP.uploaded (DP.document documents)
    let dirPath = Path "./"
    let dir = Dir dirPath
    uploadLink <- liftIO $ linkOrException "upload_document_to_inbox" $ DP.mailboxLinks mbox
    let folder = DP.Folder "" "" [uploadLink { DP.rel = "upload_document" }] (Just $ DP.Documents inboxDocuments)
    let remoteDir = RemoteDir dir folder
    let files = map (mapFileToRemoteFile folder) inboxDocuments
    return $ Map.fromList $ (dirPath, remoteDir) : files