Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idgoogle.documentai.schemas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The resource name of the Schema. Format: projects/{project}/locations/{location}/schemas/{schema}
createTimestring (google-datetime)Output only. The time when the Schema was created.
displayNamestringOptional. The user-defined name of the Schema.
labelsobjectOptional. The GCP labels for the Schema.
updateTimestring (google-datetime)Output only. The time when the Schema was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_schemas_getselectprojectsId, locationsId, schemasIdGets a schema.
projects_locations_schemas_listselectprojectsId, locationsIdpageSize, pageTokenLists Schemas.
projects_locations_schemas_createinsertprojectsId, locationsIdCreates a schema.
projects_locations_schemas_patchupdateprojectsId, locationsId, schemasIdupdateMaskUpdates a schema. Editable fields are: - display_name - labels
projects_locations_schemas_deletedeleteprojectsId, locationsId, schemasIdforceDeletes 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.

NameDatatypeDescription
locationsIdstring
projectsIdstring
schemasIdstring
forceboolean
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

Deletes a schema.

DELETE FROM google.documentai.schemas
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND force = '{{ force }}'
;