document_schemas
Creates, updates, deletes, gets or lists a document_schemas
resource.
Overview
Name | document_schemas |
Type | Resource |
Id | google.contentwarehouse.document_schemas |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The 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. |
createTime | string (google-datetime) | Output only. The time when the document schema is created. |
description | string | Schema description. |
displayName | string | Required. Name of the schema given by the user. Must be unique per project. |
documentIsFolder | boolean | Document Type, true refers the document is a folder, otherwise it is a typical document. |
propertyDefinitions | array | Document details. |
updateTime | string (google-datetime) | Output only. The time when the document schema is last updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The 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. |
createTime | string (google-datetime) | Output only. The time when the document schema is created. |
description | string | Schema description. |
displayName | string | Required. Name of the schema given by the user. Must be unique per project. |
documentIsFolder | boolean | Document Type, true refers the document is a folder, otherwise it is a typical document. |
propertyDefinitions | array | Document details. |
updateTime | string (google-datetime) | Output only. The time when the document schema is last updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , documentSchemasId | Gets a document schema. Returns NOT_FOUND if the document schema does not exist. | |
list | select | projectsId , locationsId | pageSize , pageToken | Lists document schemas. |
create | insert | projectsId , locationsId | Creates a document schema. | |
patch | update | projectsId , locationsId , documentSchemasId | Updates 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. | |
delete | delete | projectsId , locationsId , documentSchemasId | Deletes 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. |
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 |
---|---|---|
documentSchemasId | string | |
locationsId | string | |
projectsId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Gets a document schema. Returns NOT_FOUND if the document schema does not exist.
SELECT
name,
createTime,
description,
displayName,
documentIsFolder,
propertyDefinitions,
updateTime
FROM google.contentwarehouse.document_schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND documentSchemasId = '{{ documentSchemasId }}' -- required;
Lists document schemas.
SELECT
name,
createTime,
description,
displayName,
documentIsFolder,
propertyDefinitions,
updateTime
FROM google.contentwarehouse.document_schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a document schema.
INSERT INTO google.contentwarehouse.document_schemas (
data__description,
data__displayName,
data__propertyDefinitions,
data__name,
data__documentIsFolder,
projectsId,
locationsId
)
SELECT
'{{ description }}',
'{{ displayName }}',
'{{ propertyDefinitions }}',
'{{ name }}',
{{ documentIsFolder }},
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
description,
displayName,
documentIsFolder,
propertyDefinitions,
updateTime
;
# Description fields are for documentation purposes
- name: document_schemas
props:
- name: projectsId
value: string
description: Required parameter for the document_schemas resource.
- name: locationsId
value: string
description: Required parameter for the document_schemas resource.
- name: description
value: string
description: >
Schema description.
- name: displayName
value: string
description: >
Required. Name of the schema given by the user. Must be unique per project.
- name: propertyDefinitions
value: array
description: >
Document details.
- name: name
value: string
description: >
The 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.
- name: documentIsFolder
value: boolean
description: >
Document Type, true refers the document is a folder, otherwise it is a typical document.
UPDATE
examples
- patch
Updates 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.
UPDATE google.contentwarehouse.document_schemas
SET
data__documentSchema = '{{ documentSchema }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND documentSchemasId = '{{ documentSchemasId }}' --required
RETURNING
name,
createTime,
description,
displayName,
documentIsFolder,
propertyDefinitions,
updateTime;
DELETE
examples
- delete
Deletes 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.
DELETE FROM google.contentwarehouse.document_schemas
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND documentSchemasId = '{{ documentSchemasId }}' --required;