drives
Creates, updates, deletes, gets or lists a drives
resource.
Overview
Name | drives |
Type | Resource |
Id | googleworkspace.drivev3.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 . |
createdTime | 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. Identifies what kind of resource this is. Value: the fixed string "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. Note that restrictions can't be set when creating a shared drive. To add a restriction, first create a shared drive and then use drives.update to add restrictions. |
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.create 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 . |
createdTime | 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. Identifies what kind of resource this is. Value: the fixed string "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. Note that restrictions can't be set when creating a shared drive. To add a restriction, first create a shared drive and then use drives.update to add restrictions. |
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.create 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. For more information, see Manage shared drives. |
list | select | pageSize , 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. | |
create | insert | requestId | Creates a shared drive. For more information, see Manage shared drives. | |
update | update | driveId | useDomainAdminAccess | Updates the metadata for a shared drive. For more information, see Manage shared drives. |
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. For more information, see Manage shared drives. |
hide | exec | driveId | Hides a shared drive from the default view. For more information, see Manage shared drives. | |
unhide | exec | driveId | Restores a shared drive to the default view. For more information, see Manage shared drives. |
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 | |
pageSize | integer (int32) | |
pageToken | string | |
q | string | |
useDomainAdminAccess | boolean |
SELECT
examples
- get
- list
Gets a shared drive's metadata by ID. For more information, see Manage shared drives.
SELECT
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdTime,
hidden,
kind,
orgUnitId,
restrictions,
themeId
FROM googleworkspace.drivev3.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,
createdTime,
hidden,
kind,
orgUnitId,
restrictions,
themeId
FROM googleworkspace.drivev3.drives
WHERE pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND q = '{{ q }}'
AND useDomainAdminAccess = '{{ useDomainAdminAccess }}'
;
INSERT
examples
- create
- Manifest
Creates a shared drive. For more information, see Manage shared drives.
INSERT INTO googleworkspace.drivev3.drives (
data__id,
data__name,
data__colorRgb,
data__kind,
data__backgroundImageLink,
data__capabilities,
data__themeId,
data__backgroundImageFile,
data__createdTime,
data__hidden,
data__restrictions,
data__orgUnitId,
requestId
)
SELECT
'{{ id }}',
'{{ name }}',
'{{ colorRgb }}',
'{{ kind }}',
'{{ backgroundImageLink }}',
'{{ capabilities }}',
'{{ themeId }}',
'{{ backgroundImageFile }}',
'{{ createdTime }}',
{{ hidden }},
'{{ restrictions }}',
'{{ orgUnitId }}',
'{{ requestId }}'
RETURNING
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdTime,
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. Identifies what kind of resource this is. Value: the fixed string `"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.create` 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: createdTime
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. Note that restrictions can't be set when creating a shared drive. To add a restriction, first create a shared drive and then use `drives.update` to add restrictions.
- 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`.
UPDATE
examples
- update
Updates the metadata for a shared drive. For more information, see Manage shared drives.
UPDATE googleworkspace.drivev3.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__createdTime = '{{ createdTime }}',
data__hidden = {{ hidden }},
data__restrictions = '{{ restrictions }}',
data__orgUnitId = '{{ orgUnitId }}'
WHERE
driveId = '{{ driveId }}' --required
AND useDomainAdminAccess = {{ useDomainAdminAccess}}
RETURNING
id,
name,
backgroundImageFile,
backgroundImageLink,
capabilities,
colorRgb,
createdTime,
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. For more information, see Manage shared drives.
DELETE FROM googleworkspace.drivev3.drives
WHERE driveId = '{{ driveId }}' --required
AND useDomainAdminAccess = '{{ useDomainAdminAccess }}'
AND allowItemDeletion = '{{ allowItemDeletion }}'
;
Lifecycle Methods
- hide
- unhide
Hides a shared drive from the default view. For more information, see Manage shared drives.
EXEC googleworkspace.drivev3.drives.hide
@driveId='{{ driveId }}' --required
;
Restores a shared drive to the default view. For more information, see Manage shared drives.
EXEC googleworkspace.drivev3.drives.unhide
@driveId='{{ driveId }}' --required
;