parents
Creates, updates, deletes, gets or lists a parents
resource.
Overview
Name | parents |
Type | Resource |
Id | googleworkspace.drivev2.parents |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Name | Datatype | Description |
---|---|---|
id | string | The ID of the parent. |
isRoot | boolean | Output only. Whether or not the parent is the root folder. |
kind | string | Output only. This is always drive#parentReference . (default: drive#parentReference) |
parentLink | string | Output only. A link to the parent. |
selfLink | string | Output only. A link back to this reference. |
Name | Datatype | Description |
---|---|---|
etag | string | The ETag of the list. |
items | array | The list of parents. |
kind | string | This is always drive#parentList . (default: drive#parentList) |
selfLink | string | A 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 , parentId | Gets a specific parent reference. | |
list | select | fileId | Lists a file's parents. | |
insert | insert | fileId | enforceSingleParent , supportsAllDrives , supportsTeamDrives | Adds a parent folder for a file. |
delete | delete | fileId , parentId | enforceSingleParent | Removes a parent from a file. |
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 | |
parentId | string | |
enforceSingleParent | boolean | |
supportsAllDrives | boolean | |
supportsTeamDrives | boolean |
SELECT
examples
- get
- list
Gets a specific parent reference.
SELECT
id,
isRoot,
kind,
parentLink,
selfLink
FROM googleworkspace.drivev2.parents
WHERE fileId = '{{ fileId }}' -- required
AND parentId = '{{ parentId }}' -- required
;
Lists a file's parents.
SELECT
etag,
items,
kind,
selfLink
FROM googleworkspace.drivev2.parents
WHERE fileId = '{{ fileId }}' -- required
;
INSERT
examples
- insert
- Manifest
Adds a parent folder for a file.
INSERT INTO googleworkspace.drivev2.parents (
data__selfLink,
data__id,
data__isRoot,
data__kind,
data__parentLink,
fileId,
enforceSingleParent,
supportsAllDrives,
supportsTeamDrives
)
SELECT
'{{ selfLink }}',
'{{ id }}',
{{ isRoot }},
'{{ kind }}',
'{{ parentLink }}',
'{{ fileId }}',
'{{ enforceSingleParent }}',
'{{ supportsAllDrives }}',
'{{ supportsTeamDrives }}'
RETURNING
id,
isRoot,
kind,
parentLink,
selfLink
;
# Description fields are for documentation purposes
- name: parents
props:
- name: fileId
value: string
description: Required parameter for the parents resource.
- name: selfLink
value: string
description: >
Output only. A link back to this reference.
- name: id
value: string
description: >
The ID of the parent.
- name: isRoot
value: boolean
description: >
Output only. Whether or not the parent is the root folder.
- name: kind
value: string
description: >
Output only. This is always `drive#parentReference`.
default: drive#parentReference
- name: parentLink
value: string
description: >
Output only. A link to the parent.
- name: enforceSingleParent
value: boolean
- name: supportsAllDrives
value: boolean
- name: supportsTeamDrives
value: boolean
DELETE
examples
- delete
Removes a parent from a file.
DELETE FROM googleworkspace.drivev2.parents
WHERE fileId = '{{ fileId }}' --required
AND parentId = '{{ parentId }}' --required
AND enforceSingleParent = '{{ enforceSingleParent }}'
;