document_schemas
Creates, updates, deletes, gets or lists a document_schemas
resource.
Overview
Name | document_schemas |
Type | Resource |
Id | google.contentwarehouse.document_schemas |
Fields
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. |
description | string | Schema description. |
createTime | string | Output only. The time when the document schema is created. |
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 | Output only. The time when the document schema is last updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | documentSchemasId, locationsId, projectsId | Gets a document schema. Returns NOT_FOUND if the document schema does not exist. |
list | SELECT | locationsId, projectsId | Lists document schemas. |
create | INSERT | locationsId, projectsId | Creates a document schema. |
delete | DELETE | documentSchemasId, locationsId, projectsId | 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. |
patch | UPDATE | documentSchemasId, locationsId, projectsId | 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. |
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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.contentwarehouse.document_schemas (
locationsId,
projectsId,
propertyDefinitions,
documentIsFolder,
description,
displayName,
name
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ propertyDefinitions }}',
{{ documentIsFolder }},
'{{ description }}',
'{{ displayName }}',
'{{ name }}'
;
- name: your_resource_model_name
props:
- name: propertyDefinitions
value:
- - name: mapTypeOptions
value: []
- name: isSearchable
value: boolean
- name: isRequired
value: boolean
- name: isRepeatable
value: boolean
- name: isMetadata
value: boolean
- name: dateTimeTypeOptions
value: []
- name: name
value: string
- name: displayName
value: string
- name: timestampTypeOptions
value: []
- name: floatTypeOptions
value: []
- name: retrievalImportance
value: string
- name: integerTypeOptions
value: []
- name: textTypeOptions
value: []
- name: propertyTypeOptions
value:
- name: propertyDefinitions
value:
- - name: isSearchable
value: boolean
- name: isRequired
value: boolean
- name: isRepeatable
value: boolean
- name: isMetadata
value: boolean
- name: name
value: string
- name: displayName
value: string
- name: retrievalImportance
value: string
- name: schemaSources
value:
- - name: processorType
value: string
- name: name
value: string
- name: enumTypeOptions
value:
- name: possibleValues
value:
- string
- name: validationCheckDisabled
value: boolean
- name: isFilterable
value: boolean
- name: schemaSources
value:
- - name: processorType
value: string
- name: name
value: string
- name: isFilterable
value: boolean
- name: documentIsFolder
value: boolean
- name: description
value: string
- name: displayName
value: string
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
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 }}';