schema_versions
Creates, updates, deletes, gets or lists a schema_versions resource.
Overview
| Name | schema_versions |
| Type | Resource |
| Id | google.documentai.schema_versions |
Fields
The following fields are returned by SELECT queries:
- projects_locations_schemas_schema_versions_get
- projects_locations_schemas_schema_versions_list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the SchemaVersion. Format: projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version} |
createTime | string (google-datetime) | Output only. The time when the SchemaVersion was created. |
displayName | string | Optional. The user-defined name of the SchemaVersion. |
labels | object | Optional. The GCP labels for the SchemaVersion. |
schema | object | Required. The schema of the SchemaVersion. (id: GoogleCloudDocumentaiV1DocumentSchema) |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the SchemaVersion. Format: projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version} |
createTime | string (google-datetime) | Output only. The time when the SchemaVersion was created. |
displayName | string | Optional. The user-defined name of the SchemaVersion. |
labels | object | Optional. The GCP labels for the SchemaVersion. |
schema | object | Required. The schema of the SchemaVersion. (id: GoogleCloudDocumentaiV1DocumentSchema) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_schemas_schema_versions_get | select | projectsId, locationsId, schemasId, schemaVersionsId | Gets a schema version. | |
projects_locations_schemas_schema_versions_list | select | projectsId, locationsId, schemasId | pageSize, pageToken | Lists SchemaVersions. |
projects_locations_schemas_schema_versions_create | insert | projectsId, locationsId, schemasId | Creates a schema version. | |
projects_locations_schemas_schema_versions_patch | update | projectsId, locationsId, schemasId, schemaVersionsId | updateMask | Updates a schema version. Editable fields are: - display_name - labels |
projects_locations_schemas_schema_versions_delete | delete | projectsId, locationsId, schemasId, schemaVersionsId | Deletes a schema version. | |
projects_locations_schemas_schema_versions_generate | exec | projectsId, locationsId, schemasId | Generates a schema version. |
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 |
|---|---|---|
locationsId | string | |
projectsId | string | |
schemaVersionsId | string | |
schemasId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_locations_schemas_schema_versions_get
- projects_locations_schemas_schema_versions_list
Gets a schema version.
SELECT
name,
createTime,
displayName,
labels,
schema
FROM google.documentai.schema_versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND schemasId = '{{ schemasId }}' -- required
AND schemaVersionsId = '{{ schemaVersionsId }}' -- required
;
Lists SchemaVersions.
SELECT
name,
createTime,
displayName,
labels,
schema
FROM google.documentai.schema_versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND schemasId = '{{ schemasId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- projects_locations_schemas_schema_versions_create
- Manifest
Creates a schema version.
INSERT INTO google.documentai.schema_versions (
data__name,
data__displayName,
data__labels,
data__schema,
projectsId,
locationsId,
schemasId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ labels }}',
'{{ schema }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ schemasId }}'
RETURNING
name,
createTime,
displayName,
labels,
schema
;
# Description fields are for documentation purposes
- name: schema_versions
props:
- name: projectsId
value: string
description: Required parameter for the schema_versions resource.
- name: locationsId
value: string
description: Required parameter for the schema_versions resource.
- name: schemasId
value: string
description: Required parameter for the schema_versions resource.
- name: name
value: string
description: >
Identifier. The resource name of the SchemaVersion. Format: `projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version}`
- name: displayName
value: string
description: >
Optional. The user-defined name of the SchemaVersion.
- name: labels
value: object
description: >
Optional. The GCP labels for the SchemaVersion.
- name: schema
value: object
description: >
Required. The schema of the SchemaVersion.
UPDATE examples
- projects_locations_schemas_schema_versions_patch
Updates a schema version. Editable fields are: - display_name - labels
UPDATE google.documentai.schema_versions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__schema = '{{ schema }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND schemaVersionsId = '{{ schemaVersionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
displayName,
labels,
schema;
DELETE examples
- projects_locations_schemas_schema_versions_delete
Deletes a schema version.
DELETE FROM google.documentai.schema_versions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND schemaVersionsId = '{{ schemaVersionsId }}' --required
;
Lifecycle Methods
- projects_locations_schemas_schema_versions_generate
Generates a schema version.
EXEC google.documentai.schema_versions.projects_locations_schemas_schema_versions_generate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@schemasId='{{ schemasId }}' --required
@@json=
'{
"inlineDocuments": "{{ inlineDocuments }}",
"rawDocuments": "{{ rawDocuments }}",
"gcsDocuments": "{{ gcsDocuments }}",
"gcsPrefix": "{{ gcsPrefix }}",
"baseSchemaVersion": "{{ baseSchemaVersion }}",
"generateSchemaVersionParams": "{{ generateSchemaVersionParams }}"
}'
;