schemas
Creates, updates, deletes, gets or lists a schemas resource.
Overview
| Name | schemas |
| Type | Resource |
| Id | google.documentai.schemas |
Fields
The following fields are returned by SELECT queries:
- projects_locations_schemas_get
- projects_locations_schemas_list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the Schema. Format: projects/{project}/locations/{location}/schemas/{schema} |
createTime | string (google-datetime) | Output only. The time when the Schema was created. |
displayName | string | Optional. The user-defined name of the Schema. |
labels | object | Optional. The GCP labels for the Schema. |
updateTime | string (google-datetime) | Output only. The time when the Schema was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the Schema. Format: projects/{project}/locations/{location}/schemas/{schema} |
createTime | string (google-datetime) | Output only. The time when the Schema was created. |
displayName | string | Optional. The user-defined name of the Schema. |
labels | object | Optional. The GCP labels for the Schema. |
updateTime | string (google-datetime) | Output only. The time when the Schema was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_schemas_get | select | projectsId, locationsId, schemasId | Gets a schema. | |
projects_locations_schemas_list | select | projectsId, locationsId | pageSize, pageToken | Lists Schemas. |
projects_locations_schemas_create | insert | projectsId, locationsId | Creates a schema. | |
projects_locations_schemas_patch | update | projectsId, locationsId, schemasId | updateMask | Updates a schema. Editable fields are: - display_name - labels |
projects_locations_schemas_delete | delete | projectsId, locationsId, schemasId | force | Deletes a schema. |
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 | |
schemasId | string | |
force | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_locations_schemas_get
- projects_locations_schemas_list
Gets a schema.
SELECT
name,
createTime,
displayName,
labels,
updateTime
FROM google.documentai.schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND schemasId = '{{ schemasId }}' -- required
;
Lists Schemas.
SELECT
name,
createTime,
displayName,
labels,
updateTime
FROM google.documentai.schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- projects_locations_schemas_create
- Manifest
Creates a schema.
INSERT INTO google.documentai.schemas (
data__name,
data__displayName,
data__labels,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
displayName,
labels,
updateTime
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: projectsId
value: string
description: Required parameter for the schemas resource.
- name: locationsId
value: string
description: Required parameter for the schemas resource.
- name: name
value: string
description: >
Identifier. The resource name of the Schema. Format: `projects/{project}/locations/{location}/schemas/{schema}`
- name: displayName
value: string
description: >
Optional. The user-defined name of the Schema.
- name: labels
value: object
description: >
Optional. The GCP labels for the Schema.
UPDATE examples
- projects_locations_schemas_patch
Updates a schema. Editable fields are: - display_name - labels
UPDATE google.documentai.schemas
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
displayName,
labels,
updateTime;
DELETE examples
- projects_locations_schemas_delete
Deletes a schema.
DELETE FROM google.documentai.schemas
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND force = '{{ force }}'
;