Module types (1.7.2)

API documentation for translate_v3beta1.types module.

Classes

Any

API documentation for translate_v3beta1.types.Any class.

BatchTranslateMetadata

State metadata for the batch translation operation.

Number of successfully translated characters so far (Unicode codepoints).

Total number of characters (Unicode codepoints). This is the total number of codepoints from input files times the number of target languages and appears here shortly after the call is submitted.

BatchTranslateResponse

Stored in the google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by BatchTranslateText if at least one sentence is translated successfully.

Number of successfully translated characters (Unicode codepoints).

Time when the operation was submitted.

BatchTranslateTextRequest

The batch translation request.

Required. Source language code.

Optional. The models to use for translation. Map's key is target language code. Map's value is model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: projects/{project-id}/locations/{location- id}/models/{model-id} - General (built-in) models: projects/{project-id}/locations/{location- id}/models/general/nmt, projects/{project- id}/locations/{location-id}/models/general/base If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

CancelOperationRequest

API documentation for translate_v3beta1.types.CancelOperationRequest class.

CreateGlossaryMetadata

Stored in the google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by CreateGlossary.

The current state of the glossary creation operation.

CreateGlossaryRequest

Request message for CreateGlossary.

Required. The glossary to create.

DeleteGlossaryMetadata

Stored in the google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by DeleteGlossary.

The current state of the glossary deletion operation.

DeleteGlossaryRequest

Request message for DeleteGlossary.

DeleteGlossaryResponse

Stored in the google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by DeleteGlossary.

The time when the operation was submitted to the server.

DeleteOperationRequest

API documentation for translate_v3beta1.types.DeleteOperationRequest class.

DetectLanguageRequest

The request message for language detection.

Optional. The language detection model to be used. Format: projects/{project-id}/locations/{location- id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project- id}/locations/{location-id}/models/language- detection/default. If not specified, the default model is used.

The content of the input stored as a string.

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

DetectLanguageResponse

The response message for language detection.

DetectedLanguage

The response message for language detection.

The confidence of the detection result for this language.

GcsDestination

The Google Cloud Storage location for the output content.

GcsSource

The Google Cloud Storage location for the input content.

GetGlossaryRequest

Request message for GetGlossary.

GetOperationRequest

API documentation for translate_v3beta1.types.GetOperationRequest class.

GetSupportedLanguagesRequest

The request message for discovering supported languages.

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

Glossary

Represents a glossary built from user provided data.

Languages supported by the glossary.

Used with equivalent term set glossaries.

Output only. The number of entries defined in the glossary.

Output only. When the glossary creation was finished.

GlossaryInputConfig

Input configuration for glossaries.

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): 2 column file, tab- or comma-separated. The first column is source text. The second column is target text. The file must not contain headers. That is, the first row is data, 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. The format is defined for Google Translation Toolkit and documented in Use a glossary <https://support. google.com/translatortoolkit/answer/6306379?hl=en>__.

InputConfig

Input configuration for BatchTranslateText request.

Required. Specify the input.

ListGlossariesRequest

Request message for ListGlossaries.

Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.

Optional. Filter specifying constraints of a list operation. Filtering is not supported yet, and the parameter currently has no effect. If missing, no filtering is performed.

ListGlossariesResponse

Response message for ListGlossaries.

A token to retrieve a page of results. Pass this value in the [ListGlossariesRequest.page_token] field in the subsequent call to ListGlossaries method to retrieve the next page of results.

ListOperationsRequest

API documentation for translate_v3beta1.types.ListOperationsRequest class.

ListOperationsResponse

API documentation for translate_v3beta1.types.ListOperationsResponse class.

Operation

API documentation for translate_v3beta1.types.Operation class.

OperationInfo

API documentation for translate_v3beta1.types.OperationInfo class.

OutputConfig

Output configuration for BatchTranslateText request.

Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are \\n instead of \\r\\n. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation- test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target _language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). The format of translations_file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_translations .[extension] If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_t est/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://transl ation_test/a_b_c_'trg'_glossary_errors.[extension]

Status

API documentation for translate_v3beta1.types.Status class.

SupportedLanguage

A single supported language response corresponds to information related to one supported language.

Human readable name of the language localized in the display language specified in the request.

Can be used as target language.

SupportedLanguages

The response message for discovering supported languages.

Timestamp

API documentation for translate_v3beta1.types.Timestamp class.

TranslateTextGlossaryConfig

Configures which glossary should be used for a specific target language, and defines options for applying that glossary.

Optional. Indicates match is case-insensitive. Default value is false if missing.

TranslateTextRequest

The request message for synchronous translation.

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

Optional. The model type requested for this translation. The format depends on model type: - AutoML Translation models: projects/{project-id}/locations/{location- id}/models/{model-id} - General (built-in) models: projects/{project-id}/locations/{location- id}/models/general/nmt, projects/{project- id}/locations/{location-id}/models/general/base For global (non-regionalized) requests, use location-id global. For example, projects/{project- id}/locations/global/models/general/nmt. If missing, the system decides which google base model to use.

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

TranslateTextResponse

Text translation responses if a glossary is provided in the request. This can be the same as [translations][google.clo ud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. This field has the same length as [contents][google.cloud.translation.v3beta1.TranslateTextRequest.contents].

Translation

A single translation response.

Only present when model is present in the request. This is same as model provided in the request.

The glossary_config used for this translation.

WaitOperationRequest

API documentation for translate_v3beta1.types.WaitOperationRequest class.