REST Resource: properties
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Risorsa: proprietà
Una coppia chiave-valore collegata a un file pubblico o privato di un'applicazione.
Ai file si applicano i seguenti limiti:
- Massimo 100 proprietà totali per file
- Massimo 30 proprietà private per app
- Massimo 30 proprietà pubbliche
- Limite di dimensioni massimo di 124 byte per la stringa (chiave + valore) in codifica UTF-8 per una singola proprietà
Alcuni metodi delle risorse (ad esempio properties.update
) richiedono un propertyKey
. Utilizza il metodo properties.list
per recuperare la chiave di una proprietà.
Rappresentazione JSON |
{
"selfLink": string,
"value": string,
"visibility": string,
"kind": string,
"etag": string,
"key": string
} |
Campi |
selfLink |
string
Solo output. Il link a questa proprietà.
|
value |
string
Il valore di questa proprietà.
|
visibility |
string
La visibilità di questa proprietà. I valori consentiti sono PRIVATE (predefinito) e PUBLIC. Le proprietà private possono essere recuperate solo utilizzando una richiesta autenticata. Una richiesta autenticata utilizza un token di accesso ottenuto con un ID client OAuth 2. Non puoi utilizzare una chiave API per recuperare proprietà private.
|
kind |
string
Solo output. Questo valore è sempre drive#property .
|
etag |
string
Solo output. ETag della proprietà.
|
key |
string
La chiave di questa proprietà.
|
Metodi |
|
Consente di eliminare una proprietà. |
|
Recupera una proprietà tramite la relativa chiave. |
|
Aggiunge una proprietà a un file o la aggiorna se esiste già. |
|
Elenca le proprietà di un file. |
|
Aggiorna una proprietà. |
|
Aggiorna una proprietà. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[],[],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. |"]]