驱动器资源类型
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
驱动器资源是代表用户的 OneDrive 或在 SharePoint 中文档库的顶级对象。
OneDrive 用户必须始终具有至少一个可用驱动器,即默认驱动器。没有 OneDrive 许可证的用户不能拥有可用的默认驱动器。
方法
| 方法 | 返回类型 | 说明 |
|---|---|---|
| 获取驱动器 | 驱动器 | 获取有关驱动器的元数据 |
| 获取驱动器根 | driveItem | 获取驱动器的根文件夹 |
| 列出活动 | itemActivity 集合 | 列出在驱动器下发生的活动 |
| 列出关注的项 | driveItem 集合 | 列出用户的关注 driveItems |
| 列出子项 | driveItem 集合 | 列出驱动器根文件夹的子项 |
| 列出变更 | driveItem 集合 | 列出驱动器中所有 DriveItem 的变更 |
| 搜索 | driveItem 集合 | 搜索驱动器中的 DriveItem |
| 获取特殊文件夹 | driveItem | 通过特殊文件夹的规范名称访问它 |
属性
| 属性 | 类型 | 说明 |
|---|---|---|
| createdBy | identitySet | 识别创建项目的用户、设备或应用程序。只读。 |
| createdDateTime | dateTimeOffset | 创建项的日期和时间。只读。 |
| description | String | 提供驱动器的用户可见说明。读写。 |
| driveType | String | 说明了由该资源表示的驱动器的类型。OneDrive 个人版驱动器将返回 personal。OneDrive for Business 将返回 business。SharePoint 文档库将返回 documentLibrary。只读。 |
| id | String | 驱动器唯一标识符。只读。 |
| lastModifiedBy | identitySet | 上次修改项目的用户、设备和应用程序的标识。只读。 |
| lastModifiedDateTime | dateTimeOffset | 上次修改项目的日期和时间。只读。 |
| name | string | 项目名称。读写。 |
| 所有者 | identitySet | 可选。拥有此驱动器的用户帐户。只读。 |
| 配额 | 配额 | 可选。有关驱动器的存储空间配额的信息。只读。 |
| sharepointIds | sharepointIds | 返回对 SharePoint REST 兼容性有用的标识符。 只读。 默认情况下不返回此属性,必须使用查询参数 $select 进行选择。 |
| system | systemFacet | 如果存在,则表示这是系统管理的驱动器。只读。 |
| WebUrl | string (url) | 在浏览器中显示此资源的 URL。只读。 |
关系
| 关系 | 类型 | 说明 |
|---|---|---|
| activities | itemActivity 集合 | 最近发生在此驱动器下的活动的列表。 |
| 捆绑 | driveItem 集合 | 捆绑(相册和多选共享项集)的集合。仅在个人版 OneDrive 中。 |
| following | driveItem 集合 | 用户关注的项列表。 仅适用于 OneDrive for Business 中。 |
| items | driveItem 集合 | 驱动器中包含的所有项。只读。可为 NULL。 |
| root | driveItem | 驱动器的根文件夹。只读。 |
| special | driveItem 集合 | OneDrive 中可用的公用文件夹的集合。只读。可为 NULL。 |
| list | 列表 | 对于 SharePoint 中的驱动器,则为基础文档库列表。只读。可为 NULL。 |
JSON 表示形式
下面是 Drive 资源的 JSON 表示形式。
drive 资源派生自 baseItem 并继承该资源的属性。
{
"activities": [{"@odata.type": "microsoft.graph.itemActivity"}],
"id": "string",
"createdBy": {"@odata.type": "microsoft.graph.identitySet"},
"createdDateTime": "string (timestamp)",
"description": "string",
"driveType": "personal | business | documentLibrary",
"following": [{"@odata.type": "microsoft.graph.driveItem"}],
"items": [{"@odata.type": "microsoft.graph.driveItem"}],
"lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"},
"lastModifiedDateTime": "string (timestamp)",
"name": "string",
"owner": {"@odata.type": "microsoft.graph.identitySet"},
"quota": {"@odata.type": "microsoft.graph.quota"},
"root": {"@odata.type": "microsoft.graph.driveItem"},
"sharepointIds": {"@odata.type": "microsoft.graph.sharepointIds"},
"special": [{"@odata.type": "microsoft.graph.driveItem"}],
"system": {"@odata.type": "microsoft.graph.systemFacet"},
"webUrl": "string",
}
反馈
提交和查看相关反馈