Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idgoogle.discoveryengine.schemas

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. The full resource name of the schema, in the format of projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
jsonSchemastringThe JSON representation of the schema.
structSchemaobjectThe structured representation of the schema.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_data_stores_schemas_getselectprojectsId, locationsId, collectionsId, dataStoresId, schemasIdGets a Schema.
projects_locations_collections_data_stores_schemas_listselectprojectsId, locationsId, collectionsId, dataStoresIdpageSize, pageTokenGets a list of Schemas.
projects_locations_data_stores_schemas_getselectprojectsId, locationsId, dataStoresId, schemasIdGets a Schema.
projects_locations_data_stores_schemas_listselectprojectsId, locationsId, dataStoresIdpageSize, pageTokenGets a list of Schemas.
projects_locations_collections_data_stores_schemas_createinsertprojectsId, locationsId, collectionsId, dataStoresIdschemaIdCreates a Schema.
projects_locations_data_stores_schemas_createinsertprojectsId, locationsId, dataStoresIdschemaIdCreates a Schema.
projects_locations_collections_data_stores_schemas_patchupdateprojectsId, locationsId, collectionsId, dataStoresId, schemasIdallowMissingUpdates a Schema.
projects_locations_data_stores_schemas_patchupdateprojectsId, locationsId, dataStoresId, schemasIdallowMissingUpdates a Schema.
projects_locations_collections_data_stores_schemas_deletedeleteprojectsId, locationsId, collectionsId, dataStoresId, schemasIdDeletes a Schema.
projects_locations_data_stores_schemas_deletedeleteprojectsId, locationsId, dataStoresId, schemasIdDeletes 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
collectionsIdstring
dataStoresIdstring
locationsIdstring
projectsIdstring
schemasIdstring
allowMissingboolean
pageSizeinteger (int32)
pageTokenstring
schemaIdstring

SELECT examples

Gets a Schema.

SELECT
name,
jsonSchema,
structSchema
FROM google.discoveryengine.schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND schemasId = '{{ schemasId }}' -- required;

INSERT examples

Creates a Schema.

INSERT INTO google.discoveryengine.schemas (
data__structSchema,
data__jsonSchema,
data__name,
projectsId,
locationsId,
collectionsId,
dataStoresId,
schemaId
)
SELECT
'{{ structSchema }}',
'{{ jsonSchema }}',
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ collectionsId }}',
'{{ dataStoresId }}',
'{{ schemaId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a Schema.

UPDATE google.discoveryengine.schemas
SET
data__structSchema = '{{ structSchema }}',
data__jsonSchema = '{{ jsonSchema }}',
data__name = '{{ name }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND allowMissing = {{ allowMissing}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a Schema.

DELETE FROM google.discoveryengine.schemas
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND dataStoresId = '{{ dataStoresId }}' --required
AND schemasId = '{{ schemasId }}' --required;