# REST Resource: projects.locations.glossaries

- [Resource: Glossary](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#Glossary)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#Glossary.SCHEMA_REPRESENTATION)
- [LanguageCodePair](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodePair)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodePair.SCHEMA_REPRESENTATION)
- [LanguageCodesSet](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodesSet)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodesSet.SCHEMA_REPRESENTATION)
- [GlossaryInputConfig](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GlossaryInputConfig)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GlossaryInputConfig.SCHEMA_REPRESENTATION)
- [GcsSource](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GcsSource)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GcsSource.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#METHODS_SUMMARY)

## Resource: Glossary

Represents a glossary built from user-provided data.

| JSON representation |
|---|
| ``` { "name": string, "inputConfig": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GlossaryInputConfig`) }, "entryCount": integer, "submitTime": string, "endTime": string, "displayName": string, // Union field `languages` can be only one of the following: "languagePair": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodePair`) }, "languageCodesSet": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodesSet`) } // End of list of possible types for union field `languages`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. |
| `inputConfig` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GlossaryInputConfig`)`` Required. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints. |
| `entryCount` | `integer` Output only. The number of entries defined in the glossary. |
| `submitTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. When glossaries.create was called. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `endTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. When the glossary creation was finished. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `displayName` | `string` Optional. The display name of the glossary. |
| Union field `languages`. Languages supported by the glossary. `languages` can be only one of the following: ||
| `languagePair` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodePair`)`` Used with unidirectional glossaries. |
| `languageCodesSet` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#LanguageCodesSet`)`` Used with equivalent term set glossaries. |

## LanguageCodePair

Used with unidirectional glossaries.

| JSON representation |
|---|
| ``` { "sourceLanguageCode": string, "targetLanguageCode": string } ``` |

| Fields ||
|---|---|
| `sourceLanguageCode` | `string` Required. The ISO-639 language code of the input text, for example, "en-US". Expected to be an exact match for GlossaryTerm.language_code. |
| `targetLanguageCode` | `string` Required. The ISO-639 language code for translation output, for example, "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. |

## LanguageCodesSet

Used with equivalent term set glossaries.

| JSON representation |
|---|
| ``` { "languageCodes": [ string ] } ``` |

| Fields ||
|---|---|
| `languageCodes[]` | `string` The ISO-639 language code(s) for terms defined in the glossary. All entries are unique. The list contains at least two entries. Expected to be an exact match for GlossaryTerm.language_code. |

## GlossaryInputConfig

Input configuration for glossaries.

| JSON representation |
|---|
| ``` { // Union field `source` can be only one of the following: "gcsSource": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GcsSource`) } // End of list of possible types for union field `source`. } ``` |

| Fields ||
|---|---|
| Union field `source`. Required. Specify the input. `source` can be only one of the following: ||
| `gcsSource` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries#GcsSource`)`` Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns `google.rpc.Code.INVALID_ARGUMENT` for unsupported URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. The first column is source text. The second column is target text. No headers in this file. The first row contains data and not column names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). |

## GcsSource

The Google Cloud Storage location for the input content.

| JSON representation |
|---|
| ``` { "inputUri": string } ``` |

| Fields ||
|---|---|
| `inputUri` | `string` Required. Source data URI. For example, `gs://my_bucket/my_object`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries/create` | Creates a glossary and returns the long-running operation. |
| ### `https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries/delete` | Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. |
| ### `https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries/get` | Gets a glossary. |
| ### `https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries/list` | Lists glossaries in a project. |
| ### `https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.glossaries/patch` | Updates a glossary. |