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
這個屬性的鍵。
|
方法 |
|
刪除屬性。 |
|
透過索引鍵取得屬性。 |
|
將屬性新增至檔案,或更新已存在的屬性。 |
|
列出檔案的屬性。 |
|
更新屬性。 |
|
更新屬性。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-04 (世界標準時間)。
[null,null,["上次更新時間:2024-09-04 (世界標準時間)。"],[[["File properties are key-value pairs that can be attached to a file, with limits on the total number and size."],["Properties can have either public or private visibility, impacting how they are accessed."],["The `properties` resource provides methods for managing file properties, such as adding, updating, deleting, and listing them."],["Each property is represented by a JSON object with fields like `selfLink`, `value`, `visibility`, `kind`, `etag`, and `key`."],["To retrieve the key for a property, which is needed for some operations, use the `properties.list` method."]]],["File properties are key-value pairs, either public or private, with limits: 100 total, 30 private per app, 30 public, and 124 bytes per property. Properties can be manipulated using methods such as `delete`, `get`, `insert`, `list`, `patch`, and `update`. The `visibility` field determines if the property is private or public. Private properties require OAuth 2 authentication, they can't use an API key. `properties.list` retrieves property keys, necessary for `properties.update`.\n"]]