REST Resource: parents
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:ParentReference
对文件父级的引用。
文件只能有一个父级文件夹;不支持指定多个父级。
某些资源方法(例如 parents.get
)需要 parentId
。使用 parents.list
方法检索父项的 ID。
JSON 表示法 |
{
"selfLink": string,
"id": string,
"isRoot": boolean,
"kind": string,
"parentLink": string
} |
字段 |
selfLink |
string
仅限输出。指向此参考文档的链接。
|
id |
string
父级的 ID。
|
isRoot |
boolean
仅限输出。父级文件夹是否为根文件夹。
|
kind |
string
仅限输出。此值始终为 drive#parentReference 。
|
parentLink |
string
仅限输出。指向父级的链接。
|
方法 |
|
从文件中移除父级。 |
|
获取特定的父级引用。 |
|
为文件添加父文件夹。 |
|
列出文件的父级。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# REST Resource: parents\n\n- [Resource: ParentReference](#ParentReference)\n - [JSON representation](#ParentReference.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: ParentReference\n-------------------------\n\nA reference to a file's parent.\n\nA file can only have one parent folder; specifying multiple parents isn't supported.\n\nSome resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"selfLink\": string, \"id\": string, \"isRoot\": boolean, \"kind\": string, \"parentLink\": string } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------------------------|\n| `selfLink` | `string` Output only. A link back to this reference. |\n| `id` | `string` The ID of the parent. |\n| `isRoot` | `boolean` Output only. Whether or not the parent is the root folder. |\n| `kind` | `string` Output only. This is always `drive#parentReference`. |\n| `parentLink` | `string` Output only. A link to the parent. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------|-----------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v2/parents/delete) | Removes a parent from a file. |\n| ### [get](/workspace/drive/api/reference/rest/v2/parents/get) | Gets a specific parent reference. |\n| ### [insert](/workspace/drive/api/reference/rest/v2/parents/insert) | Adds a parent folder for a file. |\n| ### [list](/workspace/drive/api/reference/rest/v2/parents/list) | Lists a file's parents. |"]]