【问题标题】:How to work with the @removed annotation of Event objects in MS graph using the Java Sdk如何使用 Java Sdk 处理 MS 图中 Event 对象的 @removed 注释
【发布时间】:2021-07-21 18:10:15
【问题描述】:

我正在使用 beta SDK 来获取事件增量:

    mGraphServiceController.getEventsDelta(mDeltaLink).get()

对于已删除的事件,我会收到如下回复:

    {
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(event)",
"@odata.deltaLink": "https://graph.microsoft.com/beta/me/events/delta?$deltatoken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"value": [
    {
        "@odata.type": "#microsoft.graph.event",
        "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "@removed": {
            "reason": "deleted"
        }
    }
]
    }

如何使用 MS graph Java SDK(测试版)访问 @removed 注释?

【问题讨论】:

    标签: java microsoft-graph-api


    【解决方案1】:

    @removed 对象可以通过com.microsoft.graph.models.EventadditionalDataManager() 方法访问。

    这是 Kotlin 中的示例代码:

    val events = graphApiClient.me()
                .calendarView()
                .delta()
                .buildRequest(requestOptions)
                .get()
    val event = events.currentPage.first()
    val isRemovedEvent = event.additionalDataManager().contains("@removed")
    

    更多关于the Microsoft Graph API documentation中的@removed对象

    【讨论】:

      猜你喜欢
      • 2018-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多