Skip to main content

folders

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

Overview

Namefolders
TypeResource
Idgoogle.dataform.folders

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The Folder's name.
containingFolderstringOptional. 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.
createTimestring (google-datetime)Output only. The timestamp of when the Folder was created.
creatorIamPrincipalstringOutput only. The IAM principal identifier of the creator of the Folder.
displayNamestringRequired. The Folder's user-friendly name.
internalMetadatastringOutput 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.
teamFolderNamestringOutput 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.
updateTimestring (google-datetime)Output only. The timestamp of when the Folder was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, foldersIdFetches a single Folder.
query_folder_contentsselectprojectsId, locationsId, foldersIdpageSize, pageToken, filter, orderByReturns the contents of a given Folder.
createinsertprojectsId, locationsIdCreates a new Folder in a given project and location.
patchupdateprojectsId, locationsId, foldersIdupdateMaskUpdates a single Folder.
deletedeleteprojectsId, locationsId, foldersIdDeletes a single Folder.
moveexecprojectsId, locationsId, foldersIdMoves 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.

NameDatatypeDescription
foldersIdstring
locationsIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

Deletes a single Folder.

DELETE FROM google.dataform.folders
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND foldersId = '{{ foldersId }}' --required
;

Lifecycle Methods

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 }}"
}'
;