folders
Creates, updates, deletes, gets or lists a folders resource.
Overview
| Name | folders |
| Type | Resource |
| Id | google.dataform.folders |
Fields
The following fields are returned by SELECT queries:
- get
- query_folder_contents
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The Folder's name. |
containingFolder | string | Optional. The containing Folder resource name. This should take the format: projects/{project}/locations/{location}/folders/{folder}, projects/{project}/locations/{location}/teamFolders/{teamFolder}, or just "" if this is a root Folder. This field can only be updated through MoveFolder. |
createTime | string (google-datetime) | Output only. The timestamp of when the Folder was created. |
creatorIamPrincipal | string | Output only. The IAM principal identifier of the creator of the Folder. |
displayName | string | Required. The Folder's user-friendly name. |
internalMetadata | string | Output only. All the metadata information that is used internally to serve the resource. For example: timestamps, flags, status fields, etc. The format of this field is a JSON string. |
teamFolderName | string | Output only. The resource name of the TeamFolder that this Folder is associated with. This should take the format: projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this is not set, the Folder is not associated with a TeamFolder and is a UserFolder. |
updateTime | string (google-datetime) | Output only. The timestamp of when the Folder was last updated. |
| Name | Datatype | Description |
|---|---|---|
entries | array | List of entries in the folder. |
nextPageToken | string | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, foldersId | Fetches a single Folder. | |
query_folder_contents | select | projectsId, locationsId, foldersId | pageSize, pageToken, filter, orderBy | Returns the contents of a given Folder. |
create | insert | projectsId, locationsId | Creates a new Folder in a given project and location. | |
patch | update | projectsId, locationsId, foldersId | updateMask | Updates a single Folder. |
delete | delete | projectsId, locationsId, foldersId | Deletes a single Folder. | |
move | exec | projectsId, locationsId, foldersId | Moves a Folder to a new Folder, TeamFolder, or the root location. |
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 |
|---|---|---|
foldersId | string | |
locationsId | string | |
projectsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- query_folder_contents
Fetches a single Folder.
SELECT
name,
containingFolder,
createTime,
creatorIamPrincipal,
displayName,
internalMetadata,
teamFolderName,
updateTime
FROM google.dataform.folders
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND foldersId = '{{ foldersId }}' -- required
;
Returns the contents of a given Folder.
SELECT
entries,
nextPageToken
FROM google.dataform.folders
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND foldersId = '{{ foldersId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- create
- Manifest
Creates a new Folder in a given project and location.
INSERT INTO google.dataform.folders (
data__displayName,
data__containingFolder,
data__name,
projectsId,
locationsId
)
SELECT
'{{ displayName }}',
'{{ containingFolder }}',
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
containingFolder,
createTime,
creatorIamPrincipal,
displayName,
internalMetadata,
teamFolderName,
updateTime
;
# Description fields are for documentation purposes
- name: folders
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the folders resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the folders resource.
- name: displayName
value: "{{ displayName }}"
description: |
Required. The Folder's user-friendly name.
- name: containingFolder
value: "{{ containingFolder }}"
description: |
Optional. The containing Folder resource name. This should take the format: projects/{project}/locations/{location}/folders/{folder}, projects/{project}/locations/{location}/teamFolders/{teamFolder}, or just "" if this is a root Folder. This field can only be updated through MoveFolder.
- name: name
value: "{{ name }}"
description: |
Identifier. The Folder's name.
UPDATE examples
- patch
Updates a single Folder.
UPDATE google.dataform.folders
SET
data__displayName = '{{ displayName }}',
data__containingFolder = '{{ containingFolder }}',
data__name = '{{ name }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND foldersId = '{{ foldersId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
containingFolder,
createTime,
creatorIamPrincipal,
displayName,
internalMetadata,
teamFolderName,
updateTime;
DELETE examples
- delete
Deletes a single Folder.
DELETE FROM google.dataform.folders
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND foldersId = '{{ foldersId }}' --required
;
Lifecycle Methods
- move
Moves a Folder to a new Folder, TeamFolder, or the root location.
EXEC google.dataform.folders.move
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@foldersId='{{ foldersId }}' --required
@@json=
'{
"destinationContainingFolder": "{{ destinationContainingFolder }}"
}'
;