drives
Creates, updates, deletes, gets or lists a drives
resource.
Overview
Name | drives |
Type | Resource |
Id | googleworkspace.drivev2.drives |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Name | Datatype | Description |
---|---|---|
id | string | Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive. |
name | string | The name of this shared drive. |
backgroundImageFile | object | An image file and cropping parameters from which a background image for this shared drive is set. This is a write only field; it can only be set on drive.drives.update requests that don't set themeId . When specified, all fields of the backgroundImageFile must be set. |
backgroundImageLink | string | Output only. A short-lived link to this shared drive's background image. |
capabilities | object | Output only. Capabilities the current user has on this shared drive. |
colorRgb | string | The color of this shared drive as an RGB hex string. It can only be set on a drive.drives.update request that does not set themeId . |
createdDate | string (date-time) | The time at which the shared drive was created (RFC 3339 date-time). |
hidden | boolean | Whether the shared drive is hidden from default view. |
kind | string | Output only. This is always drive#drive (default: drive#drive) |
orgUnitId | string | Output only. The organizational unit of this shared drive. This field is only populated on drives.list responses when the useDomainAdminAccess parameter is set to true . |
restrictions | object | A set of restrictions that apply to this shared drive or items inside this shared drive. |
themeId | string | The ID of the theme from which the background image and color will be set. The set of possible driveThemes can be retrieved from a drive.about.get response. When not specified on a drive.drives.insert request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile . |
Name | Datatype | Description |
---|---|---|
id | string | Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive. |
name | string | The name of this shared drive. |
backgroundImageFile | object | An image file and cropping parameters from which a background image for this shared drive is set. This is a write only field; it can only be set on drive.drives.update requests that don't set themeId . When specified, all fields of the backgroundImageFile must be set. |
backgroundImageLink | string | Output only. A short-lived link to this shared drive's background image. |
capabilities | object | Output only. Capabilities the current user has on this shared drive. |
colorRgb | string | The color of this shared drive as an RGB hex string. It can only be set on a drive.drives.update request that does not set themeId . |
createdDate | string (date-time) | The time at which the shared drive was created (RFC 3339 date-time). |
hidden | boolean | Whether the shared drive is hidden from default view. |
kind | string | Output only. This is always drive#drive (default: drive#drive) |
orgUnitId | string | Output only. The organizational unit of this shared drive. This field is only populated on drives.list responses when the useDomainAdminAccess parameter is set to true . |
restrictions | object | A set of restrictions that apply to this shared drive or items inside this shared drive. |
themeId | string | The ID of the theme from which the background image and color will be set. The set of possible driveThemes can be retrieved from a drive.about.get response. When not specified on a drive.drives.insert request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile . |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | driveId | useDomainAdminAccess | Gets a shared drive's metadata by ID. |
list | select | maxResults , pageToken , q , useDomainAdminAccess | Lists the user's shared drives. This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see the Search for shared drives guide. | |
insert | insert | requestId | Creates a new shared drive. | |
update | replace | driveId | useDomainAdminAccess | Updates the metadata for a shared drive. |
delete | delete | driveId | useDomainAdminAccess , allowItemDeletion | Permanently deletes a shared drive for which the user is an organizer . The shared drive cannot contain any untrashed items. |
hide | exec | driveId | Hides a shared drive from the default view. | |
unhide | exec | driveId | Restores a shared drive to the default view. |
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 |
---|---|---|
driveId | string | |
requestId | string | |
allowItemDeletion | boolean | |
maxResults | integer (int32) | |
pageToken | string | |
q | string | |
useDomainAdminAccess | boolean |
SELECT
examples
- get
- list
Gets a shared drive's metadata by ID.
SELECT
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdDate,
hidden,
kind,
orgUnitId,
restrictions,
themeId
FROM googleworkspace.drivev2.drives
WHERE driveId = '{{ driveId }}' -- required
AND useDomainAdminAccess = '{{ useDomainAdminAccess }}'
;
Lists the user's shared drives. This method accepts the q
parameter, which is a search query combining one or more search terms. For more information, see the Search for shared drives guide.
SELECT
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdDate,
hidden,
kind,
orgUnitId,
restrictions,
themeId
FROM googleworkspace.drivev2.drives
WHERE maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND q = '{{ q }}'
AND useDomainAdminAccess = '{{ useDomainAdminAccess }}'
;
INSERT
examples
- insert
- Manifest
Creates a new shared drive.
INSERT INTO googleworkspace.drivev2.drives (
data__id,
data__name,
data__colorRgb,
data__kind,
data__backgroundImageLink,
data__capabilities,
data__themeId,
data__backgroundImageFile,
data__createdDate,
data__hidden,
data__restrictions,
data__orgUnitId,
requestId
)
SELECT
'{{ id }}',
'{{ name }}',
'{{ colorRgb }}',
'{{ kind }}',
'{{ backgroundImageLink }}',
'{{ capabilities }}',
'{{ themeId }}',
'{{ backgroundImageFile }}',
'{{ createdDate }}',
{{ hidden }},
'{{ restrictions }}',
'{{ orgUnitId }}',
'{{ requestId }}'
RETURNING
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdDate,
hidden,
kind,
orgUnitId,
restrictions,
themeId
;
# Description fields are for documentation purposes
- name: drives
props:
- name: requestId
value: string
description: Required parameter for the drives resource.
- name: id
value: string
description: >
Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive.
- name: name
value: string
description: >
The name of this shared drive.
- name: colorRgb
value: string
description: >
The color of this shared drive as an RGB hex string. It can only be set on a `drive.drives.update` request that does not set `themeId`.
- name: kind
value: string
description: >
Output only. This is always `drive#drive`
default: drive#drive
- name: backgroundImageLink
value: string
description: >
Output only. A short-lived link to this shared drive's background image.
- name: capabilities
value: object
description: >
Output only. Capabilities the current user has on this shared drive.
- name: themeId
value: string
description: >
The ID of the theme from which the background image and color will be set. The set of possible `driveThemes` can be retrieved from a `drive.about.get` response. When not specified on a `drive.drives.insert` request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set `colorRgb` or `backgroundImageFile`.
- name: backgroundImageFile
value: object
description: >
An image file and cropping parameters from which a background image for this shared drive is set. This is a write only field; it can only be set on `drive.drives.update` requests that don't set `themeId`. When specified, all fields of the `backgroundImageFile` must be set.
- name: createdDate
value: string
description: >
The time at which the shared drive was created (RFC 3339 date-time).
- name: hidden
value: boolean
description: >
Whether the shared drive is hidden from default view.
- name: restrictions
value: object
description: >
A set of restrictions that apply to this shared drive or items inside this shared drive.
- name: orgUnitId
value: string
description: >
Output only. The organizational unit of this shared drive. This field is only populated on `drives.list` responses when the `useDomainAdminAccess` parameter is set to `true`.
REPLACE
examples
- update
Updates the metadata for a shared drive.
REPLACE googleworkspace.drivev2.drives
SET
data__id = '{{ id }}',
data__name = '{{ name }}',
data__colorRgb = '{{ colorRgb }}',
data__kind = '{{ kind }}',
data__backgroundImageLink = '{{ backgroundImageLink }}',
data__capabilities = '{{ capabilities }}',
data__themeId = '{{ themeId }}',
data__backgroundImageFile = '{{ backgroundImageFile }}',
data__createdDate = '{{ createdDate }}',
data__hidden = {{ hidden }},
data__restrictions = '{{ restrictions }}',
data__orgUnitId = '{{ orgUnitId }}'
WHERE
driveId = '{{ driveId }}' --required
AND useDomainAdminAccess = {{ useDomainAdminAccess}}
RETURNING
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdDate,
hidden,
kind,
orgUnitId,
restrictions,
themeId;
DELETE
examples
- delete
Permanently deletes a shared drive for which the user is an organizer
. The shared drive cannot contain any untrashed items.
DELETE FROM googleworkspace.drivev2.drives
WHERE driveId = '{{ driveId }}' --required
AND useDomainAdminAccess = '{{ useDomainAdminAccess }}'
AND allowItemDeletion = '{{ allowItemDeletion }}'
;
Lifecycle Methods
- hide
- unhide
Hides a shared drive from the default view.
EXEC googleworkspace.drivev2.drives.hide
@driveId='{{ driveId }}' --required
;
Restores a shared drive to the default view.
EXEC googleworkspace.drivev2.drives.unhide
@driveId='{{ driveId }}' --required
;