这是我尝试过的:
https://graph.microsoft.com/v1.0/me/mailfolders/inbox/messages?filter=ReceivedDateTime+gt+2018-12-06T06:13:00Z+and+ReceivedDateTime+lt+2018-12-07T20:13:00Z&%24count=true
但是上面的查询仅返回来自收件箱的邮件数。它不包含任何子文件夹。
在上面的查询中是否也有查询包含子文件夹的方法?
答案 0 :(得分:2)
您将必须编写一个递归函数,并对收件箱下的每个子文件夹调用上述查询。
您可以使用以下方法在收件箱下获取子文件夹:
https://graph.microsoft.com/v1.0/me/mailfolders/inbox/childfolders/{childFolderID}/messages?filter=ReceivedDateTime+gt+2018-12-06T06:13:00Z+and+ReceivedDateTime+lt+2018-12-13T20:13:00Z&%24count=true
然后您可以为每个文件夹运行此操作:
library(ggplot2)
library(testthat)
# First test should succeed (no output)
test_that("silent when ggplot2 succeeds", {
working.plot <- ggplot(diamonds, aes(x = carat, y = price)) + geom_point()
expect_silent(print(working.plot))
} )
# Second test should fail
test_that("fails when ggplot2 throws an error", {
broken.plot <- ggplot(diamonds, aes(x = carrot, y = price)) + geom_point()
expect_silent(print(broken.plot))
} )