diff --git a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py index b0feb083369d..c62bacfd859b 100644 --- a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py +++ b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py @@ -214,11 +214,12 @@ def translate_text( self, contents, target_language_code, + parent, mime_type=None, source_language_code=None, - parent=None, model=None, glossary_config=None, + labels=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, @@ -236,8 +237,9 @@ def translate_text( >>> >>> # TODO: Initialize `target_language_code`: >>> target_language_code = '' + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> - >>> response = client.translate_text(contents, target_language_code) + >>> response = client.translate_text(contents, target_language_code, parent) Args: contents (list[str]): Required. The content of the input in string format. @@ -245,6 +247,20 @@ def translate_text( 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. + parent (str): Required. Project or location to make a call. Must refer to a caller's + project. + + Format: ``projects/{project-id}`` or + ``projects/{project-id}/locations/{location-id}``. + + For global calls, use ``projects/{project-id}/locations/global`` or + ``projects/{project-id}``. + + Non-global location is required for requests using AutoML models or + custom glossaries. + + Models and glossaries must be within the same region (have same + location-id), otherwise an INVALID\_ARGUMENT (400) error is returned. mime_type (str): Optional. The format of the source text, for example, "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 @@ -252,14 +268,6 @@ def translate_text( listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the 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``. - - 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: @@ -282,6 +290,14 @@ def translate_text( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig` + labels (dict[str -> str]): 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. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -315,11 +331,12 @@ def translate_text( request = translation_service_pb2.TranslateTextRequest( contents=contents, target_language_code=target_language_code, + parent=parent, mime_type=mime_type, source_language_code=source_language_code, - parent=parent, model=model, glossary_config=glossary_config, + labels=labels, ) if metadata is None: metadata = [] @@ -340,10 +357,11 @@ def translate_text( def detect_language( self, - parent=None, + parent, model=None, content=None, mime_type=None, + labels=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, @@ -356,14 +374,19 @@ def detect_language( >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> - >>> response = client.detect_language() + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> + >>> response = client.detect_language(parent) Args: - parent (str): Required. Location to make a regional or global call. + parent (str): Required. Project or location to make a call. Must refer to a caller's + project. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: ``projects/{project-id}/locations/{location-id}`` or + ``projects/{project-id}``. - For global calls, use ``projects/{project-id}/locations/global``. + For global calls, use ``projects/{project-id}/locations/global`` or + ``projects/{project-id}``. Only models within the same region (has same location-id) can be used. Otherwise an INVALID\_ARGUMENT (400) error is returned. @@ -379,6 +402,14 @@ def detect_language( 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 defaults to "text/html". + labels (dict[str -> str]): 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. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -414,7 +445,11 @@ def detect_language( google.api_core.protobuf_helpers.check_oneof(content=content) request = translation_service_pb2.DetectLanguageRequest( - parent=parent, model=model, content=content, mime_type=mime_type + parent=parent, + model=model, + content=content, + mime_type=mime_type, + labels=labels, ) if metadata is None: metadata = [] @@ -435,7 +470,7 @@ def detect_language( def get_supported_languages( self, - parent=None, + parent, display_language_code=None, model=None, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -450,14 +485,21 @@ def get_supported_languages( >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> - >>> response = client.get_supported_languages() + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> + >>> response = client.get_supported_languages(parent) Args: - parent (str): Required. Location to make a regional or global call. + parent (str): Required. Project or location to make a call. Must refer to a caller's + project. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: ``projects/{project-id}`` or + ``projects/{project-id}/locations/{location-id}``. - For global calls, use ``projects/{project-id}/locations/global``. + For global calls, use ``projects/{project-id}/locations/global`` or + ``projects/{project-id}``. + + Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID\_ARGUMENT (400) error is returned. @@ -529,13 +571,14 @@ def get_supported_languages( def batch_translate_text( self, + parent, source_language_code, target_language_codes, input_configs, output_config, - parent=None, models=None, glossaries=None, + labels=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, @@ -554,6 +597,8 @@ def batch_translate_text( >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> >>> # TODO: Initialize `source_language_code`: >>> source_language_code = '' >>> @@ -566,7 +611,7 @@ def batch_translate_text( >>> # TODO: Initialize `output_config`: >>> output_config = {} >>> - >>> response = client.batch_translate_text(source_language_code, target_language_codes, input_configs, output_config) + >>> response = client.batch_translate_text(parent, source_language_code, target_language_codes, input_configs, output_config) >>> >>> def callback(operation_future): ... # Handle result. @@ -578,6 +623,15 @@ def batch_translate_text( >>> metadata = response.metadata() Args: + parent (str): Required. Location to make a call. Must refer to a caller's project. + + 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 (str): Required. Source language code. target_language_codes (list[str]): Required. Specify up to 10 language codes here. input_configs (list[Union[dict, ~google.cloud.translate_v3beta1.types.InputConfig]]): Required. Input configurations. @@ -593,15 +647,6 @@ 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): 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. 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. @@ -622,6 +667,14 @@ 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.TranslateTextGlossaryConfig` + labels (dict[str -> str]): 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. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -653,13 +706,14 @@ def batch_translate_text( ) request = translation_service_pb2.BatchTranslateTextRequest( + parent=parent, source_language_code=source_language_code, target_language_codes=target_language_codes, input_configs=input_configs, output_config=output_config, - parent=parent, models=models, glossaries=glossaries, + labels=labels, ) if metadata is None: metadata = [] @@ -781,7 +835,7 @@ def create_glossary( def list_glossaries( self, - parent=None, + parent, page_size=None, filter_=None, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -797,8 +851,10 @@ def list_glossaries( >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> >>> # Iterate over all results - >>> for element in client.list_glossaries(): + >>> for element in client.list_glossaries(parent): ... # process element ... pass >>> @@ -806,7 +862,7 @@ def list_glossaries( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_glossaries().pages: + >>> for page in client.list_glossaries(parent).pages: ... for element in page: ... # process element ... pass diff --git a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py index 21b7872180e8..af45b10d95d6 100644 --- a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py +++ b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py @@ -54,7 +54,7 @@ }, "DeleteGlossary": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, }, diff --git a/translate/google/cloud/translate_v3beta1/proto/translation_service.proto b/translate/google/cloud/translate_v3beta1/proto/translation_service.proto index fa20f01693f2..f1fca1857aad 100644 --- a/translate/google/cloud/translate_v3beta1/proto/translation_service.proto +++ b/translate/google/cloud/translate_v3beta1/proto/translation_service.proto @@ -18,10 +18,11 @@ syntax = "proto3"; package google.cloud.translation.v3beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.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"; @@ -36,7 +37,10 @@ option ruby_package = "Google::Cloud::Translate::V3beta1"; // Provides natural language translation operations. service TranslationService { - option (google.api.default_host) = "translation.googleapis.com"; + option (google.api.default_host) = "translate.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-translation"; // Translates input text and returns translated text. rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { @@ -60,6 +64,7 @@ service TranslationService { body: "*" } }; + option (google.api.method_signature) = "parent,model,mime_type"; } // Returns a list of supported languages for translation. @@ -70,6 +75,7 @@ service TranslationService { get: "/v3beta1/{parent=projects/*}/supportedLanguages" } }; + option (google.api.method_signature) = "parent,display_language_code,model"; } // Translates a large volume of text in asynchronous batch mode. @@ -84,6 +90,10 @@ service TranslationService { post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" body: "*" }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateResponse" + metadata_type: "BatchTranslateMetadata" + }; } // Creates a glossary and returns the long-running operation. Returns @@ -93,6 +103,11 @@ service TranslationService { post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" body: "glossary" }; + option (google.api.method_signature) = "parent,glossary"; + option (google.longrunning.operation_info) = { + response_type: "Glossary" + metadata_type: "CreateGlossaryMetadata" + }; } // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't @@ -101,6 +116,7 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" }; + option (google.api.method_signature) = "parent"; } // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't @@ -109,6 +125,7 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; + option (google.api.method_signature) = "name"; } // Deletes a glossary, or cancels glossary construction @@ -118,6 +135,11 @@ service TranslationService { option (google.api.http) = { delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeleteGlossaryResponse" + metadata_type: "DeleteGlossaryMetadata" + }; } } @@ -126,11 +148,11 @@ service TranslationService { message TranslateTextGlossaryConfig { // Required. Specifies the glossary used for this translation. Use // this format: projects/*/locations/*/glossaries/* - string glossary = 1; + string glossary = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates match is case-insensitive. // Default value is false if missing. - bool ignore_case = 2; + bool ignore_case = 2 [(google.api.field_behavior) = OPTIONAL]; } // The request message for synchronous translation. @@ -138,32 +160,43 @@ message TranslateTextRequest { // Required. The content of the input in string format. // We recommend the total content be less than 30k codepoints. // Use BatchTranslateText for larger text. - repeated string contents = 1; + repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The format of the source text, for example, "text/html", // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3; + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; // 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 // source language within the response. - string source_language_code = 4; + string source_language_code = 4 [(google.api.field_behavior) = OPTIONAL]; // 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; + string target_language_code = 5 [(google.api.field_behavior) = REQUIRED]; - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}` or + // `projects/{project-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. + // + // Non-global location is required for requests using AutoML models or + // custom glossaries. // // Models and glossaries must be within the same region (have same // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 8; + string parent = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. The `model` type requested for this translation. // @@ -182,12 +215,22 @@ message TranslateTextRequest { // `projects/{project-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. - string model = 6; + string model = 6 [(google.api.field_behavior) = OPTIONAL]; // 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; + TranslateTextGlossaryConfig glossary_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; } message TranslateTextResponse { @@ -225,15 +268,23 @@ message Translation { // The request message for language detection. message DetectLanguageRequest { - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}/locations/{location-id}` or + // `projects/{project-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. // // Only models within the same region (has same location-id) can be used. // Otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 5; + string parent = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. The language detection model to be used. // @@ -244,7 +295,7 @@ message DetectLanguageRequest { // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. // // If not specified, the default model is used. - string model = 4; + string model = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. The source of the document from which to detect the language. oneof source { @@ -254,7 +305,17 @@ message DetectLanguageRequest { // Optional. The format of the source text, for example, "text/html", // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3; + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 6; } // The response message for language detection. @@ -276,20 +337,30 @@ message DetectLanguageResponse { // The request message for discovering supported languages. message GetSupportedLanguagesRequest { - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}` or + // `projects/{project-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. + // + // Non-global location is required for AutoML models. // // Only models within the same region (have same location-id) can be used, // otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 3; + string parent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // 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. - string display_language_code = 1; + string display_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Get supported languages of this model. // @@ -305,7 +376,7 @@ message GetSupportedLanguagesRequest { // // Returns languages supported by the specified model. // If missing, we get supported languages of Google general base (PBMT) model. - string model = 2; + string model = 2 [(google.api.field_behavior) = OPTIONAL]; } // The response message for discovering supported languages. @@ -338,7 +409,7 @@ message SupportedLanguage { // 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; + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; } // Input configuration for BatchTranslateText request. @@ -347,7 +418,7 @@ message InputConfig { // For `.tsv`, "text/html" is used if mime_type is missing. // For `.html`, this field must be "text/html" or empty. // For `.txt`, this field must be "text/plain" or empty. - string mime_type = 1; + string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Specify the input. oneof source { @@ -373,12 +444,12 @@ message InputConfig { } } -// The Google Cloud Storage 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 an INVALID_ARGUMENT (400) - // error is returned.. - string output_uri_prefix = 1; + // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an + // INVALID_ARGUMENT (400) error is returned. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } // Output configuration for BatchTranslateText request. @@ -457,7 +528,7 @@ message OutputConfig { // The batch translation request. message BatchTranslateTextRequest { - // Required. Location to make a regional call. + // Required. Location to make a call. Must refer to a caller's project. // // Format: `projects/{project-id}/locations/{location-id}`. // @@ -466,13 +537,18 @@ message BatchTranslateTextRequest { // 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; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Required. Source language code. - string source_language_code = 2; + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3; + repeated string target_language_codes = 3 [(google.api.field_behavior) = REQUIRED]; // 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, @@ -490,22 +566,32 @@ message BatchTranslateTextRequest { // // If the map is empty or a specific model is // not requested for a language pair, then default google model (nmt) is used. - map models = 4; + map models = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. Input configurations. // The total number of files matched should be <= 1000. // The total content size should be <= 100M Unicode codepoints. // The files must use UTF-8 encoding. - repeated InputConfig input_configs = 5; + repeated InputConfig input_configs = 5 [(google.api.field_behavior) = REQUIRED]; // 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. - OutputConfig output_config = 6; + OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; // Optional. Glossaries to be applied for translation. // It's keyed by target language code. - map glossaries = 7; + map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; } // State metadata for the batch translation operation. @@ -606,6 +692,11 @@ message GlossaryInputConfig { // Represents a glossary built from user provided data. message Glossary { + option (google.api.resource) = { + type: "translate.googleapis.com/Glossary" + pattern: "projects/{project}/locations/{location}/glossaries/{glossary}" + }; + // Used with unidirectional glossaries. message LanguageCodePair { // Required. The BCP-47 language code of the input text, for example, @@ -627,7 +718,7 @@ message Glossary { // Required. The resource name of the glossary. Glossary names have the form // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. oneof languages { @@ -643,55 +734,75 @@ message Glossary { GlossaryInputConfig input_config = 5; // Output only. The number of entries defined in the glossary. - int32 entry_count = 6; + int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7; + google.protobuf.Timestamp submit_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8; + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for CreateGlossary. message CreateGlossaryRequest { // Required. The project name. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Required. The glossary to create. - Glossary glossary = 2; + Glossary glossary = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for GetGlossary. message GetGlossaryRequest { // Required. The name of the glossary to retrieve. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; } // Request message for DeleteGlossary. message DeleteGlossaryRequest { // Required. The name of the glossary to delete. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; } // Request message for ListGlossaries. message ListGlossariesRequest { // Required. The name of the project from which to list all of the glossaries. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. Requested page size. The server may return fewer glossaries than // requested. If unspecified, the server picks an appropriate default. - int32 page_size = 2; + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A token identifying a page of results the server should return. // Typically, this is the value of [ListGlossariesResponse.next_page_token] // returned from the previous call to `ListGlossaries` method. // The first page is returned if `page_token`is empty or missing. - string page_token = 3; + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // 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. - string filter = 4; + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } // Response message for ListGlossaries. diff --git a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py b/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py index 60dfc368b645..99ee4d293912 100644 --- a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py +++ b/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py @@ -16,12 +16,13 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__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( @@ -32,14 +33,15 @@ '\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\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' + '\n@google/cloud/translation_v3beta1/proto/translation_service.proto\x12 google.cloud.translation.v3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"N\n\x1bTranslateTextGlossaryConfig\x12\x15\n\x08glossary\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01"\xbf\x03\n\x14TranslateTextRequest\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x08 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0fglossary_config\x18\x07 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12W\n\x06labels\x18\n \x03(\x0b\x32\x42.google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\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"\x9f\x02\n\x15\x44\x65tectLanguageRequest\x12\x39\n\x06parent\x18\x05 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12S\n\x06labels\x18\x06 \x03(\x0b\x32\x43.google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\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"\x91\x01\n\x1cGetSupportedLanguagesRequest\x12\x39\n\x06parent\x18\x03 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12"\n\x15\x64isplay_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x01"\\\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"#\n\tGcsSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02"r\n\x0bInputConfig\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02"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"\xa6\x06\n\x19\x42\x61tchTranslateTextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12\\\n\x06models\x18\x04 \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntryB\x03\xe0\x41\x01\x12I\n\rinput_configs\x18\x05 \x03(\x0b\x32-.google.cloud.translation.v3beta1.InputConfigB\x03\xe0\x41\x02\x12J\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.translation.v3beta1.OutputConfigB\x03\xe0\x41\x02\x12\x64\n\nglossaries\x18\x07 \x03(\x0b\x32K.google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntryB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\t \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\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\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\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"\x8e\x05\n\x08Glossary\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\x18\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\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(\t:e\xea\x41\x62\n!translate.googleapis.com/Glossary\x12=projects/{project}/locations/{location}/glossaries/{glossary}B\x0b\n\tlanguages"\x95\x01\n\x15\x43reateGlossaryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x41\n\x08glossary\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3beta1.GlossaryB\x03\xe0\x41\x02"M\n\x12GetGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"P\n\x15\x44\x65leteGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"\x98\x01\n\x15ListGlossariesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01"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\x8a\x10\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\x93\x02\n\x0e\x44\x65tectLanguage\x12\x37.google.cloud.translation.v3beta1.DetectLanguageRequest\x1a\x38.google.cloud.translation.v3beta1.DetectLanguageResponse"\x8d\x01\x82\xd3\xe4\x93\x02n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\x01*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\x01*\xda\x41\x16parent,model,mime_type\x12\xab\x02\n\x15GetSupportedLanguages\x12>.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest\x1a\x34.google.cloud.translation.v3beta1.SupportedLanguages"\x9b\x01\x82\xd3\xe4\x93\x02p\x12;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\x12//v3beta1/{parent=projects/*}/supportedLanguages\xda\x41"parent,display_language_code,model\x12\xeb\x01\n\x12\x42\x61tchTranslateText\x12;.google.cloud.translation.v3beta1.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation"y\x82\xd3\xe4\x93\x02@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\x01*\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x12\xe6\x01\n\x0e\x43reateGlossary\x12\x37.google.cloud.translation.v3beta1.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation"|\x82\xd3\xe4\x93\x02?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\x08glossary\xda\x41\x0fparent,glossary\xca\x41"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\x12\xc9\x01\n\x0eListGlossaries\x12\x37.google.cloud.translation.v3beta1.ListGlossariesRequest\x1a\x38.google.cloud.translation.v3beta1.ListGlossariesResponse"D\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{parent=projects/*/locations/*}/glossaries\xda\x41\x06parent\x12\xb3\x01\n\x0bGetGlossary\x12\x34.google.cloud.translation.v3beta1.GetGlossaryRequest\x1a*.google.cloud.translation.v3beta1.Glossary"B\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\x12\xdf\x01\n\x0e\x44\x65leteGlossary\x12\x37.google.cloud.translation.v3beta1.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation"u\x82\xd3\xe4\x93\x02\x35*3/v3beta1/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\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_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__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, ], ) @@ -75,8 +77,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2610, - serialized_end=2711, + serialized_start=3331, + serialized_end=3432, ) _sym_db.RegisterEnumDescriptor(_BATCHTRANSLATEMETADATA_STATE) @@ -111,8 +113,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2610, - serialized_end=2711, + serialized_start=3331, + serialized_end=3432, ) _sym_db.RegisterEnumDescriptor(_CREATEGLOSSARYMETADATA_STATE) @@ -147,8 +149,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2610, - serialized_end=2711, + serialized_start=3331, + serialized_end=3432, ) _sym_db.RegisterEnumDescriptor(_DELETEGLOSSARYMETADATA_STATE) @@ -175,7 +177,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -193,7 +195,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), ], @@ -205,11 +207,67 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=254, - serialized_end=322, + serialized_start=287, + serialized_end=365, ) +_TRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( + name="LabelsEntry", + full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry.value", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=_b("8\001"), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=770, + serialized_end=815, +) + _TRANSLATETEXTREQUEST = _descriptor.Descriptor( name="TranslateTextRequest", full_name="google.cloud.translation.v3beta1.TranslateTextRequest", @@ -232,7 +290,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -250,7 +308,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -268,7 +326,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -286,7 +344,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -304,7 +362,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -322,7 +382,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -340,20 +400,38 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="labels", + full_name="google.cloud.translation.v3beta1.TranslateTextRequest.labels", + index=7, + number=10, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), ], extensions=[], - nested_types=[], + nested_types=[_TRANSLATETEXTREQUEST_LABELSENTRY], enum_types=[], serialized_options=None, is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=325, - serialized_end=563, + serialized_start=368, + serialized_end=815, ) @@ -409,8 +487,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=566, - serialized_end=736, + serialized_start=818, + serialized_end=988, ) @@ -502,11 +580,67 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=739, - serialized_end=912, + serialized_start=991, + serialized_end=1164, ) +_DETECTLANGUAGEREQUEST_LABELSENTRY = _descriptor.Descriptor( + name="LabelsEntry", + full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry.value", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=_b("8\001"), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=770, + serialized_end=815, +) + _DETECTLANGUAGEREQUEST = _descriptor.Descriptor( name="DetectLanguageRequest", full_name="google.cloud.translation.v3beta1.DetectLanguageRequest", @@ -529,7 +663,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -547,7 +683,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -583,12 +719,30 @@ containing_type=None, is_extension=False, extension_scope=None, + serialized_options=_b("\340A\001"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="labels", + full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.labels", + index=4, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, serialized_options=None, file=DESCRIPTOR, ), ], extensions=[], - nested_types=[], + nested_types=[_DETECTLANGUAGEREQUEST_LABELSENTRY], enum_types=[], serialized_options=None, is_extendable=False, @@ -603,8 +757,8 @@ fields=[], ) ], - serialized_start=914, - serialized_end=1016, + serialized_start=1167, + serialized_end=1454, ) @@ -660,8 +814,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1018, - serialized_end=1079, + serialized_start=1456, + serialized_end=1517, ) @@ -699,8 +853,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1081, - serialized_end=1176, + serialized_start=1519, + serialized_end=1614, ) @@ -726,7 +880,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -744,7 +900,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -762,7 +918,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), ], @@ -774,8 +930,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1178, - serialized_end=1270, + serialized_start=1617, + serialized_end=1762, ) @@ -813,8 +969,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1272, - serialized_end=1364, + serialized_start=1764, + serialized_end=1856, ) @@ -906,8 +1062,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1366, - serialized_end=1478, + serialized_start=1858, + serialized_end=1970, ) @@ -933,7 +1089,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ) ], @@ -945,8 +1101,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1480, - serialized_end=1510, + serialized_start=1972, + serialized_end=2007, ) @@ -972,7 +1128,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1010,8 +1166,8 @@ fields=[], ) ], - serialized_start=1512, - serialized_end=1621, + serialized_start=2009, + serialized_end=2123, ) @@ -1037,7 +1193,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ) ], @@ -1049,8 +1205,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1623, - serialized_end=1666, + serialized_start=2125, + serialized_end=2173, ) @@ -1096,8 +1252,8 @@ fields=[], ) ], - serialized_start=1668, - serialized_end=1774, + serialized_start=2175, + serialized_end=2281, ) @@ -1153,8 +1309,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2210, - serialized_end=2255, + serialized_start=2884, + serialized_end=2929, ) _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY = _descriptor.Descriptor( @@ -1209,8 +1365,64 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2257, - serialized_end=2369, + serialized_start=2931, + serialized_end=3043, +) + +_BATCHTRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( + name="LabelsEntry", + full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry.value", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=_b("8\001"), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=770, + serialized_end=815, ) _BATCHTRANSLATETEXTREQUEST = _descriptor.Descriptor( @@ -1235,7 +1447,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1253,7 +1467,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1271,7 +1485,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1289,7 +1503,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1307,7 +1521,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1325,7 +1539,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1343,7 +1557,25 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="labels", + full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.labels", + index=7, + number=9, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), ], @@ -1351,6 +1583,7 @@ nested_types=[ _BATCHTRANSLATETEXTREQUEST_MODELSENTRY, _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY, + _BATCHTRANSLATETEXTREQUEST_LABELSENTRY, ], enum_types=[], serialized_options=None, @@ -1358,8 +1591,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1777, - serialized_end=2369, + serialized_start=2284, + serialized_end=3090, ) @@ -1469,8 +1702,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2372, - serialized_end=2711, + serialized_start=3093, + serialized_end=3432, ) @@ -1580,8 +1813,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2714, - serialized_end=2917, + serialized_start=3435, + serialized_end=3638, ) @@ -1627,8 +1860,8 @@ fields=[], ) ], - serialized_start=2919, - serialized_end=3017, + serialized_start=3640, + serialized_end=3738, ) @@ -1684,8 +1917,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3416, - serialized_end=3494, + serialized_start=4157, + serialized_end=4235, ) _GLOSSARY_LANGUAGECODESSET = _descriptor.Descriptor( @@ -1722,8 +1955,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3496, - serialized_end=3538, + serialized_start=4237, + serialized_end=4279, ) _GLOSSARY = _descriptor.Descriptor( @@ -1748,7 +1981,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1820,7 +2053,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\003"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1838,7 +2071,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\003"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1856,14 +2089,16 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\003"), file=DESCRIPTOR, ), ], extensions=[], nested_types=[_GLOSSARY_LANGUAGECODEPAIR, _GLOSSARY_LANGUAGECODESSET], enum_types=[], - serialized_options=None, + serialized_options=_b( + "\352Ab\n!translate.googleapis.com/Glossary\022=projects/{project}/locations/{location}/glossaries/{glossary}" + ), is_extendable=False, syntax="proto3", extension_ranges=[], @@ -1876,8 +2111,8 @@ fields=[], ) ], - serialized_start=3020, - serialized_end=3551, + serialized_start=3741, + serialized_end=4395, ) @@ -1903,7 +2138,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1921,7 +2158,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), ], @@ -1933,8 +2170,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3553, - serialized_end=3654, + serialized_start=4398, + serialized_end=4547, ) @@ -1960,7 +2197,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!translate.googleapis.com/Glossary" + ), file=DESCRIPTOR, ) ], @@ -1972,8 +2211,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3656, - serialized_end=3690, + serialized_start=4549, + serialized_end=4626, ) @@ -1999,7 +2238,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!translate.googleapis.com/Glossary" + ), file=DESCRIPTOR, ) ], @@ -2011,8 +2252,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3692, - serialized_end=3729, + serialized_start=4628, + serialized_end=4708, ) @@ -2038,7 +2279,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A#\n!locations.googleapis.com/Location" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -2056,7 +2299,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -2074,7 +2317,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -2092,7 +2335,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), ], @@ -2104,8 +2347,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3731, - serialized_end=3825, + serialized_start=4711, + serialized_end=4863, ) @@ -2161,8 +2404,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3827, - serialized_end=3940, + serialized_start=4865, + serialized_end=4978, ) @@ -2236,8 +2479,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3943, - serialized_end=4212, + serialized_start=4981, + serialized_end=5250, ) @@ -2311,8 +2554,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4215, - serialized_end=4484, + serialized_start=5253, + serialized_end=5522, ) @@ -2386,13 +2629,17 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4487, - serialized_end=4620, + serialized_start=5525, + serialized_end=5658, ) +_TRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _TRANSLATETEXTREQUEST _TRANSLATETEXTREQUEST.fields_by_name[ "glossary_config" ].message_type = _TRANSLATETEXTGLOSSARYCONFIG +_TRANSLATETEXTREQUEST.fields_by_name[ + "labels" +].message_type = _TRANSLATETEXTREQUEST_LABELSENTRY _TRANSLATETEXTRESPONSE.fields_by_name["translations"].message_type = _TRANSLATION _TRANSLATETEXTRESPONSE.fields_by_name[ "glossary_translations" @@ -2400,6 +2647,10 @@ _TRANSLATION.fields_by_name[ "glossary_config" ].message_type = _TRANSLATETEXTGLOSSARYCONFIG +_DETECTLANGUAGEREQUEST_LABELSENTRY.containing_type = _DETECTLANGUAGEREQUEST +_DETECTLANGUAGEREQUEST.fields_by_name[ + "labels" +].message_type = _DETECTLANGUAGEREQUEST_LABELSENTRY _DETECTLANGUAGEREQUEST.oneofs_by_name["source"].fields.append( _DETECTLANGUAGEREQUEST.fields_by_name["content"] ) @@ -2427,6 +2678,7 @@ "value" ].message_type = _TRANSLATETEXTGLOSSARYCONFIG _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST +_BATCHTRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST _BATCHTRANSLATETEXTREQUEST.fields_by_name[ "models" ].message_type = _BATCHTRANSLATETEXTREQUEST_MODELSENTRY @@ -2435,6 +2687,9 @@ _BATCHTRANSLATETEXTREQUEST.fields_by_name[ "glossaries" ].message_type = _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY +_BATCHTRANSLATETEXTREQUEST.fields_by_name[ + "labels" +].message_type = _BATCHTRANSLATETEXTREQUEST_LABELSENTRY _BATCHTRANSLATEMETADATA.fields_by_name[ "state" ].enum_type = _BATCHTRANSLATEMETADATA_STATE @@ -2562,6 +2817,15 @@ "TranslateTextRequest", (_message.Message,), dict( + LabelsEntry=_reflection.GeneratedProtocolMessageType( + "LabelsEntry", + (_message.Message,), + dict( + DESCRIPTOR=_TRANSLATETEXTREQUEST_LABELSENTRY, + __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry) + ), + ), DESCRIPTOR=_TRANSLATETEXTREQUEST, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", __doc__="""The request message for synchronous translation. @@ -2588,9 +2852,12 @@ the input text, set to one of the language codes listed in Language Support. parent: - Required. Location to make a regional or global call. Format: + Required. Project or location to make a call. Must refer to a + caller's project. Format: ``projects/{project-id}`` or ``projects/{project-id}/locations/{location-id}``. For global - calls, use ``projects/{project-id}/locations/global``. Models + calls, use ``projects/{project-id}/locations/global`` or + ``projects/{project-id}``. Non-global location is required + for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID\_ARGUMENT (400) error is returned. @@ -2610,11 +2877,21 @@ 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. + labels: + 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. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextRequest) ), ) _sym_db.RegisterMessage(TranslateTextRequest) +_sym_db.RegisterMessage(TranslateTextRequest.LabelsEntry) TranslateTextResponse = _reflection.GeneratedProtocolMessageType( "TranslateTextResponse", @@ -2672,6 +2949,15 @@ "DetectLanguageRequest", (_message.Message,), dict( + LabelsEntry=_reflection.GeneratedProtocolMessageType( + "LabelsEntry", + (_message.Message,), + dict( + DESCRIPTOR=_DETECTLANGUAGEREQUEST_LABELSENTRY, + __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry) + ), + ), DESCRIPTOR=_DETECTLANGUAGEREQUEST, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", __doc__="""The request message for language detection. @@ -2679,9 +2965,11 @@ Attributes: parent: - 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 + Required. Project or location to make a call. Must refer to a + caller's project. Format: ``projects/{project- + id}/locations/{location-id}`` or ``projects/{project-id}``. + For global calls, use ``projects/{project- + id}/locations/global`` or ``projects/{project-id}``. Only models within the same region (has same location-id) can be used. Otherwise an INVALID\_ARGUMENT (400) error is returned. model: @@ -2701,11 +2989,21 @@ Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". + labels: + 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. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageRequest) ), ) _sym_db.RegisterMessage(DetectLanguageRequest) +_sym_db.RegisterMessage(DetectLanguageRequest.LabelsEntry) DetectedLanguage = _reflection.GeneratedProtocolMessageType( "DetectedLanguage", @@ -2758,11 +3056,14 @@ Attributes: parent: - Required. Location to make a regional or global call. Format: + Required. Project or location to make a call. Must refer to a + caller's project. Format: ``projects/{project-id}`` or ``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. + calls, use ``projects/{project-id}/locations/global`` or + ``projects/{project-id}``. Non-global location is required + for AutoML models. 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, then @@ -2896,14 +3197,15 @@ dict( DESCRIPTOR=_GCSDESTINATION, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The Google Cloud Storage 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 an - INVALID\_ARGUMENT (400) error is returned.. + 'output\_uri\_prefix' must end with "/" and start with + "gs://", otherwise an INVALID\_ARGUMENT (400) error is + returned. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GcsDestination) ), @@ -3006,6 +3308,15 @@ # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry) ), ), + LabelsEntry=_reflection.GeneratedProtocolMessageType( + "LabelsEntry", + (_message.Message,), + dict( + DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_LABELSENTRY, + __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry) + ), + ), DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST, __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", __doc__="""The batch translation request. @@ -3013,12 +3324,12 @@ Attributes: parent: - 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. + Required. Location to make a call. Must refer to a caller's + project. 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: @@ -3046,6 +3357,15 @@ glossaries: Optional. Glossaries to be applied for translation. It's keyed by target language code. + labels: + 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. """, # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest) ), @@ -3053,6 +3373,7 @@ _sym_db.RegisterMessage(BatchTranslateTextRequest) _sym_db.RegisterMessage(BatchTranslateTextRequest.ModelsEntry) _sym_db.RegisterMessage(BatchTranslateTextRequest.GlossariesEntry) +_sym_db.RegisterMessage(BatchTranslateTextRequest.LabelsEntry) BatchTranslateMetadata = _reflection.GeneratedProtocolMessageType( "BatchTranslateMetadata", @@ -3419,17 +3740,62 @@ DESCRIPTOR._options = None +_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["glossary"]._options = None +_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["ignore_case"]._options = None +_TRANSLATETEXTREQUEST_LABELSENTRY._options = None +_TRANSLATETEXTREQUEST.fields_by_name["contents"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["mime_type"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["target_language_code"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["model"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["glossary_config"]._options = None +_TRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None +_DETECTLANGUAGEREQUEST_LABELSENTRY._options = None +_DETECTLANGUAGEREQUEST.fields_by_name["parent"]._options = None +_DETECTLANGUAGEREQUEST.fields_by_name["model"]._options = None +_DETECTLANGUAGEREQUEST.fields_by_name["mime_type"]._options = None +_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["parent"]._options = None +_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["display_language_code"]._options = None +_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["model"]._options = None +_GCSSOURCE.fields_by_name["input_uri"]._options = None +_INPUTCONFIG.fields_by_name["mime_type"]._options = None +_GCSDESTINATION.fields_by_name["output_uri_prefix"]._options = None _BATCHTRANSLATETEXTREQUEST_MODELSENTRY._options = None _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY._options = None +_BATCHTRANSLATETEXTREQUEST_LABELSENTRY._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["target_language_codes"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["models"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["input_configs"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["output_config"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["glossaries"]._options = None +_BATCHTRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None +_GLOSSARY.fields_by_name["name"]._options = None +_GLOSSARY.fields_by_name["entry_count"]._options = None +_GLOSSARY.fields_by_name["submit_time"]._options = None +_GLOSSARY.fields_by_name["end_time"]._options = None +_GLOSSARY._options = None +_CREATEGLOSSARYREQUEST.fields_by_name["parent"]._options = None +_CREATEGLOSSARYREQUEST.fields_by_name["glossary"]._options = None +_GETGLOSSARYREQUEST.fields_by_name["name"]._options = None +_DELETEGLOSSARYREQUEST.fields_by_name["name"]._options = None +_LISTGLOSSARIESREQUEST.fields_by_name["parent"]._options = None +_LISTGLOSSARIESREQUEST.fields_by_name["page_size"]._options = None +_LISTGLOSSARIESREQUEST.fields_by_name["page_token"]._options = None +_LISTGLOSSARIESREQUEST.fields_by_name["filter"]._options = None _TRANSLATIONSERVICE = _descriptor.ServiceDescriptor( name="TranslationService", full_name="google.cloud.translation.v3beta1.TranslationService", file=DESCRIPTOR, index=0, - serialized_options=_b("\312A\032translation.googleapis.com"), - serialized_start=4623, - serialized_end=6340, + serialized_options=_b( + "\312A\030translate.googleapis.com\322A`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translation" + ), + serialized_start=5661, + serialized_end=7719, methods=[ _descriptor.MethodDescriptor( name="TranslateText", @@ -3450,7 +3816,7 @@ input_type=_DETECTLANGUAGEREQUEST, output_type=_DETECTLANGUAGERESPONSE, serialized_options=_b( - '\202\323\344\223\002n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\001*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\001*' + '\202\323\344\223\002n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\001*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\001*\332A\026parent,model,mime_type' ), ), _descriptor.MethodDescriptor( @@ -3461,7 +3827,7 @@ input_type=_GETSUPPORTEDLANGUAGESREQUEST, output_type=_SUPPORTEDLANGUAGES, serialized_options=_b( - "\202\323\344\223\002p\022;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\022//v3beta1/{parent=projects/*}/supportedLanguages" + '\202\323\344\223\002p\022;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\022//v3beta1/{parent=projects/*}/supportedLanguages\332A"parent,display_language_code,model' ), ), _descriptor.MethodDescriptor( @@ -3472,7 +3838,7 @@ input_type=_BATCHTRANSLATETEXTREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, serialized_options=_b( - '\202\323\344\223\002@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\001*' + '\202\323\344\223\002@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\001*\312A0\n\026BatchTranslateResponse\022\026BatchTranslateMetadata' ), ), _descriptor.MethodDescriptor( @@ -3483,7 +3849,7 @@ input_type=_CREATEGLOSSARYREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, serialized_options=_b( - '\202\323\344\223\002?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\010glossary' + '\202\323\344\223\002?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\010glossary\332A\017parent,glossary\312A"\n\010Glossary\022\026CreateGlossaryMetadata' ), ), _descriptor.MethodDescriptor( @@ -3494,7 +3860,7 @@ input_type=_LISTGLOSSARIESREQUEST, output_type=_LISTGLOSSARIESRESPONSE, serialized_options=_b( - "\202\323\344\223\0025\0223/v3beta1/{parent=projects/*/locations/*}/glossaries" + "\202\323\344\223\0025\0223/v3beta1/{parent=projects/*/locations/*}/glossaries\332A\006parent" ), ), _descriptor.MethodDescriptor( @@ -3505,7 +3871,7 @@ input_type=_GETGLOSSARYREQUEST, output_type=_GLOSSARY, serialized_options=_b( - "\202\323\344\223\0025\0223/v3beta1/{name=projects/*/locations/*/glossaries/*}" + "\202\323\344\223\0025\0223/v3beta1/{name=projects/*/locations/*/glossaries/*}\332A\004name" ), ), _descriptor.MethodDescriptor( @@ -3516,7 +3882,7 @@ input_type=_DELETEGLOSSARYREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, serialized_options=_b( - "\202\323\344\223\0025*3/v3beta1/{name=projects/*/locations/*/glossaries/*}" + "\202\323\344\223\0025*3/v3beta1/{name=projects/*/locations/*/glossaries/*}\332A\004name\312A0\n\026DeleteGlossaryResponse\022\026DeleteGlossaryMetadata" ), ), ], diff --git a/translate/synth.metadata b/translate/synth.metadata index cd7d315b9cbf..1539bd94b3ee 100644 --- a/translate/synth.metadata +++ b/translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-06T12:45:19.878568Z", + "updateTime": "2019-09-28T12:43:42.201475Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.1", - "dockerImage": "googleapis/artman@sha256:a684d40ba9a4e15946f5f2ca6b4bd9fe301192f522e9de4fff622118775f309b" + "version": "0.37.1", + "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e699b0cba64ffddfae39633417180f1f65875896", - "internalRef": "261759677" + "sha": "fcdec366bb4076be75649031706548128a01fc02", + "internalRef": "271635926" } }, { diff --git a/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py b/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py index c4d45f92c69f..6bd32d82c20a 100644 --- a/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py +++ b/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py @@ -80,13 +80,14 @@ def test_translate_text(self): # Setup Request contents = [] target_language_code = "targetLanguageCode1323228230" + parent = client.location_path("[PROJECT]", "[LOCATION]") - response = client.translate_text(contents, target_language_code) + response = client.translate_text(contents, target_language_code, parent) assert expected_response == response assert len(channel.requests) == 1 expected_request = translation_service_pb2.TranslateTextRequest( - contents=contents, target_language_code=target_language_code + contents=contents, target_language_code=target_language_code, parent=parent ) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -102,9 +103,10 @@ def test_translate_text_exception(self): # Setup request contents = [] target_language_code = "targetLanguageCode1323228230" + parent = client.location_path("[PROJECT]", "[LOCATION]") with pytest.raises(CustomException): - client.translate_text(contents, target_language_code) + client.translate_text(contents, target_language_code, parent) def test_detect_language(self): # Setup Expected Response @@ -120,11 +122,14 @@ def test_detect_language(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() - response = client.detect_language() + # Setup Request + parent = client.location_path("[PROJECT]", "[LOCATION]") + + response = client.detect_language(parent) assert expected_response == response assert len(channel.requests) == 1 - expected_request = translation_service_pb2.DetectLanguageRequest() + expected_request = translation_service_pb2.DetectLanguageRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -136,8 +141,11 @@ def test_detect_language_exception(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() + # Setup request + parent = client.location_path("[PROJECT]", "[LOCATION]") + with pytest.raises(CustomException): - client.detect_language() + client.detect_language(parent) def test_get_supported_languages(self): # Setup Expected Response @@ -153,11 +161,16 @@ def test_get_supported_languages(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() - response = client.get_supported_languages() + # Setup Request + parent = client.location_path("[PROJECT]", "[LOCATION]") + + response = client.get_supported_languages(parent) assert expected_response == response assert len(channel.requests) == 1 - expected_request = translation_service_pb2.GetSupportedLanguagesRequest() + expected_request = translation_service_pb2.GetSupportedLanguagesRequest( + parent=parent + ) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -169,8 +182,11 @@ def test_get_supported_languages_exception(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() + # Setup request + parent = client.location_path("[PROJECT]", "[LOCATION]") + with pytest.raises(CustomException): - client.get_supported_languages() + client.get_supported_languages(parent) def test_batch_translate_text(self): # Setup Expected Response @@ -198,19 +214,25 @@ def test_batch_translate_text(self): client = translate_v3beta1.TranslationServiceClient() # Setup Request + parent = client.location_path("[PROJECT]", "[LOCATION]") source_language_code = "sourceLanguageCode1687263568" target_language_codes = [] input_configs = [] output_config = {} response = client.batch_translate_text( - source_language_code, target_language_codes, input_configs, output_config + parent, + source_language_code, + target_language_codes, + input_configs, + output_config, ) result = response.result() assert expected_response == result assert len(channel.requests) == 1 expected_request = translation_service_pb2.BatchTranslateTextRequest( + parent=parent, source_language_code=source_language_code, target_language_codes=target_language_codes, input_configs=input_configs, @@ -235,13 +257,18 @@ def test_batch_translate_text_exception(self): client = translate_v3beta1.TranslationServiceClient() # Setup Request + parent = client.location_path("[PROJECT]", "[LOCATION]") source_language_code = "sourceLanguageCode1687263568" target_language_codes = [] input_configs = [] output_config = {} response = client.batch_translate_text( - source_language_code, target_language_codes, input_configs, output_config + parent, + source_language_code, + target_language_codes, + input_configs, + output_config, ) exception = response.exception() assert exception.errors[0] == error @@ -322,14 +349,17 @@ def test_list_glossaries(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() - paged_list_response = client.list_glossaries() + # Setup Request + parent = client.location_path("[PROJECT]", "[LOCATION]") + + paged_list_response = client.list_glossaries(parent) resources = list(paged_list_response) assert len(resources) == 1 assert expected_response.glossaries[0] == resources[0] assert len(channel.requests) == 1 - expected_request = translation_service_pb2.ListGlossariesRequest() + expected_request = translation_service_pb2.ListGlossariesRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -340,7 +370,10 @@ def test_list_glossaries_exception(self): create_channel.return_value = channel client = translate_v3beta1.TranslationServiceClient() - paged_list_response = client.list_glossaries() + # Setup request + parent = client.location_path("[PROJECT]", "[LOCATION]") + + paged_list_response = client.list_glossaries(parent) with pytest.raises(CustomException): list(paged_list_response)