Skip to main content

glossaries

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

Overview

Nameglossaries
TypeResource
Idgoogle.translate.glossaries

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. The resource name of the glossary. Glossary names have the form projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}.
displayNamestringOptional. The display name of the glossary.
endTimestring (google-datetime)Output only. When the glossary creation was finished.
entryCountinteger (int32)Output only. The number of entries defined in the glossary.
inputConfigobjectRequired. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints. (id: GlossaryInputConfig)
languageCodesSetobjectUsed with equivalent term set glossaries. (id: LanguageCodesSet)
languagePairobjectUsed with unidirectional glossaries. (id: LanguageCodePair)
submitTimestring (google-datetime)Output only. When CreateGlossary was called.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_glossaries_getselectprojectsId, locationsId, glossariesIdGets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
projects_locations_glossaries_listselectprojectsId, locationsIdpageSize, pageToken, filterLists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
projects_locations_glossaries_createinsertprojectsId, locationsIdCreates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
projects_locations_glossaries_patchupdateprojectsId, locationsId, glossariesIdupdateMaskUpdates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.
projects_locations_glossaries_deletedeleteprojectsId, locationsId, glossariesIdDeletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

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
glossariesIdstring
locationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

SELECT
name,
displayName,
endTime,
entryCount,
inputConfig,
languageCodesSet,
languagePair,
submitTime
FROM google.translate.glossaries
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND glossariesId = '{{ glossariesId }}' -- required;

INSERT examples

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

INSERT INTO google.translate.glossaries (
data__name,
data__languagePair,
data__languageCodesSet,
data__inputConfig,
data__displayName,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ languagePair }}',
'{{ languageCodesSet }}',
'{{ inputConfig }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

UPDATE google.translate.glossaries
SET
data__name = '{{ name }}',
data__languagePair = '{{ languagePair }}',
data__languageCodesSet = '{{ languageCodesSet }}',
data__inputConfig = '{{ inputConfig }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND glossariesId = '{{ glossariesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

DELETE FROM google.translate.glossaries
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND glossariesId = '{{ glossariesId }}' --required;