diff --git a/packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py b/packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py index 1d04a6bb6d0e..dc751a0dcaf1 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py @@ -226,39 +226,44 @@ def translate_text( Args: contents (list[str]): Required. The content of the input in string format. - We recommend the total contents to be less than 30k codepoints. - Please use BatchTranslateText for larger text. + We recommend the total content be less than 30k codepoints. + Use BatchTranslateText for larger text. target_language_code (str): 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. mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type is assumed to be "text/html". + "text/plain". If left blank, the MIME type defaults to "text/html". source_language_code (str): Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the - the source language within the response. - parent (str): Optional. Only used when making regionalized call. - Format: - projects/{project-id}/locations/{location-id}. + source language within the response. + parent (str): Required. Location to make a regional or global call. + + Format: ``projects/{project-id}/locations/{location-id}``. + + For global calls, use ``projects/{project-id}/locations/global``. - Only custom model/glossary within the same location-id can be used. - Otherwise 400 is returned. + Models and glossaries must be within the same region (have same + location-id), otherwise an INVALID\_ARGUMENT (400) error is returned. model (str): Optional. The ``model`` type requested for this translation. The format depends on model type: - 1. Custom models: - projects/{project-id}/locations/{location-id}/models/{model-id}. - 2. General (built-in) models: - projects/{project-id}/locations/{location-id}/models/general/nmt - projects/{project-id}/locations/{location-id}/models/general/base + - AutoML Translation models: + ``projects/{project-id}/locations/{location-id}/models/{model-id}`` - For global (non-regionalized) requests, use {location-id} 'global'. For - example, projects/{project-id}/locations/global/models/general/nmt + - 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. - glossary_config (Union[dict, ~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig]): Optional. Glossary to be applied. The glossary needs to be in the same - region as the model, otherwise an INVALID\_ARGUMENT error is returned. + glossary_config (Union[dict, ~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig]): Optional. Glossary to be applied. The glossary must be within the same + region (have the same location-id) as the model, otherwise an + INVALID\_ARGUMENT (400) error is returned. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig` @@ -339,18 +344,26 @@ def detect_language( >>> response = client.detect_language() Args: - parent (str): Optional. Only used when making regionalized call. - Format: - projects/{project-id}/locations/{location-id}. + parent (str): Required. Location to make a regional or global call. + + Format: ``projects/{project-id}/locations/{location-id}``. - Only custom model within the same location-id can be used. - Otherwise 400 is returned. + For global calls, use ``projects/{project-id}/locations/global``. + + Only models within the same region (has same location-id) can be used. + Otherwise an INVALID\_ARGUMENT (400) error is returned. model (str): Optional. The language detection model to be used. - projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} - If not specified, default will 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. content (str): The content of the input stored as a string. mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type is assumed to be "text/html". + "text/plain". If left blank, the MIME type defaults to "text/html". retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -425,24 +438,30 @@ def get_supported_languages( >>> response = client.get_supported_languages() Args: - parent (str): Optional. Used for making regionalized calls. - Format: projects/{project-id}/locations/{location-id}. - For global calls, use projects/{project-id}/locations/global. - If missing, the call is treated as a global call. + parent (str): Required. Location to make a regional or global call. + + Format: ``projects/{project-id}/locations/{location-id}``. - Only custom model within the same location-id can be used. - Otherwise 400 is returned. + For global calls, use ``projects/{project-id}/locations/global``. + + Only models within the same region (have same location-id) can be used, + otherwise an INVALID\_ARGUMENT (400) error is returned. display_language_code (str): Optional. The language to use to return localized, human readable names - of supported languages. If missing, default language is ENGLISH. + of supported languages. If missing, then display names are not returned + in a response. model (str): Optional. Get supported languages of this model. + The format depends on model type: - 1. Custom models: - projects/{project-id}/locations/{location-id}/models/{model-id}. - 2. General (built-in) models: - projects/{project-id}/locations/{location-id}/models/general/nmt - projects/{project-id}/locations/{location-id}/models/general/base - Returns languages supported by the specified model. - If missing, we get supported languages of Google general NMT model. + + - 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`` + + Returns languages supported by the specified model. If missing, we get + supported languages of Google general base (PBMT) model. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -559,25 +578,30 @@ def batch_translate_text( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.translate_v3beta1.types.OutputConfig` - parent (str): Optional. Only used when making regionalized call. - Format: - projects/{project-id}/locations/{location-id}. + parent (str): Required. Location to make a regional call. - Only custom models/glossaries within the same location-id can be used. - Otherwise 400 is returned. - models (dict[str -> str]): 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 a custom model built by AutoML. + Format: ``projects/{project-id}/locations/{location-id}``. + + The ``global`` location is not supported for batch translation. + + Only AutoML Translation models or glossaries within the same region + (have the same location-id) can be used, otherwise an INVALID\_ARGUMENT + (400) error is returned. + models (dict[str -> str]): 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: - 1. Custom models: - projects/{project-id}/locations/{location-id}/models/{model-id}. - 2. 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 is used. + + - 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. glossaries (dict[str -> Union[dict, ~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig]]): Optional. Glossaries to be applied for translation. It's keyed by target language code. @@ -779,9 +803,9 @@ def list_glossaries( resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. - filter_ (str): Optional. Filter specifying constraints of a list operation. For - example, ``tags.glossary_name="products*"``. If missing, no filtering is - performed. + filter_ (str): 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. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. diff --git a/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service.proto b/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service.proto index e9e65baa35b5..fa20f01693f2 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service.proto +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service.proto @@ -18,8 +18,10 @@ syntax = "proto3"; package google.cloud.translation.v3beta1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; @@ -34,11 +36,17 @@ option ruby_package = "Google::Cloud::Translate::V3beta1"; // Provides natural language translation operations. service TranslationService { + option (google.api.default_host) = "translation.googleapis.com"; + // Translates input text and returns translated text. rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:translateText" body: "*" + additional_bindings { + post: "/v3beta1/{parent=projects/*}:translateText" + body: "*" + } }; } @@ -47,6 +55,10 @@ service TranslationService { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:detectLanguage" body: "*" + additional_bindings { + post: "/v3beta1/{parent=projects/*}:detectLanguage" + body: "*" + } }; } @@ -54,6 +66,9 @@ service TranslationService { rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" + additional_bindings { + get: "/v3beta1/{parent=projects/*}/supportedLanguages" + } }; } @@ -113,7 +128,7 @@ message TranslateTextGlossaryConfig { // this format: projects/*/locations/*/glossaries/* string glossary = 1; - // Optional. Indicates whether we should do a case-insensitive match. + // Optional. Indicates match is case-insensitive. // Default value is false if missing. bool ignore_case = 2; } @@ -121,63 +136,71 @@ message TranslateTextGlossaryConfig { // The request message for synchronous translation. message TranslateTextRequest { // Required. The content of the input in string format. - // We recommend the total contents to be less than 30k codepoints. - // Please use BatchTranslateText for larger text. + // We recommend the total content be less than 30k codepoints. + // Use BatchTranslateText for larger text. repeated string contents = 1; // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type is assumed to be "text/html". + // "text/plain". If left blank, the MIME type defaults to "text/html". string mime_type = 3; // Optional. The BCP-47 language code of the input text if // known, for example, "en-US" or "sr-Latn". Supported language codes are // listed in Language Support. If the source language isn't specified, the API // attempts to identify the source language automatically and returns the - // the source language within the response. + // source language within the response. string source_language_code = 4; // 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. string target_language_code = 5; - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional or global call. + // + // Format: `projects/{project-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-id}/locations/global`. // - // Only custom model/glossary within the same location-id can be used. - // Otherwise 400 is returned. + // Models and glossaries must be within the same region (have same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 8; // Optional. The `model` type requested for this translation. // - // The format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // 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 global (non-regionalized) requests, use `location-id` `global`. // For example, - // projects/{project-id}/locations/global/models/general/nmt + // `projects/{project-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. string model = 6; - // Optional. Glossary to be applied. The glossary needs to be in the same - // region as the model, otherwise an INVALID_ARGUMENT error is returned. + // Optional. Glossary to be applied. The glossary must be + // within the same region (have the same location-id) as the model, otherwise + // an INVALID_ARGUMENT (400) error is returned. TranslateTextGlossaryConfig glossary_config = 7; } -// The main language translation response message. message TranslateTextResponse { // Text translation responses with no glossary applied. - // This field has the same length as `contents` in TranslateTextRequest. + // This field has the same length as + // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation translations = 1; // Text translation responses if a glossary is provided in the request. - // This could be the same as 'translation' above if no terms apply. - // This field has the same length as `contents` in TranslateTextRequest. + // This can be the same as + // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. + // This field has the same length as + // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation glossary_translations = 3; } @@ -193,7 +216,7 @@ message Translation { // The BCP-47 language code of source text in the initial request, detected // automatically, if no source language was passed within the initial // request. If the source language was passed, auto-detection of the language - // does not occur and this field will be empty. + // does not occur and this field is empty. string detected_language_code = 4; // The `glossary_config` used for this translation. @@ -202,17 +225,25 @@ message Translation { // The request message for language detection. message DetectLanguageRequest { - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional or global call. + // + // Format: `projects/{project-id}/locations/{location-id}`. // - // Only custom model within the same location-id can be used. - // Otherwise 400 is returned. + // For global calls, use `projects/{project-id}/locations/global`. + // + // Only models within the same region (has same location-id) can be used. + // Otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 5; // Optional. The language detection model to be used. - // projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} - // If not specified, default will 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. string model = 4; // Required. The source of the document from which to detect the language. @@ -222,7 +253,7 @@ message DetectLanguageRequest { } // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type is assumed to be "text/html". + // "text/plain". If left blank, the MIME type defaults to "text/html". string mime_type = 3; } @@ -245,28 +276,35 @@ message DetectLanguageResponse { // The request message for discovering supported languages. message GetSupportedLanguagesRequest { - // Optional. Used for making regionalized calls. - // Format: projects/{project-id}/locations/{location-id}. - // For global calls, use projects/{project-id}/locations/global. - // If missing, the call is treated as a global call. + // Required. Location to make a regional or global call. // - // Only custom model within the same location-id can be used. - // Otherwise 400 is returned. + // Format: `projects/{project-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-id}/locations/global`. + // + // Only models within the same region (have same location-id) can be used, + // otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 3; // Optional. The language to use to return localized, human readable names - // of supported languages. If missing, default language is ENGLISH. + // of supported languages. If missing, then display names are not returned + // in a response. string display_language_code = 1; // Optional. Get supported languages of this model. + // // The format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // + // - 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` + // + // // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general NMT model. + // If missing, we get supported languages of Google general base (PBMT) model. string model = 2; } @@ -297,13 +335,13 @@ message SupportedLanguage { bool support_target = 4; } -// The GCS location for the input content. +// The Google Cloud Storage location for the input content. message GcsSource { // Required. Source data URI. For example, `gs://my_bucket/my_object`. string input_uri = 1; } -// Input configuration. +// Input configuration for BatchTranslateText request. message InputConfig { // Optional. Can be "text/plain" or "text/html". // For `.tsv`, "text/html" is used if mime_type is missing. @@ -323,6 +361,11 @@ message InputConfig { // second column is the actual text to be // translated. We recommend each row be <= 10K Unicode codepoints, // otherwise an error might be returned. + // Note that the input tsv must be RFC 4180 compliant. + // + // You could use https://github.com/Clever/csvlint to check potential + // formatting errors in your tsv file. + // csvlint --delimiter='\t' your_input_file.tsv // // The other supported file extensions are `.txt` or `.html`, which is // treated as a single large chunk of text. @@ -330,14 +373,15 @@ message InputConfig { } } -// The GCS location for the output content +// The Google Cloud Storage location for the output content message GcsDestination { // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/". Otherwise error 400 is returned. + // 'output_uri_prefix' must end with "/", otherwise an INVALID_ARGUMENT (400) + // error is returned.. string output_uri_prefix = 1; } -// Output configuration. +// Output configuration for BatchTranslateText request. message OutputConfig { // Required. The destination of output. oneof destination { @@ -364,13 +408,13 @@ message OutputConfig { // 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,glossary_errors_file are always empty string - // if input_file is tsv. They could also be empty 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 + // 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: @@ -396,8 +440,8 @@ message OutputConfig { // 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 has the - // following Column 1: ID of the request provided in the input, if it's not + // 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. @@ -413,12 +457,15 @@ message OutputConfig { // The batch translation request. message BatchTranslateTextRequest { - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional call. + // + // Format: `projects/{project-id}/locations/{location-id}`. + // + // The `global` location is not supported for batch translation. // - // Only custom models/glossaries within the same location-id can be used. - // Otherwise 400 is returned. + // Only AutoML Translation models or glossaries within the same region (have + // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + // error is returned. string parent = 1; // Required. Source language code. @@ -429,17 +476,20 @@ message BatchTranslateTextRequest { // 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 a custom model built by AutoML. + // or an AutoML Translation model. // // The value format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // + // - 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 is used. + // not requested for a language pair, then default google model (nmt) is used. map models = 4; // Required. Input configurations. @@ -468,11 +518,11 @@ message BatchTranslateMetadata { // Request is being processed. RUNNING = 1; - // The batch is processed, and at least one item has been successfully + // The batch is processed, and at least one item was successfully // processed. SUCCEEDED = 2; - // The batch is done and no item has been successfully processed. + // The batch is done and no item was successfully processed. FAILED = 3; // Request is in the process of being canceled after caller invoked @@ -497,7 +547,7 @@ message BatchTranslateMetadata { // Total number of characters (Unicode codepoints). // This is the total number of codepoints from input files times the number of - // target languages. It appears here shortly after the call is submitted. + // target languages and appears here shortly after the call is submitted. int64 total_characters = 4; // Time when the operation was submitted. @@ -529,12 +579,12 @@ message GlossaryInputConfig { // Required. Specify the input. oneof source { // Required. Google Cloud Storage location of glossary data. - // File format is determined based on file name extension. API returns + // 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: + // 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. @@ -544,19 +594,19 @@ message GlossaryInputConfig { // - TMX (`.tmx`): TMX file with parallel data defining source/target term // pairs. // - // For `EQUIVALENT_TERMS_SET` glossaries: + // 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 here: - // `https://support.google.com/translatortoolkit/answer/6306379?hl=en`. + // Toolkit and documented in [Use a + // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). GcsSource gcs_source = 1; } } // Represents a glossary built from user provided data. message Glossary { - // Used with UNIDIRECTIONAL. + // Used with unidirectional glossaries. message LanguageCodePair { // Required. The BCP-47 language code of the input text, for example, // "en-US". Expected to be an exact match for GlossaryTerm.language_code. @@ -567,7 +617,7 @@ message Glossary { string target_language_code = 2; } - // Used with EQUIVALENT_TERMS_SET. + // Used with equivalent term set glossaries. message LanguageCodesSet { // The BCP-47 language code(s) for terms defined in the glossary. // All entries are unique. The list contains at least two entries. @@ -581,10 +631,10 @@ message Glossary { // Languages supported by the glossary. oneof languages { - // Used with UNIDIRECTIONAL. + // Used with unidirectional glossaries. LanguageCodePair language_pair = 3; - // Used with EQUIVALENT_TERMS_SET. + // Used with equivalent term set glossaries. LanguageCodesSet language_codes_set = 4; } @@ -639,7 +689,7 @@ message ListGlossariesRequest { string page_token = 3; // Optional. Filter specifying constraints of a list operation. - // For example, `tags.glossary_name="products*"`. + // Filtering is not supported yet, and the parameter currently has no effect. // If missing, no filtering is performed. string filter = 4; } @@ -666,7 +716,7 @@ message CreateGlossaryMetadata { // Request is being processed. RUNNING = 1; - // The glossary has been successfully created. + // The glossary was successfully created. SUCCEEDED = 2; // Failed to create the glossary. @@ -676,7 +726,7 @@ message CreateGlossaryMetadata { // longrunning.Operations.CancelOperation on the request id. CANCELLING = 4; - // The glossary creation request has been successfully canceled. + // The glossary creation request was successfully canceled. CANCELLED = 5; } @@ -711,7 +761,7 @@ message DeleteGlossaryMetadata { // longrunning.Operations.CancelOperation on the request id. CANCELLING = 4; - // The glossary deletion request has been successfully canceled. + // The glossary deletion request was successfully canceled. CANCELLED = 5; } diff --git a/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py b/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py index 249c9ed50821..5ee37fd6266f 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py @@ -15,10 +15,12 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, ) from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -29,12 +31,14 @@ '\n"com.google.cloud.translate.v3beta1B\027TranslationServiceProtoP\001ZGgoogle.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate\370\001\001\252\002\036Google.Cloud.Translate.V3Beta1\312\002\036Google\\Cloud\\Translate\\V3beta1\352\002!Google::Cloud::Translate::V3beta1' ), serialized_pb=_b( - '\n@google/cloud/translation_v3beta1/proto/translation_service.proto\x12 google.cloud.translation.v3beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"D\n\x1bTranslateTextGlossaryConfig\x12\x10\n\x08glossary\x18\x01 \x01(\t\x12\x13\n\x0bignore_case\x18\x02 \x01(\x08"\xee\x01\n\x14TranslateTextRequest\x12\x10\n\x08\x63ontents\x18\x01 \x03(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x1c\n\x14source_language_code\x18\x04 \x01(\t\x12\x1c\n\x14target_language_code\x18\x05 \x01(\t\x12\x0e\n\x06parent\x18\x08 \x01(\t\x12\r\n\x05model\x18\x06 \x01(\t\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"\xaa\x01\n\x15TranslateTextResponse\x12\x43\n\x0ctranslations\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation\x12L\n\x15glossary_translations\x18\x03 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation"\xad\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12V\n\x0fglossary_config\x18\x03 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"f\n\x15\x44\x65tectLanguageRequest\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12\r\n\x05model\x18\x04 \x01(\t\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x11\n\tmime_type\x18\x03 \x01(\tB\x08\n\x06source"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02"_\n\x16\x44\x65tectLanguageResponse\x12\x45\n\tlanguages\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3beta1.DetectedLanguage"\\\n\x1cGetSupportedLanguagesRequest\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1d\n\x15\x64isplay_language_code\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t"\\\n\x12SupportedLanguages\x12\x46\n\tlanguages\x18\x01 \x03(\x0b\x32\x33.google.cloud.translation.v3beta1.SupportedLanguage"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08"\x1e\n\tGcsSource\x12\x11\n\tinput_uri\x18\x01 \x01(\t"m\n\x0bInputConfig\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"+\n\x0eGcsDestination\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t"j\n\x0cOutputConfig\x12K\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x30.google.cloud.translation.v3beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xd0\x04\n\x19\x42\x61tchTranslateTextRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1d\n\x15target_language_codes\x18\x03 \x03(\t\x12W\n\x06models\x18\x04 \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry\x12\x44\n\rinput_configs\x18\x05 \x03(\x0b\x32-.google.cloud.translation.v3beta1.InputConfig\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.translation.v3beta1.OutputConfig\x12_\n\nglossaries\x18\x07 \x03(\x0b\x32K.google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ap\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig:\x02\x38\x01"\xd3\x02\n\x16\x42\x61tchTranslateMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.translation.v3beta1.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"b\n\x13GlossaryInputConfig\x12\x41\n\ngcs_source\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"\x93\x04\n\x08Glossary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\rlanguage_pair\x18\x03 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodePairH\x00\x12Y\n\x12language_codes_set\x18\x04 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodesSetH\x00\x12K\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.translation.v3beta1.GlossaryInputConfig\x12\x13\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x12/\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\tB\x0b\n\tlanguages"e\n\x15\x43reateGlossaryRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12<\n\x08glossary\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3beta1.Glossary""\n\x12GetGlossaryRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"%\n\x15\x44\x65leteGlossaryRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"^\n\x15ListGlossariesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t"q\n\x16ListGlossariesResponse\x12>\n\nglossaries\x18\x01 \x03(\x0b\x32*.google.cloud.translation.v3beta1.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x8d\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x8d\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x80\x0c\n\x12TranslationService\x12\xc3\x01\n\rTranslateText\x12\x36.google.cloud.translation.v3beta1.TranslateTextRequest\x1a\x37.google.cloud.translation.v3beta1.TranslateTextResponse"A\x82\xd3\xe4\x93\x02;"6/v3beta1/{parent=projects/*/locations/*}:translateText:\x01*\x12\xc7\x01\n\x0e\x44\x65tectLanguage\x12\x37.google.cloud.translation.v3beta1.DetectLanguageRequest\x1a\x38.google.cloud.translation.v3beta1.DetectLanguageResponse"B\x82\xd3\xe4\x93\x02<"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\x01*\x12\xd2\x01\n\x15GetSupportedLanguages\x12>.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest\x1a\x34.google.cloud.translation.v3beta1.SupportedLanguages"C\x82\xd3\xe4\x93\x02=\x12;/v3beta1/{parent=projects/*/locations/*}/supportedLanguages\x12\xb8\x01\n\x12\x42\x61tchTranslateText\x12;.google.cloud.translation.v3beta1.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation"F\x82\xd3\xe4\x93\x02@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\x01*\x12\xaf\x01\n\x0e\x43reateGlossary\x12\x37.google.cloud.translation.v3beta1.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation"E\x82\xd3\xe4\x93\x02?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\x08glossary\x12\xc0\x01\n\x0eListGlossaries\x12\x37.google.cloud.translation.v3beta1.ListGlossariesRequest\x1a\x38.google.cloud.translation.v3beta1.ListGlossariesResponse";\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{parent=projects/*/locations/*}/glossaries\x12\xac\x01\n\x0bGetGlossary\x12\x34.google.cloud.translation.v3beta1.GetGlossaryRequest\x1a*.google.cloud.translation.v3beta1.Glossary";\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{name=projects/*/locations/*/glossaries/*}\x12\xa5\x01\n\x0e\x44\x65leteGlossary\x12\x37.google.cloud.translation.v3beta1.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation";\x82\xd3\xe4\x93\x02\x35*3/v3beta1/{name=projects/*/locations/*/glossaries/*}B\xf1\x01\n"com.google.cloud.translate.v3beta1B\x17TranslationServiceProtoP\x01ZGgoogle.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.Translate.V3Beta1\xca\x02\x1eGoogle\\Cloud\\Translate\\V3beta1\xea\x02!Google::Cloud::Translate::V3beta1b\x06proto3' + '\n@google/cloud/translation_v3beta1/proto/translation_service.proto\x12 google.cloud.translation.v3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/api/client.proto"D\n\x1bTranslateTextGlossaryConfig\x12\x10\n\x08glossary\x18\x01 \x01(\t\x12\x13\n\x0bignore_case\x18\x02 \x01(\x08"\xee\x01\n\x14TranslateTextRequest\x12\x10\n\x08\x63ontents\x18\x01 \x03(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x1c\n\x14source_language_code\x18\x04 \x01(\t\x12\x1c\n\x14target_language_code\x18\x05 \x01(\t\x12\x0e\n\x06parent\x18\x08 \x01(\t\x12\r\n\x05model\x18\x06 \x01(\t\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"\xaa\x01\n\x15TranslateTextResponse\x12\x43\n\x0ctranslations\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation\x12L\n\x15glossary_translations\x18\x03 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation"\xad\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12V\n\x0fglossary_config\x18\x03 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"f\n\x15\x44\x65tectLanguageRequest\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12\r\n\x05model\x18\x04 \x01(\t\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x11\n\tmime_type\x18\x03 \x01(\tB\x08\n\x06source"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02"_\n\x16\x44\x65tectLanguageResponse\x12\x45\n\tlanguages\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3beta1.DetectedLanguage"\\\n\x1cGetSupportedLanguagesRequest\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1d\n\x15\x64isplay_language_code\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t"\\\n\x12SupportedLanguages\x12\x46\n\tlanguages\x18\x01 \x03(\x0b\x32\x33.google.cloud.translation.v3beta1.SupportedLanguage"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08"\x1e\n\tGcsSource\x12\x11\n\tinput_uri\x18\x01 \x01(\t"m\n\x0bInputConfig\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"+\n\x0eGcsDestination\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t"j\n\x0cOutputConfig\x12K\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x30.google.cloud.translation.v3beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xd0\x04\n\x19\x42\x61tchTranslateTextRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1d\n\x15target_language_codes\x18\x03 \x03(\t\x12W\n\x06models\x18\x04 \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry\x12\x44\n\rinput_configs\x18\x05 \x03(\x0b\x32-.google.cloud.translation.v3beta1.InputConfig\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.translation.v3beta1.OutputConfig\x12_\n\nglossaries\x18\x07 \x03(\x0b\x32K.google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ap\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig:\x02\x38\x01"\xd3\x02\n\x16\x42\x61tchTranslateMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.translation.v3beta1.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"b\n\x13GlossaryInputConfig\x12\x41\n\ngcs_source\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"\x93\x04\n\x08Glossary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\rlanguage_pair\x18\x03 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodePairH\x00\x12Y\n\x12language_codes_set\x18\x04 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodesSetH\x00\x12K\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.translation.v3beta1.GlossaryInputConfig\x12\x13\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x12/\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\tB\x0b\n\tlanguages"e\n\x15\x43reateGlossaryRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12<\n\x08glossary\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3beta1.Glossary""\n\x12GetGlossaryRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"%\n\x15\x44\x65leteGlossaryRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"^\n\x15ListGlossariesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t"q\n\x16ListGlossariesResponse\x12>\n\nglossaries\x18\x01 \x03(\x0b\x32*.google.cloud.translation.v3beta1.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x8d\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x8d\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xb5\r\n\x12TranslationService\x12\xf4\x01\n\rTranslateText\x12\x36.google.cloud.translation.v3beta1.TranslateTextRequest\x1a\x37.google.cloud.translation.v3beta1.TranslateTextResponse"r\x82\xd3\xe4\x93\x02l"6/v3beta1/{parent=projects/*/locations/*}:translateText:\x01*Z/"*/v3beta1/{parent=projects/*}:translateText:\x01*\x12\xf9\x01\n\x0e\x44\x65tectLanguage\x12\x37.google.cloud.translation.v3beta1.DetectLanguageRequest\x1a\x38.google.cloud.translation.v3beta1.DetectLanguageResponse"t\x82\xd3\xe4\x93\x02n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\x01*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\x01*\x12\x85\x02\n\x15GetSupportedLanguages\x12>.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest\x1a\x34.google.cloud.translation.v3beta1.SupportedLanguages"v\x82\xd3\xe4\x93\x02p\x12;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\x12//v3beta1/{parent=projects/*}/supportedLanguages\x12\xb8\x01\n\x12\x42\x61tchTranslateText\x12;.google.cloud.translation.v3beta1.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation"F\x82\xd3\xe4\x93\x02@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\x01*\x12\xaf\x01\n\x0e\x43reateGlossary\x12\x37.google.cloud.translation.v3beta1.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation"E\x82\xd3\xe4\x93\x02?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\x08glossary\x12\xc0\x01\n\x0eListGlossaries\x12\x37.google.cloud.translation.v3beta1.ListGlossariesRequest\x1a\x38.google.cloud.translation.v3beta1.ListGlossariesResponse";\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{parent=projects/*/locations/*}/glossaries\x12\xac\x01\n\x0bGetGlossary\x12\x34.google.cloud.translation.v3beta1.GetGlossaryRequest\x1a*.google.cloud.translation.v3beta1.Glossary";\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{name=projects/*/locations/*/glossaries/*}\x12\xa5\x01\n\x0e\x44\x65leteGlossary\x12\x37.google.cloud.translation.v3beta1.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation";\x82\xd3\xe4\x93\x02\x35*3/v3beta1/{name=projects/*/locations/*/glossaries/*}\x1a\x1d\xca\x41\x1atranslation.googleapis.comB\xf1\x01\n"com.google.cloud.translate.v3beta1B\x17TranslationServiceProtoP\x01ZGgoogle.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.Translate.V3Beta1\xca\x02\x1eGoogle\\Cloud\\Translate\\V3beta1\xea\x02!Google::Cloud::Translate::V3beta1b\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, ], ) @@ -70,8 +74,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2558, - serialized_end=2659, + serialized_start=2610, + serialized_end=2711, ) _sym_db.RegisterEnumDescriptor(_BATCHTRANSLATEMETADATA_STATE) @@ -106,8 +110,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2558, - serialized_end=2659, + serialized_start=2610, + serialized_end=2711, ) _sym_db.RegisterEnumDescriptor(_CREATEGLOSSARYMETADATA_STATE) @@ -142,8 +146,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2558, - serialized_end=2659, + serialized_start=2610, + serialized_end=2711, ) _sym_db.RegisterEnumDescriptor(_DELETEGLOSSARYMETADATA_STATE) @@ -200,8 +204,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=202, - serialized_end=270, + serialized_start=254, + serialized_end=322, ) @@ -347,8 +351,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=273, - serialized_end=511, + serialized_start=325, + serialized_end=563, ) @@ -404,8 +408,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=514, - serialized_end=684, + serialized_start=566, + serialized_end=736, ) @@ -497,8 +501,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=687, - serialized_end=860, + serialized_start=739, + serialized_end=912, ) @@ -598,8 +602,8 @@ fields=[], ) ], - serialized_start=862, - serialized_end=964, + serialized_start=914, + serialized_end=1016, ) @@ -655,8 +659,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=966, - serialized_end=1027, + serialized_start=1018, + serialized_end=1079, ) @@ -694,8 +698,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1029, - serialized_end=1124, + serialized_start=1081, + serialized_end=1176, ) @@ -769,8 +773,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1126, - serialized_end=1218, + serialized_start=1178, + serialized_end=1270, ) @@ -808,8 +812,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1220, - serialized_end=1312, + serialized_start=1272, + serialized_end=1364, ) @@ -901,8 +905,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1314, - serialized_end=1426, + serialized_start=1366, + serialized_end=1478, ) @@ -940,8 +944,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1428, - serialized_end=1458, + serialized_start=1480, + serialized_end=1510, ) @@ -1005,8 +1009,8 @@ fields=[], ) ], - serialized_start=1460, - serialized_end=1569, + serialized_start=1512, + serialized_end=1621, ) @@ -1044,8 +1048,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1571, - serialized_end=1614, + serialized_start=1623, + serialized_end=1666, ) @@ -1091,8 +1095,8 @@ fields=[], ) ], - serialized_start=1616, - serialized_end=1722, + serialized_start=1668, + serialized_end=1774, ) @@ -1148,8 +1152,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2158, - serialized_end=2203, + serialized_start=2210, + serialized_end=2255, ) _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY = _descriptor.Descriptor( @@ -1204,8 +1208,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2205, - serialized_end=2317, + serialized_start=2257, + serialized_end=2369, ) _BATCHTRANSLATETEXTREQUEST = _descriptor.Descriptor( @@ -1353,8 +1357,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1725, - serialized_end=2317, + serialized_start=1777, + serialized_end=2369, ) @@ -1464,8 +1468,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2320, - serialized_end=2659, + serialized_start=2372, + serialized_end=2711, ) @@ -1575,8 +1579,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2662, - serialized_end=2865, + serialized_start=2714, + serialized_end=2917, ) @@ -1622,8 +1626,8 @@ fields=[], ) ], - serialized_start=2867, - serialized_end=2965, + serialized_start=2919, + serialized_end=3017, ) @@ -1679,8 +1683,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3364, - serialized_end=3442, + serialized_start=3416, + serialized_end=3494, ) _GLOSSARY_LANGUAGECODESSET = _descriptor.Descriptor( @@ -1717,8 +1721,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3444, - serialized_end=3486, + serialized_start=3496, + serialized_end=3538, ) _GLOSSARY = _descriptor.Descriptor( @@ -1871,8 +1875,8 @@ fields=[], ) ], - serialized_start=2968, - serialized_end=3499, + serialized_start=3020, + serialized_end=3551, ) @@ -1928,8 +1932,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3501, - serialized_end=3602, + serialized_start=3553, + serialized_end=3654, ) @@ -1967,8 +1971,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3604, - serialized_end=3638, + serialized_start=3656, + serialized_end=3690, ) @@ -2006,8 +2010,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3640, - serialized_end=3677, + serialized_start=3692, + serialized_end=3729, ) @@ -2099,8 +2103,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3679, - serialized_end=3773, + serialized_start=3731, + serialized_end=3825, ) @@ -2156,8 +2160,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3775, - serialized_end=3888, + serialized_start=3827, + serialized_end=3940, ) @@ -2231,8 +2235,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3891, - serialized_end=4160, + serialized_start=3943, + serialized_end=4212, ) @@ -2306,8 +2310,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4163, - serialized_end=4432, + serialized_start=4215, + serialized_end=4484, ) @@ -2381,8 +2385,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4435, - serialized_end=4568, + serialized_start=4487, + serialized_end=4620, ) _TRANSLATETEXTREQUEST.fields_by_name[ @@ -2545,8 +2549,8 @@ Required. Specifies the glossary used for this translation. Use this format: projects/\ */locations/*/glossaries/\* ignore_case: - Optional. Indicates whether we should do a case-insensitive - match. Default value is false if missing. + Optional. Indicates match is case-insensitive. Default value + is false if missing. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextGlossaryConfig) ), @@ -2565,43 +2569,46 @@ Attributes: contents: Required. The content of the input in string format. We - recommend the total contents to be less than 30k codepoints. - Please use BatchTranslateText for larger text. + recommend the total content be less than 30k codepoints. Use + BatchTranslateText for larger text. mime_type: Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type is - assumed to be "text/html". + "text/html", "text/plain". If left blank, the MIME type + defaults to "text/html". source_language_code: Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language - automatically and returns the the source language within the + automatically and returns the source language within the response. target_language_code: 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. parent: - Optional. Only used when making regionalized call. Format: - projects/{project-id}/locations/{location-id}. Only custom - model/glossary within the same location-id can be used. - Otherwise 400 is returned. + Required. Location to make a regional or global call. Format: + ``projects/{project-id}/locations/{location-id}``. For global + calls, use ``projects/{project-id}/locations/global``. Models + and glossaries must be within the same region (have same + location-id), otherwise an INVALID\_ARGUMENT (400) error is + returned. model: Optional. The ``model`` type requested for this translation. - The format depends on model type: 1. Custom models: - projects/{project-id}/locations/{location-id}/models/{model- - id}. 2. 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. + 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. glossary_config: - Optional. Glossary to be applied. The glossary needs to be in - the same region as the model, otherwise an INVALID\_ARGUMENT - error is returned. + Optional. Glossary to be applied. The glossary must be within + the same region (have the same location-id) as the model, + otherwise an INVALID\_ARGUMENT (400) error is returned. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextRequest) ), @@ -2614,19 +2621,17 @@ dict( DESCRIPTOR=_TRANSLATETEXTRESPONSE, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The main language translation response message. - - - Attributes: + __doc__=""" + Attributes: translations: Text translation responses with no glossary applied. This - field has the same length as ``contents`` in - TranslateTextRequest. + field has the same length as [``contents``][google.cloud.trans + lation.v3beta1.TranslateTextRequest.contents]. glossary_translations: Text translation responses if a glossary is provided in the - request. This could be the same as 'translation' above if no - terms apply. This field has the same length as ``contents`` in - TranslateTextRequest. + 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]. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextResponse) ), @@ -2653,7 +2658,7 @@ request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language does not occur and this - field will be empty. + field is empty. glossary_config: The ``glossary_config`` used for this translation. """, @@ -2673,14 +2678,19 @@ Attributes: parent: - Optional. Only used when making regionalized call. Format: - projects/{project-id}/locations/{location-id}. Only custom - model within the same location-id can be used. Otherwise 400 - is returned. + Required. Location to make a regional or global call. Format: + ``projects/{project-id}/locations/{location-id}``. For global + calls, use ``projects/{project-id}/locations/global``. Only + models within the same region (has same location-id) can be + used. Otherwise an INVALID\_ARGUMENT (400) error is returned. model: - Optional. The language detection model to be used. - projects/{project-id}/locations/{location-id}/models/language- - detection/{model-id} If not specified, default will be used. + 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. source: Required. The source of the document from which to detect the language. @@ -2688,8 +2698,8 @@ The content of the input stored as a string. mime_type: Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type is - assumed to be "text/html". + "text/html", "text/plain". If left blank, the MIME type + defaults to "text/html". """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageRequest) ), @@ -2747,25 +2757,25 @@ Attributes: parent: - Optional. Used for making regionalized calls. Format: - projects/{project-id}/locations/{location-id}. For global - calls, use projects/{project-id}/locations/global. If missing, - the call is treated as a global call. Only custom model - within the same location-id can be used. Otherwise 400 is - returned. + Required. Location to make a regional or global call. Format: + ``projects/{project-id}/locations/{location-id}``. For global + calls, use ``projects/{project-id}/locations/global``. Only + models within the same region (have same location-id) can be + used, otherwise an INVALID\_ARGUMENT (400) error is returned. display_language_code: Optional. The language to use to return localized, human - readable names of supported languages. If missing, default - language is ENGLISH. + readable names of supported languages. If missing, then + display names are not returned in a response. model: - Optional. Get supported languages of this model. The format - depends on model type: 1. Custom models: projects/{project- - id}/locations/{location-id}/models/{model-id}. 2. General - (built-in) models: projects/{project-id}/locations/{location- - id}/models/general/nmt projects/{project- - id}/locations/{location-id}/models/general/base Returns - languages supported by the specified model. If missing, we get - supported languages of Google general NMT model. + Optional. Get supported languages of this model. 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`` Returns languages supported by the + specified model. If missing, we get supported languages of + Google general base (PBMT) model. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GetSupportedLanguagesRequest) ), @@ -2826,7 +2836,7 @@ dict( DESCRIPTOR=_GCSSOURCE, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The GCS location for the input content. + __doc__="""The Google Cloud Storage location for the input content. Attributes: @@ -2845,7 +2855,7 @@ dict( DESCRIPTOR=_INPUTCONFIG, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Input configuration. + __doc__="""Input configuration for BatchTranslateText request. Attributes: @@ -2866,9 +2876,13 @@ is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K - Unicode codepoints, otherwise an error might be returned. The - other supported file extensions are ``.txt`` or ``.html``, - which is treated as a single large chunk of text. + Unicode codepoints, otherwise an error might be returned. Note + that the input tsv must be RFC 4180 compliant. You could use + https://github.com/Clever/csvlint to check potential + formatting errors in your tsv file. csvlint --delimiter=':raw- + latex:`\t`' your\_input\_file.tsv The other supported file + extensions are ``.txt`` or ``.html``, which is treated as a + single large chunk of text. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.InputConfig) ), @@ -2881,14 +2895,14 @@ dict( DESCRIPTOR=_GCSDESTINATION, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The GCS location for the output content + __doc__="""The Google Cloud Storage location for the output content Attributes: output_uri_prefix: Required. There must be no files under 'output\_uri\_prefix'. - 'output\_uri\_prefix' must end with "/". Otherwise error 400 - is returned. + 'output\_uri\_prefix' must end with "/", otherwise an + INVALID\_ARGUMENT (400) error is returned.. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GcsDestination) ), @@ -2901,7 +2915,7 @@ dict( DESCRIPTOR=_OUTPUTCONFIG, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Output configuration. + __doc__="""Output configuration for BatchTranslateText request. Attributes: @@ -2928,23 +2942,23 @@ (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,glossary\_errors\_file are always - empty string if 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 + 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 @@ -2953,8 +2967,8 @@ 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 has the - following Column 1: ID of the request provided in the input, + 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 @@ -2998,10 +3012,12 @@ Attributes: parent: - Optional. Only used when making regionalized call. Format: - projects/{project-id}/locations/{location-id}. Only custom - models/glossaries within the same location-id can be used. - Otherwise 400 is returned. + Required. Location to make a regional call. Format: + ``projects/{project-id}/locations/{location-id}``. The + ``global`` location is not supported for batch translation. + Only AutoML Translation models or glossaries within the same + region (have the same location-id) can be used, otherwise an + INVALID\_ARGUMENT (400) error is returned. source_language_code: Required. Source language code. target_language_codes: @@ -3009,15 +3025,15 @@ models: 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 a custom model built by AutoML. - The value format depends on model type: 1. Custom models: - projects/{project-id}/locations/{location-id}/models/{model- - id}. 2. 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 is used. + 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. input_configs: Required. Input configurations. The total number of files matched should be <= 1000. The total content size should be <= @@ -3058,7 +3074,7 @@ total_characters: Total number of characters (Unicode codepoints). This is the total number of codepoints from input files times the number - of target languages. It appears here shortly after the call is + of target languages and appears here shortly after the call is submitted. submit_time: Time when the operation was submitted. @@ -3115,21 +3131,21 @@ Required. Specify the input. gcs_source: Required. Google Cloud Storage location of glossary data. File - format is determined based on file name 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_TERMS_SET`` - glossaries: - CSV (``.csv``): Multi-column CSV file defining - equivalent glossary terms in multiple languages. The format - is defined for Google Translation Toolkit and documented - here: ``https://support.google.com/translatortoolkit/answer - /6306379?hl=en``. + 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 `__. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GlossaryInputConfig) ), @@ -3146,7 +3162,7 @@ dict( DESCRIPTOR=_GLOSSARY_LANGUAGECODEPAIR, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Used with UNIDIRECTIONAL. + __doc__="""Used with unidirectional glossaries. Attributes: @@ -3168,7 +3184,7 @@ dict( DESCRIPTOR=_GLOSSARY_LANGUAGECODESSET, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Used with EQUIVALENT\_TERMS\_SET. + __doc__="""Used with equivalent term set glossaries. Attributes: @@ -3194,9 +3210,9 @@ languages: Languages supported by the glossary. language_pair: - Used with UNIDIRECTIONAL. + Used with unidirectional glossaries. language_codes_set: - Used with EQUIVALENT\_TERMS\_SET. + Used with equivalent term set glossaries. input_config: Required. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints. @@ -3295,8 +3311,8 @@ returned if ``page_token``\ is empty or missing. filter: Optional. Filter specifying constraints of a list operation. - For example, ``tags.glossary_name="products*"``. If missing, - no filtering is performed. + Filtering is not supported yet, and the parameter currently + has no effect. If missing, no filtering is performed. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.ListGlossariesRequest) ), @@ -3410,9 +3426,9 @@ full_name="google.cloud.translation.v3beta1.TranslationService", file=DESCRIPTOR, index=0, - serialized_options=None, - serialized_start=4571, - serialized_end=6107, + serialized_options=_b("\312A\032translation.googleapis.com"), + serialized_start=4623, + serialized_end=6340, methods=[ _descriptor.MethodDescriptor( name="TranslateText", @@ -3422,7 +3438,7 @@ input_type=_TRANSLATETEXTREQUEST, output_type=_TRANSLATETEXTRESPONSE, serialized_options=_b( - '\202\323\344\223\002;"6/v3beta1/{parent=projects/*/locations/*}:translateText:\001*' + '\202\323\344\223\002l"6/v3beta1/{parent=projects/*/locations/*}:translateText:\001*Z/"*/v3beta1/{parent=projects/*}:translateText:\001*' ), ), _descriptor.MethodDescriptor( @@ -3433,7 +3449,7 @@ input_type=_DETECTLANGUAGEREQUEST, output_type=_DETECTLANGUAGERESPONSE, serialized_options=_b( - '\202\323\344\223\002<"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\001*' + '\202\323\344\223\002n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\001*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\001*' ), ), _descriptor.MethodDescriptor( @@ -3444,7 +3460,7 @@ input_type=_GETSUPPORTEDLANGUAGESREQUEST, output_type=_SUPPORTEDLANGUAGES, serialized_options=_b( - "\202\323\344\223\002=\022;/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" + "\202\323\344\223\002p\022;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\022//v3beta1/{parent=projects/*}/supportedLanguages" ), ), _descriptor.MethodDescriptor( diff --git a/packages/google-cloud-translate/noxfile.py b/packages/google-cloud-translate/noxfile.py index 968fb5a09bf1..6ee03ef540e0 100644 --- a/packages/google-cloud-translate/noxfile.py +++ b/packages/google-cloud-translate/noxfile.py @@ -23,12 +23,6 @@ LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - @nox.session(python="3.7") def lint(session): """Run linters. @@ -37,7 +31,13 @@ def lint(session): serious code quality issues. """ session.install("flake8", "black", *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) + session.run( + "black", + "--check", + "google", + "tests", + "docs", + ) session.run("flake8", "google", "tests") @@ -46,13 +46,18 @@ def blacken(session): """Run black. Format code to uniform standard. - + This currently uses Python 3.6 due to the automated Kokoro run of synthtool. That run uses an image that doesn't have 3.6 installed. Before updating this check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install("black") - session.run("black", *BLACK_PATHS) + session.run( + "black", + "google", + "tests", + "docs", + ) @nox.session(python="3.7") @@ -78,7 +83,7 @@ def default(session): "--cov-append", "--cov-config=.coveragerc", "--cov-report=", - "--cov-fail-under=0", + "--cov-fail-under=100", os.path.join("tests", "unit"), *session.posargs, ) @@ -135,24 +140,21 @@ def cover(session): session.run("coverage", "erase") - @nox.session(python="3.7") def docs(session): """Build the docs for this library.""" - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") + session.install('-e', '.') + session.install('sphinx', 'alabaster', 'recommonmark') - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), + 'sphinx-build', + '-W', # warnings as errors + '-T', # show full traceback on exception + '-N', # no colors + '-b', 'html', + '-d', os.path.join('docs', '_build', 'doctrees', ''), + os.path.join('docs', ''), + os.path.join('docs', '_build', 'html', ''), ) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 62526bd50105..186e2c2df5cd 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-06T12:36:47.171890Z", + "updateTime": "2019-06-10T16:41:47.015823Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.24.0", + "dockerImage": "googleapis/artman@sha256:ce425884865f57f18307e597bca1a74a3619b7098688d4995261f3ffb3488681" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f03bf2139ee85aac88411d6c20a21f4c901fe83c", - "internalRef": "251806891" + "sha": "a12347ec47a7f3d18e35f2effc4295c0b0983213", + "internalRef": "252108410" } }, { diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 553d4a9d7479..dd81273af78b 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -21,22 +21,24 @@ common = gcp.CommonTemplates() versions = ["v3beta1"] -excludes = ["setup.py", "nox*.py", "README.rst", "docs/conf.py", "docs/index.rst", - "translation.py"] +excludes = [ + "setup.py", + "nox*.py", + "README.rst", + "docs/conf.py", + "docs/index.rst", + "translation.py", +] # ---------------------------------------------------------------------------- # Generate asset GAPIC layer # ---------------------------------------------------------------------------- for version in versions: - library = gapic.py_library( - "translate", - version, - include_protos=True, - ) - - #s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes) - s.move(library / f'google/cloud/translate_{version}', excludes=excludes) - s.move(library / 'tests') + library = gapic.py_library("translate", version, include_protos=True) + + # s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes) + s.move(library / f"google/cloud/translate_{version}", excludes=excludes) + s.move(library / "tests") s.move(library / f"docs/gapic/{version}") # translation -> translate @@ -51,7 +53,26 @@ r"""record delimiters are ':raw-latex:`\\n`' instead of ':raw-latex:`\\r`:raw-latex:`\\n`'.""", r"""record delimiters are ``\\\\\\\\n`` instead of - ``\\\\\\\\r\\\\\\\\n``.""",) + ``\\\\\\\\r\\\\\\\\n``.""", +) + +# Fix docstring issue for classes with no summary line +s.replace( + "google/cloud/**/proto/*_pb2.py", + '''__doc__ = """Attributes:''', + '''__doc__ = """ + Attributes:''', +) + +# Fix wrapping for literal string +s.replace( + "google/cloud/**/translation_service_pb2.py", + r"""This field has the same length as \[``contents` +\s+`\]\[google\.cloud\.translation\.v3beta1\.TranslateTextRequest\.conte +\s+nts\]\.""", + """This field has the same length as [``contents``][google.cloud.translation.v3beta1.TranslateTextRequest.contents].""", +) + # ---------------------------------------------------------------------------- # Add templated files # ----------------------------------------------------------------------------