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__selfLink,
data__value,
data__visibility,
data__kind,
data__etag,
data__key,
fileId
)
SELECT
'{{ selfLink }}',
'{{ value }}',
'{{ visibility }}',
'{{ kind }}',
'{{ etag }}',
'{{ key }}',
'{{ fileId }}'
RETURNING
etag,
key,
kind,
selfLink,
value,
visibility
;
# Description fields are for documentation purposes
- name: properties
props:
- name: fileId
value: string
description: Required parameter for the properties resource.
- name: selfLink
value: string
description: >
Output only. The link back to this property.
- name: value
value: string
description: >
The value of this property.
- name: visibility
value: string
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: kind
value: string
description: >
Output only. This is always `drive#property`.
default: drive#property
- name: etag
value: string
description: >
Output only. ETag of the property.
- name: key
value: string
description: >
The key of this property.
UPDATE
examples
- patch
Updates a property.
UPDATE googleworkspace.drivev2.properties
SET
data__selfLink = '{{ selfLink }}',
data__value = '{{ value }}',
data__visibility = '{{ visibility }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__key = '{{ key }}'
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__selfLink = '{{ selfLink }}',
data__value = '{{ value }}',
data__visibility = '{{ visibility }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__key = '{{ key }}'
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 }}'
;