Skip to main content

properties

Creates, updates, deletes, gets or lists a properties resource.

Overview

Nameproperties
TypeResource
Idgoogleworkspace.drivev2.properties

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
etagstringOutput only. ETag of the property.
keystringThe key of this property.
kindstringOutput only. This is always drive#property. (default: drive#property)
selfLinkstringOutput only. The link back to this property.
valuestringThe value of this property.
visibilitystringThe 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfileId, propertyKeyvisibilityGets a property by its key.
listselectfileIdLists a file's properties.
insertinsertfileIdAdds a property to a file, or updates it if it already exists.
patchupdatefileId, propertyKeyvisibilityUpdates a property.
updatereplacefileId, propertyKeyvisibilityUpdates a property.
deletedeletefileId, propertyKeyvisibilityDeletes 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.

NameDatatypeDescription
fileIdstring
propertyKeystring
visibilitystring

SELECT examples

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 }}'
;

INSERT examples

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
;

UPDATE examples

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

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

Deletes a property.

DELETE FROM googleworkspace.drivev2.properties
WHERE fileId = '{{ fileId }}' --required
AND propertyKey = '{{ propertyKey }}' --required
AND visibility = '{{ visibility }}'
;