Skip to main content

children

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

Overview

Namechildren
TypeResource
Idgoogleworkspace.drivev2.children

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the child.
childLinkstringOutput only. A link to the child.
kindstringOutput only. This is always drive#childReference. (default: drive#childReference)
selfLinkstringOutput only. A link back to this reference.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfolderId, childIdGets a specific child reference.
listselectfolderIdmaxResults, orderBy, pageToken, qLists a folder's children.
insertinsertfolderIdenforceSingleParent, supportsAllDrives, supportsTeamDrivesInserts a file into a folder.
deletedeletefolderId, childIdenforceSingleParentRemoves a child from a folder.

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
childIdstring
folderIdstring
enforceSingleParentboolean
maxResultsinteger (int32)
orderBystring
pageTokenstring
qstring
supportsAllDrivesboolean
supportsTeamDrivesboolean

SELECT examples

Gets a specific child reference.

SELECT
id,
childLink,
kind,
selfLink
FROM googleworkspace.drivev2.children
WHERE folderId = '{{ folderId }}' -- required
AND childId = '{{ childId }}' -- required
;

INSERT examples

Inserts a file into a folder.

INSERT INTO googleworkspace.drivev2.children (
data__id,
data__selfLink,
data__kind,
data__childLink,
folderId,
enforceSingleParent,
supportsAllDrives,
supportsTeamDrives
)
SELECT
'{{ id }}',
'{{ selfLink }}',
'{{ kind }}',
'{{ childLink }}',
'{{ folderId }}',
'{{ enforceSingleParent }}',
'{{ supportsAllDrives }}',
'{{ supportsTeamDrives }}'
RETURNING
id,
childLink,
kind,
selfLink
;

DELETE examples

Removes a child from a folder.

DELETE FROM googleworkspace.drivev2.children
WHERE folderId = '{{ folderId }}' --required
AND childId = '{{ childId }}' --required
AND enforceSingleParent = '{{ enforceSingleParent }}'
;