Skip to main content

document_schemas

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

Overview

Namedocument_schemas
TypeResource
Idgoogle.contentwarehouse.document_schemas

Fields

NameDatatypeDescription
namestringThe resource name of the document schema. Format: projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. The name is ignored when creating a document schema.
descriptionstringSchema description.
createTimestringOutput only. The time when the document schema is created.
displayNamestringRequired. Name of the schema given by the user. Must be unique per project.
documentIsFolderbooleanDocument Type, true refers the document is a folder, otherwise it is a typical document.
propertyDefinitionsarrayDocument details.
updateTimestringOutput only. The time when the document schema is last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdocumentSchemasId, locationsId, projectsIdGets a document schema. Returns NOT_FOUND if the document schema does not exist.
listSELECTlocationsId, projectsIdLists document schemas.
createINSERTlocationsId, projectsIdCreates a document schema.
deleteDELETEdocumentSchemasId, locationsId, projectsIdDeletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.
patchUPDATEdocumentSchemasId, locationsId, projectsIdUpdates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

SELECT examples

Lists document schemas.

SELECT
name,
description,
createTime,
displayName,
documentIsFolder,
propertyDefinitions,
updateTime
FROM google.contentwarehouse.document_schemas
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new document_schemas resource.

/*+ create */
INSERT INTO google.contentwarehouse.document_schemas (
locationsId,
projectsId,
propertyDefinitions,
documentIsFolder,
description,
displayName,
name
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ propertyDefinitions }}',
{{ documentIsFolder }},
'{{ description }}',
'{{ displayName }}',
'{{ name }}'
;

UPDATE example

Updates a document_schemas resource.

/*+ update */
UPDATE google.contentwarehouse.document_schemas
SET
documentSchema = '{{ documentSchema }}'
WHERE
documentSchemasId = '{{ documentSchemasId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified document_schemas resource.

/*+ delete */
DELETE FROM google.contentwarehouse.document_schemas
WHERE documentSchemasId = '{{ documentSchemasId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';