REST Resource: properties
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:媒体资源
附加到应用的公开或私有文件的键值对。
文件属性存在以下限制:
- 每个文件中房源的总数不得超过 100 个
- 每个应用的私有属性数量上限为 30 个
- 最多 30 个公共属性
- 单个属性的 UTF-8 编码 (键值对) 字符串大小上限为 124 字节
某些资源方法(例如 properties.update
)需要 propertyKey
。使用 properties.list
方法检索属性的键。
JSON 表示法 |
{
"selfLink": string,
"value": string,
"visibility": string,
"kind": string,
"etag": string,
"key": string
} |
字段 |
selfLink |
string
仅限输出。指向此媒体资源的返回链接。
|
value |
string
此属性的值。
|
visibility |
string
此属性的可见性。允许的值为 PRIVATE(默认)和 PUBLIC。您只能使用经过身份验证的请求检索私有媒体资源。经过身份验证的请求使用通过 OAuth 2 客户端 ID 获取的访问令牌。您无法使用 API 密钥检索私有媒体资源。
|
kind |
string
仅限输出。此值始终为 drive#property 。
|
etag |
string
仅限输出。媒体资源的 ETag。
|
key |
string
此属性的键。
|
方法 |
|
删除媒体资源。 |
|
按键获取媒体资源。 |
|
向文件添加属性,或更新现有属性。 |
|
列出文件的属性。 |
|
更新媒体资源。 |
|
更新媒体资源。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# REST Resource: properties\n\n- [Resource: Property](#Property)\n - [JSON representation](#Property.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Property\n------------------\n\nA key-value pair attached to a file that is either public or private to an application.\n\nThe following limits apply to file properties:\n\n- Maximum of 100 properties total per file\n- Maximum of 30 private properties per app\n- Maximum of 30 public properties\n- Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property\n\nSome resource methods (such as `properties.update`) require a `propertyKey`. Use the `properties.list` method to retrieve the key for a property.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------|\n| ``` { \"selfLink\": string, \"value\": string, \"visibility\": string, \"kind\": string, \"etag\": string, \"key\": string } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `selfLink` | `string` Output only. The link back to this property. |\n| `value` | `string` The value of this property. |\n| `visibility` | `string` The visibility of this property. Allowed values are PRIVATE (default) and PUBLIC. Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. |\n| `kind` | `string` Output only. This is always `drive#property`. |\n| `etag` | `string` Output only. ETag of the property. |\n| `key` | `string` The key of this property. |\n\n| Methods ------- ||\n|------------------------------------------------------------------------|----------------------------------------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v2/properties/delete) | Deletes a property. |\n| ### [get](/workspace/drive/api/reference/rest/v2/properties/get) | Gets a property by its key. |\n| ### [insert](/workspace/drive/api/reference/rest/v2/properties/insert) | Adds a property to a file, or updates it if it already exists. |\n| ### [list](/workspace/drive/api/reference/rest/v2/properties/list) | Lists a file's properties. |\n| ### [patch](/workspace/drive/api/reference/rest/v2/properties/patch) | Updates a property. |\n| ### [update](/workspace/drive/api/reference/rest/v2/properties/update) | Updates a property. |"]]