REST Resource: parents
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tài nguyên: ParentReference
Tham chiếu đến tệp mẹ.
Một tệp chỉ có thể có một thư mục mẹ; không hỗ trợ việc chỉ định nhiều thư mục mẹ.
Một số phương thức tài nguyên (chẳng hạn như parents.get
) yêu cầu parentId
. Sử dụng phương thức parents.list
để truy xuất mã nhận dạng cho thành phần mẹ.
Biểu diễn dưới dạng JSON |
{
"selfLink": string,
"id": string,
"isRoot": boolean,
"kind": string,
"parentLink": string
} |
Trường |
selfLink |
string
Chỉ có đầu ra. Đường liên kết quay lại tài liệu tham khảo này.
|
id |
string
Mã của phần tử mẹ.
|
isRoot |
boolean
Chỉ có đầu ra. Liệu thư mục mẹ có phải là thư mục gốc hay không.
|
kind |
string
Chỉ có đầu ra. Giá trị này luôn là drive#parentReference .
|
parentLink |
string
Chỉ có đầu ra. Đường liên kết đến phần tử mẹ.
|
Phương thức |
|
Xoá một phần tử mẹ khỏi tệp. |
|
Lấy một tệp tham chiếu mẹ cụ thể. |
|
Thêm thư mục mẹ cho một tệp. |
|
Liệt kê các tệp mẹ của một tệp. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],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. |"]]