

# 从 Microsoft Teams 实体读取内容
<a name="microsoft-teams-reading-from-entities"></a>

 **先决条件** 
+  要从中读取内容的 Microsoft Teams 对象。需要 team 或 channel-message 等对象名称。下表显示支持的实体。

 **源支持的实体** 

 API 1.0 版本支持所有实体。


| 实体 | 可以筛选 | 支持限制 | 支持排序依据 | 支持 Select \$1 | 支持分区 | 
| --- | --- | --- | --- | --- | --- | 
| 团队 | 否 | 否 | 否 | 是 | 否 | 
| Team Members | 支持 | 是 | 否 | 是 | 是 | 
| 组 | 支持 | 是 | 是 | 是 | 是 | 
| Group Members | 支持 | 是 | 否 | 是 | 否 | 
| 渠道 | 是 | 否 | 否 | 是 | 是 | 
| Channel Messages | 否 | 是 | 否 | 是 | 否 | 
| Channel Message Replies | 否 | 是 | 否 | 是 | 否 | 
| Channel Tabs | 是 | 否 | 否 | 是 | 否 | 
| Chats | 支持 | 是 | 是 | 是 | 是 | 
| Calendar Events | 支持 | 是 | 是 | 是 | 是 | 

 **示例** 

```
MicrosoftTeams_read = glueContext.create_dynamic_frame.from_options(
    connection_type="MicrosoftTeams",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "company",
        "API_VERSION": "v1.0"
    }
```

## Microsoft Teams 实体和字段详细信息
<a name="microsoft-teams-entity-and-field-details"></a>

 实体列表：
+  Team：[https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0) 
+  Team-Member：[https://docs.microsoft.com/en-us/graph/api/team-list-members?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/team-list-members?view=graph-rest-1.0) 
+  Group：[https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0) 
+  Group-Member：[https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0) 
+  Channel：[https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0) 
+  Channel-Message：[https://docs.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-1.0) 
+  Channel-Message-Reply：[https://docs.microsoft.com/en-us/graph/api/chatmessage-list-replies?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/chatmessage-list-replies?view=graph-rest-1.0) 
+  Channel-Tab：[https://docs.microsoft.com/en-us/graph/api/channel-list-tabs?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/channel-list-tabs?view=graph-rest-1.0) 
+  Chat：[https://docs.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-1.0]( https://docs.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-1.0) 
+  Calendar-Event：[https://docs.microsoft.com/en-us/graph/api/group-list-events?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/group-list-events?view=graph-rest-1.0) 

 **对查询进行分区** 

 如果您想在 Spark 中利用并发，可以提供附加 Spark 选项 `PARTITION_FIELD`、`LOWER_BOUND`、`UPPER_BOUND` 和 `NUM_PARTITIONS`。使用这些参数，原始查询将被拆分为 `NUM_PARTITIONS` 个子查询，这些子查询可以由 Spark 任务同时执行。
+  `PARTITION_FIELD`：用于对查询进行分区的字段的名称。
+  `LOWER_BOUND`：所选分区字段的包含下限值。

   对于日期，我们接受 Spark SQL 查询中使用的 Spark 日期格式。有效值示例：`"2024-02-06"`。
+  `UPPER_BOUND`：所选分区字段的排除上限值。
+  `NUM_PARTITIONS`：分区的数量。

 基于实体的分区字段支持详细信息如下表中所示：


| 实体名称 | 分区字段 | 数据类型 | 
| --- | --- | --- | 
| Team Members | visibleHistoryStartDateTime | 日期时间 | 
| 组 | createdDateTime | 日期时间 | 
| 渠道 | createdDateTime | 日期时间 | 
| Chats | createdDateTime、lastModifiedDateTime | 日期时间 | 
| Calendar Events | createdDateTime、lastModifiedDateTime、originalStart | 日期时间 | 

 **示例** 

```
microsoftteams_read = glueContext.create_dynamic_frame.from_options(
    connection_type="MicrosoftTeams",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "group",
        "API_VERSION": "v1.0",
        "PARTITION_FIELD": "createdDateTime"
        "LOWER_BOUND": "2022-07-13T07:55:27.065Z"
        "UPPER_BOUND": "2022-08-12T07:55:27.065Z"
        "NUM_PARTITIONS": "2"
    }
```