Skip to main content

custom_classes

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

Overview

Namecustom_classes
TypeResource
Idgoogle.speechv2.custom_classes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the CustomClass. Format: projects/{project}/locations/{location}/customClasses/{custom_class}.
annotationsobjectOptional. Allows users to store small amounts of arbitrary data. Both the key and the value must be 63 characters or less each. At most 100 annotations.
createTimestring (google-datetime)Output only. Creation time.
deleteTimestring (google-datetime)Output only. The time at which this resource was requested for deletion.
displayNamestringOptional. User-settable, human-readable name for the CustomClass. Must be 63 characters or less.
etagstringOutput only. This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
expireTimestring (google-datetime)Output only. The time at which this resource will be purged.
itemsarrayA collection of class items.
kmsKeyNamestringOutput only. The KMS key name with which the CustomClass is encrypted. The expected format is projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
kmsKeyVersionNamestringOutput only. The KMS key version name with which the CustomClass is encrypted. The expected format is projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}.
reconcilingbooleanOutput only. Whether or not this CustomClass is in the process of being updated.
statestringOutput only. The CustomClass lifecycle state.
uidstringOutput only. System-assigned unique identifier for the CustomClass.
updateTimestring (google-datetime)Output only. The most recent time this resource was modified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, customClassesIdReturns the requested CustomClass.
listselectprojectsId, locationsIdpageSize, pageToken, showDeletedLists CustomClasses.
createinsertprojectsId, locationsIdvalidateOnly, customClassIdCreates a CustomClass.
patchupdateprojectsId, locationsId, customClassesIdupdateMask, validateOnlyUpdates the CustomClass.
deletedeleteprojectsId, locationsId, customClassesIdvalidateOnly, allowMissing, etagDeletes the CustomClass.
undeleteexecprojectsId, locationsId, customClassesIdUndeletes the CustomClass.

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
customClassesIdstring
locationsIdstring
projectsIdstring
allowMissingboolean
customClassIdstring
etagstring
pageSizeinteger (int32)
pageTokenstring
showDeletedboolean
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Returns the requested CustomClass.

SELECT
name,
annotations,
createTime,
deleteTime,
displayName,
etag,
expireTime,
items,
kmsKeyName,
kmsKeyVersionName,
reconciling,
state,
uid,
updateTime
FROM google.speechv2.custom_classes
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND customClassesId = '{{ customClassesId }}' -- required
;

INSERT examples

Creates a CustomClass.

INSERT INTO google.speechv2.custom_classes (
data__displayName,
data__items,
data__annotations,
projectsId,
locationsId,
validateOnly,
customClassId
)
SELECT
'{{ displayName }}',
'{{ items }}',
'{{ annotations }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ validateOnly }}',
'{{ customClassId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the CustomClass.

UPDATE google.speechv2.custom_classes
SET
data__displayName = '{{ displayName }}',
data__items = '{{ items }}',
data__annotations = '{{ annotations }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND customClassesId = '{{ customClassesId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes the CustomClass.

DELETE FROM google.speechv2.custom_classes
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND customClassesId = '{{ customClassesId }}' --required
AND validateOnly = '{{ validateOnly }}'
AND allowMissing = '{{ allowMissing }}'
AND etag = '{{ etag }}'
;

Lifecycle Methods

Undeletes the CustomClass.

EXEC google.speechv2.custom_classes.undelete 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@customClassesId='{{ customClassesId }}' --required
@@json=
'{
"name": "{{ name }}",
"validateOnly": {{ validateOnly }},
"etag": "{{ etag }}"
}'
;