properties
Creates, updates, deletes, gets or lists a properties resource.
Overview
| Name | properties |
| Type | Resource |
| Id | googleworkspace.drivev2.properties |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
etag | string | Output only. ETag of the property. |
key | string | The key of this property. |
kind | string | Output only. This is always drive#property. (default: drive#property) |
selfLink | string | Output only. The link back to this property. |
value | string | The value of this property. |
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. |
| Name | Datatype | Description |
|---|---|---|
etag | string | The ETag of the list. |
items | array | The list of properties. |
kind | string | This is always drive#propertyList. (default: drive#propertyList) |
selfLink | string | The link back to this list. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | fileId, propertyKey | visibility | Gets a property by its key. |
list | select | fileId | Lists a file's properties. | |
insert | insert | fileId | Adds a property to a file, or updates it if it already exists. | |
patch | update | fileId, propertyKey | visibility | Updates a property. |
update | replace | fileId, propertyKey | visibility | Updates a property. |
delete | delete | fileId, propertyKey | visibility | Deletes a property. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
fileId | string | |
propertyKey | string | |
visibility | string |
SELECT examples
- get
- list
Gets a property by its key.
SELECT
etag,
key,
kind,
selfLink,
value,
visibility
FROM googleworkspace.drivev2.properties
WHERE fileId = '{{ fileId }}' -- required
AND propertyKey = '{{ propertyKey }}' -- required
AND visibility = '{{ visibility }}'
;
Lists a file's properties.
SELECT
etag,
items,
kind,
selfLink
FROM googleworkspace.drivev2.properties
WHERE fileId = '{{ fileId }}' -- required
;
INSERT examples
- insert
- Manifest
Adds a property to a file, or updates it if it already exists.
INSERT INTO googleworkspace.drivev2.properties (
data__kind,
data__selfLink,
data__visibility,
data__key,
data__value,
data__etag,
fileId
)
SELECT
'{{ kind }}',
'{{ selfLink }}',
'{{ visibility }}',
'{{ key }}',
'{{ value }}',
'{{ etag }}',
'{{ fileId }}'
RETURNING
etag,
key,
kind,
selfLink,
value,
visibility
;
# Description fields are for documentation purposes
- name: properties
props:
- name: fileId
value: "{{ fileId }}"
description: Required parameter for the properties resource.
- name: kind
value: "{{ kind }}"
description: |
Output only. This is always `drive#property`.
default: drive#property
- name: selfLink
value: "{{ selfLink }}"
description: |
Output only. The link back to this property.
- name: visibility
value: "{{ visibility }}"
description: |
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.
- name: key
value: "{{ key }}"
description: |
The key of this property.
- name: value
value: "{{ value }}"
description: |
The value of this property.
- name: etag
value: "{{ etag }}"
description: |
Output only. ETag of the property.
UPDATE examples
- patch
Updates a property.
UPDATE googleworkspace.drivev2.properties
SET
data__kind = '{{ kind }}',
data__selfLink = '{{ selfLink }}',
data__visibility = '{{ visibility }}',
data__key = '{{ key }}',
data__value = '{{ value }}',
data__etag = '{{ etag }}'
WHERE
fileId = '{{ fileId }}' --required
AND propertyKey = '{{ propertyKey }}' --required
AND visibility = '{{ visibility}}'
RETURNING
etag,
key,
kind,
selfLink,
value,
visibility;
REPLACE examples
- update
Updates a property.
REPLACE googleworkspace.drivev2.properties
SET
data__kind = '{{ kind }}',
data__selfLink = '{{ selfLink }}',
data__visibility = '{{ visibility }}',
data__key = '{{ key }}',
data__value = '{{ value }}',
data__etag = '{{ etag }}'
WHERE
fileId = '{{ fileId }}' --required
AND propertyKey = '{{ propertyKey }}' --required
AND visibility = '{{ visibility}}'
RETURNING
etag,
key,
kind,
selfLink,
value,
visibility;
DELETE examples
- delete
Deletes a property.
DELETE FROM googleworkspace.drivev2.properties
WHERE fileId = '{{ fileId }}' --required
AND propertyKey = '{{ propertyKey }}' --required
AND visibility = '{{ visibility }}'
;